[PATCH 3/5] virt-viewer-display-spice: Pass proper x and y coordinates in windowed mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This stops monitor order from the guest from being re-arranged in multi-
monitor setups when switching between fullscreen and windowed mode.

Note this relies on spice-gtk's auto monitor alignment code, which currently
does not properly handle setups where there is more then 1 row of monitors,
ie 2x1 - 5x1 will work fine, but 2x2 will not.

Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
---
 src/virt-viewer-display-spice.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/virt-viewer-display-spice.c b/src/virt-viewer-display-spice.c
index d15f415..1e17ca5 100644
--- a/src/virt-viewer-display-spice.c
+++ b/src/virt-viewer-display-spice.c
@@ -209,6 +209,13 @@ virt_viewer_display_spice_size_allocate(VirtViewerDisplaySpice *self,
         y = monitor.y;
         dw = monitor.width;
         dh = monitor.height;
+    } else {
+        GtkWidget *top = gtk_widget_get_toplevel(GTK_WIDGET(self));
+        gtk_window_get_position(GTK_WINDOW(top), &x, &y);
+        if (x < 0)
+            x = 0;
+        if (y < 0)
+            y = 0;
     }
 
     if (virt_viewer_display_get_zoom(VIRT_VIEWER_DISPLAY(self))) {
-- 
1.8.1

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list


[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux