mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-01-31 00:35:19 +01:00
fix(linux): work area returns logical rect (#14637)
This commit is contained in:
6
.changes/linux-workarea-logical-size.md
Normal file
6
.changes/linux-workarea-logical-size.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
tauri: patch:bug
|
||||
tauri-runtime-wry: patch:bug
|
||||
---
|
||||
|
||||
Fix `Monitor::work_area` returns logical position and size inside the `PhysicalRect` on Linux
|
||||
@@ -4,14 +4,15 @@
|
||||
|
||||
use gtk::prelude::MonitorExt;
|
||||
use tao::platform::unix::MonitorHandleExtUnix;
|
||||
use tauri_runtime::dpi::{PhysicalPosition, PhysicalRect, PhysicalSize};
|
||||
use tauri_runtime::dpi::{LogicalPosition, LogicalSize, PhysicalRect};
|
||||
|
||||
impl super::MonitorExt for tao::monitor::MonitorHandle {
|
||||
fn work_area(&self) -> PhysicalRect<i32, u32> {
|
||||
let rect = self.gdk_monitor().workarea();
|
||||
let scale_factor = self.scale_factor();
|
||||
PhysicalRect {
|
||||
size: PhysicalSize::new(rect.width() as u32, rect.height() as u32),
|
||||
position: PhysicalPosition::new(rect.x(), rect.y()),
|
||||
size: LogicalSize::new(rect.width() as u32, rect.height() as u32).to_physical(scale_factor),
|
||||
position: LogicalPosition::new(rect.x(), rect.y()).to_physical(scale_factor),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user