Commit e180cd95 authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

Screen depth cannot be selected when double buffering is enabled.

Disable depth selection when it's the case.
parent 9f859692
...@@ -95,21 +95,9 @@ static void update_gui_for_desktop_mode(HWND dialog) { ...@@ -95,21 +95,9 @@ static void update_gui_for_desktop_mode(HWND dialog) {
updating_ui = FALSE; updating_ui = FALSE;
} }
static void init_dialog (HWND dialog) static void init_screen_depth(HWND dialog)
{ {
unsigned int it;
char* buf; char* buf;
update_gui_for_desktop_mode(dialog);
updating_ui = TRUE;
SendDlgItemMessage(dialog, IDC_SCREEN_DEPTH, CB_RESETCONTENT, 0, 0);
SendDlgItemMessage(dialog, IDC_SCREEN_DEPTH, CB_ADDSTRING, 0, (LPARAM) "8 bit");
SendDlgItemMessage(dialog, IDC_SCREEN_DEPTH, CB_ADDSTRING, 0, (LPARAM) "16 bit");
SendDlgItemMessage(dialog, IDC_SCREEN_DEPTH, CB_ADDSTRING, 0, (LPARAM) "24 bit");
SendDlgItemMessage(dialog, IDC_SCREEN_DEPTH, CB_ADDSTRING, 0, (LPARAM) "32 bit"); /* is this valid? */
buf = get_reg_key(config_key, keypath("X11 Driver"), "ScreenDepth", "24"); buf = get_reg_key(config_key, keypath("X11 Driver"), "ScreenDepth", "24");
if (strcmp(buf, "8") == 0) if (strcmp(buf, "8") == 0)
SendDlgItemMessage(dialog, IDC_SCREEN_DEPTH, CB_SETCURSEL, 0, 0); SendDlgItemMessage(dialog, IDC_SCREEN_DEPTH, CB_SETCURSEL, 0, 0);
...@@ -122,6 +110,22 @@ static void init_dialog (HWND dialog) ...@@ -122,6 +110,22 @@ static void init_dialog (HWND dialog)
else else
WINE_ERR("Invalid screen depth read from registry (%s)\n", buf); WINE_ERR("Invalid screen depth read from registry (%s)\n", buf);
HeapFree(GetProcessHeap(), 0, buf); HeapFree(GetProcessHeap(), 0, buf);
}
static void init_dialog(HWND dialog)
{
unsigned int it;
char* buf;
update_gui_for_desktop_mode(dialog);
updating_ui = TRUE;
SendDlgItemMessage(dialog, IDC_SCREEN_DEPTH, CB_RESETCONTENT, 0, 0);
SendDlgItemMessage(dialog, IDC_SCREEN_DEPTH, CB_ADDSTRING, 0, (LPARAM) "8 bit");
SendDlgItemMessage(dialog, IDC_SCREEN_DEPTH, CB_ADDSTRING, 0, (LPARAM) "16 bit");
SendDlgItemMessage(dialog, IDC_SCREEN_DEPTH, CB_ADDSTRING, 0, (LPARAM) "24 bit");
SendDlgItemMessage(dialog, IDC_SCREEN_DEPTH, CB_ADDSTRING, 0, (LPARAM) "32 bit"); /* is this valid? */
SendDlgItemMessage(dialog, IDC_DESKTOP_WIDTH, EM_LIMITTEXT, RES_MAXLEN, 0); SendDlgItemMessage(dialog, IDC_DESKTOP_WIDTH, EM_LIMITTEXT, RES_MAXLEN, 0);
SendDlgItemMessage(dialog, IDC_DESKTOP_HEIGHT, EM_LIMITTEXT, RES_MAXLEN, 0); SendDlgItemMessage(dialog, IDC_DESKTOP_HEIGHT, EM_LIMITTEXT, RES_MAXLEN, 0);
...@@ -134,10 +138,15 @@ static void init_dialog (HWND dialog) ...@@ -134,10 +138,15 @@ static void init_dialog (HWND dialog)
HeapFree(GetProcessHeap(), 0, buf); HeapFree(GetProcessHeap(), 0, buf);
buf = get_reg_key(config_key, keypath("X11 Driver"), "DesktopDoubleBuffered", "Y"); buf = get_reg_key(config_key, keypath("X11 Driver"), "DesktopDoubleBuffered", "Y");
if (IS_OPTION_TRUE(*buf)) if (IS_OPTION_TRUE(*buf)) {
CheckDlgButton(dialog, IDC_DOUBLE_BUFFER, BST_CHECKED); CheckDlgButton(dialog, IDC_DOUBLE_BUFFER, BST_CHECKED);
else SendDlgItemMessage(dialog, IDC_SCREEN_DEPTH, CB_SETCURSEL, -1, 0);
disable(IDC_SCREEN_DEPTH);
} else {
CheckDlgButton(dialog, IDC_DOUBLE_BUFFER, BST_UNCHECKED); CheckDlgButton(dialog, IDC_DOUBLE_BUFFER, BST_UNCHECKED);
init_screen_depth(dialog);
enable(IDC_SCREEN_DEPTH);
}
HeapFree(GetProcessHeap(), 0, buf); HeapFree(GetProcessHeap(), 0, buf);
SendDlgItemMessage(dialog, IDC_D3D_VSHADER_MODE, CB_RESETCONTENT, 0, 0); SendDlgItemMessage(dialog, IDC_D3D_VSHADER_MODE, CB_RESETCONTENT, 0, 0);
...@@ -228,10 +237,15 @@ static void on_dx_mouse_grab_clicked(HWND dialog) { ...@@ -228,10 +237,15 @@ static void on_dx_mouse_grab_clicked(HWND dialog) {
static void on_double_buffer_clicked(HWND dialog) { static void on_double_buffer_clicked(HWND dialog) {
if (IsDlgButtonChecked(dialog, IDC_DOUBLE_BUFFER) == BST_CHECKED) if (IsDlgButtonChecked(dialog, IDC_DOUBLE_BUFFER) == BST_CHECKED) {
set_reg_key(config_key, keypath("X11 Driver"), "DesktopDoubleBuffered", "Y"); set_reg_key(config_key, keypath("X11 Driver"), "DesktopDoubleBuffered", "Y");
else SendDlgItemMessage(dialog, IDC_SCREEN_DEPTH, CB_SETCURSEL, -1, 0);
disable(IDC_SCREEN_DEPTH);
} else {
set_reg_key(config_key, keypath("X11 Driver"), "DesktopDoubleBuffered", "N"); set_reg_key(config_key, keypath("X11 Driver"), "DesktopDoubleBuffered", "N");
init_screen_depth(dialog);
enable(IDC_SCREEN_DEPTH);
}
} }
static void on_d3d_vshader_mode_changed(HWND dialog) { static void on_d3d_vshader_mode_changed(HWND dialog) {
...@@ -247,7 +261,7 @@ static void on_d3d_pshader_mode_clicked(HWND dialog) { ...@@ -247,7 +261,7 @@ static void on_d3d_pshader_mode_clicked(HWND dialog) {
} }
INT_PTR CALLBACK INT_PTR CALLBACK
GraphDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) GraphDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
switch (uMsg) { switch (uMsg) {
case WM_INITDIALOG: case WM_INITDIALOG:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment