Requesting configs which exactly matches the current config often causes the window manager to ignore it entirely, and no event is generated, which we would then wait forever.
Do you have an example for this? As I understand, sending a ConfigureRequest event to window managers will always generate a ConfigureNotify event, even if the requested config is the same as the current config in the window manager. This behavior is standardized in [ICCCM 4.1.5](https://tronche.com/gui/x/icccm/sec-4.html).
``` * Not changing the size, location, border width, or stacking order of the window at all.
A client will receive a synthetic ConfigureNotify event that describes the (unchanged) geometry of the window. The (x,y) coordinates will be in the root coordinate system, adjusted for the border width the client requested, irrespective of any reparenting that has taken place. The border_width will be the border width the client requested. The client will not receive a real ConfigureNotify event because no change has actually taken place. ```
There is the Mutter code in meta_window_x11_move_resize_internal() ``` /* If this is a configure request and we change nothing, then we * must send configure notify. */ if (is_configure_request && !(need_move_client || need_move_frame || need_resize_client || need_resize_frame || priv->border_width != 0)) need_configure_notify = TRUE; ```
Also the KWin code in X11Window::configureRequestEvent(). ``` if (e->value_mask & (XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_HEIGHT | XCB_CONFIG_WINDOW_WIDTH)) { configureRequest(e->value_mask, Xcb::fromXNative(e->x), Xcb::fromXNative(e->y), Xcb::fromXNative(e->width), Xcb::fromXNative(e->height), 0, false); } if (e->value_mask & XCB_CONFIG_WINDOW_STACK_MODE) { restackWindow(e->sibling, e->stack_mode, NET::FromApplication, userTime(), false); }
// Sending a synthetic configure notify always is fine, even in cases where // the ICCCM doesn't require this - it can be though of as 'the WM decided to move // the window later'. The window should not cause that many configure request, // so this should not have any significant impact. With user moving/resizing // the it should be optimized though (see also X11Window::setGeometry()/resize()/move()). sendSyntheticConfigureNotify(); ```
Of course, there might be window managers that might not be ICCCM compliant. If what you're saying can be true, then serializing configure requests and waiting for ConfigureNotify might be problematic as well. For example, let's say a window goes from 100x100 to fullscreen, then removing __NET_WM_STATE_FULLSCREEN and Wine requests it to 100x100. Removing __NET_WM_STATE_FULLSCREEN will cause the window manager to restore the window geometry back to the size before fullscreen, so 100x100. Then Wine sends a configure request to change to 100x100, without realizing the window geometry has already been changed to 100x100. Since they have the same geometry, no configure notify as you said.