chore(client): checkpoint deployed features and unfinished server management
User requested a checkpoint and stopped all agents. Deployed artifacts remain the last verified releases; unfinished settings/categories/forums are preserved as WIP. See TODO/roadmap for verification and remaining release/updater work.
This commit is contained in:
parent
15f03bf8df
commit
f04691c3cd
90 changed files with 9599 additions and 371 deletions
|
|
@ -462,6 +462,10 @@ pub struct WinitWindowAdapter {
|
|||
current_resize_direction: Cell<Option<ResizeDirection>>,
|
||||
/// Allocates small i32 finger ids for winit's per-device u64 touch ids.
|
||||
touch_finger_ids: RefCell<crate::touch_finger_id::TouchFingerIdAllocator>,
|
||||
#[cfg(target_os = "linux")]
|
||||
keyboard_modifiers: Cell<winit::keyboard::ModifiersState>,
|
||||
#[cfg(target_os = "linux")]
|
||||
alt_graph_pressed: Cell<bool>,
|
||||
}
|
||||
|
||||
impl WinitWindowAdapter {
|
||||
|
|
@ -516,6 +520,10 @@ impl WinitWindowAdapter {
|
|||
pressed: Default::default(),
|
||||
current_resize_direction: Default::default(),
|
||||
touch_finger_ids: Default::default(),
|
||||
#[cfg(target_os = "linux")]
|
||||
keyboard_modifiers: Default::default(),
|
||||
#[cfg(target_os = "linux")]
|
||||
alt_graph_pressed: Default::default(),
|
||||
});
|
||||
|
||||
self_rc.shared_backend_data.register_inactive_window((self_rc.clone()) as _);
|
||||
|
|
@ -1314,13 +1322,76 @@ impl WinitWindowAdapter {
|
|||
.dispatch_event_with_result(corelib::platform::WindowEvent::CloseRequested)?;
|
||||
}
|
||||
WinitWindowEvent::Focused(have_focus) => {
|
||||
#[cfg(target_os = "linux")]
|
||||
if !have_focus {
|
||||
self.keyboard_modifiers.set(Default::default());
|
||||
self.alt_graph_pressed.set(false);
|
||||
}
|
||||
// Work around https://github.com/rust-windowing/winit/issues/4371
|
||||
let have_focus =
|
||||
if cfg!(target_os = "macos") { winit_window.has_focus() } else { have_focus };
|
||||
self.activation_changed(have_focus)?;
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
WinitWindowEvent::ModifiersChanged(modifiers) => {
|
||||
let next = modifiers.state();
|
||||
let previous = self.keyboard_modifiers.replace(next);
|
||||
// Wayland may report modifiers without individual key events
|
||||
// (virtual keyboards, or focus acquired with Ctrl held).
|
||||
if self.shared_backend_data.is_wayland {
|
||||
use corelib::input::key_codes;
|
||||
for (was, now, left, right) in [
|
||||
(
|
||||
previous.control_key(),
|
||||
next.control_key(),
|
||||
key_codes::Control,
|
||||
key_codes::ControlR,
|
||||
),
|
||||
(
|
||||
previous.shift_key(),
|
||||
next.shift_key(),
|
||||
key_codes::Shift,
|
||||
key_codes::ShiftR,
|
||||
),
|
||||
(
|
||||
previous.alt_key(),
|
||||
next.alt_key(),
|
||||
key_codes::Alt,
|
||||
key_codes::AltGr,
|
||||
),
|
||||
(
|
||||
previous.super_key(),
|
||||
next.super_key(),
|
||||
key_codes::Meta,
|
||||
key_codes::MetaR,
|
||||
),
|
||||
] {
|
||||
if was != now {
|
||||
let text = left.to_string().into();
|
||||
self.window().dispatch_event_with_result(if now {
|
||||
WindowEvent::KeyPressed { text }
|
||||
} else {
|
||||
WindowEvent::KeyReleased { text }
|
||||
})?;
|
||||
if !now {
|
||||
self.window().dispatch_event_with_result(
|
||||
WindowEvent::KeyReleased {
|
||||
text: right.to_string().into(),
|
||||
},
|
||||
)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WinitWindowEvent::KeyboardInput { event, is_synthetic, .. } => {
|
||||
#[cfg(target_os = "linux")]
|
||||
if event.logical_key == Key::Named(winit::keyboard::NamedKey::AltGraph) {
|
||||
// Linux AltGr is usually Mod5, absent from ModifiersState::ALT.
|
||||
self.alt_graph_pressed.set(event.state == winit::event::ElementState::Pressed);
|
||||
}
|
||||
let key_code = event.logical_key.clone();
|
||||
// For now: Match Qt's behavior of mapping command to control and control to meta (LWin/RWin).
|
||||
let swap_cmd_ctrl = i_slint_core::is_apple_platform();
|
||||
|
|
@ -1366,6 +1437,34 @@ impl WinitWindowAdapter {
|
|||
#[allow(unused_mut)]
|
||||
let mut text = to_slint_key(&event, &key_code);
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
if matches!(key_code, Key::Character(_)) {
|
||||
use winit::keyboard::{KeyCode, PhysicalKey};
|
||||
let physical = match event.physical_key {
|
||||
PhysicalKey::Code(KeyCode::KeyA) => Some('a'),
|
||||
PhysicalKey::Code(KeyCode::KeyC) => Some('c'),
|
||||
PhysicalKey::Code(KeyCode::KeyV) => Some('v'),
|
||||
PhysicalKey::Code(KeyCode::KeyX) => Some('x'),
|
||||
PhysicalKey::Code(KeyCode::KeyY) => Some('y'),
|
||||
PhysicalKey::Code(KeyCode::KeyZ) => Some('z'),
|
||||
PhysicalKey::Code(KeyCode::KeyF) => Some('f'),
|
||||
PhysicalKey::Code(KeyCode::KeyS) => Some('s'),
|
||||
PhysicalKey::Code(KeyCode::KeyP) => Some('p'),
|
||||
PhysicalKey::Code(KeyCode::KeyR) => Some('r'),
|
||||
_ => None,
|
||||
};
|
||||
let modifiers = self.keyboard_modifiers.get();
|
||||
if let Some(letter) = crate::keyboard_shortcuts::shortcut_letter(
|
||||
text.as_str(),
|
||||
physical,
|
||||
modifiers.control_key(),
|
||||
modifiers.alt_key() || self.alt_graph_pressed.get(),
|
||||
modifiers.super_key(),
|
||||
) {
|
||||
text = letter.to_string().into();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
let text_without_modifiers = {
|
||||
use winit::platform::modifier_supplement::KeyEventExtModifierSupplement;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue