x11: Move X11 calls to map/unmap a MetaWindow to MetaWindowX11
Add 2 vmethods so that MetaWindowX11 may handle the X11 calls itself. https://gitlab.gnome.org/GNOME/mutter/merge_requests/420
This commit is contained in:
parent
dbe6e01e12
commit
5e0523cc8b
@ -581,6 +581,9 @@ struct _MetaWindowClass
|
||||
gboolean (*is_stackable) (MetaWindow *window);
|
||||
gboolean (*can_ping) (MetaWindow *window);
|
||||
gboolean (*are_updates_frozen) (MetaWindow *window);
|
||||
|
||||
void (* map) (MetaWindow *window);
|
||||
void (* unmap) (MetaWindow *window);
|
||||
};
|
||||
|
||||
/* These differ from window->has_foo_func in that they consider
|
||||
|
@ -809,17 +809,10 @@ sync_client_window_mapped (MetaWindow *window)
|
||||
|
||||
window->mapped = should_be_mapped;
|
||||
|
||||
meta_x11_error_trap_push (window->display->x11_display);
|
||||
if (should_be_mapped)
|
||||
{
|
||||
XMapWindow (window->display->x11_display->xdisplay, window->xwindow);
|
||||
}
|
||||
if (window->mapped)
|
||||
META_WINDOW_GET_CLASS (window)->map (window);
|
||||
else
|
||||
{
|
||||
XUnmapWindow (window->display->x11_display->xdisplay, window->xwindow);
|
||||
window->unmaps_pending ++;
|
||||
}
|
||||
meta_x11_error_trap_pop (window->display->x11_display);
|
||||
META_WINDOW_GET_CLASS (window)->unmap (window);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -611,6 +611,16 @@ meta_window_wayland_are_updates_frozen (MetaWindow *window)
|
||||
return !wl_window->has_been_shown;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_wayland_map (MetaWindow *window)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_wayland_unmap (MetaWindow *window)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_wayland_class_init (MetaWindowWaylandClass *klass)
|
||||
{
|
||||
@ -634,6 +644,8 @@ meta_window_wayland_class_init (MetaWindowWaylandClass *klass)
|
||||
window_class->is_stackable = meta_window_wayland_is_stackable;
|
||||
window_class->can_ping = meta_window_wayland_can_ping;
|
||||
window_class->are_updates_frozen = meta_window_wayland_are_updates_frozen;
|
||||
window_class->map = meta_window_wayland_map;
|
||||
window_class->unmap = meta_window_wayland_unmap;
|
||||
}
|
||||
|
||||
MetaWindow *
|
||||
|
@ -1706,6 +1706,27 @@ meta_window_x11_are_updates_frozen (MetaWindow *window)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_x11_map (MetaWindow *window)
|
||||
{
|
||||
MetaX11Display *x11_display = window->display->x11_display;
|
||||
|
||||
meta_x11_error_trap_push (x11_display);
|
||||
XMapWindow (x11_display->xdisplay, window->xwindow);
|
||||
meta_x11_error_trap_pop (x11_display);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_x11_unmap (MetaWindow *window)
|
||||
{
|
||||
MetaX11Display *x11_display = window->display->x11_display;
|
||||
|
||||
meta_x11_error_trap_push (x11_display);
|
||||
XUnmapWindow (x11_display->xdisplay, window->xwindow);
|
||||
meta_x11_error_trap_pop (x11_display);
|
||||
window->unmaps_pending ++;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_x11_class_init (MetaWindowX11Class *klass)
|
||||
{
|
||||
@ -1733,6 +1754,8 @@ meta_window_x11_class_init (MetaWindowX11Class *klass)
|
||||
window_class->is_stackable = meta_window_x11_is_stackable;
|
||||
window_class->can_ping = meta_window_x11_can_ping;
|
||||
window_class->are_updates_frozen = meta_window_x11_are_updates_frozen;
|
||||
window_class->map = meta_window_x11_map;
|
||||
window_class->unmap = meta_window_x11_unmap;
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user