[Xfce4-commits] <xfce4-terminal:master> Allow re-using of the drop-down window.

Nick Schermer noreply at xfce.org
Mon Dec 31 16:46:01 CET 2012


Updating branch refs/heads/master
         to 8f5e8b6c1796c5613fe4a94228c34d76ee6d007d (commit)
       from dbd5b6d88e5c004d403ab60bcf7a1abedbc86009 (commit)

commit 8f5e8b6c1796c5613fe4a94228c34d76ee6d007d
Author: Nick Schermer <nick at xfce.org>
Date:   Mon Dec 31 16:42:52 2012 +0100

    Allow re-using of the drop-down window.
    
    Allow the following combination:
    
    xfce4-terminal --tab --drop-down -e something
    
    to open a new tab in the existing drop-down window.

 terminal/terminal-app.c |   39 +++++++++++++++++++++++++--------------
 1 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/terminal/terminal-app.c b/terminal/terminal-app.c
index 38ee904..1a03473 100644
--- a/terminal/terminal-app.c
+++ b/terminal/terminal-app.c
@@ -594,17 +594,28 @@ terminal_app_open_window (TerminalApp        *app,
 
       if (lp != NULL)
         {
-          /* toggle state of visible window */
-          terminal_window_dropdown_toggle (lp->data, attr->startup_id);
-          return;
+          if (G_UNLIKELY (attr->reuse_last_window))
+            {
+              /* use the drop-down window to insert the tab */
+              window = lp->data;
+              reuse_window = TRUE;
+            }
+          else
+            {
+              /* toggle state of visible window */
+              terminal_window_dropdown_toggle (lp->data, attr->startup_id);
+              return;
+            }
+        }
+      else
+        {
+          /* create new drop-down window */
+          window = terminal_app_create_drop_down (app,
+                                                  attr->role,
+                                                  attr->fullscreen,
+                                                  attr->menubar,
+                                                  attr->toolbar);
         }
-
-      /* create new drop-down window */
-      window = terminal_app_create_drop_down (app,
-                                              attr->role,
-                                              attr->fullscreen,
-                                              attr->menubar,
-                                              attr->toolbar);
     }
   else if (attr->reuse_last_window
            && app->windows != NULL)
@@ -665,12 +676,12 @@ terminal_app_open_window (TerminalApp        *app,
       terminal_screen_launch_child (TERMINAL_SCREEN (terminal));
     }
 
-  /* don't apply other attributes to teh window when reusing */
-  if (reuse_window)
-    return;
-
   if (!attr->drop_down)
     {
+      /* don't apply other attributes to the window when reusing */
+      if (reuse_window)
+        return;
+
       /* set the window geometry, this can only be set after one of the tabs
        * has been added, because vte is the geometry widget, so atleast one
        * call should have been made to terminal_screen_set_window_geometry_hints */


More information about the Xfce4-commits mailing list