qterminal
qterminal copied to clipboard
Set layer overlay for dropdown terminal on wayland
Fix for https://github.com/lxqt/qterminal/issues/1111
Remaining issues:
- [ ] Configuration window is below the dropdownterminal and eventually completely unaccessible
- [ ] Consider screen width instead of available width for centering. With a 100% size and a right or left panel it goes out of screen (for the panel-width).
- [ ] Add an info and disable not-working shortcut selection in preferences.
This works great..!! Two problems I face at the moment.
- Multiple instances.
- Toggling the terminal window.
Solution for 1. We can use a single-instance class derived from QApplication. When starting in drop-down mode, we can lock the instance. In all other cases, leave it unlocked.
Solution for 2.
Call qterminal -d
to toggle and start the drop-down mode. Since the first instance is already locked, the subsequent instances can request the fist instance to toggle the window. All non-drop-down instances will not be affected by this since they're not locked.
There are already open issues for that - listed in the the issue which will be fixed. At the moment I've a rather hacky script which I use for the shortcut.
There are already open issues for that - listed in the the issue which will be fixed. At the moment I've a rather hacky script which I use for the shortcut.
Well.. I am working on this now. Let's see how it goes.
Testing combined with https://github.com/lxqt/qterminal/pull/1115 the issue with the settings window below is less severe as users could use F12 again to remove the terminal. Ideally doing this in the code would best IMO.
Regarding the second listed issue: it is exactly half panel width which moves the terminal out of center or out of screen if set to 100% width. With 2 identical panels on both sides it turns centered.
Regarding the second listed issue: it is exactly half panel width which moves the terminal out of center or out of screen if set to 100% width. With 2 identical panels on both sides it turns centered.
Panel should be a TopLayer
. Since QTerminal will be OverlayLayer
, there should not be any conflict at all. Is this behaviour with all compositors (including kwin) or only a particular one?
Is this behaviour with all compositors (including kwin) or only a particular one?
I saw exactly the same with kwin too - actually it was kwin and another user where I played with 100px panels adding and removing (and hating the jumping icon at cursor at F12 press). In theory you're right, it may be a bug in layershell-qt.
I didn't test wayfire or others.
Added another issue to fix:
Add an info and disable not-working shortcut selection in preferences.
The conflict with the current master aside, the combination of this and https://github.com/lxqt/qterminal/pull/1131 resulted in a good experience here, under LabWC.
However, we may need to address some issues. For example, I noticed that the Preferences dialog goes behind the main window. I was able to work with it after clicking into the main window and then somewhere else to hide the main window, but that's not good for UX.
The problem with Preferences dialog seems to be a problem in Wayland (WM): it's the job of a WM to put a modal dialog in front of its parent window. So, we don't need to deal with it.
The problem with Preferences dialog seems to be a problem in Wayland (WM): it's the job of a WM to put a modal dialog in front of its parent window. So, we don't need to deal with it.
We have multiple levels of problems here:
- The main window is now a layer-surface, and an overlay surface. What this implies is that: a. It's not a xdg-shell window. So any windows that this layer-surface window spawns will be a simple, xdg-shell window. b. All windows that this layer-surface window spawns will be placed below this surface, because you have asked the compositor to place this on top.
- Wayland, at the moment, does not have the concept of window modality. Even if it did, 1a and 1b would make it a moot point.
The solution to this is to hide the drop-down surface, and then show it again when the options dialog is closed.
Alternatively, show the options dialog as a layer-surface.
@marcusbritanicus Thanks for your explanation! I get your point; I just don't think it's our problem to solve. But yes, we may need a workaround, in which case, it could be added in another PR, after this is merged.
Just noticed that qterminal -d
and lxqt-runner
on sway have the same issue: missing keyboard focus. Actually I don't remember if I already opened an issue about that.
@marcusbritanicus Thanks for your explanation! I get your point; I just don't think it's our problem to solve. But yes, we may need a workaround, in which case, it could be added in another PR, after this is merged.
@tsujan Just a quick update: There is a xdg-dialog in wayland-protocols. It might take time for it to be implemented in Qt, but it might solve our problem of the dialog going below. I do not expect that to directly work - it will require changes to layershell-qt.
It might take time for it to be implemented in Qt, but it might solve our problem of the dialog going below.
Thanks for the info! indeed problems like that should be solved upstream.