From b3dd09a0f2df44ded01ff30f83e1ac2f0c365abc Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 13 Sep 2022 14:50:18 +0200 Subject: [PATCH] :art: --- crates/gpui/src/platform/mac/status_item.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/crates/gpui/src/platform/mac/status_item.rs b/crates/gpui/src/platform/mac/status_item.rs index 9d98c4a1f7..9c08917927 100644 --- a/crates/gpui/src/platform/mac/status_item.rs +++ b/crates/gpui/src/platform/mac/status_item.rs @@ -5,8 +5,8 @@ use crate::{ }; use cocoa::{ appkit::{ - NSApplication, NSButton, NSSquareStatusItemLength, NSStatusBar, NSStatusItem, NSView, - NSViewHeightSizable, NSViewWidthSizable, NSWindow, + NSApplication, NSButton, NSEventMask, NSSquareStatusItemLength, NSStatusBar, NSStatusItem, + NSView, NSViewHeightSizable, NSViewWidthSizable, NSWindow, }, base::{id, nil, YES}, foundation::{NSSize, NSUInteger}, @@ -32,9 +32,6 @@ use std::{ static mut HANDLER_CLASS: *const Class = ptr::null(); const STATE_IVAR: &str = "state"; -#[allow(non_upper_case_globals)] -const NSEventMaskAny: NSUInteger = NSUInteger::MAX; - #[ctor] unsafe fn build_classes() { HANDLER_CLASS = { @@ -82,7 +79,7 @@ impl StatusItem { .set_ivar(STATE_IVAR, Weak::into_raw(state.clone()) as *const c_void); button.setTarget_(*event_handler); button.setAction_(sel!(handleEvent)); - let _: () = msg_send![button, sendActionOn: NSEventMaskAny]; + let _: () = msg_send![button, sendActionOn: NSEventMask::NSAnyEventMask]; RefCell::new(StatusItemState { native_item,