wayland: Keep wl_shell_surface state during loss of window

It has been common practice (in QT5 for example) to set
wl_shell_surface state at situations where mutter will have destroyed
the MetaWindow. This commit keeps track of the relevant state
separately from MetaWindow, and synchronizes when needed.

https://bugzilla.gnome.org/show_bug.cgi?id=757623

https://bugzilla.gnome.org/show_bug.cgi?id=763431
This commit is contained in:
Jonas Ådahl
2015-12-15 18:14:25 +08:00
parent b3ba8e897e
commit c2643ba5ac
2 changed files with 180 additions and 52 deletions

View File

@ -156,6 +156,16 @@ struct _MetaWaylandDragDestFuncs
MetaWaylandSurface *surface);
};
typedef enum
{
META_WL_SHELL_SURFACE_STATE_NONE,
META_WL_SHELL_SURFACE_STATE_TOPLEVEL,
META_WL_SHELL_SURFACE_STATE_POPUP,
META_WL_SHELL_SURFACE_STATE_TRANSIENT,
META_WL_SHELL_SURFACE_STATE_FULLSCREEN,
META_WL_SHELL_SURFACE_STATE_MAXIMIZED,
} MetaWlShellSurfaceState;
struct _MetaWaylandSurface
{
GObject parent;
@ -221,6 +231,23 @@ struct _MetaWaylandSurface
struct wl_listener destroy_listener;
} popup;
/* wl_shell_surface */
struct {
MetaWlShellSurfaceState state;
char *title;
char *wm_class;
gboolean pending_popup;
MetaWaylandSurface *parent_surface;
GList *children;
MetaWaylandSeat *popup_seat;
int x;
int y;
} wl_shell;
/* wl_subsurface stuff. */
struct {
MetaWaylandSurface *parent;