Cannot trigger hidden/visible state

Bug #1501128 reported by Sparhawk on 2015-09-30
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Terminator
Medium
Unassigned

Bug Description

I have the following in ~/.config/terminator/config

[global_config]
  window_state = hidden
[keybindings]
  hide_window = F3

Pressing F3 will toggle the visibility of terminator perfectly in the gtk2 version, but does nothing in the gtk3 version. I've attached the output of `terminator -d`.

Arch Linux
terminator-gtk3-bzr r1612
KDE Plasma 5.4.1

Related branches

Sparhawk (sparhawkthesecond) wrote :
tags: added: gtk3
Changed in terminator:
importance: Undecided → Medium
milestone: none → 2.0
Stephen Boddy (stephen-j-boddy) wrote :

Turns out this is present in the trunk GTK2 version too. It looks like some of the earlier work on IBus/broadcast seems to have accidentally begun ignoring this key event. It might be because it is the only global shortcut that this is the only one affected. Other shortcuts (as far as I'm aware) are OK. It'll need a bit more attention than I can pay it right now.

tags: removed: gtk3
Changed in terminator:
milestone: 2.0 → none
status: New → Triaged
summary: - (gtk3-only) Cannot trigger hidden/visible state
+ Cannot trigger hidden/visible state
Sparhawk (sparhawkthesecond) wrote :

I just tried installing terminator-gtk3 again, this time the latest r1637. I can trigger the hidden/visible state perfectly now.

A small note: unlike terminator-gtk2, when I make the window visible again, it doesn't automatically bring it to the front. I looked in Preferences > Behaviour > Always on top, but that doesn't do anything. I'm using KDE Plasma 5, and fortunately I can emulate the previous behaviour with Window Rules, so it's not a problem for me personally.

Sparhawk (sparhawkthesecond) wrote :

Oh, there is a larger problem. On making terminator visible again, it no longer accepts focus. That is, keystrokes get sent to the previous window. Oddly enough, it sometimes works, if terminator previously had focus, as below.

1) Have terminator visible. Click it to make it accept focus.
2) Hide terminator.

3a) Do nothing.
  OR
3b) Click or type in Firefox.

4) Make terminator visible again.

If I follow 3a, then terminator accepts focus. If I follow 3b, then keystrokes get sent to Firefox.

Unfortunately this is a show stopper for me, and I can't see a workaround in Plasma, so I'll have to go back to terminator-gtk2.

One other minor query: I can only open up the contextual menu (e.g. for preferences) with a double right-click. Is that normal?

Sparhawk (sparhawkthesecond) wrote :

I just tried installing the latest terminator again. It's now at r1641. All these bugs have been fixed.

* I can toggle hide/visible state.
* On un-hiding, it moves to the front.
* On un-hiding, it automatically accepts input.

You can close this bug now. Thank you.

r34ch (thedarchorse) wrote :

Im using the latest nightly build of 1.9 via PPA and I am getting the same issue described in https://bugs.launchpad.net/terminator/+bug/1501128/comments/4

This is the last issue I am having with the GTK3 build and it is a show stopper for me too. Is the nightly PPA build different to manually making the build?

r34ch (thedarchorse) wrote :

Can confirm this issue on r1641 and r1697 for me. Output on console reads

```
0
<window.Window object at 0x7f50de4b78c0 (terminatorlib+window+Window at 0x10ee240)>
Traceback (most recent call last):
  File "/home/dr/Workspace/terminator/gtk3-2/terminatorlib/window.py", line 315, in on_hide_window
    print self.window
AttributeError: 'Window' object has no attribute 'window'

```

After executing `bzr branch http://bazaar.launchpad.net/~gnome-terminator/terminator/gtk3/ branch-name` is there anything else needed to be done (like make)? Currently im simply executing terminator using `./terminator`

Sparhawk (sparhawkthesecond) wrote :

If it helps, I'm using r1691 at the moment, and it's fine for me. (Using Arch Linux.)

Stephen Boddy (stephen-j-boddy) wrote :

I'm going to close this as fix committed for now. The original issue is resolved. Further issues about focus and window z-order on unhide are already raised as other bugs.

@r34ch (thedarchorse): Your error was me being dumb and not deleting some debug prints before I checked in another fix. I removed them today, as well as some other fixes for keyboard bindings, so if you can check on a fresh branch and report back. If it still doesn't work for you, we can look to reopen the bug.

Changed in terminator:
status: Triaged → Fix Committed
r34ch (thedarchorse) wrote :

@Stephen Boddy (stephen-j-boddy)

I checked out bzr@1714 [merge] and ran `python setup.py install`. I then ran `./terminator -g temp_config -u` and changed my key bindings for `hide_window` to ' Left Ctrl + ` '. I closed the terminator instance and reran using `-g temp_config` flag again.

The same issues are occurring as comment #4. Are they the focus and window z-order issues?

If so, then I don't think this bug needs reopened as I can toggle the visibility. I still get the output

Traceback (most recent call last):
  File "/home/dr/Workspace/terminator/gtk3-3/terminatorlib/window.py", line 316, in on_hide_window
    self.window.focus(t)
AttributeError: 'Window' object has no attribute 'window'

though

Committed revision 1715.

Yes, focus and z-order == comment #4

Hmmm I had to dig through history to understand what happened that was causing your exception. A patch was provided by a guy in gtk2 days to fix foreground/focus issues. The gtk2->gtk3 port left a line that tried to do something invalid for gtk3. Then a guy posted a fix for the gtk3 version to the already closed, original gtk2 ticket. So it got missed.

More info: https://bugs.launchpad.net/terminator/+bug/805870

So this gets rid of your error, and it looks like it may also fix the focus and z-order issues.

r34ch (thedarchorse) wrote :

@Stephen Boddy (stephen-j-boddy) thanks, revision 1715 does indeed fix the debug output but unfortunately the focus and z-order issues still persist for me. If it helps, im using dual monitors on 16.04. Is there a separate bug for the z-order and focus issue?

https://bugs.launchpad.net/terminator/+bug/843674 looks like a focus issue but slightly different. Should I post reproduction steps in the thread linked or create a new one?

Hi r34ch, that particular bug is about quake mode, and the window disappearing prematurely. It's not related. There's a whole bundle of other bugs for focus and z-order on new windows and unhides, so please don't create more new ones. I think they're all related so I just need to find the culprit and hopefully a whole bunch of stuff will stop giving me grief. Just search for "unhide", "focus", and "behind", and scan through. You should find a whole bunch, with at least one matching your experiences.

Hi (again) r34ch. Please try again with the very latest. Seems I missed a part of the fix, so it cured the exception, but still didn't work properly. It (hopefully) is working now.

r34ch (thedarchorse) wrote :

@Stephen Boddy (stephen-j-boddy) It works! As of rev 1717 the z-order and focus both work on the gtk3 port for me. I am now happy to make the switch from the gkt2 version.

Thank you very much for your help and continued patience, Stephen. Great project.

Changed in terminator:
milestone: none → 2.0
Changed in terminator:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments