[PATCH 0/1] MR11573: server: Initialize window monitor DPI with the system DPI.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=60023 --- This isn't fully correct as initial window DPI should be its monitor DPI in case of monitor aware windows, but it's enough to fix the regression which is about non-default system DPI. Fwiw there's also some bug with child window DPI propagation when reparented which I will fix separately, although that hasn't been reported to cause regression yet. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11573
From: Rémi Bernon <rbernon@codeweavers.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=60023 --- dlls/win32u/sysparams.c | 1 + server/protocol.def | 1 + server/user.h | 1 + server/window.c | 4 ++-- server/winstation.c | 2 ++ 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index fa22d6294c0..db295620b9e 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -2481,6 +2481,7 @@ static void set_winstation_monitors( BOOL increment ) SERVER_START_REQ( set_winstation_monitors ) { req->increment = increment; + req->system_dpi = system_dpi; wine_server_add_data( req, infos, count * sizeof(*infos) ); if (!wine_server_call( req )) monitor_update_serial = reply->serial; } diff --git a/server/protocol.def b/server/protocol.def index 1399b694ed2..96a17508e68 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -3001,6 +3001,7 @@ enum coords_relative /* Update the process current window station monitors */ @REQ(set_winstation_monitors) int increment; /* force increment the monitor update counter */ + unsigned int system_dpi; /* current system DPI value */ VARARG(infos,monitor_infos); /* window station monitors */ @REPLY unsigned __int64 serial; /* winstation monitor update counter */ diff --git a/server/user.h b/server/user.h index d002b8d6b88..d508ba7d9eb 100644 --- a/server/user.h +++ b/server/user.h @@ -201,6 +201,7 @@ extern client_ptr_t get_class_client_ptr( struct window_class *class ); /* windows station functions */ +extern unsigned int system_dpi; extern struct winstation *get_visible_winstation(void); extern struct desktop *get_input_desktop( struct winstation *winstation ); extern int set_input_desktop( struct winstation *winstation, struct desktop *new_desktop ); diff --git a/server/window.c b/server/window.c index fb5e310cec0..8830035cc34 100644 --- a/server/window.c +++ b/server/window.c @@ -677,9 +677,9 @@ static struct window *create_window( struct window *parent, struct window *owner shared->dpi_context = NTUSER_DPI_PER_MONITOR_AWARE; shared->fnid = fnid; shared->private_size = private_size; - shared->dpi.num = USER_DEFAULT_SCREEN_DPI; + shared->dpi.num = system_dpi; shared->dpi.den = 1; - shared->raw_dpi.num = USER_DEFAULT_SCREEN_DPI; + shared->raw_dpi.num = system_dpi; shared->raw_dpi.den = 1; shared->extra_size = extra_size; memset( (void *)&shared->info, 0, sizeof(shared->info) ); diff --git a/server/winstation.c b/server/winstation.c index 3e410c54488..bb10a5f236c 100644 --- a/server/winstation.c +++ b/server/winstation.c @@ -41,6 +41,7 @@ #define DESKTOP_ALL_ACCESS 0x01ff +unsigned int system_dpi = USER_DEFAULT_SCREEN_DPI; static struct list winstation_list = LIST_INIT(winstation_list); struct winstation_init_data @@ -630,6 +631,7 @@ DECL_HANDLER(set_winstation_monitors) } SHARED_WRITE_END; } + system_dpi = req->system_dpi; if (size && (winstation->monitors = memdup( get_req_data(), size ))) winstation->monitor_count = size / sizeof(*winstation->monitors); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11573
participants (2)
-
Rémi Bernon -
Rémi Bernon (@rbernon)