mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
WebTab: Fix loading other non-selected tabs while pinning tabs
This commit is contained in:
parent
1f32a018f5
commit
f755e312b9
@ -34,6 +34,7 @@
|
||||
#include <QTimer>
|
||||
#include <QSplitter>
|
||||
|
||||
bool WebTab::s_pinningTab = false;
|
||||
static const int savedTabVersion = 2;
|
||||
|
||||
WebTab::SavedTab::SavedTab()
|
||||
@ -199,6 +200,8 @@ QWebEngineHistory* WebTab::history() const
|
||||
|
||||
void WebTab::detach()
|
||||
{
|
||||
Q_ASSERT(m_tabBar);
|
||||
|
||||
// Remove icon from tab
|
||||
m_tabBar->setTabButton(tabIndex(), m_tabBar->iconButtonPosition(), 0);
|
||||
|
||||
@ -377,7 +380,7 @@ void WebTab::showEvent(QShowEvent* event)
|
||||
{
|
||||
QWidget::showEvent(event);
|
||||
|
||||
if (!isRestored()) {
|
||||
if (!isRestored() && !s_pinningTab) {
|
||||
// When session is being restored, restore the tab immediately
|
||||
if (mApp->isRestoring()) {
|
||||
slotRestore();
|
||||
@ -406,5 +409,10 @@ void WebTab::togglePinned()
|
||||
Q_ASSERT(m_window);
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -116,6 +116,8 @@ private:
|
||||
|
||||
SavedTab m_savedTab;
|
||||
bool m_isPinned;
|
||||
|
||||
static bool s_pinningTab;
|
||||
};
|
||||
|
||||
#endif // WEBTAB_H
|
||||
|
Loading…
Reference in New Issue
Block a user