[gtk+] GdkWindowX11: start off with an odd frame-counter value
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GdkWindowX11: start off with an odd frame-counter value
- Date: Thu, 14 Feb 2013 22:23:42 +0000 (UTC)
commit 6557a775df9651536747867e5052be2b2eddb45d
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Wed Oct 3 20:15:44 2012 -0400
GdkWindowX11: start off with an odd frame-counter value
By starting with an odd frame counter value, we make the mapping
and initial paint of the window an atomic operation, avoiding
any visual artifacts from an unpainted window.
Possible improvement: start the frame when doing gdk_window_show(),
so that the same improvement occurs for windows that were previously
shown and are being mapped again.
https://bugzilla.gnome.org/show_bug.cgi?id=685460
gdk/x11/gdkwindow-x11.c | 35 ++++++++++++++++++++++-------------
1 files changed, 22 insertions(+), 13 deletions(-)
---
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index f6af492..fbc13b5 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -226,10 +226,13 @@ gdk_x11_window_begin_frame (GdkWindow *window)
impl->toplevel->extended_update_counter == None)
return;
- impl->toplevel->current_counter_value += 1;
- set_sync_counter(GDK_WINDOW_XDISPLAY (impl->wrapper),
- impl->toplevel->extended_update_counter,
- impl->toplevel->current_counter_value);
+ if (impl->toplevel->current_counter_value % 2 == 0)
+ {
+ impl->toplevel->current_counter_value += 1;
+ set_sync_counter(GDK_WINDOW_XDISPLAY (impl->wrapper),
+ impl->toplevel->extended_update_counter,
+ impl->toplevel->current_counter_value);
+ }
}
static void
@@ -245,16 +248,19 @@ gdk_x11_window_end_frame (GdkWindow *window)
impl->toplevel->extended_update_counter == None)
return;
- impl->toplevel->current_counter_value += 1;
- set_sync_counter(GDK_WINDOW_XDISPLAY (impl->wrapper),
- impl->toplevel->extended_update_counter,
- impl->toplevel->current_counter_value);
-
- if (gdk_x11_screen_supports_net_wm_hint (gdk_window_get_screen (window),
- gdk_atom_intern_static_string ("_NET_WM_FRAME_DRAWN")))
+ if (impl->toplevel->current_counter_value % 2 == 1)
{
- impl->toplevel->frame_pending = TRUE;
- gdk_frame_clock_freeze (gdk_window_get_frame_clock (window));
+ impl->toplevel->current_counter_value += 1;
+ set_sync_counter(GDK_WINDOW_XDISPLAY (impl->wrapper),
+ impl->toplevel->extended_update_counter,
+ impl->toplevel->current_counter_value);
+
+ if (gdk_x11_screen_supports_net_wm_hint (gdk_window_get_screen (window),
+ gdk_atom_intern_static_string ("_NET_WM_FRAME_DRAWN")))
+ {
+ impl->toplevel->frame_pending = TRUE;
+ gdk_frame_clock_freeze (gdk_window_get_frame_clock (window));
+ }
}
}
@@ -760,6 +766,9 @@ setup_toplevel_window (GdkWindow *window,
gdk_x11_window_set_user_time (window, GDK_X11_DISPLAY (x11_screen->display)->user_time);
ensure_sync_counter (window);
+
+ /* Start off in a frozen state - we'll finish this when we first paint */
+ gdk_x11_window_begin_frame (window);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]