|
@@ -23,15 +23,20 @@ pub fn wm(tx: &Channel, _config: &Config) {
|
|
|
let screen = conn.default_screen();
|
|
|
let mut last_win = screen.get_active_window();
|
|
|
comm::send(tx, "title", conn.get_window_name(last_win).as_ref());
|
|
|
- conn.watch(screen.root, true);
|
|
|
- conn.watch(last_win, true);
|
|
|
- conn.flush();
|
|
|
|
|
|
let stalonetray = wait_for(|| screen.search_by_class("stalonetray"));
|
|
|
let panel = wait_for(|| screen.search_by_name("__panel_top"));
|
|
|
+ let width = xcb::get_geometry(&conn, stalonetray).get_reply().unwrap().width();
|
|
|
|
|
|
- xcb::configure_window(&conn, stalonetray, &[(xcb::CONFIG_WINDOW_SIBLING as u16, panel), (xcb::CONFIG_WINDOW_STACK_MODE as u16, xcb::STACK_MODE_ABOVE)]);
|
|
|
+ xcb::configure_window(&conn, stalonetray, &[
|
|
|
+ (xcb::CONFIG_WINDOW_X as u16, (screen.width - width) as u32),
|
|
|
+ (xcb::CONFIG_WINDOW_SIBLING as u16, panel),
|
|
|
+ (xcb::CONFIG_WINDOW_STACK_MODE as u16, xcb::STACK_MODE_ABOVE)
|
|
|
+ ]);
|
|
|
xcb::change_window_attributes(&conn, stalonetray, &[(xcb::CW_EVENT_MASK, xcb::EVENT_MASK_STRUCTURE_NOTIFY)]);
|
|
|
+ conn.watch(screen.root, true);
|
|
|
+ conn.watch(last_win, true);
|
|
|
+ conn.flush();
|
|
|
|
|
|
conn.event_loop(&mut |event: &xcb::GenericEvent| {
|
|
|
match event.response_type() {
|