]> Dogcows Code - chaz/openbox/blobdiff - openbox/moveresize.c
add the left/right/top/bottom direction arrows and use them for resizing those ways
[chaz/openbox] / openbox / moveresize.c
index 2bee161eb3c3917219ad9b7fe8bdffa3010c739d..2c9f0cdfb7b2820ca5642de41b46255a95193503 100644 (file)
@@ -70,6 +70,8 @@ void moveresize_start(Client *c, int x, int y, guint b, guint32 cnr)
     start_cy = c->frame->area.y;
     start_cw = c->area.width;
     start_ch = c->area.height;
+    start_x = x;
+    start_y = y;
     if (corner == prop_atoms.net_wm_moveresize_move_keyboard ||
         corner == prop_atoms.net_wm_moveresize_size_keyboard)
         button = 0; /* mouse can't end it without being pressed first */
@@ -93,19 +95,19 @@ void moveresize_start(Client *c, int x, int y, guint b, guint32 cnr)
     if (corner == prop_atoms.net_wm_moveresize_size_topleft)
         cur = ob_cursors.tl;
     else if (corner == prop_atoms.net_wm_moveresize_size_top)
-        cur = ob_cursors.tl;
+        cur = ob_cursors.t;
     else if (corner == prop_atoms.net_wm_moveresize_size_topright)
         cur = ob_cursors.tr;
     else if (corner == prop_atoms.net_wm_moveresize_size_right)
-        cur = ob_cursors.tr;
+        cur = ob_cursors.r;
     else if (corner == prop_atoms.net_wm_moveresize_size_bottomright)
         cur = ob_cursors.br;
     else if (corner == prop_atoms.net_wm_moveresize_size_bottom)
-        cur = ob_cursors.br;
+        cur = ob_cursors.b;
     else if (corner == prop_atoms.net_wm_moveresize_size_bottomleft)
         cur = ob_cursors.bl;
     else if (corner == prop_atoms.net_wm_moveresize_size_left)
-        cur = ob_cursors.bl;
+        cur = ob_cursors.l;
     else if (corner == prop_atoms.net_wm_moveresize_size_keyboard)
         cur = ob_cursors.br;
     else if (corner == prop_atoms.net_wm_moveresize_move)
@@ -115,8 +117,8 @@ void moveresize_start(Client *c, int x, int y, guint b, guint32 cnr)
     else
         g_assert_not_reached();
 
-    grab_keyboard(TRUE);
     grab_pointer(TRUE, cur);
+    grab_keyboard(TRUE);
 }
 
 static void end_moveresize(gboolean cancel)
@@ -181,14 +183,13 @@ void moveresize_event(XEvent *e)
             button = e->xbutton.button; /* this will end it now */
         }
     } else if (e->type == ButtonRelease) {
-        if (e->xbutton.button == button) {
+        if (!button || e->xbutton.button == button) {
             end_moveresize(FALSE);
         }
     } else if (e->type == MotionNotify) {
         if (moving) {
             cur_x = start_cx + e->xmotion.x_root - start_x;
             cur_y = start_cy + e->xmotion.y_root - start_y;
-
             do_move();
         } else {
             if (corner == prop_atoms.net_wm_moveresize_size_topleft) {
This page took 0.022482 seconds and 4 git commands to generate.