From d387448a61c3c220484b3cc08aac04058c35a645 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 13 Mar 2013 18:57:24 +0100 Subject: Restore activity daemon support BUG: 315694 --- src/tabwindow/tabwidget.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/tabwindow/tabwidget.cpp') diff --git a/src/tabwindow/tabwidget.cpp b/src/tabwindow/tabwidget.cpp index bdc7a47a..9494fad4 100644 --- a/src/tabwindow/tabwidget.cpp +++ b/src/tabwindow/tabwidget.cpp @@ -35,9 +35,11 @@ #include "application.h" #include "rekonqwindow.h" +#include "tabbar.h" + #include "webpage.h" +#include "webtab.h" #include "webwindow.h" -#include "tabbar.h" #include "tabhistory.h" @@ -78,6 +80,7 @@ TabWidget::TabWidget(bool withTab, bool PrivateBrowsingMode, QWidget *parent) , _openedTabsCounter(0) , _isPrivateBrowsing(PrivateBrowsingMode) , _ac(new KActionCollection(this)) + , _lastCurrentTabIndex(-1) { init(); @@ -98,6 +101,7 @@ TabWidget::TabWidget(WebPage *pg, QWidget *parent) , _openedTabsCounter(0) , _isPrivateBrowsing(false) , _ac(new KActionCollection(this)) + , _lastCurrentTabIndex(-1) { init(); @@ -394,6 +398,8 @@ void TabWidget::pageCreated(WebPage *page) void TabWidget::currentChanged(int newIndex) { + _lastCurrentTabIndex = newIndex; + _openedTabsCounter = 0; tabBar()->setTabHighlighted(newIndex, false); @@ -403,6 +409,8 @@ void TabWidget::currentChanged(int newIndex) if (!tab) return; + tab->tabView()->focusIn(); + QString t = tab->title(); (t.isEmpty() || t == QL1S("rekonq")) @@ -410,6 +418,16 @@ void TabWidget::currentChanged(int newIndex) : setWindowTitle(t + QL1S(" - rekonq")); tab->checkFocus(); + + // ---------------------------------------------------- + + WebWindow *oldTab = webWindow(_lastCurrentTabIndex); + if (!oldTab) + return; + + oldTab->tabView()->focusOut(); + + _lastCurrentTabIndex = newIndex; } -- cgit v1.2.1