[virt-tools-list] [PATCH virt-viewer 1/2] window: save window geometry if the window is realized

Marc-André Lureau mlureau at redhat.com
Tue Mar 26 13:33:34 UTC 2013



----- Mensaje original -----
> Agree with Hans's ACK, just a few nits:
> 
> On Tue, Mar 26, 2013 at 12:37:35PM +0100, Marc-André Lureau wrote:
> > Protect against re-entering fullscreen by moving pre-condition,
> > keey the last know window geometry, since it stays valid.
> 
> keep the last known

oops, a tad late

> 
> > ---
> >  src/virt-viewer-window.c | 11 +++++------
> >  1 file changed, 5 insertions(+), 6 deletions(-)
> > 
> > diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
> > index 1cd0eee..9e064c7 100644
> > --- a/src/virt-viewer-window.c
> > +++ b/src/virt-viewer-window.c
> > @@ -519,7 +519,6 @@
> > virt_viewer_window_leave_fullscreen(VirtViewerWindow *self)
> >          gtk_window_resize(GTK_WINDOW(priv->window),
> >                            priv->before_fullscreen.width,
> >                            priv->before_fullscreen.height);
> > -        priv->before_saved = FALSE;
> >      }
> >  }
> >  
> > @@ -530,7 +529,11 @@
> > virt_viewer_window_enter_fullscreen(VirtViewerWindow *self, gint
> > monitor)
> >      GtkWidget *menu =
> >      GTK_WIDGET(gtk_builder_get_object(priv->builder,
> >      "top-menu"));
> >      GtkCheckMenuItem *check =
> >      GTK_CHECK_MENU_ITEM(gtk_builder_get_object(priv->builder,
> >      "menu-view-fullscreen"));
> >  
> > -    if (!priv->before_saved) {
> > +    if (priv->fullscreen)
> > +        return;
> > +    priv->fullscreen = TRUE;
> > +
> > +    if (gtk_widget_get_realized(priv->window)) {
> 
> This needs a compat #define for older gtk+
> 

ok with that in src/virt-gtk-compat.h?

+#if !GTK_CHECK_VERSION(3, 0, 0)
+#define gtk_widget_set_realized(widget, val)    \
+  GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED)
+#define gtk_widget_get_realized(widget)         \
+  GTK_WIDGET_REALIZED(widget)
+#endif





More information about the virt-tools-list mailing list