diff options
author | Owen W. Taylor <otaylor@fishsoup.net> | 2012-12-19 12:49:32 -0500 |
---|---|---|
committer | Owen W. Taylor <otaylor@fishsoup.net> | 2013-02-14 17:19:51 -0500 |
commit | 645b5f398d2d50c361600f4f8a089488a66eed99 (patch) | |
tree | 5e4310dfe88fd71fc09d83dc993599b6e1d2a7e2 | |
parent | 8865ebcc80038de7a2290fccc9594709e8e72b2a (diff) | |
download | gtk+-645b5f398d2d50c361600f4f8a089488a66eed99.tar.gz |
Reimplement _NET_WM_SYNC_REQUEST inside X11 backend
Deprecate gdk_window_enable_synchronized_configure() and
gdk_window_configure_done() and make them no-ops. Implement the
handling of _NET_WM_SYNC_REQUEST in terms of the frame cycle -
we know that all processing will be finished in the next frame
cycle after the ConfigureNotify is received.
-rw-r--r-- | gdk/broadway/gdkwindow-broadway.c | 16 | ||||
-rw-r--r-- | gdk/gdkwindow.c | 24 | ||||
-rw-r--r-- | gdk/gdkwindow.h | 2 | ||||
-rw-r--r-- | gdk/quartz/gdkwindow-quartz.c | 12 | ||||
-rw-r--r-- | gdk/wayland/gdkwindow-wayland.c | 17 | ||||
-rw-r--r-- | gdk/win32/gdkwindow-win32.c | 14 | ||||
-rw-r--r-- | gdk/x11/gdkwindow-x11.c | 94 | ||||
-rw-r--r-- | gdk/x11/gdkwindow-x11.h | 1 | ||||
-rw-r--r-- | gtk/gtkwindow.c | 9 |
9 files changed, 31 insertions, 158 deletions
diff --git a/gdk/broadway/gdkwindow-broadway.c b/gdk/broadway/gdkwindow-broadway.c index 7a1245cca0..c4931976b8 100644 --- a/gdk/broadway/gdkwindow-broadway.c +++ b/gdk/broadway/gdkwindow-broadway.c @@ -1294,20 +1294,6 @@ gdk_broadway_window_begin_move_drag (GdkWindow *window, } -static void -gdk_broadway_window_enable_synchronized_configure (GdkWindow *window) -{ - if (!GDK_IS_WINDOW_IMPL_BROADWAY (window->impl)) - return; -} - -static void -gdk_broadway_window_configure_finished (GdkWindow *window) -{ - if (!WINDOW_IS_TOPLEVEL (window)) - return; -} - static gboolean gdk_broadway_window_beep (GdkWindow *window) { @@ -1499,8 +1485,6 @@ gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass) impl_class->set_functions = gdk_broadway_window_set_functions; impl_class->begin_resize_drag = gdk_broadway_window_begin_resize_drag; impl_class->begin_move_drag = gdk_broadway_window_begin_move_drag; - impl_class->enable_synchronized_configure = gdk_broadway_window_enable_synchronized_configure; - impl_class->configure_finished = gdk_broadway_window_configure_finished; impl_class->set_opacity = gdk_broadway_window_set_opacity; impl_class->set_composited = gdk_broadway_window_set_composited; impl_class->destroy_notify = gdk_broadway_window_destroy_notify; diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 211f8fd9ee..38543ce123 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -11215,44 +11215,28 @@ gdk_window_begin_move_drag (GdkWindow *window, * gdk_window_enable_synchronized_configure: * @window: a toplevel #GdkWindow * - * Indicates that the application will cooperate with the window - * system in synchronizing the window repaint with the window - * manager during resizing operations. After an application calls - * this function, it must call gdk_window_configure_finished() every - * time it has finished all processing associated with a set of - * Configure events. Toplevel GTK+ windows automatically use this - * protocol. - * - * On X, calling this function makes @window participate in the - * _NET_WM_SYNC_REQUEST window manager protocol. + * Does nothing, present only for compatiblity. * * Since: 2.6 + * Deprecated: 3.8: this function is no longer needed **/ void gdk_window_enable_synchronized_configure (GdkWindow *window) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->enable_synchronized_configure (window); } /** * gdk_window_configure_finished: * @window: a toplevel #GdkWindow - * - * Signal to the window system that the application has finished - * handling Configure events it has received. Window Managers can - * use this to better synchronize the frame repaint with the - * application. GTK+ applications will automatically call this - * function when appropriate. * - * This function can only be called if gdk_window_enable_synchronized_configure() - * was called previously. + * Does nothing, present only for compatiblity. * * Since: 2.6 + * Deprecated: 3.8: this function is no longer needed **/ void gdk_window_configure_finished (GdkWindow *window) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->configure_finished (window); } /** diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h index a93e5ced99..ef8bb5eb82 100644 --- a/gdk/gdkwindow.h +++ b/gdk/gdkwindow.h @@ -884,7 +884,9 @@ void gdk_window_constrain_size (GdkGeometry *geometry, gint *new_width, gint *new_height); +GDK_DEPRECATED_IN_3_8 void gdk_window_enable_synchronized_configure (GdkWindow *window); +GDK_DEPRECATED_IN_3_8 void gdk_window_configure_finished (GdkWindow *window); GdkWindow *gdk_get_default_root_window (void); diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c index b83adfc063..a096064ae3 100644 --- a/gdk/quartz/gdkwindow-quartz.c +++ b/gdk/quartz/gdkwindow-quartz.c @@ -3003,16 +3003,6 @@ gdk_quartz_window_set_group (GdkWindow *window, } static void -gdk_quartz_window_enable_synchronized_configure (GdkWindow *window) -{ -} - -static void -gdk_quartz_window_configure_finished (GdkWindow *window) -{ -} - -static void gdk_quartz_window_destroy_notify (GdkWindow *window) { check_grab_destroy (window); @@ -3129,8 +3119,6 @@ gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass) impl_class->set_functions = gdk_quartz_window_set_functions; impl_class->begin_resize_drag = gdk_quartz_window_begin_resize_drag; impl_class->begin_move_drag = gdk_quartz_window_begin_move_drag; - impl_class->enable_synchronized_configure = gdk_quartz_window_enable_synchronized_configure; - impl_class->configure_finished = gdk_quartz_window_configure_finished; impl_class->set_opacity = gdk_quartz_window_set_opacity; impl_class->destroy_notify = gdk_quartz_window_destroy_notify; impl_class->register_dnd = _gdk_quartz_window_register_dnd; diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index 5c8d6b6dc1..15cef9f4a5 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -1469,21 +1469,6 @@ gdk_wayland_window_begin_move_drag (GdkWindow *window, } static void -gdk_wayland_window_enable_synchronized_configure (GdkWindow *window) -{ -} - -static void -gdk_wayland_window_configure_finished (GdkWindow *window) -{ - if (!WINDOW_IS_TOPLEVEL (window)) - return; - - if (!GDK_IS_WINDOW_IMPL_WAYLAND (window->impl)) - return; -} - -static void gdk_wayland_window_set_opacity (GdkWindow *window, gdouble opacity) { @@ -1666,8 +1651,6 @@ _gdk_window_impl_wayland_class_init (GdkWindowImplWaylandClass *klass) impl_class->set_functions = gdk_wayland_window_set_functions; impl_class->begin_resize_drag = gdk_wayland_window_begin_resize_drag; impl_class->begin_move_drag = gdk_wayland_window_begin_move_drag; - impl_class->enable_synchronized_configure = gdk_wayland_window_enable_synchronized_configure; - impl_class->configure_finished = gdk_wayland_window_configure_finished; impl_class->set_opacity = gdk_wayland_window_set_opacity; impl_class->set_composited = gdk_wayland_window_set_composited; impl_class->destroy_notify = gdk_wayland_window_destroy_notify; diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c index 5d1b1535e9..039284963c 100644 --- a/gdk/win32/gdkwindow-win32.c +++ b/gdk/win32/gdkwindow-win32.c @@ -3249,18 +3249,6 @@ gdk_win32_window_lookup_for_display (GdkDisplay *display, } static void -gdk_win32_window_enable_synchronized_configure (GdkWindow *window) -{ - /* nothing - no window manager to cooperate with */ -} - -static void -gdk_win32_window_configure_finished (GdkWindow *window) -{ - /* nothing - no window manager to cooperate with */ -} - -static void gdk_win32_window_set_opacity (GdkWindow *window, gdouble opacity) { @@ -3618,8 +3606,6 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass) impl_class->begin_resize_drag = gdk_win32_window_begin_resize_drag; impl_class->begin_move_drag = gdk_win32_window_begin_move_drag; - impl_class->enable_synchronized_configure = gdk_win32_window_enable_synchronized_configure; - impl_class->configure_finished = gdk_win32_window_configure_finished; impl_class->set_opacity = gdk_win32_window_set_opacity; //impl_class->set_composited = gdk_win32_window_set_composited; impl_class->destroy_notify = gdk_win32_window_destroy_notify; diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index 3d625f5fa7..7541e59531 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -344,7 +344,21 @@ gdk_x11_window_begin_frame (GdkWindow *window) impl->toplevel->in_frame = TRUE; - hook_surface_changed (window); + if (impl->toplevel->configure_counter_value != 0 && + impl->toplevel->configure_counter_value_is_extended) + { + impl->toplevel->current_counter_value = impl->toplevel->configure_counter_value; + if ((impl->toplevel->current_counter_value % 2) == 1) + impl->toplevel->current_counter_value += 1; + + impl->toplevel->configure_counter_value = 0; + + window_pre_damage (window); + } + else + { + hook_surface_changed (window); + } } static void @@ -407,6 +421,16 @@ gdk_x11_window_end_frame (GdkWindow *window) unhook_surface_changed (window); + if (impl->toplevel->configure_counter_value != 0 && + !impl->toplevel->configure_counter_value_is_extended) + { + set_sync_counter (GDK_WINDOW_XDISPLAY (window), + impl->toplevel->update_counter, + impl->toplevel->configure_counter_value); + + impl->toplevel->configure_counter_value = 0; + } + if (!impl->toplevel->frame_pending) gdk_frame_timings_set_complete (timings, TRUE); } @@ -5074,72 +5098,6 @@ gdk_x11_window_begin_move_drag (GdkWindow *window, emulate_move_drag (window, device, button, root_x, root_y, timestamp); } -static void -gdk_x11_window_enable_synchronized_configure (GdkWindow *window) -{ - GdkWindowImplX11 *impl; - - if (!GDK_IS_WINDOW_IMPL_X11 (window->impl)) - return; - - impl = GDK_WINDOW_IMPL_X11 (window->impl); - - if (!impl->use_synchronized_configure) - { - /* This basically means you want to do fancy X specific stuff, so - ensure we have a native window */ - gdk_window_ensure_native (window); - - impl->use_synchronized_configure = TRUE; - ensure_sync_counter (window); - } -} - -static void -gdk_x11_window_configure_finished (GdkWindow *window) -{ - GdkWindowImplX11 *impl; - - if (!WINDOW_IS_TOPLEVEL (window)) - return; - - impl = GDK_WINDOW_IMPL_X11 (window->impl); - if (!impl->use_synchronized_configure) - return; - -#ifdef HAVE_XSYNC - if (!GDK_WINDOW_DESTROYED (window)) - { - GdkDisplay *display = GDK_WINDOW_DISPLAY (window); - GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window); - - if (toplevel && toplevel->update_counter != None && - GDK_X11_DISPLAY (display)->use_sync && - toplevel->configure_counter_value != 0) - { - if (toplevel->configure_counter_value_is_extended) - { - toplevel->current_counter_value = toplevel->configure_counter_value; - if ((toplevel->current_counter_value % 2) == 1) - toplevel->current_counter_value += 1; - - toplevel->configure_counter_value = 0; - - set_sync_counter (GDK_WINDOW_XDISPLAY (window), - toplevel->extended_update_counter, - toplevel->current_counter_value); - } - else - { - set_sync_counter (GDK_WINDOW_XDISPLAY (window), - toplevel->update_counter, - toplevel->configure_counter_value); - } - } - } -#endif -} - static gboolean gdk_x11_window_beep (GdkWindow *window) { @@ -5411,8 +5369,6 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass) impl_class->set_functions = gdk_x11_window_set_functions; impl_class->begin_resize_drag = gdk_x11_window_begin_resize_drag; impl_class->begin_move_drag = gdk_x11_window_begin_move_drag; - impl_class->enable_synchronized_configure = gdk_x11_window_enable_synchronized_configure; - impl_class->configure_finished = gdk_x11_window_configure_finished; impl_class->set_opacity = gdk_x11_window_set_opacity; impl_class->set_composited = gdk_x11_window_set_composited; impl_class->destroy_notify = gdk_x11_window_destroy_notify; diff --git a/gdk/x11/gdkwindow-x11.h b/gdk/x11/gdkwindow-x11.h index d58d7e34a4..aefc88262c 100644 --- a/gdk/x11/gdkwindow-x11.h +++ b/gdk/x11/gdkwindow-x11.h @@ -72,7 +72,6 @@ struct _GdkWindowImplX11 guint no_bg : 1; /* Set when the window background is temporarily * unset during resizing and scaling */ guint override_redirect : 1; - guint use_synchronized_configure : 1; cairo_surface_t *cairo_surface; diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index a2f9b18e0d..a6ff07d4e4 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -5164,7 +5164,6 @@ gtk_window_realize (GtkWidget *widget) gtk_style_context_set_background (gtk_widget_get_style_context (widget), gdk_window); - gdk_window_enable_synchronized_configure (gdk_window); return; } @@ -5238,8 +5237,6 @@ gtk_window_realize (GtkWidget *widget) gdk_window = gdk_window_new (parent_window, &attributes, attributes_mask); gtk_widget_set_window (widget, gdk_window); - gdk_window_enable_synchronized_configure (gdk_window); - gtk_widget_register_window (widget, gdk_window); context = gtk_widget_get_style_context (widget); @@ -5580,7 +5577,6 @@ gtk_window_configure_event (GtkWidget *widget, if (GTK_WIDGET_CLASS (gtk_window_parent_class)->configure_event) return GTK_WIDGET_CLASS (gtk_window_parent_class)->configure_event (widget, event); - gdk_window_configure_finished (gtk_widget_get_window (widget)); return FALSE; } @@ -5614,7 +5610,6 @@ gtk_window_configure_event (GtkWidget *widget, (allocation.width == event->width && allocation.height == event->height)) { - gdk_window_configure_finished (gtk_widget_get_window (widget)); return TRUE; } @@ -7153,10 +7148,6 @@ gtk_window_move_resize (GtkWindow *window) set_grip_position (window); update_grip_visibility (window); - gdk_window_process_updates (gdk_window, TRUE); - - gdk_window_configure_finished (gdk_window); - /* If the configure request changed, it means that * we either: * 1) coincidentally changed hints or widget properties |