Skip to content

Commit 399ae04

Browse files
committed
More logs and handle topmost case
Signed-off-by: Gaetan Semet <[email protected]>
1 parent 3b34898 commit 399ae04

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/guake.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -1083,19 +1083,29 @@ def show_hide(self, *args):
10831083

10841084
GDK_WINDOW_STATE_STICKY = 8
10851085
GDK_WINDOW_STATE_WITHDRAWN = 1
1086+
GDK_WINDOW_STATE_ABOVE = 32
1087+
10861088
if self.window.window:
10871089
print "DBG: gtk.gdk.WindowState =", self.window.window.get_state()
10881090
print "DBG: gtk.gdk.WindowState =", int(self.window.window.get_state())
1091+
print ("DBG: GDK_WINDOW_STATE_STICKY? %s" %
1092+
(bool(int(self.window.window.get_state()) & GDK_WINDOW_STATE_STICKY),))
1093+
print ("DBG: GDK_WINDOW_STATE_WITHDRAWN? %s" %
1094+
(bool(int(self.window.window.get_state()) & GDK_WINDOW_STATE_WITHDRAWN,)))
1095+
print ("DBG: GDK_WINDOW_STATE_ABOVE? %s" %
1096+
(bool(int(self.window.window.get_state()) & GDK_WINDOW_STATE_ABOVE,)))
10891097
if not self.window.get_property('visible'):
10901098
print "DBG: Showing the terminal"
10911099
self.show()
10921100
self.set_terminal_focus()
10931101
elif (self.client.get_bool(KEY('/general/focus_if_open')) and
10941102
self.window.window and
1095-
self.window.window.get_state() in [GDK_WINDOW_STATE_STICKY,
1096-
GDK_WINDOW_STATE_WITHDRAWN]):
1103+
(int(self.window.window.get_state()) & GDK_WINDOW_STATE_STICKY or
1104+
int(self.window.window.get_state()) & GDK_WINDOW_STATE_WITHDRAWN
1105+
)):
10971106
print "DBG: Restoring the focus to the terminal"
10981107
self.window.window.focus()
1108+
self.set_terminal_focus()
10991109
else:
11001110
print "DBG: hiding the terminal"
11011111
self.hide()

0 commit comments

Comments
 (0)