Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Commit

Permalink
Show window on re-open event
Browse files Browse the repository at this point in the history
  • Loading branch information
sendyhalim committed Nov 18, 2016
1 parent 557266b commit c1edaa2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Yomu/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ import AppKit

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
var mainWindow: NSWindow!

func applicationDidFinishLaunching(_ aNotification: Notification) {
let mainWindow = NSApplication.shared().windows.first!
mainWindow = NSApplication.shared().windows.first!
mainWindow.titleVisibility = NSWindowTitleVisibility.hidden
mainWindow.titlebarAppearsTransparent = true
mainWindow.styleMask = [NSFullSizeContentViewWindowMask, mainWindow.styleMask]
Expand All @@ -21,4 +23,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
func applicationWillTerminate(_ aNotification: Notification) {
// Insert code here to tear down your application
}

func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
mainWindow.makeKeyAndOrderFront(sender)

return true
}
}

0 comments on commit c1edaa2

Please sign in to comment.