Skip to content

Commit

Permalink
9.15-2 patchset
Browse files Browse the repository at this point in the history
rebase; fix disable IME envvar, add new wayland-childwindow patchset, improve cursor clipping hack (again), add a ton of winex11 patches (rbernon) and improve gnome 60hz bug fix patch (0003-winex11-Xshape-GNOME-workaround.patch)
  • Loading branch information
whrvt committed Aug 16, 2024
1 parent f5ddea9 commit 0e363ec
Show file tree
Hide file tree
Showing 97 changed files with 5,903 additions and 1,527 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@ Subject: [PATCH 1/7] server: Pass window's per-monitor DPI in set_window_pos.
3 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c
index caa3b3aa323..193e7212e02 100644
index 44d96ea27b9..95d333dffd5 100644
--- a/dlls/win32u/window.c
+++ b/dlls/win32u/window.c
@@ -1793,6 +1793,7 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags,
BOOL ret, needs_update = FALSE;
RECT old_visible_rect, old_window_rect, old_client_rect, extra_rects[3];
@@ -1948,6 +1948,7 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru
struct window_rects old_rects;
RECT extra_rects[3];
struct window_surface *old_surface;
+ UINT monitor_dpi;

get_window_rects( hwnd, COORDS_SCREEN, &old_window_rect, NULL, get_thread_dpi() );
if (IsRectEmpty( &valid_rects[0] )) valid_rects = NULL;
@@ -1834,11 +1835,14 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags,
is_layered = new_surface && new_surface->alpha_mask;

@@ -1965,11 +1966,14 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru
valid_rects = NULL;
}

+ monitor_dpi = get_monitor_dpi( monitor_from_rect( window_rect, MONITOR_DEFAULTTONEAREST, get_thread_dpi() ) );
+ monitor_dpi = get_monitor_dpi( monitor_from_rect( &new_rects->window, MONITOR_DEFAULTTONEAREST, get_thread_dpi() ) );
+
SERVER_START_REQ( set_window_pos )
{
req->handle = wine_server_user_handle( hwnd );
req->previous = wine_server_user_handle( insert_after );
req->swp_flags = swp_flags;
+ req->monitor_dpi = monitor_dpi;
req->window = wine_server_rectangle( *window_rect );
req->client = wine_server_rectangle( *client_rect );
if (!EqualRect( window_rect, &visible_rect ) || new_surface || valid_rects)
req->window = wine_server_rectangle( new_rects->window );
req->client = wine_server_rectangle( new_rects->client );
if (!EqualRect( &new_rects->window, &new_rects->visible ) || new_surface || valid_rects)
diff --git a/server/protocol.def b/server/protocol.def
index 25184641082..173368df6eb 100644
--- a/server/protocol.def
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
From 719de91abf6e5cf328adc0402f87957664537e01 Mon Sep 17 00:00:00 2001
From: Alexandros Frantzis <[email protected]>
Date: Thu, 11 Jul 2024 14:47:41 +0300
Subject: [PATCH 1/7] winewayland: Store all window rects in wayland_win_data.

This allows wayland_win_data_update_wayland_surface() to be called
outside of WAYLAND_WindowPosChange, which will be needed in upcoming
commits.
---
dlls/winewayland.drv/waylanddrv.h | 5 +----
dlls/winewayland.drv/window.c | 26 ++++++++++++--------------
2 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/dlls/winewayland.drv/waylanddrv.h b/dlls/winewayland.drv/waylanddrv.h
index 5bde94a0ac9..3ac3865efd2 100644
--- a/dlls/winewayland.drv/waylanddrv.h
+++ b/dlls/winewayland.drv/waylanddrv.h
@@ -290,10 +290,7 @@ struct wayland_win_data
struct wayland_surface *wayland_surface;
/* wine window_surface backing this window */
struct window_surface *window_surface;
- /* USER window rectangle relative to win32 parent window client area */
- RECT window_rect;
- /* USER client rectangle relative to win32 parent window client area */
- RECT client_rect;
+ struct window_rects rects;
BOOL managed;
};

