mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
Add is_floating to Window IPC
This commit is contained in:
@@ -758,6 +758,10 @@ pub struct Window {
|
|||||||
///
|
///
|
||||||
/// There can be either one focused window or zero (e.g. when a layer-shell surface has focus).
|
/// There can be either one focused window or zero (e.g. when a layer-shell surface has focus).
|
||||||
pub is_focused: bool,
|
pub is_focused: bool,
|
||||||
|
/// Whether this window is currently floating.
|
||||||
|
///
|
||||||
|
/// If the window isn't floating then it is in the tiling layout.
|
||||||
|
pub is_floating: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Output configuration change result.
|
/// Output configuration change result.
|
||||||
|
|||||||
@@ -516,6 +516,11 @@ fn print_window(window: &Window) {
|
|||||||
println!(" App ID: (unset)");
|
println!(" App ID: (unset)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
println!(
|
||||||
|
" Is floating: {}",
|
||||||
|
if window.is_floating { "yes" } else { "no" }
|
||||||
|
);
|
||||||
|
|
||||||
if let Some(pid) = window.pid {
|
if let Some(pid) = window.pid {
|
||||||
println!(" PID: {pid}");
|
println!(" PID: {pid}");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+3
-1
@@ -412,6 +412,7 @@ fn make_ipc_window(mapped: &Mapped, workspace_id: Option<WorkspaceId>) -> niri_i
|
|||||||
pid: mapped.credentials().map(|c| c.pid),
|
pid: mapped.credentials().map(|c| c.pid),
|
||||||
workspace_id: workspace_id.map(|id| id.get()),
|
workspace_id: workspace_id.map(|id| id.get()),
|
||||||
is_focused: mapped.is_focused(),
|
is_focused: mapped.is_focused(),
|
||||||
|
is_floating: mapped.is_floating(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -592,7 +593,8 @@ impl State {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let workspace_id = ws_id.map(|id| id.get());
|
let workspace_id = ws_id.map(|id| id.get());
|
||||||
let mut changed = ipc_win.workspace_id != workspace_id;
|
let mut changed =
|
||||||
|
ipc_win.workspace_id != workspace_id || ipc_win.is_floating != mapped.is_floating();
|
||||||
|
|
||||||
changed |= with_toplevel_role(mapped.toplevel(), |role| {
|
changed |= with_toplevel_role(mapped.toplevel(), |role| {
|
||||||
ipc_win.title != role.title || ipc_win.app_id != role.app_id
|
ipc_win.title != role.title || ipc_win.app_id != role.app_id
|
||||||
|
|||||||
Reference in New Issue
Block a user