From 895713078a55e18a6357374c306b819debcc2d59 Mon Sep 17 00:00:00 2001 From: Lucas Kent Date: Sat, 5 Mar 2022 13:35:57 +1100 Subject: [PATCH 1/5] Disable scrolling on web by default but provide method in builder to enable it --- CHANGELOG.md | 1 + src/platform/web.rs | 15 ++++++++++ src/platform_impl/web/web_sys/canvas.rs | 38 +++++++++++++++++++------ src/platform_impl/web/window.rs | 2 ++ 4 files changed, 48 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf98276312..d87cd35b23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ And please only add new entries to the top of this list, right below the `# Unre - Added `Window::is_decorated`. - On X11, fix for repeated event loop iteration when `ControlFlow` was `Wait` - On X11, fix scale factor calculation when the only monitor is reconnected +- On web, by default, when the canvas is focused, scrolling of the webpage is disabled. It can however be enabled via the `WindowBuilderExtWebSys::enable_web_scroll` method. - On Wayland, report unaccelerated mouse deltas in `DeviceEvent::MouseMotion`. - On Web, a focused event is manually generated when a click occurs to emulate behaviour of other backends. - **Breaking:** Bump `ndk` version to 0.6, ndk-sys to `v0.3`, `ndk-glue` to `0.6`. diff --git a/src/platform/web.rs b/src/platform/web.rs index f78a01fb02..63004698f9 100644 --- a/src/platform/web.rs +++ b/src/platform/web.rs @@ -19,6 +19,15 @@ pub trait WindowExtWebSys { } pub trait WindowBuilderExtWebSys { + /// Enable scrolling of the web page the canvas is in when the canvas is focused. + /// + /// Scrolling is disabled by default because the scroll input on many mobile devices + /// is the same as click and dragging which is a very common input method for many applications. + /// + /// So only call this method if you know that you will never need to handle mouse wheel inputs + /// or click and dragging. + fn enable_web_scroll(self) -> Self; + fn with_canvas(self, canvas: Option) -> Self; /// Whether `event.preventDefault` should be automatically called to prevent event propagation @@ -34,6 +43,12 @@ pub trait WindowBuilderExtWebSys { } impl WindowBuilderExtWebSys for WindowBuilder { + fn enable_web_scroll(mut self) -> Self { + self.platform_specific.enable_web_scroll = true; + + self + } + fn with_canvas(mut self, canvas: Option) -> Self { self.platform_specific.canvas = canvas; diff --git a/src/platform_impl/web/web_sys/canvas.rs b/src/platform_impl/web/web_sys/canvas.rs index ebae672227..c5a5fd6762 100644 --- a/src/platform_impl/web/web_sys/canvas.rs +++ b/src/platform_impl/web/web_sys/canvas.rs @@ -30,6 +30,7 @@ pub struct Canvas { on_fullscreen_change: Option>, on_dark_mode: Option, mouse_state: MouseState, + disable_web_scroll: Option<[EventListenerHandle; 5]>, } struct Common { @@ -74,11 +75,34 @@ impl Canvas { MouseState::NoPointerEvent(mouse_handler::MouseHandler::new()) }; + let common = Common { + raw: canvas, + wants_fullscreen: Rc::new(RefCell::new(false)), + }; + + let disable_web_scroll = if !attr.enable_web_scroll { + Some([ + common.add_event("pointermove", move |event: Event| { + event.prevent_default(); + }), + common.add_event("pointermove", move |event: Event| { + event.prevent_default(); + }), + common.add_event("touchstart", move |event: Event| { + event.prevent_default(); + }), + common.add_event("touchend", move |event: Event| { + event.prevent_default(); + }), + common.add_event("wheel", move |event: Event| { + event.prevent_default(); + }), + ]) + } else { + None + }; + Ok(Canvas { - common: Common { - raw: canvas, - wants_fullscreen: Rc::new(RefCell::new(false)), - }, on_blur: None, on_focus: None, on_keyboard_release: None, @@ -88,6 +112,8 @@ impl Canvas { on_fullscreen_change: None, on_dark_mode: None, mouse_state, + disable_web_scroll, + common, }) } @@ -277,10 +303,6 @@ impl Canvas { F: 'static + FnMut(i32, MouseScrollDelta, ModifiersState), { self.on_mouse_wheel = Some(self.common.add_event("wheel", move |event: WheelEvent| { - if prevent_default { - event.prevent_default(); - } - if let Some(delta) = event::mouse_scroll_delta(&event) { handler(0, delta, event::mouse_modifiers(&event)); } diff --git a/src/platform_impl/web/window.rs b/src/platform_impl/web/window.rs index 6fe5839e9d..16b8f70434 100644 --- a/src/platform_impl/web/window.rs +++ b/src/platform_impl/web/window.rs @@ -414,6 +414,7 @@ pub struct PlatformSpecificWindowBuilderAttributes { pub(crate) canvas: Option, pub(crate) prevent_default: bool, pub(crate) focusable: bool, + pub(crate) enable_web_scroll: bool, } impl Default for PlatformSpecificWindowBuilderAttributes { @@ -422,6 +423,7 @@ impl Default for PlatformSpecificWindowBuilderAttributes { canvas: None, prevent_default: true, focusable: true, + enable_web_scroll: false, } } } From 6d95de02d15897dbdd58681e813dbd10ca24f234 Mon Sep 17 00:00:00 2001 From: Lucas Kent Date: Sun, 24 Apr 2022 10:11:28 +1000 Subject: [PATCH 2/5] rename enable_web_scroll -> enable_web_page_scroll --- CHANGELOG.md | 2 +- src/platform/web.rs | 6 +++--- src/platform_impl/web/web_sys/canvas.rs | 10 ++++++---- src/platform_impl/web/window.rs | 4 ++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d87cd35b23..187fdca90e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ And please only add new entries to the top of this list, right below the `# Unre - On Windows, added `WindowExtWindows::set_undecorated_shadow` and `WindowBuilderExtWindows::with_undecorated_shadow` to draw the drop shadow behind a borderless window. - On Windows, fixed default window features (ie snap, animations, shake, etc.) when decorations are disabled. - **Breaking:** On macOS, add support for two-finger touchpad magnification and rotation gestures with new events `WindowEvent::TouchpadMagnify` and `WindowEvent::TouchpadRotate`. +- On web, by default, when the canvas is focused, scrolling of the webpage is disabled. It can however be enabled via the `WindowBuilderExtWebSys::enable_web_page_scroll` method. - On Wayland, `wayland-csd-adwaita` now uses `ab_glyph` instead of `crossfont` to render the title for decorations. - On Wayland, a new `wayland-csd-adwaita-crossfont` feature was added to use `crossfont` instead of `ab_glyph` for decorations. - On Wayland, if not otherwise specified use upstream automatic CSD theme selection. @@ -60,7 +61,6 @@ And please only add new entries to the top of this list, right below the `# Unre - Added `Window::is_decorated`. - On X11, fix for repeated event loop iteration when `ControlFlow` was `Wait` - On X11, fix scale factor calculation when the only monitor is reconnected -- On web, by default, when the canvas is focused, scrolling of the webpage is disabled. It can however be enabled via the `WindowBuilderExtWebSys::enable_web_scroll` method. - On Wayland, report unaccelerated mouse deltas in `DeviceEvent::MouseMotion`. - On Web, a focused event is manually generated when a click occurs to emulate behaviour of other backends. - **Breaking:** Bump `ndk` version to 0.6, ndk-sys to `v0.3`, `ndk-glue` to `0.6`. diff --git a/src/platform/web.rs b/src/platform/web.rs index 63004698f9..5ac83604a4 100644 --- a/src/platform/web.rs +++ b/src/platform/web.rs @@ -26,7 +26,7 @@ pub trait WindowBuilderExtWebSys { /// /// So only call this method if you know that you will never need to handle mouse wheel inputs /// or click and dragging. - fn enable_web_scroll(self) -> Self; + fn enable_web_page_scroll(self) -> Self; fn with_canvas(self, canvas: Option) -> Self; @@ -43,8 +43,8 @@ pub trait WindowBuilderExtWebSys { } impl WindowBuilderExtWebSys for WindowBuilder { - fn enable_web_scroll(mut self) -> Self { - self.platform_specific.enable_web_scroll = true; + fn enable_web_page_scroll(mut self) -> Self { + self.platform_specific.enable_web_page_scroll = true; self } diff --git a/src/platform_impl/web/web_sys/canvas.rs b/src/platform_impl/web/web_sys/canvas.rs index c5a5fd6762..53655771b2 100644 --- a/src/platform_impl/web/web_sys/canvas.rs +++ b/src/platform_impl/web/web_sys/canvas.rs @@ -18,6 +18,8 @@ use web_sys::{ mod mouse_handler; mod pointer_handler; +type EventListener = EventListenerHandle; + #[allow(dead_code)] pub struct Canvas { common: Common, @@ -27,10 +29,10 @@ pub struct Canvas { on_keyboard_press: Option>, on_received_character: Option>, on_mouse_wheel: Option>, - on_fullscreen_change: Option>, + on_fullscreen_change: Option, on_dark_mode: Option, mouse_state: MouseState, - disable_web_scroll: Option<[EventListenerHandle; 5]>, + disable_web_scroll: Option<[EventListener; 5]>, } struct Common { @@ -80,7 +82,7 @@ impl Canvas { wants_fullscreen: Rc::new(RefCell::new(false)), }; - let disable_web_scroll = if !attr.enable_web_scroll { + let disable_web_scroll = if !attr.enable_web_page_scroll && attr.prevent_default { Some([ common.add_event("pointermove", move |event: Event| { event.prevent_default(); @@ -298,7 +300,7 @@ impl Canvas { } } - pub fn on_mouse_wheel(&mut self, mut handler: F, prevent_default: bool) + pub fn on_mouse_wheel(&mut self, mut handler: F, _prevent_default: bool) where F: 'static + FnMut(i32, MouseScrollDelta, ModifiersState), { diff --git a/src/platform_impl/web/window.rs b/src/platform_impl/web/window.rs index 16b8f70434..70deaed36e 100644 --- a/src/platform_impl/web/window.rs +++ b/src/platform_impl/web/window.rs @@ -414,7 +414,7 @@ pub struct PlatformSpecificWindowBuilderAttributes { pub(crate) canvas: Option, pub(crate) prevent_default: bool, pub(crate) focusable: bool, - pub(crate) enable_web_scroll: bool, + pub(crate) enable_web_page_scroll: bool, } impl Default for PlatformSpecificWindowBuilderAttributes { @@ -423,7 +423,7 @@ impl Default for PlatformSpecificWindowBuilderAttributes { canvas: None, prevent_default: true, focusable: true, - enable_web_scroll: false, + enable_web_page_scroll: false, } } } From 455180fae206c4b37f202d6c516fbf0912198873 Mon Sep 17 00:00:00 2001 From: Lucas Kent Date: Sat, 3 Sep 2022 19:36:15 +1000 Subject: [PATCH 3/5] move enable_web_page_scroll into prevent_default option --- CHANGELOG.md | 2 +- src/platform/web.rs | 15 --------------- src/platform_impl/web/web_sys/canvas.rs | 18 ++++++++---------- src/platform_impl/web/window.rs | 2 -- 4 files changed, 9 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 187fdca90e..3dadb1c5bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ And please only add new entries to the top of this list, right below the `# Unre - On Windows, added `WindowExtWindows::set_undecorated_shadow` and `WindowBuilderExtWindows::with_undecorated_shadow` to draw the drop shadow behind a borderless window. - On Windows, fixed default window features (ie snap, animations, shake, etc.) when decorations are disabled. - **Breaking:** On macOS, add support for two-finger touchpad magnification and rotation gestures with new events `WindowEvent::TouchpadMagnify` and `WindowEvent::TouchpadRotate`. -- On web, by default, when the canvas is focused, scrolling of the webpage is disabled. It can however be enabled via the `WindowBuilderExtWebSys::enable_web_page_scroll` method. +- On web, the `WindowBuilderExtWebSys::with_prevent_default` setting (enabled by default), now additionally prevents scrolling of the webpage in mobile browsers, previously it only disabled scrolling on desktop. - On Wayland, `wayland-csd-adwaita` now uses `ab_glyph` instead of `crossfont` to render the title for decorations. - On Wayland, a new `wayland-csd-adwaita-crossfont` feature was added to use `crossfont` instead of `ab_glyph` for decorations. - On Wayland, if not otherwise specified use upstream automatic CSD theme selection. diff --git a/src/platform/web.rs b/src/platform/web.rs index 5ac83604a4..f78a01fb02 100644 --- a/src/platform/web.rs +++ b/src/platform/web.rs @@ -19,15 +19,6 @@ pub trait WindowExtWebSys { } pub trait WindowBuilderExtWebSys { - /// Enable scrolling of the web page the canvas is in when the canvas is focused. - /// - /// Scrolling is disabled by default because the scroll input on many mobile devices - /// is the same as click and dragging which is a very common input method for many applications. - /// - /// So only call this method if you know that you will never need to handle mouse wheel inputs - /// or click and dragging. - fn enable_web_page_scroll(self) -> Self; - fn with_canvas(self, canvas: Option) -> Self; /// Whether `event.preventDefault` should be automatically called to prevent event propagation @@ -43,12 +34,6 @@ pub trait WindowBuilderExtWebSys { } impl WindowBuilderExtWebSys for WindowBuilder { - fn enable_web_page_scroll(mut self) -> Self { - self.platform_specific.enable_web_page_scroll = true; - - self - } - fn with_canvas(mut self, canvas: Option) -> Self { self.platform_specific.canvas = canvas; diff --git a/src/platform_impl/web/web_sys/canvas.rs b/src/platform_impl/web/web_sys/canvas.rs index 53655771b2..a2b27450f1 100644 --- a/src/platform_impl/web/web_sys/canvas.rs +++ b/src/platform_impl/web/web_sys/canvas.rs @@ -32,7 +32,7 @@ pub struct Canvas { on_fullscreen_change: Option, on_dark_mode: Option, mouse_state: MouseState, - disable_web_scroll: Option<[EventListener; 5]>, + disable_mobile_scroll: Option<[EventListener; 3]>, } struct Common { @@ -82,11 +82,8 @@ impl Canvas { wants_fullscreen: Rc::new(RefCell::new(false)), }; - let disable_web_scroll = if !attr.enable_web_page_scroll && attr.prevent_default { + let disable_mobile_scroll = if attr.prevent_default { Some([ - common.add_event("pointermove", move |event: Event| { - event.prevent_default(); - }), common.add_event("pointermove", move |event: Event| { event.prevent_default(); }), @@ -96,9 +93,6 @@ impl Canvas { common.add_event("touchend", move |event: Event| { event.prevent_default(); }), - common.add_event("wheel", move |event: Event| { - event.prevent_default(); - }), ]) } else { None @@ -114,7 +108,7 @@ impl Canvas { on_fullscreen_change: None, on_dark_mode: None, mouse_state, - disable_web_scroll, + disable_mobile_scroll, common, }) } @@ -300,11 +294,15 @@ impl Canvas { } } - pub fn on_mouse_wheel(&mut self, mut handler: F, _prevent_default: bool) + pub fn on_mouse_wheel(&mut self, mut handler: F, prevent_default: bool) where F: 'static + FnMut(i32, MouseScrollDelta, ModifiersState), { self.on_mouse_wheel = Some(self.common.add_event("wheel", move |event: WheelEvent| { + if prevent_default { + event.prevent_default(); + } + if let Some(delta) = event::mouse_scroll_delta(&event) { handler(0, delta, event::mouse_modifiers(&event)); } diff --git a/src/platform_impl/web/window.rs b/src/platform_impl/web/window.rs index 70deaed36e..6fe5839e9d 100644 --- a/src/platform_impl/web/window.rs +++ b/src/platform_impl/web/window.rs @@ -414,7 +414,6 @@ pub struct PlatformSpecificWindowBuilderAttributes { pub(crate) canvas: Option, pub(crate) prevent_default: bool, pub(crate) focusable: bool, - pub(crate) enable_web_page_scroll: bool, } impl Default for PlatformSpecificWindowBuilderAttributes { @@ -423,7 +422,6 @@ impl Default for PlatformSpecificWindowBuilderAttributes { canvas: None, prevent_default: true, focusable: true, - enable_web_page_scroll: false, } } } From 44fb4363959ca1ce6237cb016a9c63d31eea4cc0 Mon Sep 17 00:00:00 2001 From: Lucas Kent Date: Sun, 4 Sep 2022 12:31:53 +1000 Subject: [PATCH 4/5] final approach --- .../web/event_loop/window_target.rs | 36 +++++++----- src/platform_impl/web/web_sys/canvas.rs | 58 +++++++++---------- .../web/web_sys/canvas/pointer_handler.rs | 11 +++- 3 files changed, 59 insertions(+), 46 deletions(-) diff --git a/src/platform_impl/web/event_loop/window_target.rs b/src/platform_impl/web/event_loop/window_target.rs index 6b15e3dd22..c9863bf99c 100644 --- a/src/platform_impl/web/event_loop/window_target.rs +++ b/src/platform_impl/web/event_loop/window_target.rs @@ -63,6 +63,9 @@ impl EventLoopWindowTarget { let mut canvas = canvas.borrow_mut(); canvas.set_attribute("data-raw-handle", &id.0.to_string()); + canvas.on_touch_start(prevent_default); + canvas.on_touch_end(prevent_default); + let runner = self.runner.clone(); canvas.on_blur(move || { runner.send_event(Event::WindowEvent { @@ -153,22 +156,25 @@ impl EventLoopWindowTarget { }); let runner = self.runner.clone(); - canvas.on_cursor_move(move |pointer_id, position, delta, modifiers| { - runner.send_event(Event::WindowEvent { - window_id: RootWindowId(id), - event: WindowEvent::CursorMoved { + canvas.on_cursor_move( + move |pointer_id, position, delta, modifiers| { + runner.send_event(Event::WindowEvent { + window_id: RootWindowId(id), + event: WindowEvent::CursorMoved { + device_id: RootDeviceId(DeviceId(pointer_id)), + position, + modifiers, + }, + }); + runner.send_event(Event::DeviceEvent { device_id: RootDeviceId(DeviceId(pointer_id)), - position, - modifiers, - }, - }); - runner.send_event(Event::DeviceEvent { - device_id: RootDeviceId(DeviceId(pointer_id)), - event: DeviceEvent::MouseMotion { - delta: (delta.x, delta.y), - }, - }); - }); + event: DeviceEvent::MouseMotion { + delta: (delta.x, delta.y), + }, + }); + }, + prevent_default, + ); let runner = self.runner.clone(); canvas.on_mouse_press(move |pointer_id, position, button, modifiers| { diff --git a/src/platform_impl/web/web_sys/canvas.rs b/src/platform_impl/web/web_sys/canvas.rs index a2b27450f1..2e87587442 100644 --- a/src/platform_impl/web/web_sys/canvas.rs +++ b/src/platform_impl/web/web_sys/canvas.rs @@ -18,21 +18,20 @@ use web_sys::{ mod mouse_handler; mod pointer_handler; -type EventListener = EventListenerHandle; - #[allow(dead_code)] pub struct Canvas { common: Common, + on_touch_start: Option>, + on_touch_end: Option>, on_focus: Option>, on_blur: Option>, on_keyboard_release: Option>, on_keyboard_press: Option>, on_received_character: Option>, on_mouse_wheel: Option>, - on_fullscreen_change: Option, + on_fullscreen_change: Option>, on_dark_mode: Option, mouse_state: MouseState, - disable_mobile_scroll: Option<[EventListener; 3]>, } struct Common { @@ -77,28 +76,13 @@ impl Canvas { MouseState::NoPointerEvent(mouse_handler::MouseHandler::new()) }; - let common = Common { - raw: canvas, - wants_fullscreen: Rc::new(RefCell::new(false)), - }; - - let disable_mobile_scroll = if attr.prevent_default { - Some([ - common.add_event("pointermove", move |event: Event| { - event.prevent_default(); - }), - common.add_event("touchstart", move |event: Event| { - event.prevent_default(); - }), - common.add_event("touchend", move |event: Event| { - event.prevent_default(); - }), - ]) - } else { - None - }; - Ok(Canvas { + common: Common { + raw: canvas, + wants_fullscreen: Rc::new(RefCell::new(false)), + }, + on_touch_start: None, + on_touch_end: None, on_blur: None, on_focus: None, on_keyboard_release: None, @@ -108,8 +92,6 @@ impl Canvas { on_fullscreen_change: None, on_dark_mode: None, mouse_state, - disable_mobile_scroll, - common, }) } @@ -154,6 +136,22 @@ impl Canvas { &self.common.raw } + pub fn on_touch_start(&mut self, prevent_default: bool) { + self.on_touch_start = Some(self.common.add_event("touchstart", move |event: Event| { + if prevent_default { + event.prevent_default(); + } + })); + } + + pub fn on_touch_end(&mut self, prevent_default: bool) { + self.on_touch_end = Some(self.common.add_event("touchend", move |event: Event| { + if prevent_default { + event.prevent_default(); + } + })); + } + pub fn on_blur(&mut self, mut handler: F) where F: 'static + FnMut(), @@ -284,12 +282,14 @@ impl Canvas { } } - pub fn on_cursor_move(&mut self, handler: F) + pub fn on_cursor_move(&mut self, handler: F, prevent_default: bool) where F: 'static + FnMut(i32, PhysicalPosition, PhysicalPosition, ModifiersState), { match &mut self.mouse_state { - MouseState::HasPointerEvent(h) => h.on_cursor_move(&self.common, handler), + MouseState::HasPointerEvent(h) => { + h.on_cursor_move(&self.common, handler, prevent_default) + } MouseState::NoPointerEvent(h) => h.on_cursor_move(&self.common, handler), } } diff --git a/src/platform_impl/web/web_sys/canvas/pointer_handler.rs b/src/platform_impl/web/web_sys/canvas/pointer_handler.rs index 85a99eb8ab..e907f54ebe 100644 --- a/src/platform_impl/web/web_sys/canvas/pointer_handler.rs +++ b/src/platform_impl/web/web_sys/canvas/pointer_handler.rs @@ -88,13 +88,20 @@ impl PointerHandler { )); } - pub fn on_cursor_move(&mut self, canvas_common: &super::Common, mut handler: F) - where + pub fn on_cursor_move( + &mut self, + canvas_common: &super::Common, + mut handler: F, + prevent_default: bool, + ) where F: 'static + FnMut(i32, PhysicalPosition, PhysicalPosition, ModifiersState), { self.on_cursor_move = Some(canvas_common.add_event( "pointermove", move |event: PointerEvent| { + if prevent_default { + event.prevent_default(); + } handler( event.pointer_id(), event::mouse_position(&event).to_physical(super::super::scale_factor()), From df205c0b716a7b00365846361291949891af6e4c Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Sun, 4 Sep 2022 05:32:44 +0200 Subject: [PATCH 5/5] Mark prevent_default change as breaking --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dadb1c5bf..0e648fd508 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ And please only add new entries to the top of this list, right below the `# Unre - On Windows, added `WindowExtWindows::set_undecorated_shadow` and `WindowBuilderExtWindows::with_undecorated_shadow` to draw the drop shadow behind a borderless window. - On Windows, fixed default window features (ie snap, animations, shake, etc.) when decorations are disabled. - **Breaking:** On macOS, add support for two-finger touchpad magnification and rotation gestures with new events `WindowEvent::TouchpadMagnify` and `WindowEvent::TouchpadRotate`. -- On web, the `WindowBuilderExtWebSys::with_prevent_default` setting (enabled by default), now additionally prevents scrolling of the webpage in mobile browsers, previously it only disabled scrolling on desktop. +- **Breaking:** On web, the `WindowBuilderExtWebSys::with_prevent_default` setting (enabled by default), now additionally prevents scrolling of the webpage in mobile browsers, previously it only disabled scrolling on desktop. - On Wayland, `wayland-csd-adwaita` now uses `ab_glyph` instead of `crossfont` to render the title for decorations. - On Wayland, a new `wayland-csd-adwaita-crossfont` feature was added to use `crossfont` instead of `ab_glyph` for decorations. - On Wayland, if not otherwise specified use upstream automatic CSD theme selection.