@@ -1083,19 +1083,29 @@ def show_hide(self, *args):
1083
1083
1084
1084
GDK_WINDOW_STATE_STICKY = 8
1085
1085
GDK_WINDOW_STATE_WITHDRAWN = 1
1086
+ GDK_WINDOW_STATE_ABOVE = 32
1087
+
1086
1088
if self .window .window :
1087
1089
print "DBG: gtk.gdk.WindowState =" , self .window .window .get_state ()
1088
1090
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 ,)))
1089
1097
if not self .window .get_property ('visible' ):
1090
1098
print "DBG: Showing the terminal"
1091
1099
self .show ()
1092
1100
self .set_terminal_focus ()
1093
1101
elif (self .client .get_bool (KEY ('/general/focus_if_open' )) and
1094
1102
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
+ )):
1097
1106
print "DBG: Restoring the focus to the terminal"
1098
1107
self .window .window .focus ()
1108
+ self .set_terminal_focus ()
1099
1109
else :
1100
1110
print "DBG: hiding the terminal"
1101
1111
self .hide ()
0 commit comments