//
//  SIApplication+Amethyst.swift
//  Amethyst
//
//  Created by Ian Ynda-Hummel on 5/8/16.
//  Copyright © 2016 Ian Ynda-Hummel. All rights reserved.
//

import Foundation
import Silica

public extension SIApplication {
    public func floating() -> Bool {
        let runningApplication = NSRunningApplication(processIdentifier: self.processIdentifier())
        return UserConfiguration.shared.runningApplicationShouldFloat(runningApplication!)
    }
}

//
//  SIApplication+Amethyst.swift
//  Amethyst
//
//  Created by Ian Ynda-Hummel on 5/8/16.
//  Copyright © 2016 Ian Ynda-Hummel. All rights reserved.
//

import Foundation
import Silica

public extension SIApplication {
    public func floating() -> Bool {
        guard let runningApplication = NSRunningApplication(processIdentifier: processIdentifier()) else {
            return true
        }

        return UserConfiguration.shared.runningApplicationShouldFloat(runningApplication)
    }
}

Allow for optional applications from process identifiers
Allow for optional applications from process identifiers

If a stale window has a process identifier for an application that has been closed we crash.
