Skip to content

Commit

Permalink
Print x window client id instead of internal i3 id (fixes #10)
Browse files Browse the repository at this point in the history
  • Loading branch information
svenstaro committed Jan 7, 2019
1 parent d828eb7 commit d41767f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use crate::wm_i3 as wm;
#[derive(Debug)]
pub struct DesktopWindow {
id: i64,
x_window_id: Option<i32>,
title: String,
pos: (i32, i32),
size: (i32, i32),
Expand Down Expand Up @@ -300,7 +301,7 @@ fn main() {
if let Some(rw) = &render_windows.get(&pressed_keys) {
info!("Found matching window, focusing");
if app_config.print_only {
println!("{}", rw.desktop_window.id);
println!("0x{:x}", rw.desktop_window.x_window_id.unwrap_or(0));
} else {
wm::focus_window(&rw.desktop_window);
}
Expand Down
1 change: 1 addition & 0 deletions src/wm_i3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ fn crawl_windows(root_node: &Node, workspace: &Workspace) -> Vec<DesktopWindow>

let window = DesktopWindow {
id: node.id,
x_window_id: node.window,
title: node.name.clone().unwrap_or_default(),
pos: (pos_x, pos_y),
size: ((node.rect.2), (node.rect.3 + node.deco_rect.3)),
Expand Down

0 comments on commit d41767f

Please sign in to comment.