Freeze the update counter for unmapped windows

When a window is unmapped, freeze its frame clock. This avoids doing
unnecessary work, but also means that we won't block waiting for
_NET_WM_FRAME_DRAWN messages that will never be received since the
frame ended while the window was withdrawn.

https://bugzilla.gnome.org/show_bug.cgi?id=685460
This commit is contained in:
Owen W. Taylor 2012-10-03 20:13:42 -04:00
parent 8a6895fe52
commit 355e305c16
2 changed files with 9 additions and 0 deletions

View File

@ -688,6 +688,9 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
gdk_frame_clock_thaw (gdk_window_get_frame_clock (event->any.window));
}
if (toplevel)
gdk_window_freeze_toplevel_updates_libgtk_only (window);
_gdk_x11_window_grab_check_unmap (window, xevent->xany.serial);
}
@ -708,6 +711,9 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
gdk_synthesize_window_state (window,
GDK_WINDOW_STATE_ICONIFIED,
0);
if (toplevel)
gdk_window_thaw_toplevel_updates_libgtk_only (window);
}
break;

View File

@ -940,6 +940,9 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display,
G_CALLBACK (on_frame_clock_before_paint), window);
g_signal_connect (clock, "after-paint",
G_CALLBACK (on_frame_clock_after_paint), window);
if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD)
gdk_window_freeze_toplevel_updates_libgtk_only (window);
}
static GdkEventMask