[Xfce4-commits] [apps/xfce4-terminal] 01/01: Also hide action_fullscreen

noreply at xfce.org noreply at xfce.org
Fri Nov 18 09:24:02 CET 2016


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

f2404 pushed a commit to branch master
in repository apps/xfce4-terminal.

commit 1ca448d872040d52cacd1028ffffbc93fd6e5ce9
Author: Igor <f2404 at yandex.ru>
Date:   Fri Nov 18 10:23:57 2016 +0200

    Also hide action_fullscreen
---
 terminal/terminal-window-dropdown.c | 16 ++++++++++------
 terminal/terminal-window.c          | 15 ++++++++-------
 terminal/terminal-window.h          |  2 --
 3 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/terminal/terminal-window-dropdown.c b/terminal/terminal-window-dropdown.c
index 0e4b217..6fefbc2 100644
--- a/terminal/terminal-window-dropdown.c
+++ b/terminal/terminal-window-dropdown.c
@@ -554,6 +554,7 @@ terminal_window_dropdown_animate_down (gpointer data)
 {
   TerminalWindowDropdown *dropdown = TERMINAL_WINDOW_DROPDOWN (data);
   TerminalWindow         *window = TERMINAL_WINDOW (data);
+  GtkToggleAction        *action_fullscreen;
   GtkRequisition          req1;
   GdkRectangle            rect;
   gint                    step_size, vbox_h;
@@ -567,7 +568,9 @@ terminal_window_dropdown_animate_down (gpointer data)
 #else
   gdk_screen_get_monitor_geometry (dropdown->screen, dropdown->monitor_num, &rect);
 #endif
-  if (!gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (window->action_fullscreen)))
+
+  action_fullscreen = GTK_TOGGLE_ACTION (terminal_window_get_action (window, "fullscreen"));
+  if (!gtk_toggle_action_get_active (action_fullscreen))
     {
       /* calculate width/height if not fullscreen */
       rect.width *= dropdown->rel_width;
@@ -594,7 +597,7 @@ terminal_window_dropdown_animate_down (gpointer data)
     return TRUE;
 
   /* restore the fullscreen state */
-  if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (window->action_fullscreen)))
+  if (gtk_toggle_action_get_active (action_fullscreen))
     gtk_window_fullscreen (GTK_WINDOW (window));
 
   /* animation complete */
@@ -621,7 +624,7 @@ terminal_window_dropdown_animate_up (gpointer data)
 #else
   gdk_screen_get_monitor_geometry (dropdown->screen, dropdown->monitor_num, &rect);
 #endif
-  if (!gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (window->action_fullscreen)))
+  if (!gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (terminal_window_get_action (window, "fullscreen"))))
     {
       /* calculate width/height if not fullscreen */
       rect.width *= dropdown->rel_width;
@@ -751,7 +754,7 @@ terminal_window_dropdown_show (TerminalWindowDropdown *dropdown,
   gtk_window_set_screen (GTK_WINDOW (dropdown), dropdown->screen);
 
   /* correct padding with notebook size */
-  if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (window->action_fullscreen)))
+  if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (terminal_window_get_action (window, "fullscreen"))))
     {
       /* don't fullscreen during animation*/
       if (dropdown->animation_time > 0)
@@ -944,8 +947,9 @@ terminal_window_dropdown_new (const gchar        *role,
                                          PROP_DROPDOWN_STATUS_ICON, &value, NULL);
 
   /* setup full screen */
-  if (fullscreen && gtk_action_is_sensitive (window->action_fullscreen))
-    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (window->action_fullscreen), TRUE);
+  action = terminal_window_get_action (window, "fullscreen");
+  if (fullscreen && gtk_action_is_sensitive (action))
+    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
 
   /* setup menubar visibility */
   if (G_LIKELY (menubar != TERMINAL_VISIBILITY_DEFAULT))
diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 5128186..f359fd2 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -256,6 +256,7 @@ struct _TerminalWindowPrivate
   GtkAction           *action_copy;
   GtkAction           *action_search_next;
   GtkAction           *action_search_prev;
+  GtkAction           *action_fullscreen;
 
   GQueue              *closed_tabs_list;
 };
@@ -472,14 +473,14 @@ terminal_window_init (TerminalWindow *window)
   window->priv->action_copy = terminal_window_get_action (window, "copy");
   window->priv->action_search_next = terminal_window_get_action (window, "search-next");
   window->priv->action_search_prev = terminal_window_get_action (window, "search-prev");
-  window->action_fullscreen = terminal_window_get_action (window, "fullscreen");
+  window->priv->action_fullscreen = terminal_window_get_action (window, "fullscreen");
 
 #if defined(GDK_WINDOWING_X11)
   if (GDK_IS_X11_SCREEN (screen))
     {
       /* setup fullscreen mode */
       if (!gdk_x11_screen_supports_net_wm_hint (screen, gdk_atom_intern ("_NET_WM_STATE_FULLSCREEN", FALSE)))
-        gtk_action_set_sensitive (window->action_fullscreen, FALSE);
+        gtk_action_set_sensitive (window->priv->action_fullscreen, FALSE);
     }
 #endif
 }
@@ -545,8 +546,8 @@ terminal_window_state_event (GtkWidget           *widget,
       && gtk_widget_get_visible (widget))
     {
       fullscreen = (event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN) != 0;
-      if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (window->action_fullscreen)) != fullscreen)
-        gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (window->action_fullscreen), fullscreen);
+      if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (window->priv->action_fullscreen)) != fullscreen)
+        gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (window->priv->action_fullscreen), fullscreen);
     }
 
   if (GTK_WIDGET_CLASS (terminal_window_parent_class)->window_state_event != NULL)
@@ -2198,8 +2199,8 @@ terminal_window_new (const gchar       *role,
                 NULL);
 
   /* setup full screen */
-  if (fullscreen && gtk_action_is_sensitive (window->action_fullscreen))
-    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (window->action_fullscreen), TRUE);
+  if (fullscreen && gtk_action_is_sensitive (window->priv->action_fullscreen))
+    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (window->priv->action_fullscreen), TRUE);
 
   /* setup menubar visibility */
   if (G_LIKELY (menubar != TERMINAL_VISIBILITY_DEFAULT))
@@ -2367,7 +2368,7 @@ terminal_window_get_restart_command (TerminalWindow *window)
   if (G_LIKELY (role != NULL))
     result = g_slist_prepend (result, g_strdup_printf ("--role=%s", role));
 
-  if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (window->action_fullscreen)))
+  if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (window->priv->action_fullscreen)))
     result = g_slist_prepend (result, g_strdup ("--fullscreen"));
 
   action = terminal_window_get_action (window, "show-menubar");
diff --git a/terminal/terminal-window.h b/terminal/terminal-window.h
index e0eb163..cd11bf5 100644
--- a/terminal/terminal-window.h
+++ b/terminal/terminal-window.h
@@ -57,8 +57,6 @@ typedef struct
   gchar                 *font;
   TerminalZoomLevel      zoom;
 
-  GtkAction             *action_fullscreen;
-
   TerminalVisibility     scrollbar_visibility;
 } TerminalWindow;
 

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


More information about the Xfce4-commits mailing list