commit:     c0e6cbb16cc7682173870439709ba880e1460b46
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 13 20:06:18 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Fri Aug 13 20:13:47 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0e6cbb1

kde-apps/konsole: Prevent window "flashing" when closing last session

Upstream commit 302c16791935cc3cf262aee355afce13d694b00f

KDE-bug: https://bugs.kde.org/show_bug.cgi?id=432077
Bug: https://bugs.gentoo.org/807933
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ...konsole-21.04.3-no-flash-on-session-close.patch | 81 ++++++++++++++++++++++
 kde-apps/konsole/konsole-21.04.3-r1.ebuild         | 76 ++++++++++++++++++++
 kde-apps/konsole/konsole-21.08.0-r1.ebuild         | 72 +++++++++++++++++++
 3 files changed, 229 insertions(+)

diff --git 
a/kde-apps/konsole/files/konsole-21.04.3-no-flash-on-session-close.patch 
b/kde-apps/konsole/files/konsole-21.04.3-no-flash-on-session-close.patch
new file mode 100644
index 00000000000..d8b14f2f166
--- /dev/null
+++ b/kde-apps/konsole/files/konsole-21.04.3-no-flash-on-session-close.patch
@@ -0,0 +1,81 @@
+From 302c16791935cc3cf262aee355afce13d694b00f Mon Sep 17 00:00:00 2001
+From: Ahmad Samir <[email protected]>
+Date: Thu, 12 Aug 2021 13:58:20 +0200
+Subject: [PATCH] Prevent window "flashing" when closing the last session
+
+There are two scenarios when closing a window:
+A) clicking the close button on the title bar (or Ctrl+Shift+Q):
+~MainWindow()
+~ViewManager()
+~TabbedViewContainer()
+~TerminalDisplay()
+~Session()
+
+B) closing the last session/tab in a window:
+SessionController::sessionFinished()
+~Session()
+~TerminalDisplay()
+~TabbedViewContainer()
+~MainWindow()
+~ViewManager()
+
+the issue with the second case is that the TerminalDisplay is torn down
+first, which exposes the TabbedViewContainer widget, the latter has the same
+Qt::Window colour as the system colour scheme window background colour, if
+you're using a dark terminal colour scheme and a light-coloured system colour
+scheme, you could see some "flashing" when you close the last session with
+e.g. Ctrl+D.
+
+To fix this, in sessionFinished() check if TabbedViewContainer::count() is
+1 (i.e. closing last tab/session), and emit the empty() signal in that case,
+which is connected to MainwWindow::close(), then the order of tear down
+becomes:
+SessionController::sessionFinished()
+~Session()
+~MainWindow()
+~ViewManager()
+~TabbedViewContainer()
+~TerminalDisplay()
+
+BUG: 432077
+FIXED-IN: 21.12
+(cherry picked from commit bbec72250d080ce286a6762fb9beee4b6e7981c9)
+---
+ src/MainWindow.cpp  | 2 +-
+ src/ViewManager.cpp | 7 +++++++
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
+index cc38b3990..0fae334de 100644
+--- a/src/MainWindow.cpp
++++ b/src/MainWindow.cpp
+@@ -102,7 +102,7 @@ MainWindow::MainWindow() :
+ 
+     // create view manager
+     _viewManager = new ViewManager(this, actionCollection());
+-    connect(_viewManager, &Konsole::ViewManager::empty, this, 
&Konsole::MainWindow::close);
++    connect(_viewManager, &Konsole::ViewManager::empty, this, 
&QWidget::close);
+     connect(_viewManager, &Konsole::ViewManager::activeViewChanged, this,
+             &Konsole::MainWindow::activeViewChanged);
+     connect(_viewManager, &Konsole::ViewManager::unplugController, this,
+diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp
+index 751684dc8..4d33a4cf8 100644
+--- a/src/ViewManager.cpp
++++ b/src/ViewManager.cpp
+@@ -461,6 +461,13 @@ void ViewManager::sessionFinished()
+         return;
+     }
+ 
++    // The last session/tab? emit empty() so that close() is called in
++    // MainWindow, fixes #432077
++    if (_viewContainer->count() == 1) {
++        Q_EMIT empty();
++        return;
++    }
++
+     auto *session = qobject_cast<Session *>(sender());
+     Q_ASSERT(session);
+ 
+-- 
+GitLab
+

