This is a heavily simplified version of Michael Müller's staging patch (the staging version got broken by the PE/Unix split)
I rebased that staging patch but I thought it was too big for what it does (so I did this instead)
As for automatically changing the status, SM_MEDIACENTER would require Windows version checks (which are never used in Wine) and SM_TABLETPC would likely require touchscreen/tablet detection (rbernon is working on some touch stuff so that could be useful)
-- v2: win32u: Enable the media center metric by default. win32u: Add registry key for changing tablet status.
From: Aida Jonikienė aidas957@gmail.com
Some applications expect the tablet PC metric to return a positive value (so add an option to set that).
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=18732 --- dlls/win32u/sysparams.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 1106c265402..bbdccce1fbf 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -148,6 +148,7 @@ static INT64 last_query_display_time; static pthread_mutex_t display_lock = PTHREAD_MUTEX_INITIALIZER;
BOOL decorated_mode = TRUE; +BOOL tabletpc_mode = FALSE; UINT64 thunk_lock_callback = 0;
#define VIRTUAL_HMONITOR ((HMONITOR)(UINT_PTR)(0x10000 + 1)) @@ -4936,6 +4937,8 @@ void sysparams_init(void) grab_fullscreen = IS_OPTION_TRUE( buffer[0] ); if (!get_config_key( hkey, appkey, "Decorated", buffer, sizeof(buffer) )) decorated_mode = IS_OPTION_TRUE( buffer[0] ); + if (!get_config_key( hkey, appkey, "TabletPC", buffer, sizeof(buffer) )) + tabletpc_mode = IS_OPTION_TRUE( buffer[0] );
#undef IS_OPTION_TRUE } @@ -6103,6 +6106,7 @@ int get_system_metrics( int index ) case SM_CYFOCUSBORDER: return 1; case SM_TABLETPC: + return tabletpc_mode; case SM_MEDIACENTER: return 0; case SM_CMETRICS:
From: Aida Jonikienė aidas957@gmail.com
Very few applications likely check for this status metric (so it should be safe to enable it by default). --- dlls/win32u/sysparams.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index bbdccce1fbf..d4371dd914f 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -6108,7 +6108,7 @@ int get_system_metrics( int index ) case SM_TABLETPC: return tabletpc_mode; case SM_MEDIACENTER: - return 0; + return 1; case SM_CMETRICS: return SM_CMETRICS; default:
On Sat Aug 24 16:39:36 2024 +0000, Aida Jonikienė wrote:
I guess some application could see that the media center property is enabled and try to do some stuff that fails (but that's an unlikely case) so I can probably set it to 1 by default
I set that metric to 1 in the updated MR (I had to go back to it because it had merge conflicts)