mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 02:59:21 +02:00
lcl: gtk2: fixed shrinking designer form, bug #31832, patch Kostas Michalopoulos
git-svn-id: trunk@54958 -
This commit is contained in:
parent
c2dcfae499
commit
36c1a482a0
@ -9400,6 +9400,7 @@ var
|
|||||||
GtkWindow: PGtkWindow;
|
GtkWindow: PGtkWindow;
|
||||||
B: Boolean;
|
B: Boolean;
|
||||||
Widget: PGtkWidget;
|
Widget: PGtkWidget;
|
||||||
|
Control: TWinControl;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
|
|
||||||
@ -9446,7 +9447,18 @@ begin
|
|||||||
if not GTK_WIDGET_VISIBLE(PGtkWidget(GtkWindow)) then
|
if not GTK_WIDGET_VISIBLE(PGtkWidget(GtkWindow)) then
|
||||||
gtk_widget_show(PGtkWidget(GtkWindow));
|
gtk_widget_show(PGtkWidget(GtkWindow));
|
||||||
gtk_window_deiconify(GtkWindow);
|
gtk_window_deiconify(GtkWindow);
|
||||||
gtk_window_unmaximize(GtkWindow);
|
// Workaround for gtk2 bug with some window managers:
|
||||||
|
// calling gtk_window_unmaximize when the window is not maximized
|
||||||
|
// will cause window to shrink. Here we check if the window we are
|
||||||
|
// resizing is a form and use its WindowState property to make sure
|
||||||
|
// it is maximized before trying to unmaximize it which avoids the
|
||||||
|
// issue (custom code that uses the Win32 API will still have the
|
||||||
|
// problem though, but gtk2 does not offer a is_maximized method)
|
||||||
|
// see https://bugs.freepascal.org/view.php?id=31832
|
||||||
|
Control:=TWinControl(GetLCLObject({%H-}Pointer(hWnd)));
|
||||||
|
if (not (Control is TCustomForm)) or
|
||||||
|
(TCustomForm(Control).WindowState=wsMaximized) then
|
||||||
|
gtk_window_unmaximize(GtkWindow);
|
||||||
gtk_window_unfullscreen(GtkWindow);
|
gtk_window_unfullscreen(GtkWindow);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user