11use std:: { borrow:: Cow , sync:: Arc } ;
22
3+ #[ cfg( feature = "xwayland" ) ]
4+ use smithay:: xwayland:: xwm:: XwmOfferData ;
35#[ cfg( feature = "xwayland" ) ]
46use smithay:: xwayland:: X11Surface ;
57pub use smithay:: {
@@ -27,7 +29,6 @@ use smithay::{
2729 reexports:: wayland_server:: DisplayHandle ,
2830 utils:: { Logical , Point } ,
2931 wayland:: selection:: data_device:: WlOfferData ,
30- xwayland:: xwm:: XwmOfferData ,
3132} ;
3233
3334use crate :: {
@@ -376,32 +377,37 @@ impl WaylandFocus for KeyboardFocusTarget {
376377
377378pub enum AnvilOfferData < S : Source > {
378379 Wayland ( WlOfferData < S > ) ,
380+ #[ cfg( feature = "xwayland" ) ]
379381 X11 ( XwmOfferData < S > ) ,
380382}
381383
382384impl < S : Source > OfferData for AnvilOfferData < S > {
383385 fn disable ( & self ) {
384386 match self {
385387 AnvilOfferData :: Wayland ( data) => data. disable ( ) ,
388+ #[ cfg( feature = "xwayland" ) ]
386389 AnvilOfferData :: X11 ( data) => data. disable ( ) ,
387390 }
388391 }
389392
390393 fn drop ( & self ) {
391394 match self {
392395 AnvilOfferData :: Wayland ( data) => data. drop ( ) ,
396+ #[ cfg( feature = "xwayland" ) ]
393397 AnvilOfferData :: X11 ( data) => data. drop ( ) ,
394398 }
395399 }
396400
397401 fn validated ( & self ) -> bool {
398402 match self {
399403 AnvilOfferData :: Wayland ( data) => data. validated ( ) ,
404+ #[ cfg( feature = "xwayland" ) ]
400405 AnvilOfferData :: X11 ( data) => data. validated ( ) ,
401406 }
402407 }
403408}
404409
410+ #[ allow( unreachable_patterns) ]
405411impl < BackendData : Backend > DndFocus < AnvilState < BackendData > > for PointerFocusTarget {
406412 type OfferData < S >
407413 = AnvilOfferData < S >
@@ -422,6 +428,7 @@ impl<BackendData: Backend> DndFocus<AnvilState<BackendData>> for PointerFocusTar
422428 DndFocus :: enter ( surface, data, dh, source, seat, location, serial)
423429 . map ( AnvilOfferData :: Wayland )
424430 }
431+ #[ cfg( feature = "xwayland" ) ]
425432 PointerFocusTarget :: X11Surface ( surface) => {
426433 DndFocus :: enter ( surface, data, dh, source, seat, location, serial) . map ( AnvilOfferData :: X11 )
427434 }
@@ -446,6 +453,7 @@ impl<BackendData: Backend> DndFocus<AnvilState<BackendData>> for PointerFocusTar
446453 } ;
447454 DndFocus :: motion ( surface, data, offer, seat, location, time)
448455 }
456+ #[ cfg( feature = "xwayland" ) ]
449457 PointerFocusTarget :: X11Surface ( surface) => {
450458 let offer = match offer {
451459 Some ( AnvilOfferData :: X11 ( ref mut offer) ) => Some ( offer) ,
@@ -473,6 +481,7 @@ impl<BackendData: Backend> DndFocus<AnvilState<BackendData>> for PointerFocusTar
473481 } ;
474482 DndFocus :: leave ( surface, data, offer, seat)
475483 }
484+ #[ cfg( feature = "xwayland" ) ]
476485 PointerFocusTarget :: X11Surface ( surface) => {
477486 let offer = match offer {
478487 Some ( AnvilOfferData :: X11 ( ref mut offer) ) => Some ( offer) ,
@@ -500,6 +509,7 @@ impl<BackendData: Backend> DndFocus<AnvilState<BackendData>> for PointerFocusTar
500509 } ;
501510 DndFocus :: drop ( surface, data, offer, seat)
502511 }
512+ #[ cfg( feature = "xwayland" ) ]
503513 PointerFocusTarget :: X11Surface ( surface) => {
504514 let offer = match offer {
505515 Some ( AnvilOfferData :: X11 ( ref mut offer) ) => Some ( offer) ,
0 commit comments