[virt-tools-list] [PATCH virt-viewer] Use monitor geometry, not screen size
Christophe Fergeau
cfergeau at redhat.com
Fri Dec 7 11:08:00 UTC 2012
On Fri, Dec 07, 2012 at 05:22:00AM -0500, Marc-André Lureau wrote:
>
>
> ----- 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?
My reasoning was that gtk_widget_get_screen(GTK_WIDGET(self)); operates on
a subwindow of the application, not on the main one, so it's inconsistent
with the use of _get_root_window. I don't think this will cause practical
problems, but I thought I'd asked anyway.
Also, is _get_root_window about getting the main GdkWindow for the current
GtkWindow, or about the screen root GdkWindow? I guess the former, but I'm
a bit confused. Anyway, ACK from me if you think _get_root_window is
better.
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20121207/031bbaf5/attachment.sig>
More information about the virt-tools-list
mailing list