@@ -24,6 +24,7 @@ use cosmic::iced::wayland::popup::get_popup;
24
24
use cosmic:: iced:: widget:: { column, dnd_source, mouse_listener, row, text, Column , Row } ;
25
25
use cosmic:: iced:: Settings ;
26
26
use cosmic:: iced:: { window, Application , Command , Subscription } ;
27
+ use cosmic:: iced_native as native;
27
28
use cosmic:: iced_native:: alignment:: Horizontal ;
28
29
use cosmic:: iced_native:: subscription:: events_with;
29
30
use cosmic:: iced_native:: widget:: vertical_space;
@@ -51,6 +52,7 @@ use iced::Alignment;
51
52
use iced:: Background ;
52
53
use iced:: Length ;
53
54
use itertools:: Itertools ;
55
+ use native:: event;
54
56
use url:: Url ;
55
57
56
58
static MIME_TYPE : & str = "text/uri-list" ;
@@ -981,52 +983,38 @@ impl Application for CosmicAppList {
981
983
Subscription :: batch ( vec ! [
982
984
toplevel_subscription( self . subscription_ctr) . map( |( _, event) | Message :: Toplevel ( event) ) ,
983
985
events_with( |e, _| match e {
984
- cosmic:: iced_native:: Event :: PlatformSpecific (
985
- cosmic:: iced_native:: event:: PlatformSpecific :: Wayland (
986
- cosmic:: iced_native:: event:: wayland:: Event :: Seat ( e, seat) ,
987
- ) ,
988
- ) => match e {
989
- cosmic:: iced_native:: event:: wayland:: SeatEvent :: Enter => {
990
- Some ( Message :: NewSeat ( seat) )
991
- }
992
- cosmic:: iced_native:: event:: wayland:: SeatEvent :: Leave => {
993
- Some ( Message :: RemovedSeat ( seat) )
994
- }
986
+ native:: Event :: PlatformSpecific ( event:: PlatformSpecific :: Wayland (
987
+ event:: wayland:: Event :: Seat ( e, seat) ,
988
+ ) ) => match e {
989
+ event:: wayland:: SeatEvent :: Enter => Some ( Message :: NewSeat ( seat) ) ,
990
+ event:: wayland:: SeatEvent :: Leave => Some ( Message :: RemovedSeat ( seat) ) ,
995
991
} ,
996
992
// XXX Must be done to catch a finished drag after the source is removed
997
993
// (for now, the source is removed when the drag starts)
998
- cosmic:: iced_native:: Event :: PlatformSpecific (
999
- cosmic:: iced_native:: event:: PlatformSpecific :: Wayland (
1000
- cosmic:: iced_sctk:: event:: wayland:: Event :: DataSource (
1001
- cosmic:: iced_sctk:: event:: wayland:: DataSourceEvent :: DndFinished
1002
- | cosmic:: iced_sctk:: event:: wayland:: DataSourceEvent :: Cancelled ,
1003
- ) ,
1004
- ) ,
1005
- ) => Some ( Message :: DragFinished ) ,
1006
- cosmic:: iced_native:: Event :: PlatformSpecific (
1007
- cosmic:: iced_native:: event:: PlatformSpecific :: Wayland (
1008
- cosmic:: iced_native:: event:: wayland:: Event :: DndOffer (
1009
- cosmic:: iced_native:: event:: wayland:: DndOfferEvent :: Enter {
1010
- mime_types,
1011
- ..
1012
- } ,
1013
- ) ,
994
+ native:: Event :: PlatformSpecific ( event:: PlatformSpecific :: Wayland (
995
+ event:: wayland:: Event :: DataSource (
996
+ event:: wayland:: DataSourceEvent :: DndFinished
997
+ | event:: wayland:: DataSourceEvent :: Cancelled ,
1014
998
) ,
1015
- ) => {
999
+ ) ) => Some ( Message :: DragFinished ) ,
1000
+ native:: Event :: PlatformSpecific ( event:: PlatformSpecific :: Wayland (
1001
+ event:: wayland:: Event :: DndOffer ( event:: wayland:: DndOfferEvent :: Enter {
1002
+ mime_types,
1003
+ ..
1004
+ } ) ,
1005
+ ) ) => {
1016
1006
if mime_types. iter( ) . any( |m| m == MIME_TYPE ) {
1017
1007
Some ( Message :: StartListeningForDnd )
1018
1008
} else {
1019
1009
None
1020
1010
}
1021
1011
}
1022
- cosmic:: iced_native:: Event :: PlatformSpecific (
1023
- cosmic:: iced_native:: event:: PlatformSpecific :: Wayland (
1024
- cosmic:: iced_native:: event:: wayland:: Event :: DndOffer (
1025
- cosmic:: iced_native:: event:: wayland:: DndOfferEvent :: Leave
1026
- | cosmic:: iced_native:: event:: wayland:: DndOfferEvent :: DropPerformed ,
1027
- ) ,
1012
+ native:: Event :: PlatformSpecific ( event:: PlatformSpecific :: Wayland (
1013
+ event:: wayland:: Event :: DndOffer (
1014
+ event:: wayland:: DndOfferEvent :: Leave
1015
+ | event:: wayland:: DndOfferEvent :: DropPerformed ,
1028
1016
) ,
1029
- ) => Some ( Message :: StopListeningForDnd ) ,
1017
+ ) ) => Some ( Message :: StopListeningForDnd ) ,
1030
1018
_ => None ,
1031
1019
} ) ,
1032
1020
rectangle_tracker_subscription( 0 ) . map( |( _, update) | Message :: Rectangle ( update) ) ,
0 commit comments