mirror of
https://gitlab.com/virt-viewer/virt-viewer.git
synced 2025-01-20 14:03:40 +03:00
Fullscreen displays on wrong monitors in Wayland
In fullscreen mode, we attempt to enable a guest display for each client monitor and then place a fullscreen window for each display on the appropriate monitor. Previously, we were using gtk_window_move() to move the window to the proper monitor, and then calling gtk_window_fullscreen() to enter fullscreen mode on that monitor. However, under wayland, gtk_window_move() no longer has any effect for toplevel windows, so all displays were showing up on top of eachother on the same client monitor. Fortunately, Gtk+ 3.18 added a new gtk_window_fullscreen_on_monitor() API that works on Wayland. In theory this allows us to remove the call to gtk_window_move() from the code. But to avoid potentially changing behavior on xorg or older systems, I left the existing logic. This requires a dependency bump for gtk+ from 3.12 to 3.18. Gtk 3.18 is provided by the following distributions (or newer): - RHEL 7.4 - Fedora 23 - Ubuntu 16.04LTS Resolves: rhbz#1584561 Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
parent
45eeda66a2
commit
71419bfa71
@ -17,8 +17,8 @@ GLIB2_REQUIRED="2.38"
|
||||
GLIB2_ENCODED_VERSION="GLIB_VERSION_2_38"
|
||||
|
||||
# Keep these two definitions in agreement.
|
||||
GTK_REQUIRED="3.12"
|
||||
GTK_ENCODED_VERSION="GDK_VERSION_3_12"
|
||||
GTK_REQUIRED="3.18"
|
||||
GTK_ENCODED_VERSION="GDK_VERSION_3_18"
|
||||
|
||||
LIBXML2_REQUIRED="2.6.0"
|
||||
LIBVIRT_REQUIRED="0.10.0"
|
||||
|
@ -525,7 +525,13 @@ virt_viewer_window_enter_fullscreen(VirtViewerWindow *self, gint monitor)
|
||||
}
|
||||
virt_viewer_window_move_to_monitor(self);
|
||||
|
||||
gtk_window_fullscreen(GTK_WINDOW(priv->window));
|
||||
if (monitor == -1) {
|
||||
// just go fullscreen on the current monitor
|
||||
gtk_window_fullscreen(GTK_WINDOW(priv->window));
|
||||
} else {
|
||||
gtk_window_fullscreen_on_monitor(GTK_WINDOW(priv->window),
|
||||
gdk_screen_get_default(), monitor);
|
||||
}
|
||||
}
|
||||
|
||||
#define MAX_KEY_COMBO 4
|
||||
|
Loading…
x
Reference in New Issue
Block a user