mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-29 12:06:01 +02:00
Merge remote-tracking branch 'origin/v1' into chore/merge-v1-into-v2
This commit is contained in:
@@ -36,13 +36,11 @@ struct Tray(std::sync::Mutex<Option<(PhysicalPosition<f64>, PhysicalSize<f64>)>>
|
||||
#[cfg(feature = "tray-icon")]
|
||||
pub fn on_tray_event<R: Runtime>(app: &AppHandle<R>, event: &TrayIconEvent) {
|
||||
let position = PhysicalPosition {
|
||||
x: event.x,
|
||||
y: event.y,
|
||||
};
|
||||
let size = PhysicalSize {
|
||||
width: event.icon_rect.right - event.icon_rect.left,
|
||||
height: event.icon_rect.bottom - event.icon_rect.top,
|
||||
x: event.position.x,
|
||||
y: event.position.y,
|
||||
};
|
||||
// tray-icon emits PhysicalSize so the scale factor should not matter.
|
||||
let size = event.icon_rect.size.to_physical(1.0);
|
||||
app.state::<Tray>()
|
||||
.0
|
||||
.lock()
|
||||
|
||||
Reference in New Issue
Block a user