From 7a8c45dda8d1ae7c57be69be1afd2d28528d8c37 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Fri, 15 Mar 2013 16:16:28 -0400 Subject: [PATCH] Handle spontaneous frames during a resize During a resize, if we don't have a configure pending, then a counter change shouldn't trigger anything other than the normal drawing: it's just a spontaneous frame from the application. So don't try to update the position or remove our timeout ID. https://bugzilla.gnome.org/show_bug.cgi?id=696091 --- src/core/window.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/core/window.c b/src/core/window.c index bfcb2f390..d97303971 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -9638,19 +9638,14 @@ meta_window_update_sync_request_counter (MetaWindow *window, if (window == window->display->grab_window && 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->extended_sync_request_counter || new_counter_value % 2 == 0) && + window->sync_request_timeout_id) { 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); - /* If sync was previously disabled, turn it back on and hope - * the application has come to its senses (maybe it was just - * busy with a pagefault or a long computation). - */ - window->disable_sync = FALSE; - g_source_remove (window->sync_request_timeout_id); window->sync_request_timeout_id = 0; @@ -9663,6 +9658,12 @@ meta_window_update_sync_request_counter (MetaWindow *window, TRUE); } + /* If sync was previously disabled, turn it back on and hope + * the application has come to its senses (maybe it was just + * busy with a pagefault or a long computation). + */ + window->disable_sync = FALSE; + if (needs_frame_drawn) meta_compositor_queue_frame_drawn (window->display->compositor, window, no_delay_frame);