lxqt / qterminal

A lightweight Qt-based terminal emulator
https://lxqt.github.io
GNU General Public License v2.0
586 stars 150 forks source link

Single instance for drop-down mode #1131

Closed tsujan closed 1 month ago

tsujan commented 1 month ago

Based on D-Bus.

marcusbritanicus commented 1 month ago

I can confirm that this solves both #1028 and #1059. It should be quite easy to set a (keybind, command) pair to show and toggle the drop-down window on all wayland compositors.

stefonarch commented 1 month ago

Works fine, yes.

This has a nice side-effect: qterminal -d in x11 needs to be in autostart and opens the window at login, while on wayland the first hit on F12 opens it and if you actually close it by ctrl+q no issue, it reopens again at F12. So I added X-LXQt-X11-Only=true in its autostart .desktop file.

tsujan commented 1 month ago

@marcusbritanicus, @stefonarch, thanks for testing it! Will merge it along with https://github.com/lxqt/qterminal/pull/1113 after testing them together for a week or so.

@marcusbritanicus, as I mentioned at https://github.com/lxqt/qterminal/pull/1115, your method was also correct and worked fine. I didn't check why D-Bus was already used in the code, but I didn't find a real use for it by a glance before the current PR.

If needed, we could also make a single-instance app out of the windowed mode later. But I'm not sure if that's a good idea. Personally, I feel safer when my terminal instances are independent from each other. However, the drop-down mode was already used like a single-instance app.

@stefonarch,, please rebase https://github.com/lxqt/qterminal/pull/1113 to fix its conflict (only one) with the current master.

marcusbritanicus commented 1 month ago

@tsujan No issues at all. This way is much shorter and it will be easy on the maintenance. Plus, no new files added.

luis-pereira commented 1 month ago

Testing it.

tsujan commented 1 month ago

This PR and https://github.com/lxqt/qterminal/pull/1113 have worked reliably here for 4 days. I'm merging both...