View Issue Details

IDProjectCategoryView StatusLast Update
0037821LazarusLCLpublic2020-09-28 00:36
Reporterjamie philbrook Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.0.10 
Summary0037821: All Dialogs that have "OldStyleDialog" option when checks moves the Calling FORM to center of screen, Dialog to where it was.
Description
 When using any file dialog that has the OldStyle Option and checked, causes the form that is in focus to move to the center of the screen and places the file dialog to where the form was or near it.

  This does not happen when using the modern version of the dialog.

TagsNo tags attached.
Fixed in Revisionr63929
LazTarget-
WidgetsetWin32/Win64
Attached Files

Activities

jamie philbrook

2020-09-27 04:05

reporter   ~0125891

I have stumbled on the problem and fix, please look at this forum post I have left there and I would like opinions because I really don't know why it was that way in the first place. This has been around for a long time..

https://forum.lazarus.freepascal.org/index.php?topic=51578.msg378835#msg378835

jamie philbrook

2020-09-27 15:53

reporter   ~0125900

Last edited: 2020-09-27 15:54

View 2 revisions

the fix I did in the forum post made the dialog work exactly like my old Delphi does, it displays the dialog at the center of the screen and does not effect the active form that called it.

  But I noted this, the Vista dialogs and up, do follow along with the active form, in other words, it does not center the dialog so maybe this is more desirable ?

  I tested the TOpenDialog with Delphi 10.3 and it seems for what ever reason the OldStyleDialogs option is ignored because it always shows the new style. So I am not sure if this is intentional or a bug on their side ?

 But I've found it maybe better to simply comment out the "Reposition" function call during the dialog callback initial message, this allows the OS (Windows) to have the dialog follow the active form exactly in the same manner as the Vista styles do now.

 And if that is acceptable we could go as far as removing the code for it too, to un-lard the widget a bit.

So I vote on taking the "Reposition" procedure out of the equation !

jamie philbrook

2020-09-27 20:01

reporter   ~0125907

This is my first attempt at making a patch file against the trunk.. so excuse me if something goes wrong..
--
Index: win32wsdialogs.pp
===================================================================
--- win32wsdialogs.pp (revision 63928)
+++ win32wsdialogs.pp (working copy)
@@ -523,7 +523,7 @@
   begin
     // Windows asks us to initialize dialog. At this moment controls are not
     // arranged and this is that moment when we should set bounds of our dialog
- Reposition(GetParent(Wnd));
+ // Reposition(GetParent(Wnd)); // this causes active form to move out of position with old dilaogs JP
   end
   else
   if uMsg = WM_NOTIFY then

jamie philbrook

2020-09-27 20:12

reporter   ~0125908

here is patch file
win32wsdialogs.pp.patch (544 bytes)   
Index: win32wsdialogs.pp
===================================================================
--- win32wsdialogs.pp	(revision 63928)
+++ win32wsdialogs.pp	(working copy)
@@ -523,7 +523,7 @@
   begin
     // Windows asks us to initialize dialog. At this moment controls are not
     // arranged and this is that moment when we should set bounds of our dialog
-    Reposition(GetParent(Wnd));
+  //  Reposition(GetParent(Wnd)); // this causes active form to move out of position with old dilaogs JP
   end
   else
   if uMsg = WM_NOTIFY then
win32wsdialogs.pp.patch (544 bytes)   

Juha Manninen

2020-09-28 00:26

developer   ~0125913

Applied, thanks.
Note, I commented out the nested procedure Reposition. It is not used anywhere else.

jamie philbrook

2020-09-28 00:36

reporter   ~0125914

Thanks

Issue History

Date Modified Username Field Change
2020-09-26 23:19 jamie philbrook New Issue
2020-09-27 04:05 jamie philbrook Note Added: 0125891
2020-09-27 15:53 jamie philbrook Note Added: 0125900
2020-09-27 15:54 jamie philbrook Note Edited: 0125900 View Revisions
2020-09-27 20:01 jamie philbrook Note Added: 0125907
2020-09-27 20:12 jamie philbrook Note Added: 0125908
2020-09-27 20:12 jamie philbrook File Added: win32wsdialogs.pp.patch
2020-09-28 00:15 Juha Manninen Assigned To => Juha Manninen
2020-09-28 00:15 Juha Manninen Status new => assigned
2020-09-28 00:26 Juha Manninen Status assigned => resolved
2020-09-28 00:26 Juha Manninen Resolution open => fixed
2020-09-28 00:26 Juha Manninen Fixed in Revision => r63929
2020-09-28 00:26 Juha Manninen LazTarget => -
2020-09-28 00:26 Juha Manninen Widgetset Win32/Win64 => Win32/Win64
2020-09-28 00:26 Juha Manninen Note Added: 0125913
2020-09-28 00:36 jamie philbrook Note Added: 0125914