desk.cpl: Expose the modesetting emulation registry setting.

This commit is contained in:
Rémi Bernon 2024-09-30 17:11:28 +02:00 committed by Alexandre Julliard
parent 21623338ab
commit 3eb74f9ee8
Notes: Alexandre Julliard 2024-11-12 22:01:56 +01:00
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/wine/merge_requests/6804
54 changed files with 241 additions and 1 deletions

View file

@ -1,5 +1,5 @@
MODULE = desk.cpl
IMPORTS = ole32 comctl32 user32 gdi32
IMPORTS = advapi32 ole32 comctl32 user32 gdi32
SOURCES = \
desk.rc \

View file

@ -38,6 +38,7 @@ FONT 8, "Ms Shell Dlg"
COMBOBOX IDC_DISPLAY_SETTINGS_LIST, 10, 136, 160, 60, CBS_DROPDOWNLIST | CBS_HASSTRINGS
PUSHBUTTON "&Reset", IDC_DISPLAY_SETTINGS_RESET, 180, 135, 60, 15
PUSHBUTTON "&Apply", IDC_DISPLAY_SETTINGS_APPLY, 250, 135, 60, 15
AUTOCHECKBOX "Emulate display mode changes (requires restart)", IDC_EMULATE_MODESET, 10, 155, 300, 10
}
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL

View file

