13
13
//! * `wayland-csd-adwaita` (default).
14
14
//! * `wayland-csd-adwaita-crossfont`.
15
15
//! * `wayland-csd-adwaita-notitle`.
16
+ use sctk:: shell:: wlr_layer:: { Anchor , KeyboardInteractivity , Layer } ;
17
+ use crate :: dpi:: { LogicalPosition , LogicalSize } ;
16
18
use crate :: event_loop:: { ActiveEventLoop , EventLoop , EventLoopBuilder } ;
17
19
use crate :: monitor:: MonitorHandle ;
18
20
use crate :: window:: { Window , WindowAttributes } ;
@@ -85,7 +87,15 @@ pub trait WindowAttributesExtWayland {
85
87
///
86
88
/// For details about application ID conventions, see the
87
89
/// [Desktop Entry Spec](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#desktop-file-id)
88
- fn with_name ( self , general : impl Into < String > , instance : impl Into < String > ) -> Self ;
90
+ fn with_name ( self , general : impl Into < String > , instance : impl Into < String > ) -> Self ; fn with_anchor ( self , anchor : Anchor ) -> Self ;
91
+ fn with_exclusive_zone ( self , exclusive_zone : i32 ) -> Self ;
92
+ fn with_margin ( self , top : i32 , right : i32 , bottom : i32 , left : i32 ) -> Self ;
93
+ fn with_keyboard_interactivity ( self , keyboard_interactivity : KeyboardInteractivity ) -> Self ;
94
+ fn with_layer ( self , layer : Layer ) -> Self ;
95
+ #[ cfg( wayland_platform) ]
96
+ fn with_region ( self , position : LogicalPosition < i32 > , size : LogicalSize < i32 > ) -> Self ;
97
+ #[ cfg( wayland_platform) ]
98
+ fn with_output ( self , output : u32 ) -> Self ;
89
99
}
90
100
91
101
impl WindowAttributesExtWayland for WindowAttributes {
@@ -95,6 +105,45 @@ impl WindowAttributesExtWayland for WindowAttributes {
95
105
Some ( crate :: platform_impl:: ApplicationName :: new ( general. into ( ) , instance. into ( ) ) ) ;
96
106
self
97
107
}
108
+ fn with_anchor ( mut self , anchor : Anchor ) -> Self {
109
+ self . platform_specific . wayland . anchor = Some ( anchor) ;
110
+ self
111
+ }
112
+ #[ inline]
113
+ fn with_exclusive_zone ( mut self , exclusive_zone : i32 ) -> Self {
114
+ self . platform_specific . wayland . exclusive_zone = Some ( exclusive_zone) ;
115
+ self
116
+ }
117
+ #[ inline]
118
+ fn with_margin ( mut self , top : i32 , right : i32 , bottom : i32 , left : i32 ) -> Self {
119
+ self . platform_specific . wayland . margin = Some ( ( top, right, bottom, left) ) ;
120
+ self
121
+ }
122
+ #[ inline]
123
+ fn with_keyboard_interactivity (
124
+ mut self ,
125
+ keyboard_interactivity : KeyboardInteractivity ,
126
+ ) -> Self {
127
+ self . platform_specific . wayland . keyboard_interactivity = Some ( keyboard_interactivity) ;
128
+ self
129
+ }
130
+ #[ inline]
131
+ fn with_layer ( mut self , layer : Layer ) -> Self {
132
+ self . platform_specific . wayland . layer = Some ( layer) ;
133
+ self
134
+ }
135
+ #[ inline]
136
+ #[ cfg( wayland_platform) ]
137
+ fn with_region ( mut self , position : LogicalPosition < i32 > , size : LogicalSize < i32 > ) -> Self {
138
+ self . platform_specific . wayland . region = Some ( ( position, size) ) ;
139
+ self
140
+ }
141
+ #[ inline]
142
+ #[ cfg( wayland_platform) ]
143
+ fn with_output ( mut self , output : u32 ) -> Self {
144
+ self . platform_specific . wayland . output = Some ( output) ;
145
+ self
146
+ }
98
147
}
99
148
100
149
/// Additional methods on `MonitorHandle` that are specific to Wayland.
0 commit comments