@@ -26,6 +26,7 @@ use cosmic::app::DbusActivationMessage;
26
26
#[ cfg( feature = "wayland" ) ]
27
27
use cosmic:: cctk:: { sctk:: output:: OutputInfo , wayland_client:: protocol:: wl_output:: WlOutput } ;
28
28
use cosmic:: iced:: Subscription ;
29
+ use cosmic:: surface_message:: SurfaceMessage ;
29
30
use cosmic:: widget:: { self , button, row, text_input} ;
30
31
use cosmic:: {
31
32
app:: { Core , Task } ,
@@ -139,6 +140,23 @@ impl SettingsApp {
139
140
}
140
141
}
141
142
143
+ #[ cfg( feature = "wayland" ) ]
144
+ impl From < Message > for cosmic:: surface_message:: MessageWrapper < Message > {
145
+ fn from ( value : Message ) -> Self {
146
+ match value {
147
+ Message :: Surface ( msg) => cosmic:: surface_message:: MessageWrapper :: Surface ( msg) ,
148
+ msg => cosmic:: surface_message:: MessageWrapper :: Message ( msg) ,
149
+ }
150
+ }
151
+ }
152
+
153
+ #[ cfg( feature = "wayland" ) ]
154
+ impl From < SurfaceMessage > for Message {
155
+ fn from ( value : SurfaceMessage ) -> Self {
156
+ Message :: Surface ( value)
157
+ }
158
+ }
159
+
142
160
#[ derive( Clone , Debug ) ]
143
161
pub enum Message {
144
162
CloseContextDrawer ,
@@ -161,6 +179,7 @@ pub enum Message {
161
179
SearchSubmit ,
162
180
SetTheme ( cosmic:: theme:: Theme ) ,
163
181
SetWindowTitle ,
182
+ Surface ( SurfaceMessage ) ,
164
183
}
165
184
166
185
impl cosmic:: Application for SettingsApp {
@@ -240,7 +259,7 @@ impl cosmic::Application for SettingsApp {
240
259
. id ( self . search_id . clone ( ) )
241
260
. on_clear ( Message :: SearchClear )
242
261
. on_input ( Message :: SearchChanged )
243
- . on_submit ( Message :: SearchSubmit )
262
+ . on_submit ( |_| Message :: SearchSubmit )
244
263
. into ( )
245
264
} else {
246
265
icon:: from_name ( "system-search-symbolic" )
@@ -734,6 +753,7 @@ impl cosmic::Application for SettingsApp {
734
753
Message :: Error ( error) => {
735
754
tracing:: error!( error, "error occurred" ) ;
736
755
}
756
+ Message :: Surface ( _) => { }
737
757
}
738
758
739
759
Task :: none ( )
0 commit comments