From: Alexandros Frantzis alexandros.frantzis@collabora.com
Having access to the Wayland thread data will allow the desktop process to eventually access information that requires interaction with the Wayland compositor.
Signed-off-by: Alexandros Frantzis alexandros.frantzis@collabora.com --- dlls/winewayland.drv/Makefile.in | 1 + dlls/winewayland.drv/waylanddrv.h | 6 ++++ dlls/winewayland.drv/waylanddrv_main.c | 1 + dlls/winewayland.drv/window.c | 50 ++++++++++++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 dlls/winewayland.drv/window.c
diff --git a/dlls/winewayland.drv/Makefile.in b/dlls/winewayland.drv/Makefile.in index 6365ce4845c..627cda9b7d3 100644 --- a/dlls/winewayland.drv/Makefile.in +++ b/dlls/winewayland.drv/Makefile.in @@ -8,5 +8,6 @@ C_SRCS = \ wayland.c \ wayland_mutex.c \ waylanddrv_main.c \ + window.c \
RC_SRCS = version.rc diff --git a/dlls/winewayland.drv/waylanddrv.h b/dlls/winewayland.drv/waylanddrv.h index ee6ee2589a8..b9ea28be33c 100644 --- a/dlls/winewayland.drv/waylanddrv.h +++ b/dlls/winewayland.drv/waylanddrv.h @@ -111,4 +111,10 @@ void wayland_mutex_destroy(struct wayland_mutex *wayland_mutex) DECLSPEC_HIDDEN; void wayland_mutex_lock(struct wayland_mutex *wayland_mutex) DECLSPEC_HIDDEN; void wayland_mutex_unlock(struct wayland_mutex *wayland_mutex) DECLSPEC_HIDDEN;
+/********************************************************************** + * USER driver functions + */ + +BOOL WAYLAND_CreateWindow(HWND hwnd) DECLSPEC_HIDDEN; + #endif /* __WINE_WAYLANDDRV_H */ diff --git a/dlls/winewayland.drv/waylanddrv_main.c b/dlls/winewayland.drv/waylanddrv_main.c index 787d837cc0b..f4d2a8b32ac 100644 --- a/dlls/winewayland.drv/waylanddrv_main.c +++ b/dlls/winewayland.drv/waylanddrv_main.c @@ -83,6 +83,7 @@ static void WAYLAND_ThreadDetach(void)
static const struct user_driver_funcs waylanddrv_funcs = { + .pCreateWindow = WAYLAND_CreateWindow, .pThreadDetach = WAYLAND_ThreadDetach, };
diff --git a/dlls/winewayland.drv/window.c b/dlls/winewayland.drv/window.c new file mode 100644 index 00000000000..002f15157bd --- /dev/null +++ b/dlls/winewayland.drv/window.c @@ -0,0 +1,50 @@ +/* + * Window related functions + * + * 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" + +#include "ntuser.h" + +WINE_DEFAULT_DEBUG_CHANNEL(waylanddrv); + +/********************************************************************** + * WAYLAND_CreateWindow + */ +BOOL WAYLAND_CreateWindow(HWND hwnd) +{ + TRACE("%p\n", hwnd); + + if (hwnd == NtUserGetDesktopWindow()) + { + /* Initialize wayland so that the desktop process has access + * to all the wayland related information (e.g., displays). */ + wayland_init_thread_data(); + } + + return TRUE; +}