@ -242,6 +242,39 @@ static void handle_display_settings_apply(void)
ChangeDisplaySettingsExW( NULL, NULL, 0, 0, NULL );
}
static void handle_emulate_modeset_change( HWND hwnd )
{
const WCHAR *value = L"N";
HKEY hkey;
/* Registry key can be found in HKCU\Software\Wine\X11 Driver */
if (!RegCreateKeyExW( HKEY_CURRENT_USER, L"Software\\Wine\\X11 Driver", 0, NULL, 0,
KEY_SET_VALUE, NULL, &hkey, NULL ))
{
if (IsDlgButtonChecked( hwnd, IDC_EMULATE_MODESET ) == BST_CHECKED) value = L"Y";
RegSetValueExW( hkey, L"EmulateModeset", 0, REG_SZ, (BYTE *)value, (wcslen( value ) + 1) * sizeof(WCHAR) );
RegCloseKey( hkey );
}
}
static BOOL get_option( const WCHAR *option, BOOL default_value )
{
BOOL ret = default_value;
WCHAR buffer[MAX_PATH];
DWORD size = sizeof(buffer);
#define IS_OPTION_TRUE(ch) \
((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1')
/* Registry key can be found in HKCU\Software\Wine\X11 Driver */
if (!RegGetValueW( HKEY_CURRENT_USER, L"Software\\Wine\\X11 Driver", option, RRF_RT_REG_SZ, NULL,
(BYTE *)buffer, &size ))
ret = IS_OPTION_TRUE(buffer[0]);
#undef IS_OPTION_TRUE
return ret;
}
static RECT map_virtual_client_rect( RECT rect, RECT client_rect, RECT virtual_rect, float scale )
{
OffsetRect( &rect, -(virtual_rect.left + virtual_rect.right) / 2, -(virtual_rect.top + virtual_rect.bottom) / 2 );
@ -424,6 +457,8 @@ static INT_PTR CALLBACK desktop_dialog_proc( HWND hwnd, UINT msg, WPARAM wparam,
case WM_INITDIALOG:
refresh_device_list( hwnd );
create_desktop_view( hwnd );
SendMessageW( GetDlgItem( hwnd, IDC_EMULATE_MODESET ), BM_SETCHECK,
get_option( L"EmulateModeset", FALSE ), 0 );
return TRUE;
case WM_COMMAND:
@ -432,6 +467,9 @@ static INT_PTR CALLBACK desktop_dialog_proc( HWND hwnd, UINT msg, WPARAM wparam,
case MAKEWPARAM( IDC_DISPLAY_SETTINGS_LIST, CBN_SELCHANGE ):
handle_display_settings_change( hwnd );
break;
case IDC_EMULATE_MODESET:
handle_emulate_modeset_change( hwnd );
break;
case IDC_DISPLAY_SETTINGS_APPLY:
handle_display_settings_apply();
break;

View file

@ -40,5 +40,6 @@
#define IDC_DISPLAY_SETTINGS_LIST 2001
#define IDC_DISPLAY_SETTINGS_RESET 2002
#define IDC_DISPLAY_SETTINGS_APPLY 2003
#define IDC_EMULATE_MODESET 2004
#define ICO_MAIN 100

View file

@ -3184,6 +3184,10 @@ msgstr "سطح المكتب"
msgid "&Reset"
msgstr "إعادة الضبط"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3160,6 +3160,10 @@ msgstr "Escritoriu"
msgid "&Reset"
msgstr "&Reafitar"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3162,6 +3162,10 @@ msgstr "Работен плот"
msgid "&Reset"
msgstr "&Възстанови"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
msgid "Display Settings"

View file

@ -3184,6 +3184,10 @@ msgstr "Escriptori"
msgid "&Reset"
msgstr "&Reinicia"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3131,6 +3131,10 @@ msgstr "Plocha"
msgid "&Reset"
msgstr "Restart"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3211,6 +3211,10 @@ msgstr "Skrivebord"
msgid "&Reset"
msgstr "Nulstil"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3174,6 +3174,10 @@ msgstr "Desktop"
msgid "&Reset"
msgstr "&Reset"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3106,6 +3106,10 @@ msgstr "Επιφάνεια Εργασίας"
msgid "&Reset"
msgstr "Ε&παναφορά"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
msgid "Display Settings"

View file

@ -3159,6 +3159,10 @@ msgstr "Virtual Desktop"
msgid "&Reset"
msgstr "&Reset"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr "Emulate display mode changes (requires restart)"
#: dlls/desk.cpl/desk.rc:29
msgid "Display Settings"
msgstr "Display Settings"

View file

@ -3159,6 +3159,10 @@ msgstr "Virtual Desktop"
msgid "&Reset"
msgstr "&Reset"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr "Emulate display mode changes (requires restart)"
#: dlls/desk.cpl/desk.rc:29
msgid "Display Settings"
msgstr "Display Settings"

View file

@ -3110,6 +3110,10 @@ msgstr "Labortablo"
msgid "&Reset"
msgstr "R&estarigi"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3185,6 +3185,10 @@ msgstr "Escritorio"
msgid "&Reset"
msgstr "&Resetear"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3138,6 +3138,10 @@ msgstr "ذخیره &به نام..."
msgid "&Reset"
msgstr ""
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
msgid "Display Settings"
msgstr ""

View file

@ -3158,6 +3158,10 @@ msgstr "Winen Työpöytä"
msgid "&Reset"
msgstr "&Nollaa"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3190,6 +3190,10 @@ msgstr "Bureau"
msgid "&Reset"
msgstr "&Réinitialiser"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3177,6 +3177,10 @@ msgstr "שולחן העבודה"
msgid "&Reset"
msgstr "&איפוס"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
msgid "Display Settings"

View file

@ -3079,6 +3079,10 @@ msgstr ""
msgid "&Reset"
msgstr ""
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
msgid "Display Settings"
msgstr ""

View file

@ -3185,6 +3185,10 @@ msgstr "Radna površina"
msgid "&Reset"
msgstr "Poništi"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3225,6 +3225,10 @@ msgstr "Asztal"
msgid "&Reset"
msgstr "Újraindítás"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3235,6 +3235,10 @@ msgstr "Scrivania"
msgid "&Reset"
msgstr "Resetta"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3161,6 +3161,10 @@ msgstr "デスクトップ"
msgid "&Reset"
msgstr "リセット(&R)"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3157,6 +3157,10 @@ msgstr "სამუშაო მაგიდა"
msgid "&Reset"
msgstr "&საწყისი მნიშვნელობებზე დაბრუნება"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3149,6 +3149,10 @@ msgstr "바탕 화면"
msgid "&Reset"
msgstr "초기화(&R)"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3164,6 +3164,10 @@ msgstr "Virtualus darbalaukis"
msgid "&Reset"
msgstr "&Atkurti"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
msgid "Display Settings"
msgstr "Rodymo nuostatos"

View file

@ -3081,6 +3081,10 @@ msgstr ""
msgid "&Reset"
msgstr ""
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
msgid "Display Settings"
msgstr ""

View file

@ -3176,6 +3176,10 @@ msgstr "Skrivebord"
msgid "&Reset"
msgstr "Tilbakestill"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3172,6 +3172,10 @@ msgstr "Virtueel Bureaublad"
msgid "&Reset"
msgstr "&Terugzetten"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
msgid "Display Settings"
msgstr "Beeldscherm Instellingen"

View file

@ -3079,6 +3079,10 @@ msgstr ""
msgid "&Reset"
msgstr ""
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
msgid "Display Settings"
msgstr ""

View file

@ -3079,6 +3079,10 @@ msgstr ""
msgid "&Reset"
msgstr ""
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
msgid "Display Settings"
msgstr ""

View file

@ -3185,6 +3185,10 @@ msgstr "Pulpit"
msgid "&Reset"
msgstr "Wyze&ruj"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3179,6 +3179,10 @@ msgstr "Área de Trabalho"
msgid "&Reset"
msgstr "&Reiniciar"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3213,6 +3213,10 @@ msgstr "Área de trabalho"
msgid "&Reset"
msgstr "Reinicializar"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3105,6 +3105,10 @@ msgstr "Wine ag<61>d"
msgid "&Reset"
msgstr ""
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
msgid "Display Settings"
msgstr ""

View file

@ -3182,6 +3182,10 @@ msgstr "Birou"
msgid "&Reset"
msgstr "Resetează"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3185,6 +3185,10 @@ msgstr "Рабочий стол"
msgid "&Reset"
msgstr "Сброс"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3118,6 +3118,10 @@ msgstr "වැඩතලය"
msgid "&Reset"
msgstr "නැවත සකසන්න"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3137,6 +3137,10 @@ msgstr "Pracovná plocha"
msgid "&Reset"
msgstr "Vynulovať"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "System Settings"

View file

@ -3229,6 +3229,10 @@ msgstr "Namizje"
msgid "&Reset"
msgstr "Ponastavi"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3175,6 +3175,10 @@ msgstr "Радна површина"
msgid "&Reset"
msgstr "&Поништи"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
msgid "Display Settings"

View file

@ -3259,6 +3259,10 @@ msgstr "Radna površina"
msgid "&Reset"
msgstr "&Poništi"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3192,6 +3192,10 @@ msgstr "Skrivbord"
msgid "&Reset"
msgstr "Återställa"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3110,6 +3110,10 @@ msgstr "Wine உதவி"
msgid "&Reset"
msgstr "மீட்டமை (&E)"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
msgid "Display Settings"
msgstr ""

View file

@ -3079,6 +3079,10 @@ msgstr ""
msgid "&Reset"
msgstr ""
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
msgid "Display Settings"
msgstr ""

View file

@ -3125,6 +3125,10 @@ msgstr "พื้นที่ทำงาน"
msgid "&Reset"
msgstr "แก้ออก"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
msgid "Display Settings"
msgstr ""

View file

@ -3166,6 +3166,10 @@ msgstr "Masaüstü"
msgid "&Reset"
msgstr "&Sıfırla"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3171,6 +3171,10 @@ msgstr "Стільниця"
msgid "&Reset"
msgstr "&Скинути"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3133,6 +3133,10 @@ msgstr "Aidance di Wine"
msgid "&Reset"
msgstr "&Rifé"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
msgid "Display Settings"
msgstr ""

View file

@ -3045,6 +3045,10 @@ msgstr ""
msgid "&Reset"
msgstr ""
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
msgid "Display Settings"
msgstr ""

View file

@ -3119,6 +3119,10 @@ msgstr "桌面"
msgid "&Reset"
msgstr "重置(&R)"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"

View file

@ -3126,6 +3126,10 @@ msgstr "桌面"
msgid "&Reset"
msgstr "重設(&R)"
#: dlls/desk.cpl/desk.rc:42
msgid "Emulate display mode changes (requires restart)"
msgstr ""
#: dlls/desk.cpl/desk.rc:29
#, fuzzy
#| msgid "Default Settings"