diff --git a/src/lib/tabwidget/tabwidget.cpp b/src/lib/tabwidget/tabwidget.cpp index b423c63f4..eed511344 100644 --- a/src/lib/tabwidget/tabwidget.cpp +++ b/src/lib/tabwidget/tabwidget.cpp @@ -507,6 +507,8 @@ void TabWidget::currentTabChanged(int index) m_currentTabFresh = false; WebTab* webTab = weTab(index); + webTab->tabActivated(); + LocationBar* locBar = webTab->locationBar(); if (locBar && m_locationBars->indexOf(locBar) != -1) { diff --git a/src/lib/webtab/webtab.cpp b/src/lib/webtab/webtab.cpp index 8cdaefd35..4a36e5603 100644 --- a/src/lib/webtab/webtab.cpp +++ b/src/lib/webtab/webtab.cpp @@ -36,7 +36,6 @@ #include #include -bool WebTab::s_pinningTab = false; static const int savedTabVersion = 3; WebTab::SavedTab::SavedTab() @@ -474,11 +473,10 @@ void WebTab::slotRestore() m_tabBar->restoreTabTextColor(tabIndex()); } -void WebTab::showEvent(QShowEvent* event) +void WebTab::tabActivated() { - QWidget::showEvent(event); - if (!isRestored() && !s_pinningTab) { + if (!isRestored()) { // When session is being restored, restore the tab immediately if (mApp->isRestoring()) { slotRestore(); @@ -515,9 +513,5 @@ void WebTab::togglePinned() m_isPinned = !m_isPinned; - // Workaround bug in TabStackedWidget when pinning tab, other tabs may be accidentaly - // shown and restored state even when they won't be switched to by user. - s_pinningTab = true; m_window->tabWidget()->pinUnPinTab(tabIndex(), title()); - s_pinningTab = false; } diff --git a/src/lib/webtab/webtab.h b/src/lib/webtab/webtab.h index fee25eff2..06d26139a 100644 --- a/src/lib/webtab/webtab.h +++ b/src/lib/webtab/webtab.h @@ -102,6 +102,8 @@ public: void p_restoreTab(const SavedTab &tab); void p_restoreTab(const QUrl &url, const QByteArray &history, int zoomLevel); + void tabActivated(); + private slots: void showNotification(QWidget* notif); void loadStarted(); @@ -111,7 +113,6 @@ private slots: void slotRestore(); private: - void showEvent(QShowEvent* event); void resizeEvent(QResizeEvent *event) override; BrowserWindow* m_window; @@ -128,7 +129,6 @@ private: SavedTab m_savedTab; bool m_isPinned; - static bool s_pinningTab; }; #endif // WEBTAB_H