mirror of
https://github.com/brl/mutter.git
synced 2025-08-03 07:04:41 +00:00
wayland: refactor window destruction and focus
The previous code was leaving focus fields dirty in MetaWaylandPointer and MetaWaylandKeyboard at time (which could crash the X server because of invalid object IDs) The new code is more tighly integrated in the normal X11 code for handling keyboard focus (meaning that the core idea of input focus is also correct now), so that meta_window_unmanage() can do the right thing. As a side benefit, clicking on wayland clients now unfocus X11 clients. For the mouse focus, we need to clear the surface pointer when the metawindowactor is destroyed (even if the actual actor is kept alive for effects), so that a repick finds a different pointer focus. https://bugzilla.gnome.org/show_bug.cgi?id=705859
This commit is contained in:
@@ -62,6 +62,10 @@
|
||||
|
||||
#include <X11/extensions/Xcomposite.h>
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
#include "meta-wayland-private.h"
|
||||
#endif
|
||||
|
||||
/* Windows that unmaximize to a size bigger than that fraction of the workarea
|
||||
* will be scaled down to that size (while maintaining aspect ratio).
|
||||
* Windows that cover an area greater then this size are automaximized on map.
|
||||
@@ -2103,6 +2107,11 @@ meta_window_unmanage (MetaWindow *window,
|
||||
meta_error_trap_pop (window->display);
|
||||
}
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
if (window->surface)
|
||||
meta_wayland_surface_free (window->surface);
|
||||
#endif
|
||||
|
||||
meta_prefs_remove_listener (prefs_changed_callback, window);
|
||||
|
||||
meta_screen_queue_check_fullscreen (window->screen);
|
||||
|
Reference in New Issue
Block a user