From f959cfb603baea26f6e7c7d9414d0d06ee4acd0a Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 2 Mar 2010 01:20:04 +0100 Subject: This will fix rekonq behaviour on opening external links. It's a bit "less functional" than before, but it always works :) --- src/application.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/application.cpp b/src/application.cpp index e5b76745..270cd87f 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -53,7 +53,6 @@ #include #include #include -#include #include #include @@ -153,21 +152,17 @@ int Application::newInstance() // are there args? load them.. if (args->count() > 0) { - // is there a window open on the current desktop ? use it! - for (int i = 0; i < m_mainWindows.size(); ++i) + // are there any windows there? use it + int index = m_mainWindows.size(); + if(index > 0) { - MainWindow *m = m_mainWindows.at(i).data(); - KWindowInfo w = KWindowInfo(m->winId(), NET::WMDesktop); - if(w.isOnCurrentDesktop()) - { - m->activateWindow(); - m->raise(); + MainWindow *m = m_mainWindows.at(index - 1).data(); + m->activateWindow(); - for (int i = 0; i < args->count(); ++i) - loadUrl(args->arg(i), Rekonq::NewCurrentTab); + for (int i = 0; i < args->count(); ++i) + loadUrl(args->arg(i), Rekonq::NewCurrentTab); - return 2; - } + return 2; } // No windows in the current desktop? No windows at all? -- cgit v1.2.1