Skip to content

Commit

Permalink
seems like x11 auto focus prev window after hide
Browse files Browse the repository at this point in the history
  • Loading branch information
SnosMe committed Jan 29, 2020
1 parent 827df24 commit b792995
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/positioning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export function setupShowHide () {

if (poeWindowId && isWindowLocked) {
isWindowLocked = false
windowManager.focusWindowById(poeWindowId)
if (process.platform === 'win32') {
windowManager.focusWindowById(poeWindowId)
}
if (browserViewExternal) {
win.removeBrowserView(browserViewExternal)
// uncomment to trade performance for less memory usage (1 process & 13 MB)
Expand Down
8 changes: 7 additions & 1 deletion src/main/window-manager/LinuxX11.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ export class LinuxX11 implements IWindowManager {

getActiveWindowId (): Promise<number | null> {
return new Promise((resolve, reject) => {
reject(new Error('Method not implemented.'))
this.X.GetProperty(0, this.rootWid, this.USED_ATOMS._NET_ACTIVE_WINDOW, this.USED_ATOMS.WINDOW, 0, 4, (err, prop) => {
if (err) {
reject(err)
} else {
resolve(decodeWindow(prop.data))
}
})
})
}

Expand Down

0 comments on commit b792995

Please sign in to comment.