[rkward] rkward/windows: When adding tool windows (during start up or later), don't force them active.

Thomas Friedrichsmeier null at kde.org
Thu Feb 6 15:27:32 GMT 2020


Git commit b9dcce99e58082f81a93317166ca24f65d9671a4 by Thomas Friedrichsmeier.
Committed on 06/02/2020 at 15:27.
Pushed by tfry into branch 'master'.

When adding tool windows (during start up or later), don't force them active.

M  +1    -0    rkward/windows/detachedwindowcontainer.cpp
M  +1    -1    rkward/windows/katepluginintegration.cpp
M  +2    -1    rkward/windows/rktoolwindowbar.cpp
M  +1    -2    rkward/windows/rkworkplace.cpp

https://commits.kde.org/rkward/b9dcce99e58082f81a93317166ca24f65d9671a4

diff --git a/rkward/windows/detachedwindowcontainer.cpp b/rkward/windows/detachedwindowcontainer.cpp
index f298287a..ce0966d4 100644
--- a/rkward/windows/detachedwindowcontainer.cpp
+++ b/rkward/windows/detachedwindowcontainer.cpp
@@ -143,6 +143,7 @@ void DetachedWindowContainer::slotReattach () {
 	RK_TRACE (APP);
 
 	RKWorkplace::mainWorkplace ()->attachWindow (captured);
+	captured->activate ();
 }
 
 void DetachedWindowContainer::closeEvent (QCloseEvent *e) {
diff --git a/rkward/windows/katepluginintegration.cpp b/rkward/windows/katepluginintegration.cpp
index 4465738a..58685681 100644
--- a/rkward/windows/katepluginintegration.cpp
+++ b/rkward/windows/katepluginintegration.cpp
@@ -318,8 +318,8 @@ QWidget* KatePluginIntegrationWindow::createToolView (KTextEditor::Plugin *plugi
 	KatePluginToolWindow *window = new KatePluginToolWindow(RKWorkplace::mainWorkplace()->view());
 	window->setCaption(text);
 	window->setWindowIcon(icon);
-	RKWorkplace::mainWorkplace()->placeInToolWindowBar(window, pos);
 	RKToolWindowList::registerToolWindow(window, identifier, (RKToolWindowList::Placement) pos, 0);
+	RKWorkplace::mainWorkplace()->placeInToolWindowBar(window, pos);
 	plugin_resources[plugin].windows.append(window);
 
 	return window;
diff --git a/rkward/windows/rktoolwindowbar.cpp b/rkward/windows/rktoolwindowbar.cpp
index e70e6348..46c4ac47 100644
--- a/rkward/windows/rktoolwindowbar.cpp
+++ b/rkward/windows/rktoolwindowbar.cpp
@@ -144,7 +144,6 @@ void RKToolWindowBar::addWidget (RKMDIWindow *window) {
 	if (window->tool_window_bar) {
 		window->tool_window_bar->removeWidget (window);
 	}
-	closeOthers (window);
 
 #if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5,13,0)
 	appendTab (window->windowIcon (), id, window->shortCaption ());
@@ -169,6 +168,8 @@ void RKToolWindowBar::addWidget (RKMDIWindow *window) {
 void RKToolWindowBar::reclaimDetached (RKMDIWindow *window) {
 	RK_TRACE (APP);
 
+	if (window->parent () == container) return;
+
 	window->hide();
 	window->setParent (container);
 	container->layout ()->addWidget (window);
diff --git a/rkward/windows/rkworkplace.cpp b/rkward/windows/rkworkplace.cpp
index 657d96d9..cdedd4e7 100644
--- a/rkward/windows/rkworkplace.cpp
+++ b/rkward/windows/rkworkplace.cpp
@@ -214,7 +214,7 @@ void RKWorkplace::attachWindow (RKMDIWindow *window) {
 	}
 
 	RK_ASSERT (window->getPart ());
-	RKWardMainWindow::getMain ()->partManager ()->addPart (window->getPart ());
+	RKWardMainWindow::getMain ()->partManager ()->addPart (window->getPart (), false);
 }
 
 void RKWorkplace::detachWindow (RKMDIWindow *window, bool was_attached) {
@@ -304,7 +304,6 @@ void RKWorkplace::placeToolWindows() {
 
 	foreach (const RKToolWindowList::ToolWindowRepresentation& rep, RKToolWindowList::registeredToolWindows ()) {
 		placeInToolWindowBar (rep.window, rep.default_placement);
-		getHistory ()->popLastWindow (rep.window);	// windows send a spurious activation signal triggered from KPartsManager::addPart(), so we pop them, again
 	}
 }
 



More information about the rkward-tracker mailing list