From: Dana Jansens Date: Sun, 13 May 2007 23:19:56 +0000 (+0000) Subject: set the cursor before using it X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=627125a6c6e6728de98aa813e353ec75bab7b54c;p=chaz%2Fopenbox set the cursor before using it --- diff --git a/openbox/moveresize.c b/openbox/moveresize.c index 3d9914c5..37c190d5 100644 --- a/openbox/moveresize.c +++ b/openbox/moveresize.c @@ -162,6 +162,31 @@ void moveresize_start(ObClient *c, gint x, gint y, guint b, guint32 cnr) (c->functions & OB_CLIENT_FUNC_RESIZE))) return; + if (corner == prop_atoms.net_wm_moveresize_size_topleft) + cur = OB_CURSOR_NORTHWEST; + else if (corner == prop_atoms.net_wm_moveresize_size_top) + cur = OB_CURSOR_NORTH; + else if (corner == prop_atoms.net_wm_moveresize_size_topright) + cur = OB_CURSOR_NORTHEAST; + else if (corner == prop_atoms.net_wm_moveresize_size_right) + cur = OB_CURSOR_EAST; + else if (corner == prop_atoms.net_wm_moveresize_size_bottomright) + cur = OB_CURSOR_SOUTHEAST; + else if (corner == prop_atoms.net_wm_moveresize_size_bottom) + cur = OB_CURSOR_SOUTH; + else if (corner == prop_atoms.net_wm_moveresize_size_bottomleft) + cur = OB_CURSOR_SOUTHWEST; + else if (corner == prop_atoms.net_wm_moveresize_size_left) + cur = OB_CURSOR_WEST; + else if (corner == prop_atoms.net_wm_moveresize_size_keyboard) + cur = OB_CURSOR_SOUTHEAST; + else if (corner == prop_atoms.net_wm_moveresize_move) + cur = OB_CURSOR_MOVE; + else if (corner == prop_atoms.net_wm_moveresize_move_keyboard) + cur = OB_CURSOR_MOVE; + else + g_assert_not_reached(); + if (!grab_pointer(TRUE, FALSE, cur)) return; if (!grab_keyboard(TRUE)) { @@ -204,31 +229,6 @@ void moveresize_start(ObClient *c, gint x, gint y, guint b, guint32 cnr) moveresize_in_progress = TRUE; - if (corner == prop_atoms.net_wm_moveresize_size_topleft) - cur = OB_CURSOR_NORTHWEST; - else if (corner == prop_atoms.net_wm_moveresize_size_top) - cur = OB_CURSOR_NORTH; - else if (corner == prop_atoms.net_wm_moveresize_size_topright) - cur = OB_CURSOR_NORTHEAST; - else if (corner == prop_atoms.net_wm_moveresize_size_right) - cur = OB_CURSOR_EAST; - else if (corner == prop_atoms.net_wm_moveresize_size_bottomright) - cur = OB_CURSOR_SOUTHEAST; - else if (corner == prop_atoms.net_wm_moveresize_size_bottom) - cur = OB_CURSOR_SOUTH; - else if (corner == prop_atoms.net_wm_moveresize_size_bottomleft) - cur = OB_CURSOR_SOUTHWEST; - else if (corner == prop_atoms.net_wm_moveresize_size_left) - cur = OB_CURSOR_WEST; - else if (corner == prop_atoms.net_wm_moveresize_size_keyboard) - cur = OB_CURSOR_SOUTHEAST; - else if (corner == prop_atoms.net_wm_moveresize_move) - cur = OB_CURSOR_MOVE; - else if (corner == prop_atoms.net_wm_moveresize_move_keyboard) - cur = OB_CURSOR_MOVE; - else - g_assert_not_reached(); - #ifdef SYNC if (config_resize_redraw && !moving && extensions_shape && moveresize_client->sync_request && moveresize_client->sync_counter)