Skip to content

Commit 3557404

Browse files
authored
Auto merge of #456 - xiaopengli89:runningApplicationWidthProcessIdentifier, r=jdm
feat: NSRunningApplication::runningApplicationWithProcessIdentifier We can get other running application by pid.
2 parents e9a65bb + afb2f80 commit 3557404

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cocoa/src/appkit.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,12 @@ pub trait NSRunningApplication: Sized {
478478
unsafe fn currentApplication(_: Self) -> id {
479479
msg_send![class!(NSRunningApplication), currentApplication]
480480
}
481+
481482
unsafe fn activateWithOptions_(self, options: NSApplicationActivationOptions) -> BOOL;
483+
484+
unsafe fn runningApplicationWithProcessIdentifier(_: Self, pid: libc::pid_t) -> id {
485+
msg_send![class!(NSRunningApplication), runningApplicationWithProcessIdentifier:pid]
486+
}
482487
}
483488

484489
impl NSRunningApplication for id {

0 commit comments

Comments
 (0)