]> Dogcows Code - chaz/openbox/blobdiff - scripts/focus.py
grab the keyboard during move/resize to make sure the popup doesnt get left onscreen...
[chaz/openbox] / scripts / focus.py
index 5ae40cf273e483aa7cb71295a0d7d8beef15e398..00e53cbc33665144828bee2a9071484ef28f5654 100644 (file)
@@ -136,7 +136,8 @@ def _focus_stacked_ungrab(data):
         # have all the modifiers this started with been released?
         if not _cyc_mask & data.state:
             _destroy_popup_list()
-            ob.kungrab() # ungrab ourself
+            ob.kungrab()
+            ob.mungrab()
             _doing_stacked = 0;
             if cycle_raise:
                 client = ob.openbox.findClient(_cyc_w)
@@ -203,12 +204,12 @@ def _create_popup_list(data):
                 t = t[:24] + "..." + t[-24:]
             titles.append(t)
             _list_windows.append(c)
-            l = font.measureString(t) + 10 # add margin
+            l = font.measureString(t)
             if l > longest: longest = l
     if len(titles) > 1:
         for t in titles:
             w = otk.FocusLabel(_list_widget)
-            w.resize(longest, height)
+            w.fitSize(longest, height)
             w.setText(t)
             w.unfocus()
             _list_labels.append(w)
@@ -246,6 +247,10 @@ def focus_next_stacked(data, forward=1):
             _create_popup_list(data)
 
         ob.kgrab(data.screen, _focus_stacked_ungrab)
+        # the pointer grab causes pointer events during the keyboard grab to
+        # go away, which means we don't get enter notifies when the popup
+        # disappears, screwing up the focus
+        ob.mgrab(data.screen)
         focus_next_stacked(data, forward) # start with the first press
 
 def focus_prev_stacked(data):
This page took 0.020935 seconds and 4 git commands to generate.