mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-15 23:00:08 +00:00
wayland: add extended state for tiled
xdg-shell allows desktop environments to extend the list of states within a given range. Use this possibility to add a new state for tiled so that gtk+ can benefit from this. https://bugzilla.gnome.org/show_bug.cgi?id=766860
This commit is contained in:
parent
6de0ecb78e
commit
85407180cf
@ -45,6 +45,13 @@ enum {
|
||||
|
||||
static guint signals[LAST_SIGNAL];
|
||||
|
||||
/*
|
||||
* Define GNOME additional states to xdg-shell
|
||||
* The current reserved range for GNOME is 0x1000 - 0x1FFF
|
||||
*/
|
||||
|
||||
#define XDG_SURFACE_STATE_GNOME_TILED 0x1000
|
||||
|
||||
#define WINDOW_IS_TOPLEVEL_OR_FOREIGN(window) \
|
||||
(GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD && \
|
||||
GDK_WINDOW_TYPE (window) != GDK_WINDOW_OFFSCREEN)
|
||||
@ -1233,6 +1240,10 @@ xdg_surface_configure (void *data,
|
||||
break;
|
||||
case XDG_SURFACE_STATE_RESIZING:
|
||||
break;
|
||||
/* GNOME additional states to xdg-shell */
|
||||
case XDG_SURFACE_STATE_GNOME_TILED:
|
||||
new_state |= GDK_WINDOW_STATE_TILED;
|
||||
break;
|
||||
default:
|
||||
/* Unknown state */
|
||||
break;
|
||||
@ -1278,11 +1289,12 @@ xdg_surface_configure (void *data,
|
||||
}
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("configure, window %p %dx%d,%s%s%s",
|
||||
g_message ("configure, window %p %dx%d,%s%s%s%s",
|
||||
window, width, height,
|
||||
(new_state & GDK_WINDOW_STATE_FULLSCREEN) ? " fullscreen" : "",
|
||||
(new_state & GDK_WINDOW_STATE_MAXIMIZED) ? " maximized" : "",
|
||||
(new_state & GDK_WINDOW_STATE_FOCUSED) ? " focused" : ""));
|
||||
(new_state & GDK_WINDOW_STATE_FOCUSED) ? " focused" : "",
|
||||
(new_state & GDK_WINDOW_STATE_TILED) ? " tiled" : ""));
|
||||
|
||||
_gdk_set_window_state (window, new_state);
|
||||
gdk_wayland_window_sync_margin (window);
|
||||
|
Loading…
Reference in New Issue
Block a user