public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: kde-apps/konsole/, kde-apps/konsole/files/
Date: Sun, 15 Aug 2021 19:11:29 +0000 (UTC)	[thread overview]
Message-ID: <1629054680.a69ea70b1f7c6b56cde64cc2dc2604ecc19c4355.asturm@gentoo> (raw)

commit:     a69ea70b1f7c6b56cde64cc2dc2604ecc19c4355
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 15 19:10:27 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Aug 15 19:11:20 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a69ea70b

kde-apps/konsole: Fix KXmlGUI toolbars and MainWindow size

Upstream commit fb7f838fd3138a39aea3bcb2e91f923741587137

See also:
https://invent.kde.org/utilities/konsole/-/merge_requests/457

KDE-bug: https://bugs.kde.org/show_bug.cgi?id=430036
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=436471
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=439339
Reported-by: Lars Wendler <polynomial-c <AT> gentoo.org>
Tested-by: Lars Wendler <polynomial-c <AT> gentoo.org>
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ...-fix-KXmlGUI-toolbars-and-MainWindow-size.patch | 73 ++++++++++++++++++++++
 ...21.08.0-r1.ebuild => konsole-21.08.0-r2.ebuild} |  2 +
 2 files changed, 75 insertions(+)

diff --git a/kde-apps/konsole/files/konsole-21.08.0-fix-KXmlGUI-toolbars-and-MainWindow-size.patch b/kde-apps/konsole/files/konsole-21.08.0-fix-KXmlGUI-toolbars-and-MainWindow-size.patch
new file mode 100644
index 00000000000..fc62466ea62
--- /dev/null
+++ b/kde-apps/konsole/files/konsole-21.08.0-fix-KXmlGUI-toolbars-and-MainWindow-size.patch
@@ -0,0 +1,73 @@
+From fb7f838fd3138a39aea3bcb2e91f923741587137 Mon Sep 17 00:00:00 2001
+From: Ahmad Samir <a.samirh78@gmail.com>
+Date: Thu, 29 Jul 2021 18:44:07 +0200
+Subject: [PATCH] Fix KXmlGUI toolbars; and Konsole MainWindow size
+
+Call setupGUI(), which will call createGUI (since we set the
+KXmlGuiWindow::Create flag), omit the StatusBar flag since we don't have a
+statusbar and don't want the "Show StatusBar" menu action.
+
+TabbedViewContainer::sizeHint() calculates an optimum size for itself,
+including the sizes of its child widgets; added in efb621d091c05f11 by
+Mariusz Glebocki; following the code:
+MainWindow creates a ViewManager
+ViewManager creates a TabbedViewContainer and then a TerminalDisplay
+
+which means that the first time TabbedViewContainer::sizeHint() is called
+the TerminalDisplay widget size is 0, then TabbedViewContainer::sizeHint()
+would return 0.
+
+Which is why calling resize() in MainWindow was delayed to the showEvent(),
+(and even delayed more by a QTimer::singleShot() call in Application),
+at which point all the child widgets have been created and
+MainWindow::sizeHint() (which logically takes into account the sizeHint()
+of its child widgets) would return a sensible size.
+
+CCBUG: 430036
+CCBUG: 439339
+BUG: 436471
+
+
+(cherry picked from commit 090356661c92bfedeeeaf6f4f77d294facb3d8c6)
+---
+ src/MainWindow.cpp | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
+index c67acf8b9..a4b36b61d 100644
+--- a/src/MainWindow.cpp
++++ b/src/MainWindow.cpp
+@@ -131,8 +131,10 @@ MainWindow::MainWindow() :
+     // in terminal applications
+     KAcceleratorManager::setNoAccel(menuBar());
+ 
+-    // create menus
+-    createGUI();
++    constexpr KXmlGuiWindow::StandardWindowOptions guiOpts = ToolBar | Keys | Save | Create;
++    const QString xmlFile = componentName() + QLatin1String("ui.rc"); // Typically "konsoleui.rc"
++    // The "Create" flag will make it call createGUI()
++    setupGUI(guiOpts, xmlFile);
+ 
+     // remember the original menu accelerators for later use
+     rememberMenuAccelerators();
+@@ -945,9 +947,14 @@ void MainWindow::showEvent(QShowEvent *event)
+         menuBar()->setVisible(_menuBarInitialVisibility);
+         _toggleMenuBarAction->setChecked(_menuBarInitialVisibility);
+         _menuBarInitialVisibilityApplied = true;
+-        if (!KonsoleSettings::saveGeometryOnExit()) {
+-            resize(sizeHint());
+-        }
++    }
++
++    if (!KonsoleSettings::saveGeometryOnExit()) {
++        // Delay resizing to here, so that the other parts of the UI
++        // (ViewManager, TabbedViewContainer, TerminalDisplay ... etc)
++        // have been created and TabbedViewContainer::sizeHint() returns
++        // a usuable size.
++        resize(sizeHint());
+     }
+ 
+     // Call parent method
+-- 
+GitLab
+

diff --git a/kde-apps/konsole/konsole-21.08.0-r1.ebuild b/kde-apps/konsole/konsole-21.08.0-r2.ebuild
similarity index 93%
rename from kde-apps/konsole/konsole-21.08.0-r1.ebuild
rename to kde-apps/konsole/konsole-21.08.0-r2.ebuild
index 4095d9ac5f9..00032973af8 100644
--- a/kde-apps/konsole/konsole-21.08.0-r1.ebuild
+++ b/kde-apps/konsole/konsole-21.08.0-r2.ebuild
@@ -53,6 +53,8 @@ RDEPEND="${DEPEND}"
 PATCHES=(
 	"${FILESDIR}/${PN}-21.04.3-no-flash-on-session-close.patch" # bug 807933
 	"${FILESDIR}/${P}-fix-crash-w-blur.patch" # bug 807905, fixed in 21.08.1
+	# KDE-bugs 430036, 439339; backport pending for 21.08 branch
+	"${FILESDIR}/${P}-fix-KXmlGUI-toolbars-and-MainWindow-size.patch"
 )
 
 src_configure() {


             reply	other threads:[~2021-08-15 21:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-15 19:11 Andreas Sturmlechner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-06-26 20:18 [gentoo-commits] repo/gentoo:master commit in: kde-apps/konsole/, kde-apps/konsole/files/ Sam James
2021-09-22 21:59 Andreas Sturmlechner
2021-08-24 13:39 Andreas Sturmlechner
2021-08-13 20:14 Andreas Sturmlechner
2021-05-01 21:24 Andreas Sturmlechner
2020-05-28 20:20 Andreas Sturmlechner
2020-03-23 23:57 Andreas Sturmlechner
2018-12-23  1:25 Andreas Sturmlechner
2018-02-08  0:10 Andreas Sturmlechner
2017-04-25 12:47 Michael Palimaka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1629054680.a69ea70b1f7c6b56cde64cc2dc2604ecc19c4355.asturm@gentoo \
    --to=asturm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox