mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Fixed 'QtWin' bug about changing of desktop composition state.
This commit is contained in:
parent
07e17f7b47
commit
dbcbabdec3
10
src/lib/3rdparty/qtwin.cpp
vendored
10
src/lib/3rdparty/qtwin.cpp
vendored
@ -65,6 +65,7 @@ static PtrDwmEnableBlurBehindWindow pDwmEnableBlurBehindWindow = 0;
|
||||
static PtrDwmExtendFrameIntoClientArea pDwmExtendFrameIntoClientArea = 0;
|
||||
static PtrDwmGetColorizationColor pDwmGetColorizationColor = 0;
|
||||
|
||||
QHash<QWidget *, bool> widgetsBlurState = QHash<QWidget *, bool>();
|
||||
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user