Skip to content

Commit

Permalink
Merge remote branch 'tailhook/focusfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
cortesi committed Mar 17, 2011
2 parents fdcfe41 + b0ed2f5 commit b7009f1
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions libqtile/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,11 @@ def _setScreen(self, screen):

def hide(self):
self.screen = None
for i in self.windows:
i.hide()
with self.disableMask(xcb.xproto.EventMask.EnterWindow
|xcb.xproto.EventMask.FocusChange
|xcb.xproto.EventMask.LeaveWindow):
for i in self.windows:
i.hide()

@contextlib.contextmanager
def disableMask(self, mask):
Expand Down Expand Up @@ -381,15 +384,23 @@ def remove(self, window):
window.group = None
nextfocus = None
if window.floating:
self.floating_layout.remove(window)
nextfocus = self.floating_layout.remove(window)
if nextfocus is None:
nextfocus = self.layout.focus_first()
if nextfocus is None:
nextfocus = self.floating_layout.focus_first()
else:
for i in self.layouts:
if i is self.layout:
nextfocus = i.remove(window)
else:
i.remove(window)
self.focus(nextfocus, True)
self.layoutAll()
if nextfocus is None:
nextfocus = self.floating_layout.focus_first()
if nextfocus is None:
nextfocus = self.layout.focus_first()
self.focus(nextfocus, True)
self.layoutAll()
#else: TODO: change focus

def mark_floating(self, window, floating):
Expand Down

0 comments on commit b7009f1

Please sign in to comment.