fix: blacklisting fullscreen windows was not working (closes #5228)
This commit is contained in:
1 parent
7b7a73bd46
commit
53815e0f28
3 files changed
+15
-8
No files matched your search
@@ -43,9 +43,12 @@ class AccessibilityEvents {
|
||||
AXUIElement.retryAxCallUntilTimeout(context: "(type:\(type)", callType: .axEventEntrypoint) {
|
||||
try handleEventWindowWithDebounceIfNecessary(kAXFocusedWindowChangedNotification, pid, appFocusedWindow)
|
||||
}
|
||||
} else if let windowless = (Windows.list.first { $0.isWindowlessApp && $0.application.pid == pid }) {
|
||||
if let windows = Windows.updateLastFocusOrder(windowless) {
|
||||
App.app.refreshOpenUi(windows, .refreshUiAfterExternalEvent)
|
||||
} else {
|
||||
App.app.checkIfShortcutsShouldBeDisabled(nil, app)
|
||||
if let windowless = (Windows.list.first { $0.isWindowlessApp && $0.application.pid == pid }) {
|
||||
if let windows = Windows.updateLastFocusOrder(windowless) {
|
||||
App.app.refreshOpenUi(windows, .refreshUiAfterExternalEvent)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,7 +120,7 @@ class AccessibilityEvents {
|
||||
// if the window is shown by alt-tab, we mark it as focused for this app
|
||||
// this avoids issues with dialogs, quicklook, etc (see scenarios from #1044 and #2003)
|
||||
window.application.focusedWindow = window
|
||||
App.app.checkIfShortcutsShouldBeDisabled(window, window.application.runningApplication)
|
||||
App.app.checkIfShortcutsShouldBeDisabled(window, nil)
|
||||
if let windows = Windows.updateLastFocusOrder(window) {
|
||||
App.app.refreshOpenUi(windows, .refreshUiAfterExternalEvent)
|
||||
}
|
||||
@@ -125,7 +128,6 @@ class AccessibilityEvents {
|
||||
|
||||
private static func windowResizedOrMoved(_ window: Window) {
|
||||
window.updateSpacesAndScreen()
|
||||
App.app.checkIfShortcutsShouldBeDisabled(window, nil)
|
||||
App.app.refreshOpenUi([window], .refreshUiAfterExternalEvent)
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,11 @@ class SpacesEvents {
|
||||
// this window doesn't emit resize/move events. It doesn't pass isActualWindow on creation. It's added on focusedWindowChanged
|
||||
// for such cases, we refresh isFullscreen on Space change
|
||||
Windows.updateIsFullscreenOnCurrentSpace()
|
||||
if let frontmostPid = NSWorkspace.shared.frontmostApplication?.processIdentifier,
|
||||
let frontmostApp = Applications.findOrCreate(frontmostPid),
|
||||
let focusedWindow = frontmostApp.focusedWindow {
|
||||
App.app.checkIfShortcutsShouldBeDisabled(focusedWindow, nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -259,10 +259,10 @@ class App: AppCenterApplication {
|
||||
Windows.refreshThumbnailsAsync(Windows.list, .refreshOnlyThumbnailsAfterShowUi)
|
||||
}
|
||||
|
||||
func checkIfShortcutsShouldBeDisabled(_ activeWindow: Window?, _ activeApp: NSRunningApplication?) {
|
||||
let app = activeWindow?.application.runningApplication ?? activeApp
|
||||
func checkIfShortcutsShouldBeDisabled(_ activeWindow: Window?, _ activeApp: Application?) {
|
||||
let app = activeWindow?.application ?? activeApp!
|
||||
let shortcutsShouldBeDisabled = Preferences.blacklist.contains { blacklistedId in
|
||||
if let id = app?.bundleIdentifier {
|
||||
if let id = app.bundleIdentifier {
|
||||
return id.hasPrefix(blacklistedId.bundleIdentifier) &&
|
||||
(blacklistedId.ignore == .always || (blacklistedId.ignore == .whenFullscreen && (activeWindow?.isFullscreen ?? false)))
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user