SW_SHOWNORMAL on Gtk2 widgetset shrinks the window in some window managers
Original Reporter info from Mantis: Bad Sector @badsectoracula
-
Reporter name: Kostas Michalopoulos
Original Reporter info from Mantis: Bad Sector @badsectoracula
- Reporter name: Kostas Michalopoulos
Description:
Calling ShowWindow(Handle, SW_SHOWNORMAL) on Gtk2 widgetset will shrink the window under some window managers. This call is made at several places during design time, including changing components and loading forms. The video below shows the issue with Window Maker:
The bug seems to be in Gtk2's gtk_window_unmaximize which attempts to resize the window even if it is maximized. While it ideally the bug should be fixed in Gtk2, the development seems to be almost halted (mainly build and documentation fixes seem to happen) and with Lazarus targeting earlier versions like 2.8 (from 2005) it is a better idea to address this on LCL side.
The attached patch contains a workaround for TCustomForm descendants that checks the maximized state (Gtk2 doesn't provide any way to query the current state, but LCL already tracks it for forms) before calling gtk_window_unmaximize, which fixes the issue shown in the video above. The patch was made against revision 54956, but should apply to 1.8RC1 and earlier versions (maybe by hand - it is a small patch after all).
Steps to reproduce:
- Install Window Maker
- Build Lazarus with the Gtk2 widgetset
- Run Lazarus
- Try to select any component from the palette
- Notice how the window shrinks
alternatively check the video
Mantis conversion info:
- Mantis ID: 31832
- OS: Debian
- OS Build: Sid
- Platform: Linux
- Version: 1.9 (SVN)
- Fixed in revision: 54958 (#36c1a482),54975 (#cba5c9c5)
- Monitored by: » @badsectoracula (Kostas Michalopoulos)