[Xfce4-commits] <ristretto:master> Let the pictureviewer figure out the fullscreen mode by itself

Stephan Arts stephan at xfce.org
Wed Aug 12 12:20:09 CEST 2009


Updating branch refs/heads/master
         to 81c13825b177d82b6f72cb06b8e28cbae9fa8163 (commit)
       from 79b7af6a3c4556054e689bff631b0b53379bb350 (commit)

commit 81c13825b177d82b6f72cb06b8e28cbae9fa8163
Author: Stephan Arts <stephan at xfce.org>
Date:   Thu Apr 30 08:29:53 2009 +0200

    Let the pictureviewer figure out the fullscreen mode by itself

 ChangeLog            |    7 +++++++
 src/main_window.c    |    2 --
 src/picture_viewer.c |   11 +----------
 src/picture_viewer.h |    2 --
 4 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 09f6825..8f2b249 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-04-30  Stephan Arts <stephan at xfce.org>
+
+	* src/main_window.c
+	  src/pictureviewer.c
+	  src/pictureviewer.h: Let the pictureviewer figure out the fullscreen-
+	  state of it's parent-window by itself
+
 2009-04-28  Stephan Arts <stephan at xfce.org>
 
 	* src/image.c
diff --git a/src/main_window.c b/src/main_window.c
index 05e6f25..bc688da 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -1427,11 +1427,9 @@ cb_rstto_main_window_state_event(GtkWidget *widget, GdkEventWindowState *event,
             gtk_widget_hide (window->priv->menubar);
             gtk_widget_hide (window->priv->toolbar);
             gtk_widget_hide (window->priv->statusbar);
-            rstto_picture_viewer_set_fs (window->priv->picture_viewer, TRUE);
         }
         else
        {
-            rstto_picture_viewer_set_fs (window->priv->picture_viewer, FALSE);
             g_value_init (&show_toolbar_val, G_TYPE_BOOLEAN);
             g_object_get_property (G_OBJECT(window->priv->settings_manager), "show-toolbar", &show_toolbar_val);
 
diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 0f933ab..e64e4cf 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -65,7 +65,6 @@ struct _RsttoPictureViewerPriv
     GtkMenu                 *menu;
     RsttoPictureViewerState  state;
     RsttoZoomMode            zoom_mode;
-    gboolean                 fullscreen;
 
 
     GdkPixbuf        *dst_pixbuf; /* The pixbuf which ends up on screen */
@@ -418,7 +417,7 @@ rstto_picture_viewer_paint (GtkWidget *widget)
         GdkPixmap *buffer = gdk_pixmap_new(NULL, widget->allocation.width, widget->allocation.height, gdk_drawable_get_depth(widget->window));
         GdkGC *gc = gdk_gc_new(GDK_DRAWABLE(buffer));
 
-        if (viewer->priv->fullscreen)
+        if(gdk_window_get_state(gdk_window_get_toplevel(GTK_WIDGET(viewer)->window)) & GDK_WINDOW_STATE_FULLSCREEN)
         {
            gdk_gc_set_rgb_fg_color (gc, g_value_get_boxed (&bg_color_fs));
         }
@@ -1325,14 +1324,6 @@ cb_rstto_picture_viewer_image_prepared (RsttoImage *image, RsttoPictureViewer *v
     rstto_picture_viewer_queued_repaint (viewer, TRUE);
 }
 
-void
-rstto_picture_viewer_set_fs (RsttoPictureViewer *viewer, gboolean fullscreen)
-{
-    viewer->priv->fullscreen = fullscreen;
-
-    rstto_picture_viewer_queued_repaint (viewer, TRUE);
-}
-
 /**
  * rstto_picture_viewer_zoom_fit:
  * @window:
diff --git a/src/picture_viewer.h b/src/picture_viewer.h
index f129024..c241da8 100644
--- a/src/picture_viewer.h
+++ b/src/picture_viewer.h
@@ -71,8 +71,6 @@ GtkWidget *rstto_picture_viewer_new ();
 void       rstto_picture_viewer_set_image (RsttoPictureViewer *, RsttoImage *);
 gdouble    rstto_picture_viewer_get_scale(RsttoPictureViewer *viewer);
 
-void       rstto_picture_viewer_set_fs (RsttoPictureViewer *viewer, gboolean fullscreen);
-
 void       rstto_picture_viewer_zoom_fit (RsttoPictureViewer *viewer);
 void       rstto_picture_viewer_zoom_100 (RsttoPictureViewer *viewer);
 void       rstto_picture_viewer_zoom_in  (RsttoPictureViewer *viewer, gdouble factor);



More information about the Xfce4-commits mailing list