x11xorg

XMonad atom changes not reflected in tint2 panel - Event propagation issue


This question is not about setting up a desktop environment, it's strictly about the Xorg or X11 protocol for handling the event/situation below.

I'm experiencing an issue with X11 atom changes. Here's the situation:

  1. In XMonad, I'm modifying the _NET_WM_STATE_SKIP_TASKBAR atom for certain windows.
  2. These changes are successfully applied to the windows (I can verify this using xprop).
  3. However, tint2 is not updating its panel to reflect these changes. The affected windows continue to appear (or not appear) in the tint2 taskbar as if the atom hadn't been modified.

My questions are:

  1. Is there a common procedure or best practice for propagating atom changes to other X11 clients (like tint2 in this case)?
  2. Could this be an issue with tint2's event mask not including the necessary events to detect these atom changes?
  3. Do I need to trigger a specific event (like PropertyNotify) after modifying an atom to ensure other clients are aware of the change?

I'm using XMonad as my window manager, and I'm modifying the atoms directly through XMonad's X11 bindings. tint2 is being used as my panel/taskbar.

Any insights into how atom changes should be properly propagated or how tint2 might be expected to handle such changes would be greatly appreciated.


From what I can find it seems PropertyNotify events are being sent automatically from XMonad when I modify the window atoms. It seems tint2 indeed will not redraw the panel due to

        else if (at == server.atom [_NET_WM_STATE])
        {
            if (debug) {
                int count;
                Atom *atom_state = get_property(win, server.atom [_NET_WM_STATE], XA_ATOM, &count);
                for (int j = 0; j < count; j++)
                {
                    char *atom_state_name = XGetAtomName(server.display, atom_state[j]);
                    fprintf(stderr, "tint2: %s %d: _NET_WM_STATE = %s\n", __func__, __LINE__, atom_state_name);
                    XFree(atom_state_name);
                }
                XFree(atom_state);
            }
            if (window_is_urgent(win))
                add_urgent(task);
            if (window_is_skip_taskbar(win)) {
                remove_task(task);
                schedule_panel_redraw();
            }
        }

This seems to not correctly schedule a panel redraw - non of the if conditionals get executed for the action I'm looking at (removing _NET_WM_STATE_SKIP_TASKBAR).


Solution

  • PropertyNotify events seem to be the correct procedure here. Tint2 is not handling these events correctly.

    These events can be debuged/viewed with the xev program.