View Issue Details

IDProjectCategoryView StatusLast Update
0000712Double CommanderGraphical user interfacepublic2014-10-26 18:18
Reporterz_artem Assigned ToAlexx2000  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
ProjectionnoneETAnone 
Product Version0.6.0 (trunk)Product Build5275 
Target Version0.5.7Fixed in Version0.5.7 
Summary0000712: Main form shortcuts are triggered when other non-modal dialogs are active
DescriptionRegression is started from the revision 5194 (fix for issue 0000595). If a form doesn't handle some shortcut, it is redirected to the main form. For all platforms it is HackForm that does nothing. Mentioned revision changes main form for Mac OS to MainForm that has a bunch of assigned shortcuts. This leads to unexpected actions triggered from non-modal dialogs.

Attached patch reverts HackForm change and introduce another solution for the issue 0000595. Main form of the application receives OnCloseQuery and OnClose events when application is closing using Command-Q in Mac OS. Corresponding handlers are replaces with handlers of the MainFrm after it is created to save settings before exit.
Steps To Reproduce1. Open any file in internal Viewer or Editor.
2. Press F5

Expected: shortcut is ignored because no action is assigned for it in current window
Actual: copy file dialog is shown
TagsNo tags attached.
Attached Files
main_form.diff (1,170 bytes)   
Index: src/doublecmd.lpr
===================================================================
--- src/doublecmd.lpr	(revision 5268)
+++ src/doublecmd.lpr	(working copy)
@@ -116,10 +116,8 @@
   ProcessCommandLineParams; // before load paths
   LoadPaths; // before loading config
 
-  {$IF NOT DEFINED(DARWIN)}
   Application.ShowMainForm:= False;
   Application.CreateForm(TfrmHackForm, frmHackForm);
-  {$ENDIF}
   if InitGlobs then
     if IsInstanceAllowed then
      begin
Index: src/fmain.pas
===================================================================
--- src/fmain.pas	(revision 5268)
+++ src/fmain.pas	(working copy)
@@ -52,6 +52,9 @@
   {$ELSEIF DEFINED(LCLGTK2)}
   , Glib2, Gtk2
   {$ENDIF}
+  {$IF DEFINED(DARWIN)}
+  ,fHackForm
+  {$ENDIF}
   ;
 
 type
@@ -776,6 +779,11 @@
 begin
   Application.OnException := @AppException;
   Application.OnActivate := @AppActivate;
+  {$IF DEFINED(DARWIN)}
+  //HackForm receives in Mac OS closing events on system shortcut Ctrl-Q
+  frmHackForm.OnCloseQuery := @FormCloseQuery;
+  frmHackForm.OnClose := @frmMainClose;
+  {$ENDIF}
 
   ConvertToolbarBarConfig(gpCfgDir + 'default.bar');
   CreateDefaultToolbar;
main_form.diff (1,170 bytes)   
Fixed in Revision5278,5297
Operating systemMacOSX
WidgetsetCarbon
Architecture32-bit

Activities

Alexx2000

2013-08-17 13:06

administrator   ~0001108

Applied with small simplification

Issue History

Date Modified Username Field Change
2013-08-12 01:25 z_artem New Issue
2013-08-12 01:25 z_artem File Added: main_form.diff
2013-08-17 12:55 Alexx2000 Assigned To => Alexx2000
2013-08-17 12:55 Alexx2000 Status new => assigned
2013-08-17 13:06 Alexx2000 Fixed in Revision => 5278
2013-08-17 13:06 Alexx2000 Note Added: 0001108
2013-08-17 13:06 Alexx2000 Status assigned => resolved
2013-08-17 13:06 Alexx2000 Resolution open => fixed
2013-08-17 13:09 Alexx2000 Target Version => 0.5.7
2013-09-15 13:29 Alexx2000 Fixed in Revision 5278 => 5278,5297
2013-09-15 13:29 Alexx2000 Fixed in Version => 0.5.7
2014-10-26 18:18 Alexx2000 Status resolved => closed