From: Rémi Bernon rbernon@codeweavers.com
--- dlls/desk.cpl/desk.rc | 1 + dlls/desk.cpl/main.c | 12 ++++++++++++ dlls/desk.cpl/resource.h | 1 + 3 files changed, 14 insertions(+)
diff --git a/dlls/desk.cpl/desk.rc b/dlls/desk.cpl/desk.rc index e4686a71efe..dfffed3466c 100644 --- a/dlls/desk.cpl/desk.rc +++ b/dlls/desk.cpl/desk.rc @@ -37,6 +37,7 @@ FONT 8, "Ms Shell Dlg" GROUPBOX "Virtual Desktop", IDC_VIRTUAL_DESKTOP, 10, 10, 300, 120 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 }
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL diff --git a/dlls/desk.cpl/main.c b/dlls/desk.cpl/main.c index 7e365424dfc..7dad563be16 100644 --- a/dlls/desk.cpl/main.c +++ b/dlls/desk.cpl/main.c @@ -233,6 +233,15 @@ static void handle_display_settings_change( HWND hwnd ) InvalidateRect( GetDlgItem( hwnd, IDC_VIRTUAL_DESKTOP ), NULL, TRUE ); }
+static void handle_display_settings_apply(void) +{ + struct device_entry *entry; + + LIST_FOR_EACH_ENTRY( entry, &devices, struct device_entry, entry ) + ChangeDisplaySettingsExW( entry->adapter.DeviceName, &entry->current, 0, CDS_UPDATEREGISTRY | CDS_NORESET, NULL ); + ChangeDisplaySettingsExW( NULL, NULL, 0, 0, NULL ); +} + 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 ); @@ -423,6 +432,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_DISPLAY_SETTINGS_APPLY: + handle_display_settings_apply(); + break; case IDC_DISPLAY_SETTINGS_RESET: refresh_device_list( hwnd ); InvalidateRect( hwnd, NULL, TRUE ); diff --git a/dlls/desk.cpl/resource.h b/dlls/desk.cpl/resource.h index 2d30fa06a6f..03ff9c1e0b2 100644 --- a/dlls/desk.cpl/resource.h +++ b/dlls/desk.cpl/resource.h @@ -39,5 +39,6 @@ #define IDC_VIRTUAL_DESKTOP 2000 #define IDC_DISPLAY_SETTINGS_LIST 2001 #define IDC_DISPLAY_SETTINGS_RESET 2002 +#define IDC_DISPLAY_SETTINGS_APPLY 2003
#define ICO_MAIN 100