Skip to content

Commit 5919dc0

Browse files
committed
close main window only when not isOnActiveSpace()
fixes #76 This commit was sponsored by Jardo, Mark Harviston, Matt Campbell, and my other patrons. If you want to join them, you can support my work at https://glyph.im/patrons/.
1 parent c7ad8a4 commit 5919dc0

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/pomodouroboros/macos/mac_utils.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -256,16 +256,15 @@ def someSpaceActivated_(self, notification: NSNotification) -> None:
256256
"""
257257
Sometimes, fullscreen application stop getting the HUD overlay.
258258
"""
259-
if (
260-
NSRunningApplication.currentApplication()
261-
== NSWorkspace.sharedWorkspace().menuBarOwningApplication()
262-
):
263-
NSLog("my space activated, not doing anything")
264-
return
265-
NSLog("space activated, closing window")
266-
self.mainWindow.close()
259+
menuBarOwner = NSWorkspace.sharedWorkspace().menuBarOwningApplication()
260+
me = NSRunningApplication.currentApplication()
261+
NSLog("space activated where allegedly %@ owns the menu bar", menuBarOwner)
262+
if not self.mainWindow.isOnActiveSpace():
263+
NSLog("I am not on the active space, closing the window")
264+
self.mainWindow.close()
265+
else:
266+
NSLog("I am on the active space; not closing.")
267267
self.onSpaceChange()
268-
NSLog("window closed")
269268

270269
def someWindowWillClose_(self, notification: NSNotification) -> None:
271270
"""

0 commit comments

Comments
 (0)