Skip to content

Commit

Permalink
Fixed window focus on mouse enter.
Browse files Browse the repository at this point in the history
  • Loading branch information
avahe-kellenberger committed Nov 8, 2024
1 parent f99cf7e commit 29a0cd2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/nimdowpkg/windowmanager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1619,8 +1619,9 @@ proc onEnterNotify(this: WindowManager, e: XCrossingEvent) =
return

this.selectCorrectMonitor(e.x_root, e.y_root)
if this.selectedMonitor.taggedClients.currClientsContains(e.window):
discard XSetInputFocus(this.display, e.window, RevertToPointerRoot, CurrentTime)

let (client, _) = this.windowToClient(e.window)
this.focus(client, false)

proc onFocusIn(this: WindowManager, e: XFocusInEvent) =
if this.mouseAction != Normal or e.detail == NotifyPointer or e.window == this.rootWindow:
Expand Down

0 comments on commit 29a0cd2

Please sign in to comment.