mirror of
https://github.com/brl/mutter.git
synced 2025-08-10 02:14:42 +00:00
Fix corner cases where _NET_WM_FRAME_DRAWN might be missed
The WM spec requires _NET_WM_FRAME_DRAWN to *always* be sent when there is an appropriate update to the sync counter value. We were potentially missing _NET_WM_FRAME_DRAWN when an application did a spontaneous update during an interactive resize and during effects. Refactor the code to always send _NET_WM_FRAME_DRAWN, even when a window is frozen. https://bugzilla.gnome.org/show_bug.cgi?id=693833
This commit is contained in:
@@ -356,15 +356,6 @@ struct _MetaWindow
|
||||
* also handles application frames */
|
||||
guint extended_sync_request_counter : 1;
|
||||
|
||||
/* if TRUE, we still need to send a _NET_WM_FRAME_DRAWN message for the
|
||||
* last update the sync request counter */
|
||||
guint needs_frame_drawn : 1;
|
||||
|
||||
/* if TRUE, the frame that was just drawn was drawn without any delay
|
||||
* on the client's part and thus is high-priority - if we add delay
|
||||
* we might cause the client to miss it's target frame rate */
|
||||
guint no_delay_frame : 1;
|
||||
|
||||
/* Note: can be NULL */
|
||||
GSList *struts;
|
||||
|
||||
|
@@ -9510,11 +9510,13 @@ void
|
||||
meta_window_update_sync_request_counter (MetaWindow *window,
|
||||
gint64 new_counter_value)
|
||||
{
|
||||
if (window->extended_sync_request_counter &&
|
||||
new_counter_value % 2 == 0)
|
||||
gboolean needs_frame_drawn = FALSE;
|
||||
gboolean no_delay_frame = FALSE;
|
||||
|
||||
if (window->extended_sync_request_counter && new_counter_value % 2 == 0)
|
||||
{
|
||||
window->needs_frame_drawn = TRUE;
|
||||
window->no_delay_frame = new_counter_value == window->sync_request_serial + 1;
|
||||
needs_frame_drawn = TRUE;
|
||||
no_delay_frame = new_counter_value == window->sync_request_serial + 1;
|
||||
}
|
||||
|
||||
window->sync_request_serial = new_counter_value;
|
||||
@@ -9547,6 +9549,10 @@ meta_window_update_sync_request_counter (MetaWindow *window,
|
||||
window->display->grab_latest_motion_y,
|
||||
TRUE);
|
||||
}
|
||||
|
||||
if (needs_frame_drawn)
|
||||
meta_compositor_queue_frame_drawn (window->display->compositor, window,
|
||||
no_delay_frame);
|
||||
}
|
||||
#endif /* HAVE_XSYNC */
|
||||
|
||||
|
Reference in New Issue
Block a user