lxqt / qterminal

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

Add preliminary single-instance support for drop-down mode #1115

Closed marcusbritanicus closed 1 month ago

marcusbritanicus commented 2 months ago

This PR adds preliminary support for single instance mode for drop-down mode. Additionally, it adds support for toggling the drop-down instance via qterminal -d command line. On wayland, we can simply add a command-binding pair for most compositors. On wayfire, this would simply be adding the following lines under the [command] section.

binding_qterminal_dd: KEY_F12
command_qterminal_dd: qterminal -d

If an instance of qterminal in the drop-down mode exists, it will toggle it. Otherwise, a new drop-down instance will be created. The normal qterminal instances are unaffected.

This fixes both #1028 and #1059. Since it's not possible to fix one without the other, I am breaking the one-issue-one-PR rule.

Cc: @yan12125 @stefonarch @tsujan

stefonarch commented 2 months ago

Works as it should - for me GTM

yan12125 commented 2 months ago

Removing myself as a reviewer as I stopped maintaining qterminal and qtermwidget, see https://github.com/lxqt/lxqt/discussions/2564

tsujan commented 2 months ago

I'll review it after QTerminal 2.0 is released.

tsujan commented 1 month ago

Although this code seems OK, I'm afraid not only a D-Bus-based single instance needs much less code (because D-Bus is already used), but also it's more reliable than the socket-lock method (I say that based on my experience with old versions of FeatherPad).

Here is the D-Bus-based PR: https://github.com/lxqt/qterminal/pull/1131

marcusbritanicus commented 1 month ago

@tsujan Just tested #1131. It works great!! I'll close this.

stefonarch commented 1 month ago

Works ok here too, but thanks to @marcusbritanicus 's code which made it already possible to have it for the last weeks ;)