[Xfce4-commits] <ristretto:ristretto-0.0> Improve fullscreen behaviour

Stephan Arts noreply at xfce.org
Sun Oct 23 19:20:21 CEST 2011


Updating branch refs/heads/ristretto-0.0
         to c181f72632125b0789d4a052c5c75b634b932720 (commit)
       from 617daf015dccdb2e8dc41c9e08a8d28c3fb79877 (commit)

commit c181f72632125b0789d4a052c5c75b634b932720
Author: Stephan Arts <stephan at xfce.org>
Date:   Tue Sep 1 08:30:41 2009 +0200

    Improve fullscreen behaviour

 src/main_window.c    |   39 ++++++++++++++++++++++++++++++++-------
 src/picture_viewer.c |    7 +------
 2 files changed, 33 insertions(+), 13 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index f9cd00d..c6abf72 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -237,9 +237,13 @@ static void
 cb_rstto_main_window_settings_notify (GObject *settings, GParamSpec *spec, RsttoMainWindow *window);
 
 static gboolean 
-cb_rstto_main_window_picture_viewer_motion_notify_event (RsttoPictureViewer *viewer,
+cb_rstto_main_window_motion_notify_event (RsttoMainWindow *window,
                                              GdkEventMotion *event,
                                              gpointer user_data);
+static gboolean
+cb_rstto_main_window_picture_viewer_enter_notify_event (GtkWidget *widget,
+                                                        GdkEventCrossing *event,
+                                                        gpointer user_data);
 
 static void
 rstto_main_window_update_buttons (RsttoMainWindow *window);
@@ -620,7 +624,8 @@ rstto_main_window_init (RsttoMainWindow *window)
     }
     g_value_reset (&show_thumbnailbar_val);
 
-    g_signal_connect(G_OBJECT(window->priv->picture_viewer), "motion-notify-event", G_CALLBACK(cb_rstto_main_window_picture_viewer_motion_notify_event), window);
+    g_signal_connect(G_OBJECT(window), "motion-notify-event", G_CALLBACK(cb_rstto_main_window_motion_notify_event), window);
+    g_signal_connect(G_OBJECT(window->priv->picture_viewer), "enter-notify-event", G_CALLBACK(cb_rstto_main_window_picture_viewer_enter_notify_event), window);
     g_signal_connect(G_OBJECT(window), "configure-event", G_CALLBACK(cb_rstto_main_window_configure_event), NULL);
     g_signal_connect(G_OBJECT(window), "window-state-event", G_CALLBACK(cb_rstto_main_window_state_event), NULL);
     g_signal_connect(G_OBJECT(window->priv->image_list_toolbar), "button-press-event", G_CALLBACK(cb_rstto_main_window_navigationtoolbar_button_press_event), window);
@@ -2015,16 +2020,19 @@ cb_rstto_main_window_state_event(GtkWidget *widget, GdkEventWindowState *event,
 }
 
 static gboolean 
-cb_rstto_main_window_picture_viewer_motion_notify_event (RsttoPictureViewer *viewer,
-                                             GdkEventMotion *event,
-                                             gpointer user_data)
+cb_rstto_main_window_motion_notify_event (RsttoMainWindow *window,
+                                         GdkEventMotion *event,
+                                         gpointer user_data)
 {
-    RsttoMainWindow *window = RSTTO_MAIN_WINDOW (user_data);
+    gint width, height;
     if(gdk_window_get_state(GTK_WIDGET(window)->window) & GDK_WINDOW_STATE_FULLSCREEN)
     {
-        if (event->state == 0)
+	gdk_drawable_get_size (GDK_DRAWABLE(GTK_WIDGET(window)->window), &width, &height);
+        //if ((event->state == 0) && (event->window == event->subwindow))
+	if ((event->x == 0) || (event->y == 0) || (((gint)event->x) == (width-1)) || (((gint)event->y) == (height-1)))
         {
             gtk_widget_show (window->priv->image_list_toolbar);
+            window->priv->fs_toolbar_sticky = TRUE;
 
             if (window->priv->fs_toolbar_sticky == FALSE)
             {
@@ -2041,6 +2049,23 @@ cb_rstto_main_window_picture_viewer_motion_notify_event (RsttoPictureViewer *vie
 }
 
 static gboolean
+cb_rstto_main_window_picture_viewer_enter_notify_event (GtkWidget *widget,
+                                                        GdkEventCrossing *event,
+                                                        gpointer user_data)
+{
+    RsttoMainWindow *window = RSTTO_MAIN_WINDOW (user_data);
+    window->priv->fs_toolbar_sticky = FALSE;
+    if (window->priv->show_fs_toolbar_timeout_id > 0)
+    {
+        g_source_remove (window->priv->show_fs_toolbar_timeout_id);
+        window->priv->show_fs_toolbar_timeout_id = 0;
+    }
+    window->priv->show_fs_toolbar_timeout_id = g_timeout_add (2000, (GSourceFunc)cb_rstto_main_window_show_fs_toolbar_timeout, window);
+
+    return TRUE;
+}
+
+static gboolean
 cb_rstto_main_window_show_fs_toolbar_timeout (RsttoMainWindow *window)
 {
     gtk_widget_hide (window->priv->image_list_toolbar);
diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index a5ea1fa..666a405 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -1,9 +1,6 @@
 /*
-<<<<<<< HEAD:src/picture_viewer.c
-=======
  *  Copyright (C) Stephan Arts 2006-2009 <stephan at xfce.org>
  *
->>>>>>> 9b75414e8bb4500c58635dd45ecb8f2f45266902:src/picture_viewer.c
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation; either version 2 of the License, or
@@ -204,6 +201,7 @@ rstto_picture_viewer_init(RsttoPictureViewer *viewer)
                            GDK_BUTTON_PRESS_MASK |
                            GDK_BUTTON_RELEASE_MASK |
                            GDK_BUTTON1_MOTION_MASK |
+                           GDK_ENTER_NOTIFY_MASK |
                            GDK_POINTER_MOTION_MASK);
 
     g_signal_connect(G_OBJECT(viewer), "scroll_event", G_CALLBACK(cb_rstto_picture_viewer_scroll_event), NULL);
@@ -857,7 +855,6 @@ cb_rstto_picture_viewer_scroll_event (RsttoPictureViewer *viewer, GdkEventScroll
             }
             rstto_image_list_entry_set_scale(entry, scale * 1.1);
             rstto_image_list_entry_set_fit_to_screen (entry, FALSE);
->>>>>>> 9b75414e8bb4500c58635dd45ecb8f2f45266902:src/picture_viewer.c
 
 
             viewer->vadjustment->value = ((viewer->vadjustment->value + event->y) * 1.1) - event->y;
@@ -869,8 +866,6 @@ cb_rstto_picture_viewer_scroll_event (RsttoPictureViewer *viewer, GdkEventScroll
             viewer->priv->refresh.idle_id = g_idle_add((GSourceFunc)cb_rstto_picture_viewer_queued_repaint, viewer);
             break;
     }
-<<<<<<< HEAD:src/picture_viewer.c
-=======
     */
 }
 


More information about the Xfce4-commits mailing list