Re: [Lazarus] Patch for fixing the window resizes when switching components

2017-05-18 Thread zeljko via Lazarus
On 18.05.2017 20:24, Kostas Michalopoulos via Lazarus wrote: Yes the new code works perfectly fine here and is a better solution. My original thought was to use pure Gtk but i forgot about gdk_ and only looked for something like gtk_window_get_state - which i couldn't find :-). Thanks for

Re: [Lazarus] Patch for fixing the window resizes when switching components

2017-05-18 Thread Kostas Michalopoulos via Lazarus
Yes the new code works perfectly fine here and is a better solution. My original thought was to use pure Gtk but i forgot about gdk_ and only looked for something like gtk_window_get_state - which i couldn't find :-). On Thu, May 18, 2017 at 8:37 PM, zeljko via Lazarus <

Re: [Lazarus] Patch for fixing the window resizes when switching components

2017-05-18 Thread zeljko via Lazarus
On 18.05.2017 13:43, Mattias Gaertner via Lazarus wrote: On Thu, 18 May 2017 13:20:52 +0200 zeljko via Lazarus wrote: [...] if GDK_IS_WINDOW(PGtkWindow(OurWidget)^.window) and (gdk_window_get_state(PGtkWindow(OurWidget)^.window) = GDK_WINDOW_STATE_MAXIMIZED)

Re: [Lazarus] Patch for fixing the window resizes when switching components

2017-05-18 Thread zeljko via Lazarus
On 18.05.2017 13:43, Mattias Gaertner via Lazarus wrote: On Thu, 18 May 2017 13:20:52 +0200 zeljko via Lazarus wrote: [...] if GDK_IS_WINDOW(PGtkWindow(OurWidget)^.window) and (gdk_window_get_state(PGtkWindow(OurWidget)^.window) = GDK_WINDOW_STATE_MAXIMIZED)

Re: [Lazarus] Patch for fixing the window resizes when switching components

2017-05-18 Thread zeljko via Lazarus
On 18.05.2017 13:38, Marc Weustink via Lazarus wrote: zeljko via Lazarus wrote: On 18.05.2017 01:43, Kostas Michalopoulos via Lazarus wrote: if GDK_IS_WINDOW(PGtkWindow(OurWidget)^.window) and (gdk_window_get_state(PGtkWindow(OurWidget)^.window) = GDK_WINDOW_STATE_MAXIMIZED) then

Re: [Lazarus] Patch for fixing the window resizes when switching components

2017-05-18 Thread Mattias Gaertner via Lazarus
On Thu, 18 May 2017 13:20:52 +0200 zeljko via Lazarus wrote: >[...] > if GDK_IS_WINDOW(PGtkWindow(OurWidget)^.window) and > (gdk_window_get_state(PGtkWindow(OurWidget)^.window) = > GDK_WINDOW_STATE_MAXIMIZED) then >gtk_window_unmaximize() ... > Same for

Re: [Lazarus] Patch for fixing the window resizes when switching components

2017-05-18 Thread Marc Weustink via Lazarus
zeljko via Lazarus wrote: On 18.05.2017 01:43, Kostas Michalopoulos via Lazarus wrote: if GDK_IS_WINDOW(PGtkWindow(OurWidget)^.window) and (gdk_window_get_state(PGtkWindow(OurWidget)^.window) = GDK_WINDOW_STATE_MAXIMIZED) then gtk_window_unmaximize() ... Same for unfullscreen and other "un"

Re: [Lazarus] Patch for fixing the window resizes when switching components

2017-05-18 Thread zeljko via Lazarus
On 18.05.2017 01:43, Kostas Michalopoulos via Lazarus wrote: I see the patch was added and Lazarus seems to work fine now, but the check was altered a little. The current check assumes that the Control will never be nil, but is this the case? I ask because i see in other places in the same

Re: [Lazarus] Patch for fixing the window resizes when switching components

2017-05-18 Thread Kostas Michalopoulos via Lazarus
Oops, indeed, i was tripped up by the not in "(not (Control is TCustomForm)) or ..." part. On Thu, May 18, 2017 at 10:28 AM, Mattias Gaertner via Lazarus < lazarus@lists.lazarus-ide.org> wrote: > On Thu, 18 May 2017 02:43:10 +0300 > Kostas Michalopoulos via Lazarus

Re: [Lazarus] Patch for fixing the window resizes when switching components

2017-05-18 Thread Mattias Gaertner via Lazarus
On Thu, 18 May 2017 02:43:10 +0300 Kostas Michalopoulos via Lazarus wrote: > I see the patch was added and Lazarus seems to work fine now, but the check > was altered a little. The current check assumes that the Control will never > be nil, but is this the case?

Re: [Lazarus] Patch for fixing the window resizes when switching components

2017-05-17 Thread Kostas Michalopoulos via Lazarus
I see the patch was added and Lazarus seems to work fine now, but the check was altered a little. The current check assumes that the Control will never be nil, but is this the case? I ask because i see in other places in the same source code file that there are checks for that - almost all calls

[Lazarus] Patch for fixing the window resizes when switching components

2017-05-17 Thread Kostas Michalopoulos via Lazarus
Hi all, So i finally figured out why this happens and the reason is the ShowWindow(Handle, SW_SHOWNORMAL) call made when selecting components (this is done to activate the designer form). Under Gtk2 this call always calls gtk_window_unmaximize (among others) but Gtk2 seems to have a bug that