From dd42c278eb3fac6647f2ae016320139e485caa13 Mon Sep 17 00:00:00 2001 From: Ethan Uppal <113849268+ethanuppal@users.noreply.github.com> Date: Fri, 21 Mar 2025 21:30:33 -0400 Subject: [PATCH] cocoa: Add NSRunningApplication.processIdentifier Signed-off-by: Ethan Uppal <113849268+ethanuppal@users.noreply.github.com> --- cocoa/src/appkit.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cocoa/src/appkit.rs b/cocoa/src/appkit.rs index 36bd2634..3541309a 100644 --- a/cocoa/src/appkit.rs +++ b/cocoa/src/appkit.rs @@ -679,12 +679,18 @@ pub trait NSRunningApplication: Sized { runningApplicationWithProcessIdentifier: pid ] } + + unsafe fn processIdentifier(self) -> libc::pid_t; } impl NSRunningApplication for id { unsafe fn activateWithOptions_(self, options: NSApplicationActivationOptions) -> BOOL { msg_send![self, activateWithOptions: options as NSUInteger] } + + unsafe fn processIdentifier(self) -> libc::pid_t { + msg_send![self, processIdentifier] + } } pub trait NSPasteboard: Sized {