From 1ff2c7c4edbbbe75df9dc4378a8168bdd7cb6679 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Mon, 23 Aug 2010 17:45:26 -0500 Subject: [PATCH] winecfg: Don't allow virtual desktops smaller than 640x480. --- programs/winecfg/x11drvdlg.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/programs/winecfg/x11drvdlg.c b/programs/winecfg/x11drvdlg.c index bf1950c..d3d7220 100644 --- a/programs/winecfg/x11drvdlg.c +++ b/programs/winecfg/x11drvdlg.c @@ -189,6 +189,8 @@ static void set_from_desktop_edits(HWND dialog) static const WCHAR x[] = {'x',0}; static const WCHAR def_width[] = {'8','0','0',0}; static const WCHAR def_height[] = {'6','0','0',0}; + static const WCHAR min_width[] = {'6','4','0',0}; + static const WCHAR min_height[] = {'4','8','0',0}; WCHAR *width, *height, *new; const WCHAR *desktop_name = current_app ? current_app : defaultW; @@ -203,10 +205,20 @@ static void set_from_desktop_edits(HWND dialog) HeapFree(GetProcessHeap(), 0, width); width = strdupW(def_width); } + else if (atoiW(width) < atoiW(min_width)) + { + HeapFree(GetProcessHeap(), 0, width); + width = strdupW(min_width); + } if (!height || !height[0]) { HeapFree(GetProcessHeap(), 0, height); height = strdupW(def_height); } + else if (atoiW(height) < atoiW(min_height)) + { + HeapFree(GetProcessHeap(), 0, height); + height = strdupW(min_height); + } new = HeapAlloc(GetProcessHeap(), 0, (strlenW(width) + strlenW(height) + 2) * sizeof(WCHAR)); strcpyW( new, width ); -- 1.7.0.4