diff --git a/kde-apps/konsole/konsole-21.04.3-r1.ebuild 
b/kde-apps/konsole/konsole-21.04.3-r1.ebuild
new file mode 100644
index 00000000000..eb5601c28fc
--- /dev/null
+++ b/kde-apps/konsole/konsole-21.04.3-r1.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+ECM_HANDBOOK="optional"
+ECM_TEST="true"
+KFMIN=5.80.0
+QTMIN=5.15.2
+VIRTUALX_REQUIRED="test"
+inherit ecm kde.org
+
+DESCRIPTION="KDE's terminal emulator"
+HOMEPAGE="https://apps.kde.org/konsole/ https://konsole.kde.org";
+
+LICENSE="GPL-2" # TODO: CHECK
+SLOT="5"
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
+IUSE="X"
+
+DEPEND="
+       >=dev-qt/qtdbus-${QTMIN}:5
+       >=dev-qt/qtgui-${QTMIN}:5
+       >=dev-qt/qtnetwork-${QTMIN}:5
+       >=dev-qt/qtprintsupport-${QTMIN}:5
+       >=dev-qt/qtwidgets-${QTMIN}:5
+       >=dev-qt/qtxml-${QTMIN}:5
+       >=kde-frameworks/kbookmarks-${KFMIN}:5
+       >=kde-frameworks/kconfig-${KFMIN}:5
+       >=kde-frameworks/kconfigwidgets-${KFMIN}:5
+       >=kde-frameworks/kcoreaddons-${KFMIN}:5
+       >=kde-frameworks/kcrash-${KFMIN}:5
+       >=kde-frameworks/kdbusaddons-${KFMIN}:5
+       >=kde-frameworks/kguiaddons-${KFMIN}:5
+       >=kde-frameworks/kjobwidgets-${KFMIN}:5
+       >=kde-frameworks/ki18n-${KFMIN}:5
+       >=kde-frameworks/kinit-${KFMIN}:5
+       >=kde-frameworks/kiconthemes-${KFMIN}:5
+       >=kde-frameworks/kio-${KFMIN}:5
+       >=kde-frameworks/knewstuff-${KFMIN}:5
+       >=kde-frameworks/knotifications-${KFMIN}:5
+       >=kde-frameworks/knotifyconfig-${KFMIN}:5
+       >=kde-frameworks/kparts-${KFMIN}:5
+       >=kde-frameworks/kpty-${KFMIN}:5
+       >=kde-frameworks/kservice-${KFMIN}:5
+       >=kde-frameworks/ktextwidgets-${KFMIN}:5
+       >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
+       >=kde-frameworks/kwindowsystem-${KFMIN}:5
+       >=kde-frameworks/kxmlgui-${KFMIN}:5
+       X? ( x11-libs/libX11 )
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=( "${FILESDIR}/${P}-no-flash-on-session-close.patch" ) # bug 807933
+
+src_prepare() {
+       ecm_src_prepare
+       ecm_punt_bogus_dep KF5 Completion
+}
+
+src_configure() {
+       local mycmakeargs=(
+               $(cmake_use_find_package X X11)
+       )
+
+       ecm_src_configure
+}
+
+src_test() {
+       # drkonqi process interferes. bug 702690
+       local myctestargs=(
+               -E "(DBusTest)"
+       )
+
+       ecm_src_test
+}

diff --git a/kde-apps/konsole/konsole-21.08.0-r1.ebuild 
b/kde-apps/konsole/konsole-21.08.0-r1.ebuild
new file mode 100644
index 00000000000..a9745100e0f
--- /dev/null
+++ b/kde-apps/konsole/konsole-21.08.0-r1.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+ECM_HANDBOOK="optional"
+ECM_TEST="true"
+KFMIN=5.84.0
+QTMIN=5.15.2
+VIRTUALX_REQUIRED="test"
+inherit ecm kde.org
+
+DESCRIPTION="KDE's terminal emulator"
+HOMEPAGE="https://apps.kde.org/konsole/ https://konsole.kde.org";
+
+LICENSE="GPL-2" # TODO: CHECK
+SLOT="5"
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
+IUSE="X"
+
+DEPEND="
+       >=dev-qt/qtdbus-${QTMIN}:5
+       >=dev-qt/qtgui-${QTMIN}:5
+       >=dev-qt/qtnetwork-${QTMIN}:5
+       >=dev-qt/qtprintsupport-${QTMIN}:5
+       >=dev-qt/qtwidgets-${QTMIN}:5
+       >=dev-qt/qtxml-${QTMIN}:5
+       >=kde-frameworks/kbookmarks-${KFMIN}:5
+       >=kde-frameworks/kconfig-${KFMIN}:5
+       >=kde-frameworks/kconfigwidgets-${KFMIN}:5
+       >=kde-frameworks/kcoreaddons-${KFMIN}:5
+       >=kde-frameworks/kcrash-${KFMIN}:5
+       >=kde-frameworks/kdbusaddons-${KFMIN}:5
+       >=kde-frameworks/kguiaddons-${KFMIN}:5
+       >=kde-frameworks/kjobwidgets-${KFMIN}:5
+       >=kde-frameworks/ki18n-${KFMIN}:5
+       >=kde-frameworks/kiconthemes-${KFMIN}:5
+       >=kde-frameworks/kio-${KFMIN}:5
+       >=kde-frameworks/knewstuff-${KFMIN}:5
+       >=kde-frameworks/knotifications-${KFMIN}:5
+       >=kde-frameworks/knotifyconfig-${KFMIN}:5
+       >=kde-frameworks/kparts-${KFMIN}:5
+       >=kde-frameworks/kpty-${KFMIN}:5
+       >=kde-frameworks/kservice-${KFMIN}:5
+       >=kde-frameworks/ktextwidgets-${KFMIN}:5
+       >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
+       >=kde-frameworks/kwindowsystem-${KFMIN}:5
+       >=kde-frameworks/kxmlgui-${KFMIN}:5
+       X? ( x11-libs/libX11 )
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-21.04.3-no-flash-on-session-close.patch" # bug 807933
+)
+
+src_configure() {
+       local mycmakeargs=(
+               $(cmake_use_find_package X X11)
+       )
+
+       ecm_src_configure
+}
+
+src_test() {
+       # drkonqi process interferes. bug 702690
+       local myctestargs=(
+               -E "(DBusTest)"
+       )
+
+       ecm_src_test
+}

Reply via email to