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-09-25 00:35:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/konsole (Old)
 and      /work/SRC/openSUSE:Factory/.konsole.new.1899 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "konsole"

Sat Sep 25 00:35:16 2021 rev:146 rq:920190 version:21.08.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/konsole/konsole.changes  2021-09-04 
22:35:16.612145315 +0200
+++ /work/SRC/openSUSE:Factory/.konsole.new.1899/konsole.changes        
2021-09-25 00:35:56.931164107 +0200
@@ -1,0 +2,9 @@
+Sat Sep 18 13:57:16 UTC 2021 - Fabian Vogt <fab...@ritter-vogt.de>
+
+- Add patches to fix some more window size related issues:
+  * 0001-Don-t-resize-window-when-switching-virtual-desktops-.patch
+    (kde#441610)
+  * 0002-Always-save-the-window-state-and-geometry.patch
+    (kde#442252, boo#1189927)
+
+-------------------------------------------------------------------
@@ -30 +38,0 @@
-

New:
----
  0001-Don-t-resize-window-when-switching-virtual-desktops-.patch
  0002-Always-save-the-window-state-and-geometry.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ konsole.spec ++++++
--- /var/tmp/diff_new_pack.MRTok3/_old  2021-09-25 00:35:57.503164704 +0200
+++ /var/tmp/diff_new_pack.MRTok3/_new  2021-09-25 00:35:57.507164708 +0200
@@ -40,6 +40,9 @@
 Source24:       utilities-terminal-su-48.png
 Source25:       utilities-terminal-su-64.png
 Source26:       utilities-terminal-su-128.png
+# PATCH-FIX-UPSTREAM
+Patch1:         0001-Don-t-resize-window-when-switching-virtual-desktops-.patch
+Patch2:         0002-Always-save-the-window-state-and-geometry.patch
 BuildRequires:  fdupes
 BuildRequires:  kf5-filesystem
 BuildRequires:  update-desktop-files

++++++ 0001-Don-t-resize-window-when-switching-virtual-desktops-.patch ++++++
>From 99c50fe5264aaae05bd06206030eb9b3088dfa71 Mon Sep 17 00:00:00 2001
From: Ahmad Samir <a.samir...@gmail.com>
Date: Fri, 27 Aug 2021 19:59:30 +0200
Subject: [PATCH 1/2] Don't resize window when switching virtual desktops in
 OpenBox

It looks like switching virtual desktops in OpenBox invokes a show event
(this doesn't happen while running Plasma).

The code in MainWindow::showEvent() should only be run once on first show,
so guard it with a bool member.

BUG: 441610
FIXED-IN: 21.08.1
(cherry picked from commit 68f1505d5f6ffe6406a48732a76dbc43ff88f352)
---
 src/MainWindow.cpp | 23 +++++++++++------------
 src/MainWindow.h   |  2 +-
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index 9b025c8f..3709759e 100644
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -67,8 +67,7 @@ MainWindow::MainWindow() :
     _toggleMenuBarAction(nullptr),
     _newTabMenuAction(nullptr),
     _pluggedController(nullptr),
-    _menuBarInitialVisibility(true),
-    _menuBarInitialVisibilityApplied(false)
+    _menuBarInitialVisibility(true)
 {
     KSharedConfigPtr konsoleConfig = 
KSharedConfig::openConfig(QStringLiteral("konsolerc"));
     KConfigGroup cg = konsoleConfig->group(QStringLiteral("MainWindow"));
@@ -947,23 +946,23 @@ void MainWindow::setRemoveWindowTitleBarAndFrame(bool 
frameless)
 
 void MainWindow::showEvent(QShowEvent *event)
 {
-    // Make sure the 'initial' visibility is applied only once.
-    if (!_menuBarInitialVisibilityApplied) {
+    // Apply this code on first show only
+    if (_firstShowEvent) {
+        _firstShowEvent = false;
         // the initial visibility of menubar should be applied at this last
         // moment. Otherwise, the initial visibility will be determined by
         // what KMainWindow has automatically stored in konsolerc, but not by
         // what users has explicitly configured .
         menuBar()->setVisible(_menuBarInitialVisibility);
         _toggleMenuBarAction->setChecked(_menuBarInitialVisibility);
-        _menuBarInitialVisibilityApplied = true;
-    }
 
-    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
-        // a usuable size.
-        resize(sizeHint());
+        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
+            // a usuable size.
+            resize(sizeHint());
+        }
     }
 
     // Call parent method
diff --git a/src/MainWindow.h b/src/MainWindow.h
index 876a81d7..e598b3b6 100644
--- a/src/MainWindow.h
+++ b/src/MainWindow.h
@@ -198,7 +198,7 @@ private:
     QPointer<SessionController> _pluggedController;
     QList<IKonsolePlugin*> _plugins;
     bool _menuBarInitialVisibility;
-    bool _menuBarInitialVisibilityApplied;
+    bool _firstShowEvent = true;
     bool _blurEnabled = false;
     bool _isSavedUiState = false;
 };
-- 
2.33.0

++++++ 0002-Always-save-the-window-state-and-geometry.patch ++++++
>From ef7bbedf124e05ce9e702a49cd24706570be3a95 Mon Sep 17 00:00:00 2001
From: Ahmad Samir <a.samir...@gmail.com>
Date: Sat, 11 Sep 2021 01:27:26 +0200
Subject: [PATCH 2/2] Always save the window state and geometry

This includes the toolbar/menubar/dockwidget states (i.e. the State= config
key), and the window geometry. I was wrong to think the State= key included
the window geometry.

Depending on the "remeber window size" setting, we can apply the size saved
in the config file or the size from the profile settings (lines x columns),
which is included in MainWindow::sizeHint().

BUG: 442252
FIXED-IN: 21.12
(cherry picked from commit 3177c9ef8a21bacd52a11e797675e0488bad9e15)
---
 src/MainWindow.cpp | 66 ++++++++++++++++++----------------------------
 src/MainWindow.h   |  7 ++++-
 2 files changed, 31 insertions(+), 42 deletions(-)

diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index 3709759e..cc55b350 100644
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -69,43 +69,6 @@ MainWindow::MainWindow() :
     _pluggedController(nullptr),
     _menuBarInitialVisibility(true)
 {
-    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
-        QMap<QString, QString> configEntries = cg.entryMap();
-        QMapIterator<QString, QString> i(configEntries);
-
-        while (i.hasNext()) {
-            i.next();
-// After https://bugs.kde.org/show_bug.cgi?id=415150 was fixed in 5.74,
-// the config file keys changed
-#if KIO_VERSION < QT_VERSION_CHECK(5, 75, 0)
-            if (i.key().startsWith(QLatin1String("Width"))
-                || i.key().startsWith(QLatin1String("Height"))
-#else
-            if (i.key().contains(QLatin1String(" Width"))
-                || i.key().contains(QLatin1String(" Height"))
-                || i.key().contains(QLatin1String(" XPosition"))
-                || i.key().contains(QLatin1String(" YPosition"))
-#endif
-            ) {
-                cg.deleteEntry(i.key());
-            }
-        }
-    }
-
     updateUseTransparency();
 
     // create actions for menus
@@ -165,6 +128,26 @@ MainWindow::MainWindow() :
     }
 }
 
+bool MainWindow::wasWindowGeometrySaved() const
+{
+    KSharedConfigPtr konsoleConfig = 
KSharedConfig::openConfig(QStringLiteral("konsolerc"));
+    KConfigGroup cg = konsoleConfig->group(QStringLiteral("MainWindow"));
+    if (!cg.exists()) { // First run, no existing konsolerc?
+        return false;
+    }
+
+    const QMap<QString, QString> entries = cg.entryMap();
+    for (auto it = entries.cbegin(), itEnd = entries.cend(); it != itEnd; 
++it) {
+        const QString configKey = it.key();
+        if (configKey.contains(QLatin1String(" Width")) || 
configKey.contains(QLatin1String(" Height")) || 
configKey.contains(QLatin1String(" XPosition"))
+            || configKey.contains(QLatin1String(" YPosition"))) {
+            return true;
+        }
+    }
+
+    return false;
+}
+
 void MainWindow::updateUseTransparency()
 {
     if (!WindowSystemInfo::HAVE_TRANSPARENCY) {
@@ -853,9 +836,10 @@ void MainWindow::applyKonsoleSettings()
     }
 
     
_viewManager->activeContainer()->setNavigationBehavior(KonsoleSettings::newTabBehavior());
-    if (KonsoleSettings::saveGeometryOnExit() != autoSaveSettings()) {
-        setAutoSaveSettings(QStringLiteral("MainWindow"), 
KonsoleSettings::saveGeometryOnExit());
-    }
+
+    // Save the toolbar/menu/dockwidget states and the window geometry
+    setAutoSaveSettings();
+
     updateWindowCaption();
 }
 
@@ -956,7 +940,7 @@ void MainWindow::showEvent(QShowEvent *event)
         menuBar()->setVisible(_menuBarInitialVisibility);
         _toggleMenuBarAction->setChecked(_menuBarInitialVisibility);
 
-        if (!_isSavedUiState || !KonsoleSettings::saveGeometryOnExit()) {
+        if (!KonsoleSettings::saveGeometryOnExit() || 
!wasWindowGeometrySaved()) {
             // 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 e598b3b6..94697c45 100644
--- a/src/MainWindow.h
+++ b/src/MainWindow.h
@@ -172,6 +172,12 @@ public Q_SLOTS:
     void viewFullScreen(bool fullScreen);
 
 private:
+    /**
+     * Returns true if the window geometry was previously saved to the
+     * config file, false otherwise.
+     */
+    bool wasWindowGeometrySaved() const;
+
     void correctStandardShortcuts();
     void rememberMenuAccelerators();
     void removeMenuAccelerators();
@@ -200,7 +206,6 @@ private:
     bool _menuBarInitialVisibility;
     bool _firstShowEvent = true;
     bool _blurEnabled = false;
-    bool _isSavedUiState = false;
 };
 }
 
-- 
2.33.0

Reply via email to