diff --git a/src/panel.c b/src/panel.c index 658d88b..b643d80 100644 --- a/src/panel.c +++ b/src/panel.c @@ -603,6 +603,21 @@ void place_panel_all_desktops(Panel *p) num_atoms); } +void replace_panel_all_desktops(Panel *p) +{ + XClientMessageEvent m; + memset(&m, 0, sizeof(m)); + m.type = ClientMessage; + m.send_event = True; + m.display = server.display; + m.window = p->main_win; + m.message_type = server.atom._NET_WM_DESKTOP; + m.format = 32; + m.data.l[0] = ALL_DESKTOPS; + XSendEvent(server.display, server.root_win, False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent *)&m); + XSync(server.display, False); +} + void set_panel_properties(Panel *p) { XStoreName(server.display, p->main_win, panel_window_name); diff --git a/src/panel.h b/src/panel.h index 1806940..5f9e3b2 100644 --- a/src/panel.h +++ b/src/panel.h @@ -155,6 +155,7 @@ void render_panel(Panel *panel); void set_panel_items_order(Panel *p); void place_panel_all_desktops(Panel *p); +void replace_panel_all_desktops(Panel *p); void set_panel_properties(Panel *p); // draw background panel diff --git a/src/tint.c b/src/tint.c index 058b6d5..ec4d4a5 100644 --- a/src/tint.c +++ b/src/tint.c @@ -985,7 +985,7 @@ void event_property_notify(XEvent *e) Panel *p = &panels[i]; if (win == p->main_win) { if (at == server.atom._NET_WM_DESKTOP && get_window_desktop(p->main_win) != ALL_DESKTOPS) - place_panel_all_desktops(p); + replace_panel_all_desktops(p); return; } }