X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=scripts%2Ffocus.py;h=00e53cbc33665144828bee2a9071484ef28f5654;hb=f7a0eb7624fa323a37f9fb0e306d7e1bbc745e15;hp=60ea4189c3990a0410114f4f5a116ed2720a37e1;hpb=ef0e907efd1c3e6372e172cedd9108034744486a;p=chaz%2Fopenbox diff --git a/scripts/focus.py b/scripts/focus.py index 60ea4189..00e53cbc 100644 --- a/scripts/focus.py +++ b/scripts/focus.py @@ -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) @@ -196,18 +197,19 @@ def _create_popup_list(data): desktop = ob.openbox.screen(data.screen).desktop() if client and ((client.desktop() == desktop or client.desktop() == 0xffffffff) and \ - client.normal()): + client.normal() and (client.canFocus() or + client.focusNotify())): t = client.title() if len(t) > 50: # limit the length of titles 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) @@ -245,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):