[Xfce4-commits] [apps/mousepad] 01/01: Change visibility of fullscreen bars after small delay (Bug #9735)

noreply at xfce.org noreply at xfce.org
Wed Sep 25 18:34:50 CEST 2019


This is an automated email from the git hooks/post-receive script.

a   n   d   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/mousepad.

commit 0df544c677a66f47713381190ff8f098e8f63fa1
Author: Theo Linkspfeifer <lastonestanding at tutanota.com>
Date:   Mon May 27 22:15:06 2019 +0200

    Change visibility of fullscreen bars after small delay (Bug #9735)
---
 mousepad/mousepad-window.c | 32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/mousepad/mousepad-window.c b/mousepad/mousepad-window.c
index bc6efff..52cedb6 100644
--- a/mousepad/mousepad-window.c
+++ b/mousepad/mousepad-window.c
@@ -107,6 +107,7 @@ static GtkWidget        *mousepad_window_provide_languages_menu       (MousepadW
                                                                        MousepadStatusbar      *statusbar);
 static void              mousepad_window_create_statusbar             (MousepadWindow         *window);
 static gboolean          mousepad_window_get_in_fullscreen            (MousepadWindow         *window);
+static gboolean          mousepad_window_fullscreen_bars_timer        (gpointer                user_data);
 static void              mousepad_window_update_main_widgets          (MousepadWindow         *window);
 
 /* notebook signals */
@@ -394,6 +395,9 @@ struct _MousepadWindow
   /* support to remember window geometry */
   guint                save_geometry_timer_id;
 
+  /* fullscreen bars visibility switch */
+  guint                fullscreen_bars_timer_id;
+
   /* idle update functions for the recent and go menu */
   guint                update_recent_menu_id;
   guint                update_go_menu_id;
@@ -987,6 +991,7 @@ mousepad_window_init (MousepadWindow *window)
 
   /* initialize stuff */
   window->save_geometry_timer_id = 0;
+  window->fullscreen_bars_timer_id = 0;
   window->update_recent_menu_id = 0;
   window->update_go_menu_id = 0;
   window->gomenu_merge_id = 0;
@@ -1105,6 +1110,10 @@ mousepad_window_dispose (GObject *object)
   if (G_UNLIKELY (window->save_geometry_timer_id != 0))
     g_source_remove (window->save_geometry_timer_id);
 
+  /* destroy the fullscreen bars timer source */
+  if (G_UNLIKELY (window->fullscreen_bars_timer_id != 0))
+    g_source_remove (window->fullscreen_bars_timer_id);
+
   (*G_OBJECT_CLASS (mousepad_window_parent_class)->dispose) (object);
 }
 
@@ -4966,6 +4975,20 @@ mousepad_window_action_statusbar (GtkToggleAction *action,
 
 
 
+static gboolean
+mousepad_window_fullscreen_bars_timer (gpointer user_data)
+{
+  MousepadWindow *window = MOUSEPAD_WINDOW (user_data);
+
+  mousepad_window_update_main_widgets (window);
+
+  MOUSEPAD_WINDOW (user_data)->fullscreen_bars_timer_id = 0;
+
+  return FALSE;
+}
+
+
+
 static void
 mousepad_window_update_main_widgets (MousepadWindow *window)
 {
@@ -5026,8 +5049,13 @@ mousepad_window_action_fullscreen (GtkToggleAction *action,
       gtk_action_set_tooltip (GTK_ACTION (action), _("Make the window fullscreen"));
     }
 
-  /* update the widgets based on whether in fullscreen mode or not */
-  mousepad_window_update_main_widgets (window);
+  if (window->fullscreen_bars_timer_id == 0)
+    {
+      /* update the widgets based on whether in fullscreen mode or not */
+      window->fullscreen_bars_timer_id = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE, 50,
+                                                             mousepad_window_fullscreen_bars_timer,
+                                                             window, NULL);
+    }
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list