Skip to content

Commit 191b0e7

Browse files
committed
wip: Remove feature wayland and always enable it
1 parent 44de37e commit 191b0e7

File tree

10 files changed

+10
-90
lines changed

10 files changed

+10
-90
lines changed

src/focus.rs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ pub use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface;
1616
pub use smithay::reexports::wayland_server::Resource;
1717
pub use smithay::utils::{IsAlive, Serial};
1818
pub use smithay::wayland::seat::WaylandFocus;
19-
#[cfg(feature = "xwayland")]
2019
use smithay::xwayland::X11Surface;
2120

2221
use crate::shell::{WindowElement, SSD};
@@ -42,7 +41,6 @@ impl IsAlive for KeyboardFocusTarget {
4241
#[derive(Debug, Clone, PartialEq)]
4342
pub enum PointerFocusTarget {
4443
WlSurface(WlSurface),
45-
#[cfg(feature = "xwayland")]
4644
X11Surface(X11Surface),
4745
SSD(SSD),
4846
}
@@ -51,7 +49,6 @@ impl IsAlive for PointerFocusTarget {
5149
fn alive(&self) -> bool {
5250
match self {
5351
PointerFocusTarget::WlSurface(w) => w.alive(),
54-
#[cfg(feature = "xwayland")]
5552
PointerFocusTarget::X11Surface(w) => w.alive(),
5653
PointerFocusTarget::SSD(x) => x.alive(),
5754
}
@@ -73,7 +70,6 @@ impl<BackendData: Backend> PointerTarget<AnvilState<BackendData>> for PointerFoc
7370
) {
7471
match self {
7572
PointerFocusTarget::WlSurface(w) => PointerTarget::enter(w, seat, data, event),
76-
#[cfg(feature = "xwayland")]
7773
PointerFocusTarget::X11Surface(w) => PointerTarget::enter(w, seat, data, event),
7874
PointerFocusTarget::SSD(w) => PointerTarget::enter(w, seat, data, event),
7975
}
@@ -86,7 +82,6 @@ impl<BackendData: Backend> PointerTarget<AnvilState<BackendData>> for PointerFoc
8682
) {
8783
match self {
8884
PointerFocusTarget::WlSurface(w) => PointerTarget::motion(w, seat, data, event),
89-
#[cfg(feature = "xwayland")]
9085
PointerFocusTarget::X11Surface(w) => PointerTarget::motion(w, seat, data, event),
9186
PointerFocusTarget::SSD(w) => PointerTarget::motion(w, seat, data, event),
9287
}
@@ -101,7 +96,6 @@ impl<BackendData: Backend> PointerTarget<AnvilState<BackendData>> for PointerFoc
10196
PointerFocusTarget::WlSurface(w) => {
10297
PointerTarget::relative_motion(w, seat, data, event)
10398
}
104-
#[cfg(feature = "xwayland")]
10599
PointerFocusTarget::X11Surface(w) => {
106100
PointerTarget::relative_motion(w, seat, data, event)
107101
}
@@ -116,7 +110,6 @@ impl<BackendData: Backend> PointerTarget<AnvilState<BackendData>> for PointerFoc
116110
) {
117111
match self {
118112
PointerFocusTarget::WlSurface(w) => PointerTarget::button(w, seat, data, event),
119-
#[cfg(feature = "xwayland")]
120113
PointerFocusTarget::X11Surface(w) => PointerTarget::button(w, seat, data, event),
121114
PointerFocusTarget::SSD(w) => PointerTarget::button(w, seat, data, event),
122115
}
@@ -129,15 +122,13 @@ impl<BackendData: Backend> PointerTarget<AnvilState<BackendData>> for PointerFoc
129122
) {
130123
match self {
131124
PointerFocusTarget::WlSurface(w) => PointerTarget::axis(w, seat, data, frame),
132-
#[cfg(feature = "xwayland")]
133125
PointerFocusTarget::X11Surface(w) => PointerTarget::axis(w, seat, data, frame),
134126
PointerFocusTarget::SSD(w) => PointerTarget::axis(w, seat, data, frame),
135127
}
136128
}
137129
fn frame(&self, seat: &Seat<AnvilState<BackendData>>, data: &mut AnvilState<BackendData>) {
138130
match self {
139131
PointerFocusTarget::WlSurface(w) => PointerTarget::frame(w, seat, data),
140-
#[cfg(feature = "xwayland")]
141132
PointerFocusTarget::X11Surface(w) => PointerTarget::frame(w, seat, data),
142133
PointerFocusTarget::SSD(w) => PointerTarget::frame(w, seat, data),
143134
}
@@ -151,7 +142,6 @@ impl<BackendData: Backend> PointerTarget<AnvilState<BackendData>> for PointerFoc
151142
) {
152143
match self {
153144
PointerFocusTarget::WlSurface(w) => PointerTarget::leave(w, seat, data, serial, time),
154-
#[cfg(feature = "xwayland")]
155145
PointerFocusTarget::X11Surface(w) => PointerTarget::leave(w, seat, data, serial, time),
156146
PointerFocusTarget::SSD(w) => PointerTarget::leave(w, seat, data, serial, time),
157147
}
@@ -166,7 +156,6 @@ impl<BackendData: Backend> PointerTarget<AnvilState<BackendData>> for PointerFoc
166156
PointerFocusTarget::WlSurface(w) => {
167157
PointerTarget::gesture_swipe_begin(w, seat, data, event)
168158
}
169-
#[cfg(feature = "xwayland")]
170159
PointerFocusTarget::X11Surface(w) => {
171160
PointerTarget::gesture_swipe_begin(w, seat, data, event)
172161
}
@@ -183,7 +172,6 @@ impl<BackendData: Backend> PointerTarget<AnvilState<BackendData>> for PointerFoc
183172
PointerFocusTarget::WlSurface(w) => {
184173
PointerTarget::gesture_swipe_update(w, seat, data, event)
185174
}
186-
#[cfg(feature = "xwayland")]
187175
PointerFocusTarget::X11Surface(w) => {
188176
PointerTarget::gesture_swipe_update(w, seat, data, event)
189177
}
@@ -200,7 +188,6 @@ impl<BackendData: Backend> PointerTarget<AnvilState<BackendData>> for PointerFoc
200188
PointerFocusTarget::WlSurface(w) => {
201189
PointerTarget::gesture_swipe_end(w, seat, data, event)
202190
}
203-
#[cfg(feature = "xwayland")]
204191
PointerFocusTarget::X11Surface(w) => {
205192
PointerTarget::gesture_swipe_end(w, seat, data, event)
206193
}
@@ -217,7 +204,6 @@ impl<BackendData: Backend> PointerTarget<AnvilState<BackendData>> for PointerFoc
217204
PointerFocusTarget::WlSurface(w) => {
218205
PointerTarget::gesture_pinch_begin(w, seat, data, event)
219206
}
220-
#[cfg(feature = "xwayland")]
221207
PointerFocusTarget::X11Surface(w) => {
222208
PointerTarget::gesture_pinch_begin(w, seat, data, event)
223209
}
@@ -234,7 +220,6 @@ impl<BackendData: Backend> PointerTarget<AnvilState<BackendData>> for PointerFoc
234220
PointerFocusTarget::WlSurface(w) => {
235221
PointerTarget::gesture_pinch_update(w, seat, data, event)
236222
}
237-
#[cfg(feature = "xwayland")]
238223
PointerFocusTarget::X11Surface(w) => {
239224
PointerTarget::gesture_pinch_update(w, seat, data, event)
240225
}
@@ -251,7 +236,6 @@ impl<BackendData: Backend> PointerTarget<AnvilState<BackendData>> for PointerFoc
251236
PointerFocusTarget::WlSurface(w) => {
252237
PointerTarget::gesture_pinch_end(w, seat, data, event)
253238
}
254-
#[cfg(feature = "xwayland")]
255239
PointerFocusTarget::X11Surface(w) => {
256240
PointerTarget::gesture_pinch_end(w, seat, data, event)
257241
}
@@ -268,7 +252,6 @@ impl<BackendData: Backend> PointerTarget<AnvilState<BackendData>> for PointerFoc
268252
PointerFocusTarget::WlSurface(w) => {
269253
PointerTarget::gesture_hold_begin(w, seat, data, event)
270254
}
271-
#[cfg(feature = "xwayland")]
272255
PointerFocusTarget::X11Surface(w) => {
273256
PointerTarget::gesture_hold_begin(w, seat, data, event)
274257
}
@@ -285,7 +268,6 @@ impl<BackendData: Backend> PointerTarget<AnvilState<BackendData>> for PointerFoc
285268
PointerFocusTarget::WlSurface(w) => {
286269
PointerTarget::gesture_hold_end(w, seat, data, event)
287270
}
288-
#[cfg(feature = "xwayland")]
289271
PointerFocusTarget::X11Surface(w) => {
290272
PointerTarget::gesture_hold_end(w, seat, data, event)
291273
}
@@ -307,7 +289,6 @@ impl<BackendData: Backend> KeyboardTarget<AnvilState<BackendData>> for KeyboardF
307289
WindowSurface::Wayland(w) => {
308290
KeyboardTarget::enter(w.wl_surface(), seat, data, keys, serial)
309291
}
310-
#[cfg(feature = "xwayland")]
311292
WindowSurface::X11(s) => KeyboardTarget::enter(s, seat, data, keys, serial),
312293
},
313294
KeyboardFocusTarget::LayerSurface(l) => {
@@ -329,7 +310,6 @@ impl<BackendData: Backend> KeyboardTarget<AnvilState<BackendData>> for KeyboardF
329310
WindowSurface::Wayland(w) => {
330311
KeyboardTarget::leave(w.wl_surface(), seat, data, serial)
331312
}
332-
#[cfg(feature = "xwayland")]
333313
WindowSurface::X11(s) => KeyboardTarget::leave(s, seat, data, serial),
334314
},
335315
KeyboardFocusTarget::LayerSurface(l) => {
@@ -354,7 +334,6 @@ impl<BackendData: Backend> KeyboardTarget<AnvilState<BackendData>> for KeyboardF
354334
WindowSurface::Wayland(w) => {
355335
KeyboardTarget::key(w.wl_surface(), seat, data, key, state, serial, time)
356336
}
357-
#[cfg(feature = "xwayland")]
358337
WindowSurface::X11(s) => {
359338
KeyboardTarget::key(s, seat, data, key, state, serial, time)
360339
}
@@ -379,7 +358,6 @@ impl<BackendData: Backend> KeyboardTarget<AnvilState<BackendData>> for KeyboardF
379358
WindowSurface::Wayland(w) => {
380359
KeyboardTarget::modifiers(w.wl_surface(), seat, data, modifiers, serial)
381360
}
382-
#[cfg(feature = "xwayland")]
383361
WindowSurface::X11(s) => {
384362
KeyboardTarget::modifiers(s, seat, data, modifiers, serial)
385363
}
@@ -404,7 +382,6 @@ impl<BackendData: Backend> TouchTarget<AnvilState<BackendData>> for PointerFocus
404382
) {
405383
match self {
406384
PointerFocusTarget::WlSurface(w) => TouchTarget::down(w, seat, data, event, seq),
407-
#[cfg(feature = "xwayland")]
408385
PointerFocusTarget::X11Surface(w) => TouchTarget::down(w, seat, data, event, seq),
409386
PointerFocusTarget::SSD(w) => TouchTarget::down(w, seat, data, event, seq),
410387
}
@@ -419,7 +396,6 @@ impl<BackendData: Backend> TouchTarget<AnvilState<BackendData>> for PointerFocus
419396
) {
420397
match self {
421398
PointerFocusTarget::WlSurface(w) => TouchTarget::up(w, seat, data, event, seq),
422-
#[cfg(feature = "xwayland")]
423399
PointerFocusTarget::X11Surface(w) => TouchTarget::up(w, seat, data, event, seq),
424400
PointerFocusTarget::SSD(w) => TouchTarget::up(w, seat, data, event, seq),
425401
}
@@ -434,7 +410,6 @@ impl<BackendData: Backend> TouchTarget<AnvilState<BackendData>> for PointerFocus
434410
) {
435411
match self {
436412
PointerFocusTarget::WlSurface(w) => TouchTarget::motion(w, seat, data, event, seq),
437-
#[cfg(feature = "xwayland")]
438413
PointerFocusTarget::X11Surface(w) => TouchTarget::motion(w, seat, data, event, seq),
439414
PointerFocusTarget::SSD(w) => TouchTarget::motion(w, seat, data, event, seq),
440415
}
@@ -448,7 +423,6 @@ impl<BackendData: Backend> TouchTarget<AnvilState<BackendData>> for PointerFocus
448423
) {
449424
match self {
450425
PointerFocusTarget::WlSurface(w) => TouchTarget::frame(w, seat, data, seq),
451-
#[cfg(feature = "xwayland")]
452426
PointerFocusTarget::X11Surface(w) => TouchTarget::frame(w, seat, data, seq),
453427
PointerFocusTarget::SSD(w) => TouchTarget::frame(w, seat, data, seq),
454428
}
@@ -462,7 +436,6 @@ impl<BackendData: Backend> TouchTarget<AnvilState<BackendData>> for PointerFocus
462436
) {
463437
match self {
464438
PointerFocusTarget::WlSurface(w) => TouchTarget::cancel(w, seat, data, seq),
465-
#[cfg(feature = "xwayland")]
466439
PointerFocusTarget::X11Surface(w) => TouchTarget::cancel(w, seat, data, seq),
467440
PointerFocusTarget::SSD(w) => TouchTarget::cancel(w, seat, data, seq),
468441
}
@@ -477,7 +450,6 @@ impl<BackendData: Backend> TouchTarget<AnvilState<BackendData>> for PointerFocus
477450
) {
478451
match self {
479452
PointerFocusTarget::WlSurface(w) => TouchTarget::shape(w, seat, data, event, seq),
480-
#[cfg(feature = "xwayland")]
481453
PointerFocusTarget::X11Surface(w) => TouchTarget::shape(w, seat, data, event, seq),
482454
PointerFocusTarget::SSD(w) => TouchTarget::shape(w, seat, data, event, seq),
483455
}
@@ -492,7 +464,6 @@ impl<BackendData: Backend> TouchTarget<AnvilState<BackendData>> for PointerFocus
492464
) {
493465
match self {
494466
PointerFocusTarget::WlSurface(w) => TouchTarget::orientation(w, seat, data, event, seq),
495-
#[cfg(feature = "xwayland")]
496467
PointerFocusTarget::X11Surface(w) => {
497468
TouchTarget::orientation(w, seat, data, event, seq)
498469
}
@@ -505,15 +476,13 @@ impl WaylandFocus for PointerFocusTarget {
505476
fn wl_surface(&self) -> Option<WlSurface> {
506477
match self {
507478
PointerFocusTarget::WlSurface(w) => w.wl_surface(),
508-
#[cfg(feature = "xwayland")]
509479
PointerFocusTarget::X11Surface(w) => w.wl_surface(),
510480
PointerFocusTarget::SSD(_) => None,
511481
}
512482
}
513483
fn same_client_as(&self, object_id: &ObjectId) -> bool {
514484
match self {
515485
PointerFocusTarget::WlSurface(w) => w.same_client_as(object_id),
516-
#[cfg(feature = "xwayland")]
517486
PointerFocusTarget::X11Surface(w) => w.same_client_as(object_id),
518487
PointerFocusTarget::SSD(w) => w
519488
.wl_surface()
@@ -551,14 +520,12 @@ impl From<PopupKind> for PointerFocusTarget {
551520
}
552521
}
553522

554-
#[cfg(feature = "xwayland")]
555523
impl From<X11Surface> for PointerFocusTarget {
556524
fn from(value: X11Surface) -> Self {
557525
PointerFocusTarget::X11Surface(value)
558526
}
559527
}
560528

561-
#[cfg(feature = "xwayland")]
562529
impl From<&X11Surface> for PointerFocusTarget {
563530
fn from(value: &X11Surface) -> Self {
564531
PointerFocusTarget::from(value.clone())
@@ -588,7 +555,6 @@ impl From<KeyboardFocusTarget> for PointerFocusTarget {
588555
match value {
589556
KeyboardFocusTarget::Window(w) => match w.underlying_surface() {
590557
WindowSurface::Wayland(w) => PointerFocusTarget::from(w.wl_surface()),
591-
#[cfg(feature = "xwayland")]
592558
WindowSurface::X11(s) => PointerFocusTarget::from(s),
593559
},
594560
KeyboardFocusTarget::LayerSurface(surface) => {

src/input_handler.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,7 @@ impl<BackendData: Backend> AnvilState<BackendData> {
8484
.clone()
8585
.map(|v| ("WAYLAND_DISPLAY", v))
8686
.into_iter()
87-
.chain(
88-
#[cfg(feature = "xwayland")]
89-
self.xdisplay.map(|v| ("DISPLAY", format!(":{}", v))),
90-
#[cfg(not(feature = "xwayland"))]
91-
None,
92-
),
87+
.chain(self.xdisplay.map(|v| ("DISPLAY", format!(":{}", v)))),
9388
)
9489
.spawn()
9590
{
@@ -287,7 +282,6 @@ impl<BackendData: Backend> AnvilState<BackendData> {
287282
if let Some((_, _)) = window
288283
.surface_under(location - output_geo.loc.to_f64(), WindowSurfaceType::ALL)
289284
{
290-
#[cfg(feature = "xwayland")]
291285
if let Some(surface) = window.0.x11_surface() {
292286
self.xwm.as_mut().unwrap().raise_window(surface).unwrap();
293287
}
@@ -321,7 +315,6 @@ impl<BackendData: Backend> AnvilState<BackendData> {
321315
.map(|(w, p)| (w.clone(), p))
322316
{
323317
self.space.raise_element(&window, true);
324-
#[cfg(feature = "xwayland")]
325318
if let Some(surface) = window.0.x11_surface() {
326319
self.xwm.as_mut().unwrap().raise_window(surface).unwrap();
327320
}

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
allow(dead_code, unused_imports)
77
)]
88

9-
#[cfg(any(feature = "udev", feature = "xwayland"))]
109
pub mod cursor;
1110
pub mod drawing;
1211
pub mod focus;

src/shell/element.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ impl WindowElement {
5454
WindowSurface::Wayland(_) => {
5555
surface_under.map(|(surface, loc)| (PointerFocusTarget::WlSurface(surface), loc))
5656
}
57-
#[cfg(feature = "xwayland")]
5857
WindowSurface::X11(s) => {
5958
surface_under.map(|(_, loc)| (PointerFocusTarget::X11Surface(s.clone()), loc))
6059
}
@@ -112,7 +111,6 @@ impl WindowElement {
112111
)
113112
}
114113

115-
#[cfg(feature = "xwayland")]
116114
pub fn is_x11(&self) -> bool {
117115
self.0.is_x11()
118116
}

src/shell/grabs.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ use smithay::input::pointer::{
1010
};
1111
use smithay::input::touch::{GrabStartData as TouchGrabStartData, TouchGrab};
1212
use smithay::reexports::wayland_protocols::xdg::shell::server::xdg_toplevel;
13-
use smithay::utils::{IsAlive, Logical, Point, Serial, Size};
13+
use smithay::utils::{IsAlive, Logical, Point, Rectangle, Serial, Size};
1414
use smithay::wayland::compositor::with_states;
1515
use smithay::wayland::shell::xdg::SurfaceCachedState;
16-
#[cfg(feature = "xwayland")]
17-
use smithay::{utils::Rectangle, xwayland::xwm::ResizeEdge as X11ResizeEdge};
16+
use smithay::xwayland::xwm::ResizeEdge as X11ResizeEdge;
1817

1918
use super::{SurfaceData, WindowElement};
2019
use crate::focus::PointerFocusTarget;
@@ -273,7 +272,6 @@ impl From<ResizeEdge> for xdg_toplevel::ResizeEdge {
273272
}
274273
}
275274

276-
#[cfg(feature = "xwayland")]
277275
impl From<X11ResizeEdge> for ResizeEdge {
278276
fn from(edge: X11ResizeEdge) -> Self {
279277
match edge {
@@ -401,7 +399,6 @@ impl<BackendData: Backend> PointerGrab<AnvilState<BackendData>>
401399
});
402400
xdg.send_pending_configure();
403401
}
404-
#[cfg(feature = "xwayland")]
405402
WindowSurface::X11(x11) => {
406403
let location = data.space.element_location(&self.window).unwrap();
407404
x11.configure(Rectangle::from_loc_and_size(
@@ -476,7 +473,6 @@ impl<BackendData: Backend> PointerGrab<AnvilState<BackendData>>
476473
}
477474
});
478475
}
479-
#[cfg(feature = "xwayland")]
480476
WindowSurface::X11(x11) => {
481477
let mut location = data.space.element_location(&self.window).unwrap();
482478
if self.edges.intersects(ResizeEdge::TOP_LEFT) {
@@ -693,7 +689,6 @@ impl<BackendData: Backend> TouchGrab<AnvilState<BackendData>>
693689
}
694690
});
695691
}
696-
#[cfg(feature = "xwayland")]
697692
WindowSurface::X11(x11) => {
698693
let mut location = data.space.element_location(&self.window).unwrap();
699694
if self.edges.intersects(ResizeEdge::TOP_LEFT) {
@@ -816,7 +811,6 @@ impl<BackendData: Backend> TouchGrab<AnvilState<BackendData>>
816811
});
817812
xdg.send_pending_configure();
818813
}
819-
#[cfg(feature = "xwayland")]
820814
WindowSurface::X11(x11) => {
821815
let location = data.space.element_location(&self.window).unwrap();
822816
x11.configure(Rectangle::from_loc_and_size(

0 commit comments

Comments
 (0)