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)
From: Aida Jonikienė aidas957@gmail.com
Some applications expect the tablet PC/media center metrics 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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index a31d586a5b6..d00d73074a1 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -280,6 +280,8 @@ static struct list monitors = LIST_INIT(monitors); static INT64 last_query_display_time; static pthread_mutex_t display_lock = PTHREAD_MUTEX_INITIALIZER;
+BOOL enable_mediacenter = FALSE; +BOOL enable_tabletpc = FALSE; BOOL enable_thunk_lock = FALSE;
#define VIRTUAL_HMONITOR ((HMONITOR)(UINT_PTR)(0x10000 + 1)) @@ -4823,6 +4825,10 @@ void sysparams_init(void) grab_pointer = IS_OPTION_TRUE( buffer[0] ); if (!get_config_key( hkey, appkey, "GrabFullscreen", buffer, sizeof(buffer) )) grab_fullscreen = IS_OPTION_TRUE( buffer[0] ); + if (!get_config_key( hkey, appkey, "TabletPC", buffer, sizeof(buffer) )) + enable_tabletpc = IS_OPTION_TRUE( buffer[0] ); + if (!get_config_key( hkey, appkey, "MediaCenter", buffer, sizeof(buffer) )) + enable_mediacenter = IS_OPTION_TRUE( buffer[0] );
#undef IS_OPTION_TRUE } @@ -5987,7 +5993,7 @@ int get_system_metrics( int index ) return 1; case SM_TABLETPC: case SM_MEDIACENTER: - return 0; + return (index == SM_TABLETPC) ? enable_tabletpc : enable_mediacenter; case SM_CMETRICS: return SM_CMETRICS; default:
As for automatically changing the status, SM_MEDIACENTER would require Windows version checks (which are never used in Wine)
If SM_MEDIACENTER is fundamentally a version check, I don't see why that would be the wrong thing to do here?
SM_TABLETPC would likely require touchscreen/tablet detection (rbernon is working on some touch stuff so that could be useful)
Having a tablet attached isn't the same thing as being a tablet, though.
``` case SM_TABLETPC: case SM_MEDIACENTER: - return 0; + return (index == SM_TABLETPC) ? enable_tabletpc : enable_mediacenter; ```
Why not just make these two separate cases?
On Thu Mar 7 11:08:14 2024 +0000, Zebediah Figura wrote:
As for automatically changing the status, SM_MEDIACENTER would require
Windows version checks (which are never used in Wine) If SM_MEDIACENTER is fundamentally a version check, I don't see why that would be the wrong thing to do here?
SM_TABLETPC would likely require touchscreen/tablet detection (rbernon
is working on some touch stuff so that could be useful) Having a tablet attached isn't the same thing as being a tablet, though.
case SM_TABLETPC: case SM_MEDIACENTER: - return 0; + return (index == SM_TABLETPC) ? enable_tabletpc : enable_mediacenter;
Why not just make these two separate cases?
TestBot testing reveals that SM_MEDIACENTER is also set to 1 on Windows Vista and 7 (which both have Media Center included in the pricier editions) but not Windows 8 and later (which don't have it by default): https://testbot.winehq.org/JobDetails.pl?Key=143821
So I guess Windows is checking the Media Center installation status (checking for components that don't exist on Wine is uncommon but d3d11 loads a non-existent library for D3D_DRIVER_TYPE_REFERENCE so I guess it isn't too out of scope)
I also tried looking for tablet PC detection on Linux but I only got results for digitizer detection (which would cause a regular desktop with a drawing tablet attached to be considered a tablet); I wonder what Windows returns if there's a drawing tablet attached to an ordinary desktop
And I can split those 2 cases if you want :frog:
TestBot testing reveals that SM_MEDIACENTER is also set to 1 on Windows Vista and 7 (which both have Media Center included in the pricier editions) but not Windows 8 and later (which don't have it by default): https://testbot.winehq.org/JobDetails.pl?Key=143821
Actually, for that matter, if Media Center is just an advanced feature, is there any reason not to always return 1 here?
Actually, is there any evidence that any application even cares about SM_MEDIACENTER? Bug 18732 only mentions SM_TABLETPC.
On Mon Mar 25 17:55:38 2024 +0000, Zebediah Figura wrote:
TestBot testing reveals that SM_MEDIACENTER is also set to 1 on
Windows Vista and 7 (which both have Media Center included in the pricier editions) but not Windows 8 and later (which don't have it by default): https://testbot.winehq.org/JobDetails.pl?Key=143821 Actually, for that matter, if Media Center is just an advanced feature, is there any reason not to always return 1 here?
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
On Mon Mar 25 17:56:44 2024 +0000, Zebediah Figura wrote:
Actually, is there any evidence that any application even cares about SM_MEDIACENTER? Bug 18732 only mentions SM_TABLETPC.
I'm not aware of any application that checks for it (this MR is a simplified version of the user32-GetSystemMetrics staging patchset)