Skip to content

Commit

Permalink
Fix semantics of focus in stack for new windows
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Oct 15, 2019
1 parent b11c04a commit 70b34b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion wm/desk.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ func (x *x11WM) setupWindow(win xproto.Window) {
}

x.AddWindow(c)
x.RaiseToTop(c)
c.Focus()
}

func (x *x11WM) destroyWindow(win xproto.Window) {
Expand Down
5 changes: 2 additions & 3 deletions wm/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ func (s *stack) RaiseToTop(win desktop.Window) {
if win.Iconic() {
return
}
if len(s.clients) <= 1 {
return
if len(s.clients) > 1 {
win.RaiseAbove(s.clients[0])
}
win.RaiseAbove(s.clients[0])

s.removeFromStack(win)
s.addToStack(win)
Expand Down

0 comments on commit 70b34b2

Please sign in to comment.