Deiconifying a maximized window does not change WindowState
Original Reporter info from Mantis: cobines
-
Reporter name:
Original Reporter info from Mantis: cobines
- Reporter name:
Description:
When 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:
- Maximize the window - state is shown as wsMaximized.
- Minimize the window - it's wsMinimized (see window caption).
- Restore the window - it still says wsMinimized.
- 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 information:
Excerpt from lcl/interfaces/gtk2/gtk2callback.ini (from line 79):
else if (GDK_WINDOW_STATE_MAXIMIZED and state^.new_window_state)>0 then
begin
if (state^.changed_mask and GDK_WINDOW_STATE_MAXIMIZED)=0 then Exit;
SizeMsg.SizeType:=SIZEFULLSCREEN;
end
else
SizeMsg.SizeType:=SIZENORMAL;
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.
Mantis conversion info:
- Mantis ID: 14030
- Version: 0.9.27 (SVN)
- Fixed in version: 0.9.27 (SVN)
- Fixed in revision: 20716 (#449eaab0)
- Target version: 0.9.28