Commit b8fc4c24 authored by Rui Matos's avatar Rui Matos Committed by Matthias Clasen
Browse files

gdkwindow-x11: Add support for gdk_window_fullscreen_on_monitor

This way we can recommend that applications use the
fullscreen_on_monitor() API on both X and Wayland otherwise they'd
have to keep a path for each backend to achieve this functionality.
parent 2c26f0ca
......@@ -3956,6 +3956,23 @@ gdk_x11_window_fullscreen (GdkWindow *window)
static void
gdk_x11_window_fullscreen_on_monitor (GdkWindow *window,
gint monitor)
GdkRectangle monitor_geom;
if (GDK_WINDOW_DESTROYED (window) ||
gdk_screen_get_monitor_geometry (GDK_WINDOW_SCREEN (window), monitor, &monitor_geom);
gdk_window_move (window, monitor_geom.x, monitor_geom.y);
gdk_window_set_fullscreen_mode (window, GDK_FULLSCREEN_ON_CURRENT_MONITOR);
gdk_x11_window_fullscreen (window);
static void
gdk_x11_window_unfullscreen (GdkWindow *window)
......@@ -5412,6 +5429,7 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
impl_class->maximize = gdk_x11_window_maximize;
impl_class->unmaximize = gdk_x11_window_unmaximize;
impl_class->fullscreen = gdk_x11_window_fullscreen;
impl_class->fullscreen_on_monitor = gdk_x11_window_fullscreen_on_monitor;
impl_class->apply_fullscreen_mode = gdk_x11_window_apply_fullscreen_mode;
impl_class->unfullscreen = gdk_x11_window_unfullscreen;
impl_class->set_keep_above = gdk_x11_window_set_keep_above;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment