mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-18 14:48:34 +01:00
refactor(kde): carry DebugWindow as i64
DebugWindow(i64) as in the unified SocketMessage (D15). An id outside u32 range, which KDE used to refuse at parse time, now parses and is answered like an id of no window (no reply). Existing ids behave as before. Verified: cargo check --workspace --all-targets in komorebi-for-kde: 0 errors; cargo test -p komorebi --test rule_commands: 6 passed, 0 failed (it sends DebugWindow).
This commit is contained in:
1 parent
302e3830e9
commit
573f48ad78
2 files changed
+6
-3
No files matched your search
@@ -613,7 +613,7 @@ pub enum SocketMessage {
|
||||
SocketSchema,
|
||||
StaticConfigSchema,
|
||||
GenerateStaticConfig,
|
||||
DebugWindow(u32),
|
||||
DebugWindow(i64),
|
||||
ReloadHotkeys,
|
||||
HotkeysState,
|
||||
}
|
||||
|
||||
@@ -1974,8 +1974,11 @@ impl WindowManager {
|
||||
self.update_focused_workspace(false, false)?;
|
||||
}
|
||||
SocketMessage::DebugWindow(window_id) => {
|
||||
let window = Window::from(window_id);
|
||||
if window.is_valid() {
|
||||
// an id that is not a u32 is not a window
|
||||
let window = u32::try_from(window_id).map(Window::from);
|
||||
if let Ok(window) = window
|
||||
&& window.is_valid()
|
||||
{
|
||||
let mut rule_debug = RuleDebug::default();
|
||||
let _ = window.should_manage(None, &mut rule_debug);
|
||||
let schema = serde_json::to_string_pretty(&rule_debug)?;
|
||||
|
||||
Reference in new issue
Block a user