diff --git a/dlls/winewayland.drv/window.c b/dlls/winewayland.drv/window.c
index 233ca0e5a62..9e228b779f9 100644
--- a/dlls/winewayland.drv/window.c
+++ b/dlls/winewayland.drv/window.c
@@ -76,9 +76,7 @@ static struct rb_tree win_data_rb = { wayland_win_data_cmp_rb };
*
* Create a data window structure for an existing window.
*/
-static struct wayland_win_data *wayland_win_data_create(HWND hwnd,
- const RECT *window_rect,
- const RECT *client_rect)
+static struct wayland_win_data *wayland_win_data_create(HWND hwnd, struct window_rects *rects)
{
struct wayland_win_data *data;
struct rb_entry *rb_entry;
@@ -92,8 +90,7 @@ static struct wayland_win_data *wayland_win_data_create(HWND hwnd,
if (!(data = calloc(1, sizeof(*data)))) return NULL;

data->hwnd = hwnd;
- data->window_rect = *window_rect;
- data->client_rect = *client_rect;
+ data->rects = *rects;

pthread_mutex_lock(&win_data_mutex);

@@ -167,8 +164,8 @@ static void wayland_win_data_get_config(struct wayland_win_data *data,
enum wayland_surface_config_state window_state = 0;
DWORD style;

- conf->rect = data->window_rect;
- conf->client_rect = data->client_rect;
+ conf->rect = data->rects.window;
+ conf->client_rect = data->rects.client;
style = NtUserGetWindowLongW(data->hwnd, GWL_STYLE);

TRACE("window=%s style=%#lx\n", wine_dbgstr_rect(&conf->rect), (long)style);
@@ -200,14 +197,14 @@ static void reapply_cursor_clipping(void)
NtUserSetThreadDpiAwarenessContext(context);
}

-static void wayland_win_data_update_wayland_surface(struct wayland_win_data *data, const RECT *visible_rect)
+static void wayland_win_data_update_wayland_surface(struct wayland_win_data *data)
{
struct wayland_surface *surface = data->wayland_surface;
HWND parent = NtUserGetAncestor(data->hwnd, GA_PARENT);
BOOL visible, xdg_visible;
WCHAR text[1024];

- TRACE("hwnd=%p, rect=%s\n", data->hwnd, wine_dbgstr_rect(visible_rect));
+ TRACE("hwnd=%p\n", data->hwnd);

/* We don't want wayland surfaces for child windows. */
if (parent != NtUserGetDesktopWindow() && parent != 0)
@@ -251,7 +248,8 @@ static void wayland_win_data_update_wayland_surface(struct wayland_win_data *dat
pthread_mutex_unlock(&surface->mutex);

if (data->window_surface)
- wayland_window_surface_update_wayland_surface(data->window_surface, visible_rect, surface);
+ wayland_window_surface_update_wayland_surface(data->window_surface,
+ &data->rects.visible, surface);

/* Size/position changes affect the effective pointer constraint, so update
* it as needed. */
@@ -433,7 +431,8 @@ BOOL WAYLAND_WindowPosChanging(HWND hwnd, UINT swp_flags, BOOL shaped, struct wi

TRACE("hwnd %p, swp_flags %04x, shaped %u, rects %s\n", hwnd, swp_flags, shaped, debugstr_window_rects(rects));

- if (!data && !(data = wayland_win_data_create(hwnd, &rects->window, &rects->client))) return FALSE; /* use default surface */
+ if (!data && !(data = wayland_win_data_create(hwnd, rects))) return FALSE;
+
wayland_win_data_release(data);

return TRUE;
@@ -458,15 +457,14 @@ void WAYLAND_WindowPosChanged(HWND hwnd, HWND insert_after, UINT swp_flags, cons

if (!(data = wayland_win_data_get(hwnd))) return;

- data->window_rect = new_rects->window;
- data->client_rect = new_rects->client;
+ data->rects = *new_rects;
data->managed = managed;

if (surface) window_surface_add_ref(surface);
if (data->window_surface) window_surface_release(data->window_surface);
data->window_surface = surface;

- wayland_win_data_update_wayland_surface(data, &new_rects->visible);
+ wayland_win_data_update_wayland_surface(data);
if (data->wayland_surface) wayland_win_data_update_wayland_state(data);

wayland_win_data_release(data);
--
2.46.0

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
From 8fb239e8dda6305bc059e650443593d83e703f6e Mon Sep 17 00:00:00 2001
From 7bcbaa02ba4035cab9cc42c793487bd2cf8dec59 Mon Sep 17 00:00:00 2001
From: Alexandros Frantzis <[email protected]>
Date: Thu, 11 Jul 2024 17:36:39 +0300
Subject: [PATCH 2/8] winewayland: Create subsurfaces for child windows.
Subject: [PATCH 2/7] winewayland: Create subsurfaces for child windows.

Create (possibly nested) Wayland subsurfaces for all child windows,
to allow GL/VK contents to be presented onto them.
---
dlls/winewayland.drv/wayland_surface.c | 61 +++++++++++++++++++++++
dlls/winewayland.drv/waylanddrv.h | 12 +++++
dlls/winewayland.drv/window.c | 69 +++++++++++++++++---------
3 files changed, 119 insertions(+), 23 deletions(-)
dlls/winewayland.drv/window.c | 67 +++++++++++++++++---------
3 files changed, 117 insertions(+), 23 deletions(-)

diff --git a/dlls/winewayland.drv/wayland_surface.c b/dlls/winewayland.drv/wayland_surface.c
index 39c3976cdfd..de3307ec51e 100644
Expand Down Expand Up @@ -109,7 +109,7 @@ index 39c3976cdfd..de3307ec51e 100644
/* Ensure no buffer is attached, otherwise future role assignments may fail. */
wl_surface_attach(surface->wl_surface, NULL, 0, 0);
diff --git a/dlls/winewayland.drv/waylanddrv.h b/dlls/winewayland.drv/waylanddrv.h
index c25f5775762..87d071707a8 100644
index 3ac3865efd2..22e8b27df82 100644
--- a/dlls/winewayland.drv/waylanddrv.h
+++ b/dlls/winewayland.drv/waylanddrv.h
@@ -73,6 +73,13 @@ enum wayland_surface_config_state
Expand Down Expand Up @@ -153,10 +153,10 @@ index c25f5775762..87d071707a8 100644
void wayland_surface_attach_shm(struct wayland_surface *surface,
struct wayland_shm_buffer *shm_buffer,
diff --git a/dlls/winewayland.drv/window.c b/dlls/winewayland.drv/window.c
index fda7139283f..9be98363ac8 100644
index 9e228b779f9..9d0e649f9d6 100644
--- a/dlls/winewayland.drv/window.c
+++ b/dlls/winewayland.drv/window.c
@@ -134,19 +134,32 @@ static void wayland_win_data_destroy(struct wayland_win_data *data)
@@ -129,19 +129,32 @@ static void wayland_win_data_destroy(struct wayland_win_data *data)
}

/***********************************************************************
Expand Down Expand Up @@ -194,14 +194,14 @@ index fda7139283f..9be98363ac8 100644
pthread_mutex_unlock(&win_data_mutex);

return NULL;
@@ -205,38 +218,42 @@ static void reapply_cursor_clipping(void)
@@ -200,38 +213,40 @@ static void reapply_cursor_clipping(void)
static void wayland_win_data_update_wayland_surface(struct wayland_win_data *data)
{
struct wayland_surface *surface = data->wayland_surface;
- HWND parent = NtUserGetAncestor(data->hwnd, GA_PARENT);
- BOOL visible, xdg_visible;
+ struct wayland_win_data *parent_data;
+ enum wayland_surface_role role;
+ enum wayland_surface_role role = WAYLAND_SURFACE_ROLE_NONE;
WCHAR text[1024];

TRACE("hwnd=%p\n", data->hwnd);
Expand All @@ -216,13 +216,11 @@ index fda7139283f..9be98363ac8 100644
- surface = NULL;
- goto out;
+ parent_data = wayland_win_data_get_nolock(NtUserGetAncestor(data->hwnd, GA_PARENT));
+ if (parent_data && parent_data->wayland_surface)
+ role = WAYLAND_SURFACE_ROLE_SUBSURFACE;
+ else
+ if (!parent_data)
+ role = WAYLAND_SURFACE_ROLE_TOPLEVEL;
+ else if (parent_data->wayland_surface)
+ role = WAYLAND_SURFACE_ROLE_SUBSURFACE;
}
+ else
+ role = WAYLAND_SURFACE_ROLE_NONE;

- /* Otherwise ensure that we have a wayland surface. */
- if (!surface && !(surface = wayland_surface_create(data->hwnd))) return;
Expand Down Expand Up @@ -255,7 +253,7 @@ index fda7139283f..9be98363ac8 100644
{
wayland_surface_make_toplevel(surface);
if (surface->xdg_toplevel)
@@ -246,6 +263,12 @@ static void wayland_win_data_update_wayland_surface(struct wayland_win_data *dat
@@ -241,6 +256,12 @@ static void wayland_win_data_update_wayland_surface(struct wayland_win_data *dat
wayland_surface_set_title(surface, text);
}
}
Expand Down
Loading

0 comments on commit 0e363ec

Please sign in to comment.