Commit e2e72966 authored by Jonas Ådahl's avatar Jonas Ådahl Committed by Florian Müllner

window: Move out 'updates frozen' state into implementations

Implementation of said state was just related to X11, so move it into
window-x11.c. The Wayland path always fell back on the returning TRUE,
so just do that for now.

!229
parent 8685de96
......@@ -565,6 +565,7 @@ struct _MetaWindowClass
gboolean (*shortcuts_inhibited) (MetaWindow *window,
ClutterInputDevice *source);
gboolean (*is_stackable) (MetaWindow *window);
gboolean (*are_updates_frozen) (MetaWindow *window);
};
/* These differ from window->has_foo_func in that they consider
......
......@@ -3743,14 +3743,7 @@ meta_window_activate_with_workspace (MetaWindow *window,
gboolean
meta_window_updates_are_frozen (MetaWindow *window)
{
if (window->extended_sync_request_counter &&
window->sync_request_serial % 2 == 1)
return TRUE;
if (window->sync_request_serial < window->sync_request_wait_serial)
return TRUE;
return FALSE;
return META_WINDOW_GET_CLASS (window)->are_updates_frozen (window);
}
static void
......
......@@ -573,6 +573,12 @@ meta_window_wayland_is_stackable (MetaWindow *window)
return meta_wayland_surface_get_buffer (window->surface) != NULL;
}
static gboolean
meta_window_wayland_are_updates_frozen (MetaWindow *window)
{
return FALSE;
}
static void
meta_window_wayland_class_init (MetaWindowWaylandClass *klass)
{
......@@ -593,6 +599,7 @@ meta_window_wayland_class_init (MetaWindowWaylandClass *klass)
window_class->force_restore_shortcuts = meta_window_wayland_force_restore_shortcuts;
window_class->shortcuts_inhibited = meta_window_wayland_shortcuts_inhibited;
window_class->is_stackable = meta_window_wayland_is_stackable;
window_class->are_updates_frozen = meta_window_wayland_are_updates_frozen;
}
MetaWindow *
......
......@@ -1577,6 +1577,19 @@ meta_window_x11_is_stackable (MetaWindow *window)
return !window->override_redirect;
}
static gboolean
meta_window_x11_are_updates_frozen (MetaWindow *window)
{
if (window->extended_sync_request_counter &&
window->sync_request_serial % 2 == 1)
return TRUE;
if (window->sync_request_serial < window->sync_request_wait_serial)
return TRUE;
return FALSE;
}
static void
meta_window_x11_class_init (MetaWindowX11Class *klass)
{
......@@ -1601,6 +1614,7 @@ meta_window_x11_class_init (MetaWindowX11Class *klass)
window_class->force_restore_shortcuts = meta_window_x11_force_restore_shortcuts;
window_class->shortcuts_inhibited = meta_window_x11_shortcuts_inhibited;
window_class->is_stackable = meta_window_x11_is_stackable;
window_class->are_updates_frozen = meta_window_x11_are_updates_frozen;
}
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment