wine/dlls/commdlg filedlg.c

Alexandre Julliard julliard at wine.codeweavers.com
Fri Nov 18 10:52:35 CST 2005


ChangeSet ID:	21343
CVSROOT:	/opt/cvs-commit
Module name:	wine
Changes by:	julliard at winehq.org	2005/11/18 10:52:35

Modified files:
	dlls/commdlg   : filedlg.c 

Log message:
	Dmitry Timoshkov <dmitry at codeweavers.com>
	There is no need to resize our own fake dialog to match the parent, it
	doesn't have controls anyway.

Patch: http://cvs.winehq.org/patch.py?id=21343

Old revision  New revision  Changes     Path
 1.116         1.117         +28 -8      wine/dlls/commdlg/filedlg.c

Index: wine/dlls/commdlg/filedlg.c
diff -u -p wine/dlls/commdlg/filedlg.c:1.116 wine/dlls/commdlg/filedlg.c:1.117
--- wine/dlls/commdlg/filedlg.c:1.116	18 Nov 2005 16:52:35 -0000
+++ wine/dlls/commdlg/filedlg.c	18 Nov 2005 16:52:35 -0000
@@ -701,10 +701,6 @@ static void ArrangeCtrlPositions(HWND hw
     /* finally use fixed parent size */
     rectParent.bottom -= help_fixup;
 
-    /* save the size of the parent's client area */
-    rectChild.right = rectParent.right;
-    rectChild.bottom = rectParent.bottom;
-
     /* set the size of the parent dialog */
     AdjustWindowRectEx(&rectParent, GetWindowLongW(hwndParentDlg, GWL_STYLE),
                        FALSE, GetWindowLongW(hwndParentDlg, GWL_EXSTYLE));
@@ -713,10 +709,6 @@ static void ArrangeCtrlPositions(HWND hw
                  rectParent.right - rectParent.left,
                  rectParent.bottom - rectParent.top,
                  SWP_NOMOVE | SWP_NOZORDER);
-
-    /* set the size of the child dialog */
-    SetWindowPos(hwndChildDlg, HWND_BOTTOM,
-                 0, 0, rectChild.right, rectChild.bottom, SWP_NOACTIVATE);
 }
 
 static INT_PTR CALLBACK FileOpenDlgProcUserTemplate(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -1032,9 +1024,29 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND 
          FILEDLG95_InitControls(hwnd);
 
          if (fodInfos->DlgInfos.hwndCustomDlg)
+         {
+             RECT rc;
+             UINT flags = SWP_NOACTIVATE;
+
              ArrangeCtrlPositions(fodInfos->DlgInfos.hwndCustomDlg, hwnd,
                  (fodInfos->ofnInfos->Flags & (OFN_HIDEREADONLY | OFN_SHOWHELP)) == OFN_HIDEREADONLY);
 
+             /* resize the custom dialog to the parent size */
+             if (fodInfos->ofnInfos->Flags & (OFN_ENABLETEMPLATE | OFN_ENABLETEMPLATEHANDLE))
+                 GetClientRect(hwnd, &rc);
+             else
+             {
+                 /* our own fake template is zero sized and doesn't have
+                  * children, so there is no need to resize it.
+                  * Picasa depends on it.
+                  */
+                 flags |= SWP_NOSIZE;
+                 SetRectEmpty(&rc);
+             }
+             SetWindowPos(fodInfos->DlgInfos.hwndCustomDlg, HWND_BOTTOM,
+                          0, 0, rc.right, rc.bottom, flags);
+         }
+
       	 FILEDLG95_FillControls(hwnd, wParam, lParam);
 
          SendCustomDlgNotificationMessage(hwnd,CDN_INITDONE);
@@ -3782,6 +3794,8 @@ BOOL WINAPI GetOpenFileNameA(
 {
     BOOL win16look = FALSE;
 
+    TRACE("flags %08lx\n", ofn->Flags);
+
     /* OFN_FILEMUSTEXIST implies OFN_PATHMUSTEXIST */
     if (ofn->Flags & OFN_FILEMUSTEXIST)
         ofn->Flags |= OFN_PATHMUSTEXIST;
@@ -3810,6 +3824,12 @@ BOOL WINAPI GetOpenFileNameW(
 {
     BOOL win16look = FALSE;
 
+    TRACE("flags %08lx\n", ofn->Flags);
+
+    /* OFN_FILEMUSTEXIST implies OFN_PATHMUSTEXIST */
+    if (ofn->Flags & OFN_FILEMUSTEXIST)
+        ofn->Flags |= OFN_PATHMUSTEXIST;
+
     if (ofn->Flags & (OFN_ALLOWMULTISELECT|OFN_ENABLEHOOK|OFN_ENABLETEMPLATE))
         win16look = (ofn->Flags & OFN_EXPLORER) ? FALSE : TRUE;
 



More information about the wine-cvs mailing list