Quoting message written on Sunday 2015-06-21 09:39:18:
> I didn't thoroughly look at the code so I'll just ask...
> In case when workspace linking is turned off, is it possible to
> make a bit borders/area in which window would snap into a corner
> without changing some other Windowmaker code?
> 
> While testing the feature I have noticed that it is a bit tricky
> to pick a corner. You almost need to pinpoint it and you need to
> keep your cursor steady while releasing the button. Otherwise it
> could chose to snap to horizontal or vertical border.

I have just looked at the code and I think it could be done.

This is what I did and it works fine. I have used 10px but it might
be increased (lower than 10px wouldn't look good).

It makes corner snapping much easier and it looks more like something
people might be used to while working with other systems.


--- wmaker-crm.next/src/moveres.c       2015-06-21 10:32:38.000000000 
+0200
+++ wmaker-crm.next.patched/src/moveres.c       2015-06-21 
10:27:50.000000000 +0200
@@ -1240,20 +1240,20 @@

 static int get_snap_direction(WScreen *scr, int x, int y)
 {
-       if (x < 1) {
-               if (y < 1)
-                       return SNAP_TOPLEFT;
-               if (y > scr->scr_height - 2)
-                       return SNAP_BOTTOMLEFT;
+        if (x < 10 && y < 10)
+               return SNAP_TOPLEFT;
+        if (x < 10 && y > scr->scr_height - 10)
+               return SNAP_BOTTOMLEFT;
+       if (x < 1) 
                return SNAP_LEFT;
-       }
-       if (x > scr->scr_width - 2) {
-               if (y < 1)
-                       return SNAP_TOPRIGHT;
-               if (y > scr->scr_height - 2)
-                       return SNAP_BOTTOMRIGHT;
+
+       if (x > scr->scr_width - 10 && y < 10)
+               return SNAP_TOPRIGHT;
+        if (x > scr->scr_width - 10 && y > scr->scr_height - 10)
+                return SNAP_BOTTOMRIGHT;
+       if (x > scr->scr_width - 2)
                return SNAP_RIGHT; 
-       }
+
        if (y < 1)
                return SNAP_TOP;
        if (y > scr->scr_height - 2)


-- 
Josip Deanovic


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to