Skip to content

Commit

Permalink
Rename to work_area
Browse files Browse the repository at this point in the history
  • Loading branch information
Legend-Master committed Nov 15, 2024
1 parent 657b479 commit a01d5c9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/tauri-runtime-wry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3996,7 +3996,7 @@ fn create_window<T: UserEvent, F: Fn(RawWindow) + Send + 'static>(
}

if let Some(margin) = window_builder.prevent_overflow {
let size = monitor.get_work_area_size();
let size = monitor.work_area();
let margin = margin.to_physical::<u32>(scale_factor);
let constraint = PhysicalSize::new(size.width - margin.width, size.height - margin.height);
if window_size.width > constraint.width || window_size.height > constraint.height {
Expand Down
2 changes: 1 addition & 1 deletion crates/tauri-runtime-wry/src/monitor/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SPDX-License-Identifier: MIT

impl super::MonitorExt for tao::monitor::MonitorHandle {
fn get_work_area_size(&self) -> tao::dpi::PhysicalSize<u32> {
fn work_area(&self) -> tao::dpi::PhysicalSize<u32> {
self.size()
}
}
2 changes: 1 addition & 1 deletion crates/tauri-runtime-wry/src/monitor/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SPDX-License-Identifier: MIT

impl super::MonitorExt for tao::monitor::MonitorHandle {
fn get_work_area_size(&self) -> tao::dpi::PhysicalSize<u32> {
fn work_area(&self) -> tao::dpi::PhysicalSize<u32> {
use objc2_app_kit::NSScreen;
use tao::platform::macos::MonitorHandleExtMacOS;
if let Some(ns_screen) = self.ns_screen() {
Expand Down
2 changes: 1 addition & 1 deletion crates/tauri-runtime-wry/src/monitor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ pub trait MonitorExt {
/// ## Platform-specific:
///
/// - **Android / iOS**: Unsupported.
fn get_work_area_size(&self) -> PhysicalSize<u32>;
fn work_area(&self) -> PhysicalSize<u32>;
}
2 changes: 1 addition & 1 deletion crates/tauri-runtime-wry/src/monitor/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use tao::dpi::PhysicalSize;

impl super::MonitorExt for tao::monitor::MonitorHandle {
fn get_work_area_size(&self) -> tao::dpi::PhysicalSize<u32> {
fn work_area(&self) -> tao::dpi::PhysicalSize<u32> {
use tao::platform::windows::MonitorHandleExtWindows;
use windows::Win32::Graphics::Gdi::{GetMonitorInfoW, HMONITOR, MONITORINFO};
let mut monitor_info = MONITORINFO {
Expand Down

0 comments on commit a01d5c9

Please sign in to comment.