mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-24 12:41:16 +00:00
wayland: Implement gdk_window_fullscreen & gdk_window_unfullscreen
This commit is contained in:
parent
9d659d8a77
commit
a687cbaae8
@ -132,6 +132,9 @@ struct _GdkWindowImplWayland
|
||||
|
||||
struct wl_seat *grab_input_seat;
|
||||
guint32 grab_time;
|
||||
|
||||
gboolean fullscreen;
|
||||
int saved_width, saved_height; /* before going fullscreen */
|
||||
};
|
||||
|
||||
struct _GdkWindowImplWaylandClass
|
||||
@ -1267,15 +1270,38 @@ gdk_wayland_window_unmaximize (GdkWindow *window)
|
||||
static void
|
||||
gdk_wayland_window_fullscreen (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
if (impl->fullscreen)
|
||||
return;
|
||||
|
||||
impl->saved_width = gdk_window_get_width (window);
|
||||
impl->saved_height = gdk_window_get_height (window);
|
||||
wl_shell_surface_set_fullscreen (impl->shell_surface,
|
||||
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
|
||||
0,
|
||||
NULL);
|
||||
impl->fullscreen = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_window_unfullscreen (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
if (!impl->fullscreen)
|
||||
return;
|
||||
|
||||
wl_shell_surface_set_toplevel (impl->shell_surface);
|
||||
gdk_wayland_window_configure (window, impl->saved_width, impl->saved_height,
|
||||
0);
|
||||
impl->fullscreen = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user