public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/lazarus] multiple-IDE-widgetsets: Fix SIGSEGV in programs using Qt5 widgetset
@ 2026-07-23  8:18 Artur Frenszek-Iwicki
  0 siblings, 0 replies; only message in thread
From: Artur Frenszek-Iwicki @ 2026-07-23  8:18 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/lazarus
Branch : multiple-IDE-widgetsets
Commit : 9435ad2c50a2a0e63161dd934f07e88760ce3b9e
Author : Artur Frenszek-Iwicki <fedora@svgames.pl>
Date   : 2024-12-09T17:03:44+01:00
Stats  : +50/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/lazarus/c/9435ad2c50a2a0e63161dd934f07e88760ce3b9e?branch=multiple-IDE-widgetsets

Log:
Fix SIGSEGV in programs using Qt5 widgetset

---
diff --git a/0002-qt5-segfault.patch b/0002-qt5-segfault.patch
new file mode 100644
index 0000000..9a3976f
--- /dev/null
+++ b/0002-qt5-segfault.patch
@@ -0,0 +1,39 @@
+diff -U4 -r lazarus-3.6--orig/lazarus/lcl/interfaces/qt5/qtwsforms.pp lazarus-3.6--patched/lazarus/lcl/interfaces/qt5/qtwsforms.pp
+--- lazarus-3.6--orig/lazarus/lcl/interfaces/qt5/qtwsforms.pp	2024-09-29 11:39:45.000000000 +0200
++++ lazarus-3.6--patched/lazarus/lcl/interfaces/qt5/qtwsforms.pp	2024-12-09 16:58:22.751428297 +0100
+@@ -1034,20 +1034,23 @@
+     begin
+       if Assigned(TCustomForm(AWinControl).Menu) then
+       begin
+         AWin := TQtMainWindow(AWinControl.Handle);
+-        AWin.MenuBar.sizeHint(@ASize);
+-        // geometry isn't updated yet
+-        if ASize.cy < 10 then
+-          ASize.cy := 0;
+-        // we must use real geometry, and then exclude menubar height.
+-        aClientRect := AWin.getGeometry;
+-        Types.OffsetRect(aClientRect, -aClientRect.Left, -aClientRect.Top);
+-        dec(AClientRect.Bottom, ASize.cy);
+-        {$IFDEF VerboseQtResize}
+-        DebugLn('TQtWSCustomForm.getDefaultClientRect ',dbgsName(AWinControl),' ',dbgs(AWin.getClientBounds),' mnuBarHeight ',dbgs(AWin.MenuBar.getHeight),' ASize=',dbgs(ASize),' FINAL=',dbgs(AClientRect));
+-        {$ENDIF}
+-        Result := True;
++        if Assigned(AWin.MenuBar) then
++        begin
++          AWin.MenuBar.sizeHint(@ASize);
++          // geometry isn't updated yet
++          if ASize.cy < 10 then
++            ASize.cy := 0;
++          // we must use real geometry, and then exclude menubar height.
++          aClientRect := AWin.getGeometry;
++          Types.OffsetRect(aClientRect, -aClientRect.Left, -aClientRect.Top);
++          dec(AClientRect.Bottom, ASize.cy);
++          {$IFDEF VerboseQtResize}
++          DebugLn('TQtWSCustomForm.getDefaultClientRect ',dbgsName(AWinControl),' ',dbgs(AWin.getClientBounds),' mnuBarHeight ',dbgs(AWin.MenuBar.getHeight),' ASize=',dbgs(ASize),' FINAL=',dbgs(AClientRect));
++          {$ENDIF}
++          Result := True;
++        end;
+       end;
+     end;
+   end;
+ end;

diff --git a/lazarus.spec b/lazarus.spec
index 77de4d2..416dc28 100644
--- a/lazarus.spec
+++ b/lazarus.spec
@@ -3,7 +3,7 @@ Summary:        Lazarus Component Library and IDE for Free Pascal
 
 Version:        3.6
 
-%global baserelease 1
+%global baserelease 2
 Release:        %{baserelease}%{?dist}
 
 # The qt5pas version is taken from lcl/interfaces/qt5/cbindings/Qt5Pas.pro
@@ -39,6 +39,13 @@ Patch0:         0000-Makefile_patch.diff
 # https://sources.debian.org/data/main/l/lazarus/3.0%2Bdfsg1-6/debian/patches/Fixed-crash-when-trying-to-recompile-packages.patch
 Patch1:         0001-crash-when-trying-to-recompile-packages.patch
 
+# Fix SIGSEGV on startup in programs built using the Qt5 widgetset
+# rhbz: https://bugzilla.redhat.com/show_bug.cgi?id=2323227
+#
+# Backport of upstream commit:
+# https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/7ae720285564f69e85216a0889b3ae4308661860
+Patch2:         0002-qt5-segfault.patch
+
 # -- Build-time dependencies
 
 BuildRequires:  binutils
@@ -557,6 +564,9 @@ appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{name}.appdat
 
 
 %changelog
+* Mon Dec 09 2024 Artur Frenszek-Iwicki <fedora@svgames.pl> - 3.6-2
+- Add a patch to fix SIGSEGV in programs built using Qt5 widgetset
+
 * Mon Sep 30 2024 Artur Frenszek-Iwicki <fedora@svgames.pl> - 3.6-1
 - Update to v3.6
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-23  8:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-23  8:18 [rpms/lazarus] multiple-IDE-widgetsets: Fix SIGSEGV in programs using Qt5 widgetset Artur Frenszek-Iwicki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox