View Issue Details

IDProjectCategoryView StatusLast Update
0014030LazarusLCLpublic2009-10-23 00:40
Reportercobines Assigned ToPaul Ishenin  
Status closedResolutionfixed 
Product Version0.9.27 (SVN) 
Target Version0.9.28Fixed in Version0.9.27 (SVN) 
Summary0014030: Deiconifying a maximized window does not change WindowState
DescriptionWhen a maximized but iconified window is deiconified a 'restore window state' message is not sent by LCL. Therefore WindowState never changes from wsMinimized to wsMaximized and also the OnWindowStateChange event is not fired.

Attached an example, which shows the current window state of the form. Steps to see the bug:

1. Maximize the window - state is shown as wsMaximized.
2. Minimize the window - it's wsMinimized (see window caption).
3. Restore the window - it still says wsMinimized.
4. Hit the maximize/restore button again (or select something like 'Restore' from your window manager's menu), which should unmaximize window - the window is minimized instead (in an unmaximized state). Restoring the window again shows it in unmaximized, deiconified state.

Lazarus SVN 20712, GTK2 widgetset.
Additional InformationExcerpt from lcl/interfaces/gtk2/gtk2callback.ini (from line 79):

        else if (GDK_WINDOW_STATE_MAXIMIZED and state^.new_window_state)>0 then
          if (state^.changed_mask and GDK_WINDOW_STATE_MAXIMIZED)=0 then Exit;

When window is in maximized state the code only sends the message when GDK_WINDOW_STATE_MAXIMIZED was changed. But when an iconified window changes its state to deiconified (maximized state stays the same) the message is not sent. Since there is no 'restore state' message it probably should send SIZEFULLSCREEN even though the window did not change its maximized state. Attached patch to handle that case.
TagsNo tags attached.
Fixed in Revision20716
WidgetsetGTK 2
Attached Files


2009-06-22 17:44


2009-06-22 17:44


restore_maximized.diff (661 bytes)   
Index: lcl/interfaces/gtk2/
--- lcl/interfaces/gtk2/	(wersja 20712)
+++ lcl/interfaces/gtk2/	(kopia robocza)
@@ -78,7 +78,8 @@
         else if (GDK_WINDOW_STATE_MAXIMIZED and state^.new_window_state)>0 then
-          if (state^.changed_mask and GDK_WINDOW_STATE_MAXIMIZED)=0 then Exit;
+          if ((state^.changed_mask and GDK_WINDOW_STATE_MAXIMIZED)=0) and
+             ((state^.changed_mask and GDK_WINDOW_STATE_ICONIFIED)=0) then Exit;
restore_maximized.diff (661 bytes)   

Paul Ishenin

2009-06-23 03:52

manager   ~0028689

Thanks, similar patch was applied.

Issue History

Date Modified Username Field Change
2009-06-22 17:43 cobines New Issue
2009-06-22 17:43 cobines Widgetset => GTK 2
2009-06-22 17:44 cobines File Added: minimizing_example.tar.gz
2009-06-22 17:44 cobines File Added: restore_maximized.diff
2009-06-22 19:05 Vincent Snijders LazTarget => 0.9.28
2009-06-22 19:05 Vincent Snijders Status new => acknowledged
2009-06-22 19:05 Vincent Snijders Target Version => 0.9.28
2009-06-23 03:52 Paul Ishenin Fixed in Revision => 20716
2009-06-23 03:52 Paul Ishenin Status acknowledged => resolved
2009-06-23 03:52 Paul Ishenin Fixed in Version => 0.9.27 (SVN)
2009-06-23 03:52 Paul Ishenin Resolution open => fixed
2009-06-23 03:52 Paul Ishenin Assigned To => Paul Ishenin
2009-06-23 03:52 Paul Ishenin Note Added: 0028689
2009-10-23 00:40 Marc Weustink Status resolved => closed