Blame SOURCES/0001-Fullscreen-displays-on-wrong-monitors-in-Wayland.patch

7ba0ec
From 71419bfa71b435ee0374d491dcec81911c75394b Mon Sep 17 00:00:00 2001
7ba0ec
From: Jonathon Jongsma <jjongsma@redhat.com>
7ba0ec
Date: Fri, 12 Oct 2018 14:11:11 -0500
7ba0ec
Subject: [PATCH virt-viewer] Fullscreen displays on wrong monitors in Wayland
7ba0ec
7ba0ec
In fullscreen mode, we attempt to enable a guest display for each client
7ba0ec
monitor and then place a fullscreen window for each display on the
7ba0ec
appropriate monitor. Previously, we were using gtk_window_move() to move
7ba0ec
the window to the proper monitor, and then calling
7ba0ec
gtk_window_fullscreen() to enter fullscreen mode on that monitor.
7ba0ec
However, under wayland, gtk_window_move() no longer has any effect for
7ba0ec
toplevel windows, so all displays were showing up on top of eachother on
7ba0ec
the same client monitor.
7ba0ec
7ba0ec
Fortunately, Gtk+ 3.18 added a new gtk_window_fullscreen_on_monitor()
7ba0ec
API that works on Wayland. In theory this allows us to remove the call
7ba0ec
to gtk_window_move() from the code. But to avoid potentially changing
7ba0ec
behavior on xorg or older systems, I left the existing logic.
7ba0ec
7ba0ec
This requires a dependency bump for gtk+ from 3.12 to 3.18. Gtk 3.18 is
7ba0ec
provided by the following distributions (or newer):
7ba0ec
 - RHEL 7.4
7ba0ec
 - Fedora 23
7ba0ec
 - Ubuntu 16.04LTS
7ba0ec
7ba0ec
Resolves: rhbz#1584561
7ba0ec
7ba0ec
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
7ba0ec
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
7ba0ec
---
7ba0ec
 configure.ac             | 4 ++--
7ba0ec
 src/virt-viewer-window.c | 8 +++++++-
7ba0ec
 2 files changed, 9 insertions(+), 3 deletions(-)
7ba0ec
7ba0ec
diff --git a/configure.ac b/configure.ac
7ba0ec
index 9b52eb4..e349e62 100644
7ba0ec
--- a/configure.ac
7ba0ec
+++ b/configure.ac
7ba0ec
@@ -17,8 +17,8 @@ GLIB2_REQUIRED="2.38"
7ba0ec
 GLIB2_ENCODED_VERSION="GLIB_VERSION_2_38"
7ba0ec
 
7ba0ec
 # Keep these two definitions in agreement.
7ba0ec
-GTK_REQUIRED="3.12"
7ba0ec
-GTK_ENCODED_VERSION="GDK_VERSION_3_12"
7ba0ec
+GTK_REQUIRED="3.18"
7ba0ec
+GTK_ENCODED_VERSION="GDK_VERSION_3_18"
7ba0ec
 
7ba0ec
 LIBXML2_REQUIRED="2.6.0"
7ba0ec
 LIBVIRT_REQUIRED="0.10.0"
7ba0ec
diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
7ba0ec
index 241b627..aace0f8 100644
7ba0ec
--- a/src/virt-viewer-window.c
7ba0ec
+++ b/src/virt-viewer-window.c
7ba0ec
@@ -525,7 +525,13 @@ virt_viewer_window_enter_fullscreen(VirtViewerWindow *self, gint monitor)
7ba0ec
     }
7ba0ec
     virt_viewer_window_move_to_monitor(self);
7ba0ec
 
7ba0ec
-    gtk_window_fullscreen(GTK_WINDOW(priv->window));
7ba0ec
+    if (monitor == -1) {
7ba0ec
+        // just go fullscreen on the current monitor
7ba0ec
+        gtk_window_fullscreen(GTK_WINDOW(priv->window));
7ba0ec
+    } else {
7ba0ec
+        gtk_window_fullscreen_on_monitor(GTK_WINDOW(priv->window),
7ba0ec
+                                         gdk_screen_get_default(), monitor);
7ba0ec
+    }
7ba0ec
 }
7ba0ec
 
7ba0ec
 #define MAX_KEY_COMBO 4
7ba0ec
-- 
7ba0ec
2.17.2
7ba0ec