View Issue Details

IDProjectCategoryView StatusLast Update
0018511LazarusLCLpublic2014-09-21 14:05
ReporterBenito van der Zander Assigned ToZeljan Rikalo  
Status assignedResolutionreopened 
Product Version0.9.31 (SVN) 
Summary0018511: windowstate chaos
DescriptionChanging the windowstate to wsNormal
Additional InformationWhen a normal form is minimized and the windowsstate is changed afterwards:

When setting windowsstate := wsNormal, the onwindowstatechange event is not called, but the form becomes visible. (This is the only good case of the four)

When setting windowsstate := wsMaximized: reading windowsstate immediately after the assignment returns wsMaximized, but then the onwindowstatechange event is called and reading the windowsstate propery there, returns wsMinimized. And the form remains minimized.
Once I manually open the window, onwindowstatechange is called again and windowsstate reads as wsMaximized.


When a maximized form is minimized and the windowsstate is changed afterwards:

When setting windowsstate := wsNormal: immediately after setting it, it has the value wsNormal, but then the onwindowstatechange event is called and the windowsstate property is again wsMinimized. Then the event is automatically called a second time, and now windowsstate = wsNormal is true. And the form becomes visible.

When setting windowstate := wsMaximized, absolutely nothing happens (although the value of windowstate becomes wsMaximized).


Expected behaviour:

When setting windowsstate := X on minimized form, the form should become visible. And the onwindowstatechange event should either be called or not, but if it is called, the windowsstate property should contain the value X.

(Window manager: gdm)
TagsNo tags attached.
Fixed in Revision
WidgetsetGTK 2
Attached Files


related to 0018514 resolvedOndrej Pokorny show on minimized form 


Benito van der Zander

2011-01-15 13:09

reporter   ~0045202

On Windows it works as expected, except for case 4 which has the same behaviour as under linux (previously maximized form is minimized, setting windowsstate := wsMaximized has no effect ).

2011-01-15 13:10


example.tar.gz (2,659 bytes)

Benito van der Zander

2011-01-15 13:31

reporter   ~0045204

But Windows has another bug: If you minimize a maximized form, the windowsstatechange event is called two times. First with windowsstate = wsNormal and then with windowstate = wsMinimized. (When maximizing the form in the first place, the event is called with windowstate = wsMaximized, so minimizing does in fact change the window state first to wsNormal ) (Windows 7)

Zeljan Rikalo

2011-12-06 18:54

developer   ~0054750

@Benito I cannot reproduce this problem
Lazarus 0.9.31 r34002M FPC 2.4.5 i386-linux-gtk 2
Does it still exist ?
If so please tell me how to reproduce it with this example ?

Zeljan Rikalo

2011-12-06 19:27

developer   ~0054753

According to my tests with various distros this issue does not exist in current trunk (svn r 34004).
Reopen and give better explanation how to reproduce and what to look for, or close if ok.

Benito van der Zander

2012-03-21 18:49

reporter   ~0057880

Still doesn't work as expected.

I made a table which should be clearer (to reproduce row X of table Y: you open the example, Y-fy the window, click button X and minimize it fast):

===================================DEBIAN GTK 2 XFCE===============================

Normal form is minimized:


* after activating the window with alt+tab, it is appears maximized

=================================== WINDOWS 7 WIN32 ===============================

Normal form is minimized:


**: But onWindowsStateChange is not called

And windowState in onWindowsStateChange reports the wrong values when maximizing/minimizing on Windows:
Maximize the window (window state -> wsMaximized),
minimize it (window state -> WSNORMAL -> wsMinimized),
restore it (window state -> WSNORMAL, but it is still maximized)

Zeljan Rikalo

2012-03-22 08:59

developer   ~0057900

It works perfect under KDE & Gnome (tested gtk2 and qt), but under XFCE there's another problem: it works but OnTimer() does not write anything to console (have nothing to do with windowstate which triggers) - same problem happens with gtk2 and qt under XFCE (Fedora 14).
Besides that I'm not sure that OnWindowStateChange should trigger when you programatically set new window state. When you minimize/maximize/restore form via titlebar buttons OnWindowStateChange triggers ok for both.
Didn't test windows yet so don't know what exactly happens there.

Issue History

Date Modified Username Field Change
2011-01-15 01:06 Benito van der Zander New Issue
2011-01-15 01:06 Benito van der Zander Widgetset => GTK 2
2011-01-15 13:09 Benito van der Zander Note Added: 0045202
2011-01-15 13:10 Benito van der Zander File Added: example.tar.gz
2011-01-15 13:31 Benito van der Zander Note Added: 0045204
2011-02-07 20:45 Vincent Snijders LazTarget => -
2011-02-07 20:45 Vincent Snijders Status new => acknowledged
2011-02-07 20:46 Vincent Snijders Relationship added related to 0018514
2011-12-06 18:54 Zeljan Rikalo Note Added: 0054750
2011-12-06 18:54 Zeljan Rikalo Status acknowledged => feedback
2011-12-06 19:27 Zeljan Rikalo Status feedback => resolved
2011-12-06 19:27 Zeljan Rikalo Resolution open => fixed
2011-12-06 19:27 Zeljan Rikalo Assigned To => Zeljan Rikalo
2011-12-06 19:27 Zeljan Rikalo Note Added: 0054753
2012-03-21 18:49 Benito van der Zander Status resolved => assigned
2012-03-21 18:49 Benito van der Zander Resolution fixed => reopened
2012-03-21 18:49 Benito van der Zander Note Added: 0057880
2012-03-22 08:59 Zeljan Rikalo Note Added: 0057900