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

[virt-tools-list] [PATCH 2/2] virt-viewer-display-spice: Get monitor under our window

When getting monitor info for going fullscreen, Get the monitor under
*our* window rather then under the root-window.

Noticed this not working properly when testing the monitor coordinates stuff,
but this should also help people seeing problems when using non equally sized

Signed-off-by: Hans de Goede <hdegoede redhat com>
 src/virt-viewer-display-spice.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/virt-viewer-display-spice.c b/src/virt-viewer-display-spice.c
index e689d9d..2f6bdd4 100644
--- a/src/virt-viewer-display-spice.c
+++ b/src/virt-viewer-display-spice.c
@@ -201,7 +201,8 @@ virt_viewer_display_spice_size_allocate(VirtViewerDisplaySpice *self,
         GdkRectangle monitor;
         GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(self));
         GdkWindow *window = gtk_widget_get_root_window(GTK_WIDGET(self));
-        int n = gdk_screen_get_monitor_at_window(screen, window);
+        int n = gdk_screen_get_monitor_at_window(screen,
+                                     gtk_widget_get_window(GTK_WIDGET(self)));
         gdk_screen_get_monitor_geometry(screen, n, &monitor);
         x = monitor.x;
         y = monitor.y;

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