From: Rémi Bernon rbernon@codeweavers.com
When more reconfigurations are known to be pending, and no exact match is found. --- dlls/winex11.drv/window.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 2325171aa6b..5ba84acab0c 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1242,7 +1242,8 @@ static void discard_pending_configs( struct x11drv_win_data *data, BOOL all ) /* lookup a window config request that matches the received event rect */ BOOL find_pending_window_config( struct x11drv_win_data *data, const RECT *visible_rect, unsigned long serial ) { - struct config_entry *entry, *next, *exact = NULL; + struct config_entry *entry, *next, *exact = NULL, *near = NULL; + SIZE current_size, config_size; UINT ticks = NtGetTickCount(); BOOL found = FALSE;
@@ -1252,15 +1253,23 @@ BOOL find_pending_window_config( struct x11drv_win_data *data, const RECT *visib discard_pending_configs( data, FALSE );
/* lookup for a matching pending window config */ + current_size.cx = visible_rect->right - visible_rect->left; + current_size.cy = visible_rect->bottom - visible_rect->top; LIST_FOR_EACH_ENTRY_SAFE( entry, next, &data->pending_configs, struct config_entry, entry ) { + config_size.cx = entry->visible_rect.right - entry->visible_rect.left; + config_size.cy = entry->visible_rect.bottom - entry->visible_rect.top; + if (!near && current_size.cx == config_size.cx && current_size.cy == config_size.cy) near = entry; if (EqualRect( &entry->visible_rect, visible_rect )) exact = entry; if (exact) break; }
+ /* only match with near configs if we have more pending configs */ + if (near && !list_next( &data->pending_configs, &near->entry )) near = NULL; + LIST_FOR_EACH_ENTRY_SAFE( entry, next, &data->pending_configs, struct config_entry, entry ) { - found = entry == exact; + found = entry == exact || entry == near; if (!found) WARN( "Discarding window %p/%lx entry %p, visible_rect %s, serial %ld, ticks %u\n", data->hwnd, data->whole_window, entry, wine_dbgstr_rect(&entry->visible_rect), entry->serial, entry->ticks); list_remove( &entry->entry );