LCL-Gtk2: Fixed run-time maximization of forms with WindowState = wsMaximized under Xfce. Patch by Artem Izmaylov, issue #41219.

This commit is contained in:
Maxim Ganetsky 2025-07-17 16:21:59 +03:00
parent 26025977ef
commit e6f6b5b789

View File

@ -7192,13 +7192,11 @@ begin
// resize
gtk_window_resize(Window, Width, Height);
// reposition
if LockTopLevelWindowResizeOnNativeCall then
begin
gtk_window_get_position(Window, @x, @y);
if (x <> AWinControl.Left) or (y <> AWinControl.Top) then // for fly-wm + openbox
gtk_window_move(Window, AWinControl.Left, AWinControl.Top);
end
else
gtk_window_get_position(Window, @x, @y);
// dont move the control if position does not change.
// Required for fly-wm + openbox (refer to the LockTopLevelWindowResizeOnNativeCall method)
// Additionally, it required for maximized forms running on XCFE with borderless_maximize=off
if (x <> AWinControl.Left) or (y <> AWinControl.Top) then
gtk_window_move(Window, AWinControl.Left, AWinControl.Top);
// force early resize
allocation := PGtkWidget(Window)^.allocation;