mirror of
https://github.com/rxhanson/Rectangle.git
synced 2025-07-03 21:23:20 +00:00
Fix bug where double clicking on the toolbar (not titlebar) in Eclipse would maximize.
This commit is contained in:
parent
f35e0f9e99
commit
bd5209f225
2 changed files with 17 additions and 6 deletions
|
@ -86,6 +86,7 @@ class Defaults {
|
||||||
static let doubleClickTitleBar = IntDefault(key: "doubleClickTitleBar")
|
static let doubleClickTitleBar = IntDefault(key: "doubleClickTitleBar")
|
||||||
static let doubleClickTitleBarRestore = OptionalBoolDefault(key: "doubleClickTitleBarRestore")
|
static let doubleClickTitleBarRestore = OptionalBoolDefault(key: "doubleClickTitleBarRestore")
|
||||||
static let doubleClickTitleBarIgnoredApps = JSONDefault<[String]>(key: "doubleClickTitleBarIgnoredApps")
|
static let doubleClickTitleBarIgnoredApps = JSONDefault<[String]>(key: "doubleClickTitleBarIgnoredApps")
|
||||||
|
static let doubleClickToolBarIgnoredApps = JSONDefault<Set<String>>(key: "doubleClickTitleBarIgnoredApps", defaultValue: ["epp.package.java"])
|
||||||
static let ignoreDragSnapToo = OptionalBoolDefault(key: "ignoreDragSnapToo")
|
static let ignoreDragSnapToo = OptionalBoolDefault(key: "ignoreDragSnapToo")
|
||||||
static let systemWideMouseDown = OptionalBoolDefault(key: "systemWideMouseDown")
|
static let systemWideMouseDown = OptionalBoolDefault(key: "systemWideMouseDown")
|
||||||
static let systemWideMouseDownApps = JSONDefault<Set<String>>(key:"systemWideMouseDownApps", defaultValue: Set<String>(["org.languagetool.desktop", "com.microsoft.teams2"]))
|
static let systemWideMouseDownApps = JSONDefault<Set<String>>(key:"systemWideMouseDownApps", defaultValue: Set<String>(["org.languagetool.desktop", "com.microsoft.teams2"]))
|
||||||
|
|
|
@ -45,8 +45,20 @@ class TitleBarManager {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
lastEventNumber = event.eventNumber
|
lastEventNumber = event.eventNumber
|
||||||
|
|
||||||
|
var bundleIdentifier: String?
|
||||||
|
if let pid = element.pid {
|
||||||
|
bundleIdentifier = NSRunningApplication(processIdentifier: pid)?.bundleIdentifier
|
||||||
|
}
|
||||||
|
|
||||||
if let toolbarFrame = windowElement.getChildElement(.toolbar)?.frame, toolbarFrame != .null {
|
if let toolbarFrame = windowElement.getChildElement(.toolbar)?.frame, toolbarFrame != .null {
|
||||||
titleBarFrame = titleBarFrame.union(toolbarFrame)
|
if let bundleIdentifier,
|
||||||
|
let toolbarIgnoredIds = Defaults.doubleClickToolBarIgnoredApps.typedValue,
|
||||||
|
toolbarIgnoredIds.contains(bundleIdentifier) {
|
||||||
|
// don't add the toolbar frame to the title bar
|
||||||
|
} else {
|
||||||
|
titleBarFrame = titleBarFrame.union(toolbarFrame)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
guard
|
guard
|
||||||
titleBarFrame.contains(location),
|
titleBarFrame.contains(location),
|
||||||
|
@ -54,11 +66,9 @@ class TitleBarManager {
|
||||||
else {
|
else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if let ignoredApps = Defaults.doubleClickTitleBarIgnoredApps.typedValue,
|
if let bundleIdentifier,
|
||||||
!ignoredApps.isEmpty,
|
let ignoredApps = Defaults.doubleClickTitleBarIgnoredApps.typedValue,
|
||||||
let pid = element.pid,
|
ignoredApps.contains(bundleIdentifier) {
|
||||||
let appId = NSRunningApplication(processIdentifier: pid)?.bundleIdentifier,
|
|
||||||
ignoredApps.contains(appId) {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if Defaults.doubleClickTitleBarRestore.enabled != false,
|
if Defaults.doubleClickTitleBarRestore.enabled != false,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue