On Thu Jan 9 19:49:25 2025 +0000, Gabriel Ivăncescu wrote:
Merge request https://gitlab.winehq.org/wine/wine/-/merge_requests/7116 was
reviewed by Rémi Bernon
--
Rémi Bernon started a new discussion on dlls/winex11.drv/window.c: https://gitlab.winehq.org/wine/wine/-/merge_requests/7116#note_91691
- }
- new_rect.right = new_rect.left + new_width;
- new_rect.bottom = new_rect.top + new_height;
What about shortening it like this? Also using `desired_state` is probably better here, in case window config request is being delayed.
new_rect = data->rects.visible; if (swp_flags & SWP_NOSIZE) { new_rect.right = new_rect.left + data->desired_state.rect.right - data->desired_state.rect.left; new_rect.bottom = new_rect.top + data->desired_state.rect.bottom - data->desired_state.rect.top; } if (swp_flags & SWP_NOMOVE) { OffsetRect( &new_rect, data->desired_state.rect.left - new_rect.left, data->desired_state.rect.top - new_rect.top ); }
Sure. For `desired_state`, I'm a bit confused of how it all works, I just took it from `window_set_config` old_rect. But yes that works too.
`desired_state` is the X window state that would match the current Win32 state, `pending_state` which is the state that was last requested to the X server, `current_state` is the state that corresponds to the last window config/state notify event we've received.
Obviously `current_state` differs from `pending_state` as soon as we're requesting a change, until we've received the corresponding notify. `pending_state` and `desired_state` may differ when we decide to delay some requests, if there's some requested changes already pending.
When the notify event is received, we'll either continue by requesting the `desired_state` again, if the notify matches our expectations, or, if it does not, we will temporarily ignore the `desired_state` and notify the Win32 state of an unexpected window config/state change.