Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package konsole for openSUSE:Factory checked in at 2021-08-28 22:28:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/konsole (Old) and /work/SRC/openSUSE:Factory/.konsole.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "konsole" Sat Aug 28 22:28:44 2021 rev:144 rq:914334 version:21.08.0 Changes: -------- --- /work/SRC/openSUSE:Factory/konsole/konsole.changes 2021-08-16 10:08:04.751346769 +0200 +++ /work/SRC/openSUSE:Factory/.konsole.new.1899/konsole.changes 2021-08-28 22:28:49.441956412 +0200 @@ -1,0 +2,12 @@ +Wed Aug 18 06:16:19 UTC 2021 - Antonio Larrosa <alarr...@suse.com> + +- Add patch from upstream to fix KXmlGUI toolbars and Konsole + MainWindow size (kde#436471, kde#430036, kde#439339, boo#1188074): + * 0001-Fix-KXmlGUI-toolbars-and-konsole-MainWindow-size.patch +- Add patch from upstream to fix the MainWindow size when there is + no saved size (like the first time a user runs Konsole) + (kde#437791): + * 0001-Fix-MainWindow-size-when-there-is-no-saved-size.patch + + +------------------------------------------------------------------- New: ---- 0001-Fix-KXmlGUI-toolbars-and-konsole-MainWindow-size.patch 0001-Fix-MainWindow-size-when-there-is-no-saved-size.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ konsole.spec ++++++ --- /var/tmp/diff_new_pack.Dcl4yw/_old 2021-08-28 22:28:50.113957109 +0200 +++ /var/tmp/diff_new_pack.Dcl4yw/_new 2021-08-28 22:28:50.117957113 +0200 @@ -40,6 +40,10 @@ Source24: utilities-terminal-su-48.png Source25: utilities-terminal-su-64.png Source26: utilities-terminal-su-128.png +# PATCH-FIX-UPSTREAM +Patch0: 0001-Fix-KXmlGUI-toolbars-and-konsole-MainWindow-size.patch +# PATCH-FIX-UPSTREAM +Patch1: 0001-Fix-MainWindow-size-when-there-is-no-saved-size.patch BuildRequires: fdupes BuildRequires: kf5-filesystem BuildRequires: update-desktop-files ++++++ 0001-Fix-KXmlGUI-toolbars-and-konsole-MainWindow-size.patch ++++++ >From fb7f838fd3138a39aea3bcb2e91f923741587137 Mon Sep 17 00:00:00 2001 From: Ahmad Samir <a.samir...@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 ++++++ 0001-Fix-MainWindow-size-when-there-is-no-saved-size.patch ++++++ >From c78edfbac49852cec40efd5cbe73c341bc06c5ab Mon Sep 17 00:00:00 2001 From: Ahmad Samir <a.samir...@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