On Wed Feb 18 16:46:36 2026 +0000, Rémi Bernon wrote:
The problem is that the pending state is supposed to represent a pending operation we already did, right? But we never did it, because we skipped it (and just did a XNoOp instead), so exiting early in such case doesn't make sense. Kind of, yeah, but the same is true for the serial, and the XNoOp is assuming that the window is soon mapped and therefore activated. This was mostly an attempt at fixing some issue with X11 WM getting confused about the request on an unmapped window. I'm not even sure it actually worked, it was for https://bugs.winehq.org/show_bug.cgi?id=58505 but didn't fully fix it, and it's possible I misdiagnosed the problem. From what I read, windows are *not* activated automatically. They receive events (ClientMessage with WM_TAKE_FOCUS, or _NET_WM_STATE, etc) and that's when they're supposed to let the WM know they want to get focus/be activated or not.
And that's exactly the part that fails, because we see it's "pending" even though it's not and we return early, never letting it know we want to be activated. If we remove the entire skipping logic, then it fails for other reasons so that's not a good idea either. I then get stuff like: warn:event:handle_wm_protocols Ignoring window 0x200a4/7400001 WM_TAKE_FOCUS serial 171, event_time 5459169, foreground 0x200a4 during WM_STATE change But the point is that the pending_state should be set when we actually have a pending operation on it, not a no-op. I don't understand what sense does it make to have the pending state set to something that we haven't actually requested (and thus isn't pending)??? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10133#note_129965