qterminal icon indicating copy to clipboard operation
qterminal copied to clipboard

QTerminal dropdown always on top with "keep open if losing focus" selected

Open SubOptimal opened this issue 2 years ago • 10 comments

Is your feature request related to a problem? Please describe. When the option "Keep window open when it loses the focus" is selected, then the terminal window stays always on top.

Describe the solution you'd like It would be nice if "keep open" would not imply "stay on top". It should behave as any other open window. If another window get active and the input focus, the qterminal window should be displayed behind and not stay on top.

Describe eventual alternatives you've considered Seems there is no option to control that behavior.

image

Context

QTerminal currently hide another active window.

image

Either the qterminal drop-down window disappear when another window get the focus or it stays on top of all windows. Sometimes I would like to keep it open, but not to stay on top.

Used qterminal version 1.2.0 on Debian Bookworm.

SubOptimal avatar Jan 01 '23 23:01 SubOptimal

This option should do exactly that, but it doesn't anymore if I'm not mistaken. First I thought it was an issue with xfwm 4.18 but also with other WMs I see it.
Looks like a regression, so we should change it to "bug".

stefonarch avatar Jan 02 '23 07:01 stefonarch

That option has been working that way for a long time. The description is indeed incorrect. At least it should be fixed. It's also nice to add a not-always-on-top mode.

Under the hood:

  • The drop window always uses Qt::WindowStaysOnTopHint https://github.com/lxqt/qterminal/commit/e1f40d7e11ab1db3707f3ae05c650f8aacdbe5ab#diff-c72b037f3ac7abbd3d0ee519b6f456013a9bbf5a59df16308939320c04970447R93
  • If dropKeepOpen option is not enabled, the drop window becomes hidden when deactivated. https://github.com/lxqt/qterminal/commit/e1f40d7e11ab1db3707f3ae05c650f8aacdbe5ab#diff-c72b037f3ac7abbd3d0ee519b6f456013a9bbf5a59df16308939320c04970447R506

yan12125 avatar Jan 02 '23 09:01 yan12125

As I never used it I don't remember well- to me this option makes no sense at all if the window stays at top always, IMO we should change the behavior not the description.

stefonarch avatar Jan 02 '23 10:01 stefonarch

Some people may still want the terminal to stay on top. Not sure if WM tricks (ex: devilspie/devilspie2 or kwin rules) are enough or qterminal should have an option for it.

yan12125 avatar Jan 02 '23 11:01 yan12125

Some people may still want the terminal to stay on top.

I also think that a drop-down terminal should stay on the top. When the user selects that option, he/she just wants to hide it himself/herself. Personal habits and preferences aside, IMHO, adding an extra option isn't justified.

tsujan avatar Jan 02 '23 12:01 tsujan

An option is introduced when some people want this and others want that :) Either behavior is fine IMO.

yan12125 avatar Jan 02 '23 12:01 yan12125

I think adding options based on mere likes/dislikes will lead to a chaos — like in KDE's config dialogs. There are as many likes/dislikes as there are users. IMO, an app should have enough options, not more. Who determines they're enough? Its devs, not users.

That being said, outside my work area, I follow the main devs' opinions — in this case, you :)

tsujan avatar Jan 02 '23 12:01 tsujan

Maybe we need more information to make meaningful decisions. @SubOptimal mind to share your use scenario for keeping the dropdown window and not making it stay on top?

yan12125 avatar Jan 03 '23 05:01 yan12125

@yan12125

My common use case is to run qterminal --drop and make it visible on need. It get hidden, when it loses the focus. To make it visible again I use SHIFT-F11 (as SHIFT-F12 would, for me, not work while the browser has the focus).

Frequently I have the use case where I still want to see the last output in the QTermial while moving the focus to another application. Which is currently more or less impossible.

Keep window open when it loses the focus - disabled

  • QTerminal get hidden when another application gets the focus

Keep window open when it loses the focus - enabled

  • QTerminal stays as top window and even might be on top over the window with the current focus

An option to hide/un-hide the QTerminal drop-down manually, while it not stays the top most window, would be also OK for me.

SubOptimal avatar Jan 05 '23 13:01 SubOptimal

Thanks, that is a valid use case. I will add a new option to disable Qt::WindowStaysOnTopHint when I find time.


(from https://github.com/lxqt/qterminal/issues/1022#issuecomment-1368880500)

Not sure if WM tricks (ex: devilspie/devilspie2 or kwin rules) are enough or qterminal should have an option for it.

Apparently Qt resets _NET_WM_STATE after toggling on/off the dropdown window, so WM tricks may not be enough.

yan12125 avatar Jan 07 '23 13:01 yan12125