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
monitors.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Hans de Goede 2013-01-18 17:21:37 +01:00
parent b6af879d19
commit 412bcf6f7f

View File

@ -200,7 +200,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);
dw = monitor.width;
dh = monitor.height;