Re: [PATCH virt-viewer] Use monitor geometry, not screen size

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

 




----- Mensaje original -----
> On Wed, Dec 05, 2012 at 06:37:39PM +0100, Marc-André Lureau wrote:
> > In a recent commit, 3bb6f5ec805ecfe78eba6d4d98e3ffcab195273a, I
> > introduced a regression: going fullscreen would no longer match
> > client
> > and guest resolution correctly.
> > 
> > A GdkScreen is not necessarily the physical screen monitor size.
> > Lookup the physical monitor size using
> > gdk_screen_get_monitor_geometry().
> > 
> > Fixes:
> > https://bugzilla.redhat.com/show_bug.cgi?id=881020
> > ---
> >  src/virt-viewer-display-spice.c | 8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/virt-viewer-display-spice.c
> > b/src/virt-viewer-display-spice.c
> > index 753e369..8ad770a 100644
> > --- a/src/virt-viewer-display-spice.c
> > +++ b/src/virt-viewer-display-spice.c
> > @@ -197,9 +197,13 @@
> > virt_viewer_display_spice_size_allocate(VirtViewerDisplaySpice
> > *self,
> >          return;
> >  
> >      if (self->priv->auto_resize == AUTO_RESIZE_FULLSCREEN) {
> > +        GdkRectangle monitor;
> >          GdkScreen *screen =
> >          gtk_widget_get_screen(GTK_WIDGET(self));
> > -        dw = gdk_screen_get_width(screen);
> > -        dh = gdk_screen_get_height(screen);
> > +        GdkWindow *window =
> > gtk_widget_get_root_window(GTK_WIDGET(self));
> 
> Why _get_root_window rather than _get_window?

Get window might be a subwindow of the client application. I thought we would prefer to select the monitor based on the main application window. In practice, I don't think that will change much. Any reason to prefer one vs the other?

> Patch looks good apart from this.
> 
> Christophe
> 
> > +        int n = gdk_screen_get_monitor_at_window(screen, window);
> > +        gdk_screen_get_monitor_geometry(screen, n, &monitor);
> > +        dw = monitor.width;
> > +        dh = monitor.height;
> >      }
> >  
> >      if (virt_viewer_display_get_zoom(VIRT_VIEWER_DISPLAY(self))) {
> > --
> > 1.7.11.7
> > 
> > _______________________________________________
> > virt-tools-list mailing list
> > virt-tools-list@xxxxxxxxxx
> > https://www.redhat.com/mailman/listinfo/virt-tools-list
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/virt-tools-list

_______________________________________________
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