winewayland.drv: Update display devices from the desktop window thread.

Use a driver internal window message to dispatch updates to display devices from
the desktop window thread.
This commit is contained in:
Alexandros Frantzis 2023-04-24 17:29:43 +03:00 committed by Alexandre Julliard
parent 1a336a259c
commit 82c6becb04
5 changed files with 56 additions and 1 deletions

View file

@ -10,4 +10,5 @@ SOURCES = \
wayland.c \
wayland_output.c \
waylanddrv_main.c \
window.c \
xdg-output-unstable-v1.xml

View file

@ -119,7 +119,7 @@ static void maybe_init_display_devices(void)
/* We only update the display devices from the desktop process. */
if (GetCurrentProcessId() != desktop_pid) return;
wayland_init_display_devices(TRUE);
NtUserPostMessage(desktop_hwnd, WM_WAYLAND_INIT_DISPLAY_DEVICES, 0, 0);
}
static void wayland_output_mode_free_rb(struct rb_entry *entry, void *ctx)

View file

@ -46,6 +46,11 @@ extern struct wayland process_wayland DECLSPEC_HIDDEN;
* Definitions for wayland types
*/
enum wayland_window_message
{
WM_WAYLAND_INIT_DISPLAY_DEVICES = 0x80001000
};
struct wayland
{
BOOL initialized;
@ -107,5 +112,6 @@ void wayland_output_use_xdg_extension(struct wayland_output *output) DECLSPEC_HI
BOOL WAYLAND_UpdateDisplayDevices(const struct gdi_device_manager *device_manager,
BOOL force, void *param) DECLSPEC_HIDDEN;
LRESULT WAYLAND_WindowMessage(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) DECLSPEC_HIDDEN;
#endif /* __WINE_WAYLANDDRV_H */

View file

@ -32,6 +32,7 @@
static const struct user_driver_funcs waylanddrv_funcs =
{
.pUpdateDisplayDevices = WAYLAND_UpdateDisplayDevices,
.pWindowMessage = WAYLAND_WindowMessage
};
static NTSTATUS waylanddrv_unix_init(void *arg)

View file

@ -0,0 +1,47 @@
/*
* Wayland window handling
*
* Copyright 2020 Alexandros Frantzis for Collabora Ltd
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "config.h"
#include "waylanddrv.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(waylanddrv);
/**********************************************************************
* WAYLAND_WindowMessage
*/
LRESULT WAYLAND_WindowMessage(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
{
switch (msg)
{
case WM_WAYLAND_INIT_DISPLAY_DEVICES:
wayland_init_display_devices(TRUE);
return 0;
default:
FIXME("got window msg %x hwnd %p wp %lx lp %lx\n", msg, hwnd, (long)wp, lp);
return 0;
}
}