all repos — tint2 @ f0de284dd9e65188f3d70029f473e292b3018caa

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Fix regression (all desktop tasks not working)
o9000 mrovi9000@gmail.com
commit

f0de284dd9e65188f3d70029f473e292b3018caa

parent

9d9d6aa302dd813a133f1b62f5e719a0d22aa48c

1 files changed, 7 insertions(+), 3 deletions(-)

jump to
M src/util/window.csrc/util/window.c

@@ -108,13 +108,17 @@ }

int get_window_desktop(Window win) { - if (!server.viewports) - return MAX(0, MIN(server.num_desktops - 1, get_property32(win, server.atom._NET_WM_DESKTOP, XA_CARDINAL))); + if (!server.viewports) { + int desktop = get_property32(win, server.atom._NET_WM_DESKTOP, XA_CARDINAL); + if (desktop != ALL_DESKTOPS) + desktop = MAX(0, MIN(server.num_desktops - 1, desktop)); + return desktop; + } int x, y, w, h; get_window_coordinates(win, &x, &y, &w, &h); - int desktop = MIN(get_current_desktop(), server.num_desktops - 1); + int desktop = get_current_desktop(); // Window coordinates are relative to the current viewport, make them absolute x += server.viewports[desktop].x; y += server.viewports[desktop].y;