Update objc2 and icrate versions (#3256)

This commit is contained in:
Mads Marquart 2023-12-23 18:04:24 +01:00 committed by GitHub
parent 745cfaab2c
commit 7d5bee767c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 286 additions and 374 deletions

View file

@ -1,14 +1,13 @@
#![allow(clippy::unnecessary_cast)]
use icrate::Foundation::NSObject;
use objc2::{declare_class, msg_send, mutability, ClassType};
use objc2::{declare_class, msg_send, mutability, ClassType, DeclaredClass};
use super::appkit::{NSApplication, NSEvent, NSEventModifierFlags, NSEventType, NSResponder};
use super::{app_state::AppState, DEVICE_ID};
use crate::event::{DeviceEvent, ElementState, Event};
declare_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub(super) struct WinitApplication;
unsafe impl ClassType for WinitApplication {
@ -18,6 +17,8 @@ declare_class!(
const NAME: &'static str = "WinitApplication";
}
impl DeclaredClass for WinitApplication {}
unsafe impl WinitApplication {
// Normally, holding Cmd + any key never sends us a `keyUp` event for that key.
// Overriding `sendEvent:` like this fixes that. (https://stackoverflow.com/a/15294196)