Commit fcaed00a authored by Alexandros Frantzis's avatar Alexandros Frantzis Committed by Alexandre Julliard

winewayland.drv: Initialize display devices once after process init.

After the driver process initialization is done, use all the received wl_output information to non-forcefully initialize the display devices. We will reintroduce dynamic display device reinitialization (i.e., as a response to non-initial wl_output events) when we start reading and dispatching Wayland events. Signed-off-by: 's avatarAlexandros Frantzis <alexandros.frantzis@collabora.com>
parent 7f90c9d7
......@@ -32,30 +32,13 @@
WINE_DEFAULT_DEBUG_CHANNEL(waylanddrv);
static BOOL force_display_devices_refresh;
static void wayland_refresh_display_devices(void)
void wayland_init_display_devices(void)
{
UINT32 num_path, num_mode;
force_display_devices_refresh = TRUE;
/* Trigger refresh in win32u */
NtUserGetDisplayConfigBufferSizes(QDC_ONLY_ACTIVE_PATHS, &num_path, &num_mode);
}
void wayland_init_display_devices(void)
{
struct ntuser_thread_info *thread_info = NtUserGetThreadInfo();
DWORD current_pid = GetCurrentProcessId();
HWND desktop_hwnd = UlongToHandle(thread_info->top_window);
DWORD desktop_pid = 0;
if (desktop_hwnd) NtUserGetWindowThread(desktop_hwnd, &desktop_pid);
/* Refresh devices only from the desktop window process. */
if (!desktop_pid || current_pid == desktop_pid)
wayland_refresh_display_devices();
}
static void wayland_add_device_gpu(const struct gdi_device_manager *device_manager,
void *param)
{
......@@ -141,11 +124,9 @@ BOOL WAYLAND_UpdateDisplayDevices(const struct gdi_device_manager *device_manage
struct wayland_output *output;
INT output_id = 0;
if (!force && !force_display_devices_refresh) return TRUE;
TRACE("force=%d force_refresh=%d\n", force, force_display_devices_refresh);
if (!force) return TRUE;
force_display_devices_refresh = FALSE;
TRACE("force=%d\n", force);
wayland_add_device_gpu(device_manager, param);
......
......@@ -65,7 +65,6 @@ static void registry_handle_global_remove(void *data, struct wl_registry *regist
{
TRACE("removing output->name=%s\n", output->name);
wayland_output_destroy(output);
wayland_init_display_devices();
return;
}
}
......@@ -129,5 +128,7 @@ BOOL wayland_process_init(void)
wl_display_roundtrip_queue(process_wl_display, process_wayland->wl_event_queue);
wl_display_roundtrip_queue(process_wl_display, process_wayland->wl_event_queue);
wayland_init_display_devices();
return TRUE;
}
......@@ -132,8 +132,6 @@ static void output_handle_done(void *data, struct wl_output *wl_output)
mode->width, mode->height, mode->refresh,
output->current_mode == mode ? "*" : "");
}
wayland_init_display_devices();
}
static void output_handle_scale(void *data, struct wl_output *wl_output,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment