summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2021-08-18 09:18:16 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2021-08-18 09:19:17 +0200
commitf0b8fd584285365af19662391cbb62af44c039bf (patch)
treeec1058eb68ae2943428c373953a7dbad4efbe0b3 /kde-apps
parentdev-python/hcloud-python: Bump to 1.16.0 (diff)
downloadgentoo-f0b8fd584285365af19662391cbb62af44c039bf.tar.gz
gentoo-f0b8fd584285365af19662391cbb62af44c039bf.tar.bz2
gentoo-f0b8fd584285365af19662391cbb62af44c039bf.zip
kde-apps/konsole: Fix MainWindow size when there is no saved size
Upstream commit c78edfbac49852cec40efd5cbe73c341bc06c5ab See also: https://mail.kde.org/pipermail/distributions/2021-August/001044.html KDE-bug: https://bugs.kde.org/show_bug.cgi?id=437791 Bug: https://bugs.gentoo.org/808627 Package-Manager: Portage-3.0.20, Repoman-3.0.3 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'kde-apps')
-rw-r--r--kde-apps/konsole/files/konsole-21.08.0-fix-MainWindow-size-w-o-saved-size.patch79
-rw-r--r--kde-apps/konsole/konsole-21.08.0-r3.ebuild (renamed from kde-apps/konsole/konsole-21.08.0-r2.ebuild)4
2 files changed, 81 insertions, 2 deletions
diff --git a/kde-apps/konsole/files/konsole-21.08.0-fix-MainWindow-size-w-o-saved-size.patch b/kde-apps/konsole/files/konsole-21.08.0-fix-MainWindow-size-w-o-saved-size.patch
new file mode 100644
index 000000000000..48fe1be666af
--- /dev/null
+++ b/kde-apps/konsole/files/konsole-21.08.0-fix-MainWindow-size-w-o-saved-size.patch
@@ -0,0 +1,79 @@
+From c78edfbac49852cec40efd5cbe73c341bc06c5ab Mon Sep 17 00:00:00 2001
+From: Ahmad Samir <a.samirh78@gmail.com>
+Date: Thu, 29 Jul 2021 18:45:45 +0200
+Subject: [PATCH] Fix MainWindow size when there is no saved size
+
+The very first time a user runs Konsole, where is no konsolerc file in $HOME,
+there is no saved size to restore, instead use the sizeHint(), which ideally
+will be the size set in the default profile (based on lines/columns setting).
+
+CCBUG: 437791
+---
+ src/MainWindow.cpp | 21 +++++++++++++++------
+ src/MainWindow.h | 1 +
+ 2 files changed, 16 insertions(+), 6 deletions(-)
+
+diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
+index a4b36b61d..9b025c8fe 100644
+--- a/src/MainWindow.cpp
++++ b/src/MainWindow.cpp
+@@ -70,13 +70,22 @@ MainWindow::MainWindow() :
+ _menuBarInitialVisibility(true),
+ _menuBarInitialVisibilityApplied(false)
+ {
+- if (!KonsoleSettings::saveGeometryOnExit()) {
++ KSharedConfigPtr konsoleConfig = KSharedConfig::openConfig(QStringLiteral("konsolerc"));
++ KConfigGroup cg = konsoleConfig->group(QStringLiteral("MainWindow"));
++ const bool isGroup = cg.exists();
++ if (isGroup) {
++ const QString stateConfig = cg.readEntry(QStringLiteral("State"));
++
++ // If "stateConfig" is empty then this is the very first run,
++ // i.e. no konsolerc file in $HOME
++ _isSavedUiState = !stateConfig.isEmpty();
++ }
++
++ if (isGroup && !KonsoleSettings::saveGeometryOnExit()) {
+ // If we are not using the global Konsole save geometry on exit,
+ // remove all geometry data from [MainWindow] in Konsolerc, so KWin will
+ // manage it directly
+- KSharedConfigPtr konsoleConfig = KSharedConfig::openConfig(QStringLiteral("konsolerc"));
+- KConfigGroup group = konsoleConfig->group("MainWindow");
+- QMap<QString, QString> configEntries = group.entryMap();
++ QMap<QString, QString> configEntries = cg.entryMap();
+ QMapIterator<QString, QString> i(configEntries);
+
+ while (i.hasNext()) {
+@@ -93,7 +102,7 @@ MainWindow::MainWindow() :
+ || i.key().contains(QLatin1String(" YPosition"))
+ #endif
+ ) {
+- group.deleteEntry(i.key());
++ cg.deleteEntry(i.key());
+ }
+ }
+ }
+@@ -949,7 +958,7 @@ void MainWindow::showEvent(QShowEvent *event)
+ _menuBarInitialVisibilityApplied = true;
+ }
+
+- if (!KonsoleSettings::saveGeometryOnExit()) {
++ if (!_isSavedUiState || !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
+diff --git a/src/MainWindow.h b/src/MainWindow.h
+index a80674012..876a81d71 100644
+--- a/src/MainWindow.h
++++ b/src/MainWindow.h
+@@ -200,6 +200,7 @@ private:
+ bool _menuBarInitialVisibility;
+ bool _menuBarInitialVisibilityApplied;
+ bool _blurEnabled = false;
++ bool _isSavedUiState = false;
+ };
+ }
+
+--
+GitLab
+
diff --git a/kde-apps/konsole/konsole-21.08.0-r2.ebuild b/kde-apps/konsole/konsole-21.08.0-r3.ebuild
index 00032973af8f..fe8cab4b97f8 100644
--- a/kde-apps/konsole/konsole-21.08.0-r2.ebuild
+++ b/kde-apps/konsole/konsole-21.08.0-r3.ebuild
@@ -53,8 +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"
+ "${FILESDIR}/${P}-fix-KXmlGUI-toolbars-and-MainWindow-size.patch" # KDE-bugs 430036, 439339
+ "${FILESDIR}/${P}-fix-MainWindow-size-w-o-saved-size.patch" # KDE-bug 437791
)
src_configure() {