diff --git a/meson.build b/meson.build index fe0d94b22..1d7040fc0 100644 --- a/meson.build +++ b/meson.build @@ -47,7 +47,7 @@ gudev_req = '>= 232' # wayland version requirements wayland_server_req = '>= 1.21' -wayland_protocols_req = '>= 1.31' +wayland_protocols_req = '>= 1.32' # native backend version requirements libinput_req = '>= 1.19.0' diff --git a/src/wayland/meta-wayland-versions.h b/src/wayland/meta-wayland-versions.h index 41796db9f..e819f2843 100644 --- a/src/wayland/meta-wayland-versions.h +++ b/src/wayland/meta-wayland-versions.h @@ -36,7 +36,7 @@ /* Global/master objects (version exported by wl_registry and negotiated through bind) */ #define META_WL_COMPOSITOR_VERSION 5 #define META_WL_DATA_DEVICE_MANAGER_VERSION 3 -#define META_XDG_WM_BASE_VERSION 5 +#define META_XDG_WM_BASE_VERSION 6 #define META_WL_SEAT_VERSION 8 #define META_WL_OUTPUT_VERSION 4 #define META_XSERVER_VERSION 1 diff --git a/src/wayland/meta-wayland-window-configuration.c b/src/wayland/meta-wayland-window-configuration.c index ad6228d2f..41fa92dfd 100644 --- a/src/wayland/meta-wayland-window-configuration.c +++ b/src/wayland/meta-wayland-window-configuration.c @@ -49,6 +49,7 @@ meta_wayland_window_configuration_new (MetaWindow *window, .flags = flags, .is_fullscreen = meta_window_is_fullscreen (window), + .is_suspended = meta_window_is_suspended (window), }; if (flags & META_MOVE_RESIZE_MOVE_ACTION || diff --git a/src/wayland/meta-wayland-window-configuration.h b/src/wayland/meta-wayland-window-configuration.h index a79681eb8..89d2184f1 100644 --- a/src/wayland/meta-wayland-window-configuration.h +++ b/src/wayland/meta-wayland-window-configuration.h @@ -51,6 +51,7 @@ struct _MetaWaylandWindowConfiguration int bounds_height; gboolean is_fullscreen; + gboolean is_suspended; }; MetaWaylandWindowConfiguration * meta_wayland_window_configuration_new (MetaWindow *window, diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c index d072100ed..fa7bbc5ad 100644 --- a/src/wayland/meta-wayland-xdg-shell.c +++ b/src/wayland/meta-wayland-xdg-shell.c @@ -695,8 +695,9 @@ add_state_value (struct wl_array *states, } static void -fill_states (MetaWaylandXdgToplevel *xdg_toplevel, - struct wl_array *states) +fill_states (MetaWaylandXdgToplevel *xdg_toplevel, + MetaWaylandWindowConfiguration *configuration, + struct wl_array *states) { MetaWaylandSurfaceRole *surface_role = META_WAYLAND_SURFACE_ROLE (xdg_toplevel); @@ -717,6 +718,10 @@ fill_states (MetaWaylandXdgToplevel *xdg_toplevel, add_state_value (states, XDG_TOPLEVEL_STATE_RESIZING); if (meta_window_appears_focused (window)) add_state_value (states, XDG_TOPLEVEL_STATE_ACTIVATED); + if (configuration->is_suspended && + wl_resource_get_version (xdg_toplevel->resource) >= + XDG_TOPLEVEL_STATE_SUSPENDED_SINCE_VERSION) + add_state_value (states, XDG_TOPLEVEL_STATE_SUSPENDED); if (wl_resource_get_version (xdg_toplevel->resource) >= XDG_TOPLEVEL_STATE_TILED_LEFT_SINCE_VERSION) @@ -749,7 +754,7 @@ meta_wayland_xdg_toplevel_send_configure (MetaWaylandXdgToplevel *xdg_to struct wl_array states; wl_array_init (&states); - fill_states (xdg_toplevel, &states); + fill_states (xdg_toplevel, configuration, &states); if (wl_resource_get_version (xdg_toplevel->resource) >= XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION && diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c index 35e7a8734..0b2e69072 100644 --- a/src/wayland/meta-window-wayland.c +++ b/src/wayland/meta-window-wayland.c @@ -77,6 +77,8 @@ struct _MetaWindowWayland MetaWaylandWindowConfiguration *last_acked_configuration; gboolean has_been_shown; + + gboolean is_suspended; }; struct _MetaWindowWaylandClass @@ -692,6 +694,23 @@ appears_focused_changed (GObject *object, surface_state_changed (window); } +static void +suspend_state_changed (GObject *object, + GParamSpec *pspec, + gpointer user_data) +{ + MetaWindow *window = META_WINDOW (object); + MetaWindowWayland *wl_window = META_WINDOW_WAYLAND (window); + gboolean is_suspended; + + is_suspended = meta_window_is_suspended (window); + if (wl_window->is_suspended == is_suspended) + return; + + wl_window->is_suspended = is_suspended; + surface_state_changed (window); +} + static void on_window_shown (MetaWindow *window) { @@ -714,6 +733,8 @@ meta_window_wayland_init (MetaWindowWayland *wl_window) g_signal_connect (window, "notify::appears-focused", G_CALLBACK (appears_focused_changed), NULL); + g_signal_connect (window, "notify::suspend-state", + G_CALLBACK (suspend_state_changed), NULL); g_signal_connect (window, "shown", G_CALLBACK (on_window_shown), NULL); }