1212 html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/.github/icon.png"
1313) ]
1414
15+ use self :: monitor:: MonitorExt ;
1516use http:: Request ;
16- #[ cfg( desktop) ]
17- use monitor:: MonitorExt ;
1817use raw_window_handle:: { DisplayHandle , HasDisplayHandle , HasWindowHandle } ;
1918
2019use tauri_runtime:: {
@@ -131,7 +130,6 @@ use std::{
131130pub type WebviewId = u32 ;
132131type IpcHandler = dyn Fn ( Request < String > ) + ' static ;
133132
134- #[ cfg( desktop) ]
135133mod monitor;
136134#[ cfg( any(
137135 windows,
@@ -462,8 +460,8 @@ impl From<DeviceEventFilter> for DeviceEventFilterWrapper {
462460}
463461
464462pub struct RectWrapper ( pub wry:: Rect ) ;
465- impl From < tauri_runtime:: Rect > for RectWrapper {
466- fn from ( value : tauri_runtime:: Rect ) -> Self {
463+ impl From < tauri_runtime:: dpi :: Rect > for RectWrapper {
464+ fn from ( value : tauri_runtime:: dpi :: Rect ) -> Self {
467465 RectWrapper ( wry:: Rect {
468466 position : value. position ,
469467 size : value. size ,
@@ -518,7 +516,7 @@ impl WindowEventWrapper {
518516 if !* focused
519517 && focused_webview
520518 . as_deref ( )
521- . map_or ( false , |w| w != FOCUSED_WEBVIEW_MARKER )
519+ . is_some_and ( |w| w != FOCUSED_WEBVIEW_MARKER )
522520 {
523521 return Self ( None ) ;
524522 }
@@ -586,6 +584,7 @@ impl From<MonitorHandleWrapper> for Monitor {
586584 name : monitor. 0 . name ( ) ,
587585 position : PhysicalPositionWrapper ( monitor. 0 . position ( ) ) . into ( ) ,
588586 size : PhysicalSizeWrapper ( monitor. 0 . size ( ) ) . into ( ) ,
587+ work_area : monitor. 0 . work_area ( ) ,
589588 scale_factor : monitor. 0 . scale_factor ( ) ,
590589 }
591590 }
@@ -1403,7 +1402,7 @@ pub enum WebviewMessage {
14031402 Hide ,
14041403 SetPosition ( Position ) ,
14051404 SetSize ( Size ) ,
1406- SetBounds ( tauri_runtime:: Rect ) ,
1405+ SetBounds ( tauri_runtime:: dpi :: Rect ) ,
14071406 SetFocus ,
14081407 Reparent ( WindowId , Sender < Result < ( ) > > ) ,
14091408 SetAutoResize ( bool ) ,
@@ -1412,7 +1411,7 @@ pub enum WebviewMessage {
14121411 ClearAllBrowsingData ,
14131412 // Getters
14141413 Url ( Sender < Result < String > > ) ,
1415- Bounds ( Sender < Result < tauri_runtime:: Rect > > ) ,
1414+ Bounds ( Sender < Result < tauri_runtime:: dpi :: Rect > > ) ,
14161415 Position ( Sender < Result < PhysicalPosition < i32 > > > ) ,
14171416 Size ( Sender < Result < PhysicalSize < u32 > > > ) ,
14181417 WithWebview ( Box < dyn FnOnce ( Webview ) + Send > ) ,
@@ -1541,7 +1540,7 @@ impl<T: UserEvent> WebviewDispatch<T> for WryWebviewDispatcher<T> {
15411540 webview_getter ! ( self , WebviewMessage :: Url ) ?
15421541 }
15431542
1544- fn bounds ( & self ) -> Result < tauri_runtime:: Rect > {
1543+ fn bounds ( & self ) -> Result < tauri_runtime:: dpi :: Rect > {
15451544 webview_getter ! ( self , WebviewMessage :: Bounds ) ?
15461545 }
15471546
@@ -1599,7 +1598,7 @@ impl<T: UserEvent> WebviewDispatch<T> for WryWebviewDispatcher<T> {
15991598 )
16001599 }
16011600
1602- fn set_bounds ( & self , bounds : tauri_runtime:: Rect ) -> Result < ( ) > {
1601+ fn set_bounds ( & self , bounds : tauri_runtime:: dpi :: Rect ) -> Result < ( ) > {
16031602 send_user_message (
16041603 & self . context ,
16051604 Message :: Webview (
@@ -3667,7 +3666,7 @@ fn handle_user_message<T: UserEvent>(
36673666 tx. send (
36683667 webview
36693668 . bounds ( )
3670- . map ( |bounds| tauri_runtime:: Rect {
3669+ . map ( |bounds| tauri_runtime:: dpi :: Rect {
36713670 size : bounds. size ,
36723671 position : bounds. position ,
36733672 } )
0 commit comments