mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 14:18:04 +08:00
Desktop: Make input routing aware of floating menus (#4498)
* Desktop: Make input routing aware of floating menus * Desktop: Route mouse input like pen input * Desktop: Model pointer input routing as a state machine
This commit is contained in:
@@ -5,6 +5,7 @@ use crate::messages::prelude::*;
|
||||
pub enum AppWindowMessage {
|
||||
PointerLock,
|
||||
PointerLockMove { x: f64, y: f64 },
|
||||
DirectInput { enabled: bool },
|
||||
Restart,
|
||||
Close,
|
||||
Minimize,
|
||||
|
||||
@@ -17,6 +17,12 @@ impl MessageHandler<AppWindowMessage, ()> for AppWindowMessageHandler {
|
||||
AppWindowMessage::PointerLockMove { x, y } => {
|
||||
responses.add(FrontendMessage::WindowPointerLockMove { position: (x, y) });
|
||||
}
|
||||
AppWindowMessage::DirectInput { enabled } => {
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
responses.add(FrontendMessage::WindowUpdateDirectInput { enabled });
|
||||
#[cfg(target_family = "wasm")]
|
||||
let _ = enabled;
|
||||
}
|
||||
AppWindowMessage::Close => {
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
responses.add(FrontendMessage::WindowClose);
|
||||
|
||||
@@ -350,6 +350,10 @@ pub enum FrontendMessage {
|
||||
position: (f64, f64),
|
||||
},
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
WindowUpdateDirectInput {
|
||||
enabled: bool,
|
||||
},
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
WindowClose,
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
WindowMinimize,
|
||||
|
||||
Reference in New Issue
Block a user