mirror of
https://github.com/rxhanson/Rectangle.git
synced 2025-07-03 05:03:21 +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 doubleClickTitleBarRestore = OptionalBoolDefault(key: "doubleClickTitleBarRestore")
|
||||
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 systemWideMouseDown = OptionalBoolDefault(key: "systemWideMouseDown")
|
||||
static let systemWideMouseDownApps = JSONDefault<Set<String>>(key:"systemWideMouseDownApps", defaultValue: Set<String>(["org.languagetool.desktop", "com.microsoft.teams2"]))
|
||||
|
|
|
@ -45,20 +45,30 @@ class TitleBarManager {
|
|||
return
|
||||
}
|
||||
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 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
|
||||
titleBarFrame.contains(location),
|
||||
element.isWindow == true || element.isToolbar == true || element.isGroup == true || element.isTabGroup == true || element.isStaticText == true
|
||||
else {
|
||||
return
|
||||
}
|
||||
if let ignoredApps = Defaults.doubleClickTitleBarIgnoredApps.typedValue,
|
||||
!ignoredApps.isEmpty,
|
||||
let pid = element.pid,
|
||||
let appId = NSRunningApplication(processIdentifier: pid)?.bundleIdentifier,
|
||||
ignoredApps.contains(appId) {
|
||||
if let bundleIdentifier,
|
||||
let ignoredApps = Defaults.doubleClickTitleBarIgnoredApps.typedValue,
|
||||
ignoredApps.contains(bundleIdentifier) {
|
||||
return
|
||||
}
|
||||
if Defaults.doubleClickTitleBarRestore.enabled != false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue