From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winewayland.drv/wayland_surface.c | 6 ++++++ dlls/winewayland.drv/window.c | 14 ++------------ 2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/dlls/winewayland.drv/wayland_surface.c b/dlls/winewayland.drv/wayland_surface.c index e5794ee440f..a3b81b66f02 100644 --- a/dlls/winewayland.drv/wayland_surface.c +++ b/dlls/winewayland.drv/wayland_surface.c @@ -240,6 +240,8 @@ void wayland_surface_destroy(struct wayland_surface *surface) */ void wayland_surface_make_toplevel(struct wayland_surface *surface) { + WCHAR text[1024]; + TRACE("surface=%p\n", surface);
surface->xdg_surface = @@ -257,6 +259,10 @@ void wayland_surface_make_toplevel(struct wayland_surface *surface) wl_surface_commit(surface->wl_surface); wl_display_flush(process_wayland.wl_display);
+ if (!NtUserInternalGetWindowText(surface->hwnd, text, ARRAY_SIZE(text))) + text[0] = 0; + wayland_surface_set_title(surface, text); + return;
err: diff --git a/dlls/winewayland.drv/window.c b/dlls/winewayland.drv/window.c index 2a9f4ff8036..f483bc0eeb6 100644 --- a/dlls/winewayland.drv/window.c +++ b/dlls/winewayland.drv/window.c @@ -210,8 +210,7 @@ static BOOL wayland_win_data_update_wayland_surface(struct wayland_win_data *dat { struct wayland_client_surface *client = data->client_surface; struct wayland_surface *surface; - BOOL visible, xdg_visible; - WCHAR text[1024]; + BOOL xdg_visible;
TRACE("hwnd=%p\n", data->hwnd);
@@ -228,16 +227,7 @@ static BOOL wayland_win_data_update_wayland_surface(struct wayland_win_data *dat /* If the window is a visible toplevel make it a wayland * xdg_toplevel. Otherwise keep it role-less to avoid polluting the * compositor with empty xdg_toplevels. */ - if (visible) - { - wayland_surface_make_toplevel(surface); - if (surface->xdg_toplevel) - { - if (!NtUserInternalGetWindowText(data->hwnd, text, ARRAY_SIZE(text))) - text[0] = 0; - wayland_surface_set_title(surface, text); - } - } + if (visible) wayland_surface_make_toplevel(surface); }
if (visible && client) wayland_client_surface_attach(client, data->hwnd);