Module: wine Branch: master Commit: be1aa20276706f216c76796de91be91300165c3b URL: http://source.winehq.org/git/wine.git/?a=commit;h=be1aa20276706f216c76796de9...
Author: Vincent Povirk vincent@codeweavers.com Date: Mon Aug 23 17:45:26 2010 -0500
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 );