gnunn1 / tilix

A tiling terminal emulator for Linux using GTK+ 3
https://gnunn1.github.io/tilix-web
Mozilla Public License 2.0
5.4k stars 294 forks source link

tilix --quake toggle behavior #1494

Open iffyio opened 6 years ago

iffyio commented 6 years ago

According to the documentation the --quake switch will toggle the tilix window's visibility if one is already running. This behavior works fine if the window was already in focus: in which case, the command causes the window to become hidden.

However, running tilix --quake when the window is not in focus but is not hidden either, should bring the window back into focus instead of hiding the window. This is the behavior in terminal emulators like Iterm2 and xfce4-terminal. A consequence of the current behavior in tilix is that bringing that window back into focus becomes a two-command process that first hides the window and finally displays it again with focus.

Steps to reproduce:

Running on Linux Mint 18, X11, XFCE 4.12 Tilix version: 1.8.1 VTE version: 0.42 GTK Version: 3.18.9

gnunn1 commented 6 years ago

This is actually surprisingly tricky and difficult to do. The problem is that unlike some terminal emulators tilix opted to have the desktop environment to manage the hotkey since originally I wanted to support Wayland. The issue is when you press the global hot key tilix temporarily loses focus, this means that a check to isActive, isFocus or hasFocus fails because it thinks it's not active and just re-shows it again.

I may need to add some sort of timer for this which I hate, I'm doing it somewhere else for quake mode and it just never works well.

You can see a discussion of the losing focus issue here if someone wants to do a deep dive on it:

https://bugs.launchpad.net/gnome-settings-daemon/+bug/1244090

tgeng commented 4 years ago

How about just hide the terminal upon receiving 'tilix --quake' if the terminal is not hidden (assuming the terminal should know whether the window is being drawn)? I don't care about whether it's active or not.

RafalSkolasinski commented 2 years ago

How about just hide the terminal upon receiving 'tilix --quake' if the terminal is not hidden (assuming the terminal should know whether the window is being drawn)? I don't care about whether it's active or not.

Seems like a good idea to me...

curiousercreative commented 1 year ago

@gnunn1 I think we resolved this with https://github.com/gnunn1/tilix/pull/1993