From 936f18d714d149799b180ab2a32788e9d7d6966d Mon Sep 17 00:00:00 2001 From: neon443 <69979447+neon443@users.noreply.github.com> Date: Tue, 27 May 2025 16:34:01 +0100 Subject: [PATCH] add fullscreen support, fix dock moving to the right when hovering over menu bar icon --- DockPhobia/.DS_Store | Bin 6148 -> 6148 bytes DockPhobia/MouseTracker.swift | 47 ++++++++++++++++++++++++++++++---- DockPhobiaPy/.DS_Store | Bin 6148 -> 6148 bytes 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/DockPhobia/.DS_Store b/DockPhobia/.DS_Store index 73496c9c8088f8b040f89321151533549a352e32..e238db70b71c8ebb80addeca2d12b75ab2a6a56e 100644 GIT binary patch delta 49 wcmZoMXffEJ!OHsR>wz77lXY3u;VkLRC9KyOnQQ(YnC! screen.height-1 { + handleDockValue(dockIsAt: currentDockSide, location: location) + } + return + } + + handleDockValue(dockIsAt: currentDockSide, location: location) + } + + func handleDockValue(dockIsAt: DockSide, location: NSPoint) { + switch dockIsAt { case .left: guard location.x < dockHeight else { return } if location.y < screen.height/2 { @@ -187,3 +200,27 @@ class MouseTracker { return nil } } + +func isFrontmostFullscreen() -> Bool { + guard let frontmostApp = NSWorkspace.shared.frontmostApplication, + let appPID = frontmostApp.processIdentifier as pid_t? else { + return false + } + + let appElement = AXUIElementCreateApplication(appPID) + var frontWindo: AnyObject? + let result = AXUIElementCopyAttributeValue(appElement, kAXFocusedWindowAttribute as CFString, &frontWindo) + + guard result == .success, let windowElement = frontWindo else { + return false + } + + var fullscreenValue: AnyObject? + let fullscreenAttr = AXUIElementCopyAttributeValue(windowElement as! AXUIElement, "AXFullScreen" as CFString, &fullscreenValue) + + if fullscreenAttr == .success, + let isFullscreen = fullscreenValue as? Bool { + return isFullscreen + } + return false +} diff --git a/DockPhobiaPy/.DS_Store b/DockPhobiaPy/.DS_Store index cd9c10d8ff02d0155a914717ca5eddb9bbcbd716..1750db6efdb345977fb6778cba6be18b72ab736d 100644 GIT binary patch delta 27 jcmZoMXfc?uj48`@;)*E737Z8Ozp+g$;M>g3@s}R}kjV-P delta 27 jcmZoMXfc?uj48-+;)*E7g3W@A-`FM=@NH)2_{$FfjNJ*&