qterminal
qterminal copied to clipboard
QTerminal -d on wayland vanishes if loosing focus and can't be recovered
As it fails to register the shortcut there's no way to make it visible again.
Possible Solution
- Allow only one instance of
qterminal -d
(see comment ) - or fix the registering of the shortcut
Steps to Reproduce (for bugs)
-
Open
qterminal -d
on wayland -
change focus
-
it will disappear also from taskbar like yatbfw
-
- QTerminal version: 1.2.0
IMHO, the drop-down mode is already used like a single-instance app; having multiple instances of it running together doesn't make much sense under X11 either.
The current qterminal already allows showing/hiding the dropdown window via a dbus method. For example:
qdbus org.lxqt.QTerminal-612287 / org.lxqt.QTerminal.Process.toggleDropdown
However, the service name is not fixed, as dbus interfaces in qterminal are designed to support multiple instances. Moving to a single-instance model is a big work and I don't think I can do it in near future. See also https://github.com/lxqt/qterminal/issues/644 for previous discussions about single-instance model.
Could dbus-send something
be used with a wildcard which always matches the dropdown terminal?
This could be used in a shortcut on all wayland compositors. Looking for the clients class there are the same, would it be possibile to have a different class for the dropdown-window?
Window a8b59ab0 -> stef@archlinux: ~:
at: 41,41
size: 1283,998
workspace: 3 (3)
floating: 0
monitor: 0
class: qterminal
title: stef@archlinux: ~
pid: 2301858
xwayland: 0
pinned: 0
fullscreen: 0
fullscreenmode: 0
fakefullscreen: 0
grouped: 0
swallowing: 0
-----------------------------
Window a8b59ab0 -> stef@archlinux: ~:
at: 41,41
size: 1283,998
workspace: 3 (3)
floating: 0
monitor: 0
class: qterminal
title: stef@archlinux: ~
pid: 2301858
xwayland: 0
pinned: 0
fullscreen: 0
fullscreenmode: 0
fakefullscreen: 0
grouped: 0
swallowing: 0
Could
dbus-send something
be used with a wildcard which always matches the dropdown terminal?
I guess no direct way for current qterminal. You will need a script to iterate over possible dbus interface names.
Looking for the clients class there are the same, would it be possibile to have a different class for the dropdown-window?
Most likely possible with some code changes. That being said, I prefer a platform-independent way that is independent of Wayland or X11 properties. A dbus property may be better.
@stefonarch @yan12125 Using DBus to send a command is possible, just not in a way you might expect. Instead of using qdbus org.lxqt.qterminal...
don't you think it's easier to use qterminal --toggle
?
If only a single instance of QTerminal in the drop-down mode is allowed, you should be able to use a property (IsDropDown
), search all the qterminal dbus services, and match the one where IsDropDown
is true. Send a request to that service. If no instance is found, then do nothing.
Sure, a command line option is better. It may be non-trivial and I don't have time to look into it yet, though. As usual, patches are welcome.
If only one instance is running this works:
#!/bin/bash
# Helper script for qterminal -d
ID=$(qdbus |grep QTermin|awk '{$1=$1};1')
qdbus "$ID" / org.lxqt.QTerminal.Process.toggleDropdown
EDIT: working version for more instances:
#!/bin/bash
while IFS= read -r line; do
qdbus "$line" / org.lxqt.QTerminal.Process.toggleDropdown
done < <(qdbus | grep QTermin | awk '{$1=$1};1')
Done in https://github.com/lxqt/qterminal/pull/1131 and https://github.com/lxqt/qterminal/pull/1113