Rémi Bernon (@rbernon) commented about dlls/winewayland.drv/window.c:
WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED : 0;
- style = NtUserGetWindowLongW(hwnd, GWL_STYLE);
- TRACE("window=%s style=%#lx\n", wine_dbgstr_rect(&conf->rect), (long)style);
- /* The fullscreen state is implied by the window position and style. */
- if (NtUserIsWindowRectFullScreen(&conf->rect) &&
!(style & (WS_MINIMIZE | WS_CAPTION)))
- {
window_state |= WAYLAND_SURFACE_CONFIG_STATE_FULLSCREEN;
- }
- if (style & WS_MAXIMIZE)
window_state |= WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED;
- conf->state = window_state;
I think you should probably try to reproduce the winex11 `update_net_wm_states` logic here as, although not perfect, it has been much tested already:
```c style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ); if (style & WS_MINIMIZE) new_state |= data->net_wm_state & ((1 << NET_WM_STATE_FULLSCREEN)|(1 << NET_WM_STATE_MAXIMIZED)); if (NtUserIsWindowRectFullScreen( &data->whole_rect )) { if ((style & WS_MAXIMIZE) && (style & WS_CAPTION) == WS_CAPTION) new_state |= (1 << NET_WM_STATE_MAXIMIZED); else if (!(style & WS_MINIMIZE)) new_state |= (1 << NET_WM_STATE_FULLSCREEN); } else if (style & WS_MAXIMIZE) new_state |= (1 << NET_WM_STATE_MAXIMIZED); ```
Where I believe `whole_rect` is the same as `visible_rect`.
For instance, setting `WS_MINIMIZE` is not supposed to clear the maximized / fullscreen state (and I highly suspect some applications expect this).