! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Allowing detaching tab from dropdown terminal with only one tab
Status:
RESOLVED: WONTFIX
Severity:
enhancement
Product:
Xfce4-terminal
Component:
General

Comments

Description rubenwardy 2018-04-15 18:12:50 CEST
I'm trying to make it so that "Detach Tab" is always sensitive, even when there's only one tab

The use case is to allow detaching from a drop down terminal when there's only one tab, to turn that session into a normal terminal.

I've tried changing gtk_action_set_sensitive for detach tab on line 965 of terminal-window.c but that had no effect - the "Detach Tab" menu item remains
insensitive on both the normal and drop down terminal.

I'm looking for some pointers on how to do this, it really should be simple. 

Here's the patch of what I tried:

```
diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index f5566699..646fb1f0 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -962,7 +962,7 @@ terminal_window_update_actions (TerminalWindow *window)
   /* "Detach Tab" and "Close Other Tabs" are sensitive if we have at least two pages.
    * "Undo Close" is sensitive if there is a tab to unclose. */
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  gtk_action_set_sensitive (window->priv->action_detach_tab, (n_pages > 1));
+  gtk_action_set_sensitive (window->priv->action_detach_tab, TRUE);
   gtk_action_set_sensitive (window->priv->action_close_other_tabs, n_pages > 1);
 
   gtk_action_set_sensitive (window->priv->action_undo_close_tab, !g_queue_is_empty (window->priv->closed_tabs_list));
```

And how I test it: make -j3 && ./terminal/xfce4-terminal --drop-down

OS: Manjaro with XFCE 4.12.
Comment 1 Igor editbugs 2018-04-16 15:15:17 CEST
Hi, are you going to propose this change for the upstream or keep it for your private use?
Because I'm not sure about it: normally, when users run the terminal drop-down mode they know what they do, and they wouldn't be happy with accidental dragging of the tab and transforming the drop-down window into a normal one. Besides, one can always press Shift+Ctrl+N to open a normal window or assign a global shortcut to launch the terminal (which I always do).
Comment 2 rubenwardy 2018-04-16 19:20:51 CEST
> are you going to propose this change for the upstream or keep it for your private use?

Preferably the former

> they wouldn't be happy with accidental dragging of the tab and transforming the drop-down window into a normal one

I can't see people accidentally dragging a tag at all - never happened to me. If it does happen, then your tolerance of when it starts dragging is too low. Additionally, this can already happen if you have more than one tab - and more likely to happen as you'll be dragging to rearrange.

> Shift+Ctrl+N to open a normal window or assign a global shortcut to launch the terminal (which I always do).

Doesn't help at all

> normally, when users run the terminal drop-down mode they know what they do
>
> assign a global shortcut to launch the terminal (which I always do).

Manjaro (and I imagine other distros) have drop down as the default action for the keyboard shortcut.
Comment 3 Igor editbugs 2018-04-19 20:19:54 CEST
(In reply to rubenwardy from comment #2)
> > they wouldn't be happy with accidental dragging of the tab and transforming the drop-down window into a normal one
> I can't see people accidentally dragging a tag at all - never happened to
> me. If it does happen, then your tolerance of when it starts dragging is too
> low. Additionally, this can already happen if you have more than one tab -
> and more likely to happen as you'll be dragging to rearrange.
If you have two tabs and accidentally drag out one of them - you at least don't lose your existing drop-down window.

> > Shift+Ctrl+N to open a normal window or assign a global shortcut to launch the terminal (which I always do). 
> Doesn't help at all
Open another tab and drag the one you want to transform to a normal window. That way, you'll have your normal window and also keep drow-down window which you need (otherwise, why would you open it in the first place?).

> > normally, when users run the terminal drop-down mode they know what they do
> > assign a global shortcut to launch the terminal (which I always do).
> Manjaro (and I imagine other distros) have drop down as the default action
> for the keyboard shortcut.
Nothing is preventing you from having two shortcuts set up. I have Ctrl+Alt+T for normal terminal and F12 for drop-down.

To summarize: I can only see this implemented as a functionality to transform current tab or window to drop-down window and vice versa. Because if you dragged the only tab from a drop-down window and made it a normal window, there would be no way to undo that.
Feel free to propose a patch if you're interested.
Comment 4 rubenwardy 2018-04-20 03:48:15 CEST
I think this was a mistake, but whatever
Comment 5 rubenwardy 2018-04-20 03:50:04 CEST
This kills the usability of the drop down terminal for me, so I just won't use it

Bug #14340

Reported by:
rubenwardy
Reported on: 2018-04-15
Last modified on: 2018-04-20

People

CC List:
1 user

Version

Version:
unspecified

Attachments

Additional information