mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
window: always disarm XSYNC watchdog when X client responds
At the moment we only disarm the watchdog timer set up for SYNC counter requests if we're in the middle of a resize operation. It's possible that the resize operation finished prematurely by the user letting go of the mouse before the client responded. If that happens, when the client finally updates mutter will erroneously still have the watchdog timer engaged from before until it times out, leading to resizes for the next second or so to not get processed, and the client to get blacklisted from future sync requests.
This commit is contained in:
parent
ebff7fd7f4
commit
3488015d17
@ -3496,27 +3496,31 @@ meta_window_x11_update_sync_request_counter (MetaWindow *window,
|
|||||||
window->sync_request_serial = new_counter_value;
|
window->sync_request_serial = new_counter_value;
|
||||||
meta_compositor_sync_updates_frozen (window->display->compositor, window);
|
meta_compositor_sync_updates_frozen (window->display->compositor, window);
|
||||||
|
|
||||||
if (window == window->display->grab_window &&
|
if (new_counter_value >= window->sync_request_wait_serial && window->sync_request_timeout_id)
|
||||||
meta_grab_op_is_resizing (window->display->grab_op) &&
|
|
||||||
new_counter_value >= window->sync_request_wait_serial &&
|
|
||||||
(!window->extended_sync_request_counter || new_counter_value % 2 == 0) &&
|
|
||||||
window->sync_request_timeout_id)
|
|
||||||
{
|
{
|
||||||
meta_topic (META_DEBUG_RESIZING,
|
if (!window->extended_sync_request_counter || new_counter_value % 2 == 0)
|
||||||
"Alarm event received last motion x = %d y = %d\n",
|
{
|
||||||
window->display->grab_latest_motion_x,
|
g_source_remove (window->sync_request_timeout_id);
|
||||||
window->display->grab_latest_motion_y);
|
window->sync_request_timeout_id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
g_source_remove (window->sync_request_timeout_id);
|
if (window == window->display->grab_window &&
|
||||||
window->sync_request_timeout_id = 0;
|
meta_grab_op_is_resizing (window->display->grab_op) &&
|
||||||
|
(!window->extended_sync_request_counter || new_counter_value % 2 == 0))
|
||||||
|
{
|
||||||
|
meta_topic (META_DEBUG_RESIZING,
|
||||||
|
"Alarm event received last motion x = %d y = %d\n",
|
||||||
|
window->display->grab_latest_motion_x,
|
||||||
|
window->display->grab_latest_motion_y);
|
||||||
|
|
||||||
/* This means we are ready for another configure;
|
/* This means we are ready for another configure;
|
||||||
* no pointer round trip here, to keep in sync */
|
* no pointer round trip here, to keep in sync */
|
||||||
meta_window_update_resize (window,
|
meta_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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If sync was previously disabled, turn it back on and hope
|
/* If sync was previously disabled, turn it back on and hope
|
||||||
|
Loading…
Reference in New Issue
Block a user