Consistently use meta_grab_op_is_resizing() for _NET_WM_SYNC_REQUEST

In different places we checked the grab op differently when determing
whether we are using _NET_WM_SYNC_REQUEST. This was somewhat covered
up previously by the fact that we only had a sync alarm when using
_NET_WM_SYNC_REQUEST, but that is no longer the case, so consistently
use meta_grab_op_is_resizing() everywhere.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
This commit is contained in:
Owen W. Taylor 2013-01-30 14:49:31 -05:00
parent 87fe9685b5
commit 0503f6bb9a

View File

@ -5122,6 +5122,7 @@ meta_window_move_resize_internal (MetaWindow *window,
#ifdef HAVE_XSYNC #ifdef HAVE_XSYNC
if (window == window->display->grab_window && if (window == window->display->grab_window &&
meta_grab_op_is_resizing (window->display->grab_op) &&
window->sync_request_counter != None && window->sync_request_counter != None &&
window->sync_request_alarm != None && window->sync_request_alarm != None &&
window->sync_request_time.tv_usec == 0 && window->sync_request_time.tv_usec == 0 &&
@ -9520,9 +9521,8 @@ meta_window_update_sync_request_counter (MetaWindow *window,
meta_compositor_set_updates_frozen (window->display->compositor, window, meta_compositor_set_updates_frozen (window->display->compositor, window,
meta_window_updates_are_frozen (window)); meta_window_updates_are_frozen (window));
if (window->display->grab_op != META_GRAB_OP_NONE && if (window == window->display->grab_window &&
window == window->display->grab_window && meta_grab_op_is_resizing (window->display->grab_op) &&
meta_grab_op_is_mouse (window->display->grab_op) &&
new_counter_value >= window->display->grab_sync_counter_wait_serial) new_counter_value >= window->display->grab_sync_counter_wait_serial)
{ {
meta_topic (META_DEBUG_RESIZING, meta_topic (META_DEBUG_RESIZING,
@ -9538,36 +9538,13 @@ meta_window_update_sync_request_counter (MetaWindow *window,
window->sync_request_time.tv_sec = 0; window->sync_request_time.tv_sec = 0;
window->sync_request_time.tv_usec = 0; window->sync_request_time.tv_usec = 0;
/* This means we are ready for another configure. */ /* This means we are ready for another configure;
switch (window->display->grab_op) * no pointer round trip here, to keep in sync */
{
case META_GRAB_OP_RESIZING_E:
case META_GRAB_OP_RESIZING_W:
case META_GRAB_OP_RESIZING_S:
case META_GRAB_OP_RESIZING_N:
case META_GRAB_OP_RESIZING_SE:
case META_GRAB_OP_RESIZING_SW:
case META_GRAB_OP_RESIZING_NE:
case META_GRAB_OP_RESIZING_NW:
case META_GRAB_OP_KEYBOARD_RESIZING_S:
case META_GRAB_OP_KEYBOARD_RESIZING_N:
case META_GRAB_OP_KEYBOARD_RESIZING_W:
case META_GRAB_OP_KEYBOARD_RESIZING_E:
case META_GRAB_OP_KEYBOARD_RESIZING_SE:
case META_GRAB_OP_KEYBOARD_RESIZING_NE:
case META_GRAB_OP_KEYBOARD_RESIZING_SW:
case META_GRAB_OP_KEYBOARD_RESIZING_NW:
/* no pointer round trip here, to keep in sync */
update_resize (window, update_resize (window,
window->display->grab_last_user_action_was_snap, window->display->grab_last_user_action_was_snap,
window->display->grab_latest_motion_x, window->display->grab_latest_motion_x,
window->display->grab_latest_motion_y, window->display->grab_latest_motion_y,
TRUE); TRUE);
break;
default:
break;
}
} }
} }
#endif /* HAVE_XSYNC */ #endif /* HAVE_XSYNC */