Permalink
Browse files

Perform double click titlebar action respect to system settings

  • Loading branch information...
alejx committed Jan 31, 2019
1 parent f0b5243 commit 3ee7613ac572838afd94c071c901f6fbfe9179a2
Showing with 10 additions and 1 deletion.
  1. +10 −1 iina/MainWindowController.swift
@@ -989,8 +989,17 @@ class MainWindowController: NSWindowController, NSWindowDelegate {
}
} else if event.clickCount == 2 {
// double click
if isMouseEvent(event, inAnyOf: [titleBarView]) {
let userDefault = UserDefaults.standard.string(forKey: "AppleActionOnDoubleClick")
if userDefault == "Minimize" {
window?.performMiniaturize(nil)
} else if userDefault == "Maximize" {
window?.performZoom(nil)
}
return
}
// disable double click for sideBar / OSC
guard !isMouseEvent(event, inAnyOf: [sideBarView, currentControlBar, titleBarView, subPopoverView]) else { return }
guard !isMouseEvent(event, inAnyOf: [sideBarView, currentControlBar, subPopoverView]) else { return }
// double click
guard doubleClickAction != .none else { return }
// if already scheduled a single click timer, invalidate it

0 comments on commit 3ee7613

Please sign in to comment.