diff --git a/src/lib/3rdparty/qtwin.cpp b/src/lib/3rdparty/qtwin.cpp index 9705ea419..b2bf2606f 100644 --- a/src/lib/3rdparty/qtwin.cpp +++ b/src/lib/3rdparty/qtwin.cpp @@ -65,6 +65,7 @@ static PtrDwmEnableBlurBehindWindow pDwmEnableBlurBehindWindow = 0; static PtrDwmExtendFrameIntoClientArea pDwmExtendFrameIntoClientArea = 0; static PtrDwmGetColorizationColor pDwmGetColorizationColor = 0; +QHash widgetsBlurState = QHash(); /* * Internal helper class that notifies windows if the @@ -169,6 +170,7 @@ bool QtWin::enableBlurBehindWindow(QWidget* widget, bool enable) if (SUCCEEDED(hr)) { result = true; windowNotifier()->addWidget(widget); + widgetsBlurState.insert(widget, true); } } #endif @@ -207,6 +209,7 @@ bool QtWin::extendFrameIntoClientArea(QWidget* widget, int left, int top, int ri if (SUCCEEDED(hr)) { result = true; windowNotifier()->addWidget(widget); + widgetsBlurState.insert(widget, true); } widget->setAttribute(Qt::WA_TranslucentBackground, result); } @@ -257,6 +260,13 @@ bool WindowNotifier::winEvent(MSG* message, long* result) foreach(QWidget * widget, widgets) { if (widget) { widget->setAttribute(Qt::WA_NoSystemBackground, compositionEnabled); + bool isBlur = widgetsBlurState.value(widget, false); + if (compositionEnabled && isBlur) + { + // hack for fixing black background when enabling composition + QtWin::enableBlurBehindWindow(widget, false); + QtWin::extendFrameIntoClientArea(widget); + } widget->update(); } } diff --git a/src/lib/app/qupzilla.cpp b/src/lib/app/qupzilla.cpp index 5fd9c6ab9..994c8b75d 100644 --- a/src/lib/app/qupzilla.cpp +++ b/src/lib/app/qupzilla.cpp @@ -1454,6 +1454,11 @@ void QupZilla::fullScreen(bool make) bookmarksToolbar()->hide(); m_navigationBar->hide(); m_tabWidget->getTabBar()->hide(); +#ifdef Q_WS_WIN + if (m_usingTransparentBackground) { + QtWin::enableBlurBehindWindow(this, false); + } +#endif } else { setWindowState(windowState() & ~Qt::WindowFullScreen); @@ -1463,6 +1468,11 @@ void QupZilla::fullScreen(bool make) m_bookmarksToolbar->setVisible(m_bookmarksToolBarVisible); m_navigationBar->setVisible(m_navigationVisible); m_tabWidget->showTabBar(); +#ifdef Q_WS_WIN + if (m_usingTransparentBackground) { + QtWin::enableBlurBehindWindow(this); + } +#endif } m_actionShowFullScreen->setChecked(make); diff --git a/src/lib/webview/tabbedwebview.cpp b/src/lib/webview/tabbedwebview.cpp index e897ae567..1e0cb4b78 100644 --- a/src/lib/webview/tabbedwebview.cpp +++ b/src/lib/webview/tabbedwebview.cpp @@ -36,6 +36,8 @@ #include #include +bool TabbedWebView::m_navigationVisible = false; + TabbedWebView::TabbedWebView(QupZilla* mainClass, WebTab* webTab) : WebView(webTab) , p_QupZilla(mainClass) @@ -43,7 +45,6 @@ TabbedWebView::TabbedWebView(QupZilla* mainClass, WebTab* webTab) , m_webTab(webTab) , m_menu(new Menu(this)) , m_mouseTrack(false) - , m_navigationVisible(false) , m_hasRss(false) , m_rssChecked(false) { diff --git a/src/lib/webview/tabbedwebview.h b/src/lib/webview/tabbedwebview.h index 250605160..53a15be8f 100644 --- a/src/lib/webview/tabbedwebview.h +++ b/src/lib/webview/tabbedwebview.h @@ -98,7 +98,7 @@ private: Menu* m_menu; bool m_mouseTrack; - bool m_navigationVisible; + static bool m_navigationVisible; bool m_hasRss; bool m_rssChecked; diff --git a/src/lib/webview/tabwidget.cpp b/src/lib/webview/tabwidget.cpp index 1f7b3a118..bf5ed4b7d 100644 --- a/src/lib/webview/tabwidget.cpp +++ b/src/lib/webview/tabwidget.cpp @@ -202,7 +202,10 @@ void TabWidget::moveAddTabButton(int posX) int posY = (m_tabBar->height() - m_buttonAddTab->height()) / 2; //RTL Support if (QApplication::layoutDirection() == Qt::RightToLeft) { - posX = posX - m_buttonAddTab->width(); + posX = qMax(posX - m_buttonAddTab->width(), m_buttonListTabs->width()); + } + else { + posX = qMin(posX, m_tabBar->width() - m_buttonAddTab->width() - m_buttonListTabs->width()); } m_buttonAddTab->move(posX, posY); }