mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-17 14:30:15 +00:00
wayland: Implement gdk_window_[un]maximize
This allows the buttons in the decorations to maximise the window. Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=695945 Signed-off-by: Rob Bradford <rob@linux.intel.com>
This commit is contained in:
parent
8fb60cda19
commit
1be7f3dee9
@ -1295,15 +1295,54 @@ gdk_wayland_window_unstick (GdkWindow *window)
|
||||
static void
|
||||
gdk_wayland_window_maximize (GdkWindow *window)
|
||||
{
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
GdkWindowImplWayland *impl;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window) ||
|
||||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
||||
return;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
if (GDK_WINDOW_IS_MAPPED (window))
|
||||
{
|
||||
if (impl->surface)
|
||||
{
|
||||
impl->saved_width = gdk_window_get_width (window);
|
||||
impl->saved_height = gdk_window_get_height (window);
|
||||
|
||||
if (impl->shell_surface)
|
||||
wl_shell_surface_set_maximized (impl->shell_surface, NULL);
|
||||
}
|
||||
|
||||
gdk_synthesize_window_state (window,
|
||||
0,
|
||||
GDK_WINDOW_STATE_MAXIMIZED);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_window_unmaximize (GdkWindow *window)
|
||||
{
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
GdkWindowImplWayland *impl;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window) ||
|
||||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
||||
return;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
if (GDK_WINDOW_IS_MAPPED (window))
|
||||
{
|
||||
if (impl->surface)
|
||||
{
|
||||
if (impl->shell_surface)
|
||||
wl_shell_surface_set_toplevel (impl->shell_surface);
|
||||
}
|
||||
|
||||
gdk_synthesize_window_state (window,
|
||||
GDK_WINDOW_STATE_MAXIMIZED,
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user