[PATCH 0/2] MR4098: winewayland.drv: More robust handling of xdg_output information
Two commits to make `xdg_output` handling more robust to the ordering of `zxdg_output_manager` advertising, or the lack of `xdg_output` logical dimensions. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55788 -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4098
From: Alexandros Frantzis <alexandros.frantzis(a)collabora.com> Add outputs to the output_list on creation (instead of when they are first configured), so they are detected and "upgraded" with xdg information even if the compositor advertises the zxdg_output_manager global after the wl_outputs themselves. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55788 --- dlls/winewayland.drv/wayland_output.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/winewayland.drv/wayland_output.c b/dlls/winewayland.drv/wayland_output.c index 4b2cb0505be..268b4593fd8 100644 --- a/dlls/winewayland.drv/wayland_output.c +++ b/dlls/winewayland.drv/wayland_output.c @@ -165,9 +165,6 @@ static void wayland_output_done(struct wayland_output *output) output->current.logical_h = output->pending.logical_h; } - if (wl_list_empty(&output->link)) - wl_list_insert(process_wayland.output_list.prev, &output->link); - output->pending_flags = 0; pthread_mutex_unlock(&process_wayland.output_mutex); @@ -334,6 +331,10 @@ BOOL wayland_output_create(uint32_t id, uint32_t version) if (process_wayland.zxdg_output_manager_v1) wayland_output_use_xdg_extension(output); + pthread_mutex_lock(&process_wayland.output_mutex); + wl_list_insert(process_wayland.output_list.prev, &output->link); + pthread_mutex_unlock(&process_wayland.output_mutex); + return TRUE; err: -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4098
From: Alexandros Frantzis <alexandros.frantzis(a)collabora.com> If the compositor doesn't provide the logical dimensions (or sane ones), use the physical pixel dimensions as the logical dimensions. --- dlls/winewayland.drv/wayland_output.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/winewayland.drv/wayland_output.c b/dlls/winewayland.drv/wayland_output.c index 268b4593fd8..f5941c10f6f 100644 --- a/dlls/winewayland.drv/wayland_output.c +++ b/dlls/winewayland.drv/wayland_output.c @@ -167,6 +167,14 @@ static void wayland_output_done(struct wayland_output *output) output->pending_flags = 0; + /* Ensure the logical dimensions have sane values. */ + if ((!output->current.logical_w || !output->current.logical_h) && + output->current.current_mode) + { + output->current.logical_w = output->current.current_mode->width; + output->current.logical_h = output->current.current_mode->height; + } + pthread_mutex_unlock(&process_wayland.output_mutex); TRACE("name=%s logical=%d,%d+%dx%d\n", -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4098
@darkblaze69 Please let me know how this works for you. Thanks! -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4098#note_48719
On Sat Oct 14 17:48:13 2023 +0000, Alexandros Frantzis wrote:
@darkblaze69 Please let me know how this works for you. Thanks! I confirm, this fixes my issue.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/4098#note_48725
participants (3)
-
Alexandros Frantzis -
Alexandros Frantzis (@afrantzis) -
darkblaze69 (@darkblaze69)