Fix overlay counter on taskbar when native decorations are enabled (#47)
This commit is contained in:
parent
8ce21aa87f
commit
7de92734cd
2 changed files with 11 additions and 10 deletions
|
|
@ -633,20 +633,19 @@ UINT MainWindow::_taskbarCreatedMsgId = 0;
|
||||||
MainWindow::MainWindow(not_null<Window::Controller*> controller)
|
MainWindow::MainWindow(not_null<Window::Controller*> controller)
|
||||||
: Window::MainWindow(controller)
|
: Window::MainWindow(controller)
|
||||||
, ps_tbHider_hWnd(createTaskbarHider()) {
|
, ps_tbHider_hWnd(createTaskbarHider()) {
|
||||||
if (!UseNativeDecorations()) {
|
QCoreApplication::instance()->installNativeEventFilter(
|
||||||
QCoreApplication::instance()->installNativeEventFilter(
|
EventFilter::CreateInstance(this));
|
||||||
EventFilter::CreateInstance(this));
|
|
||||||
|
|
||||||
|
if (!_taskbarCreatedMsgId) {
|
||||||
|
_taskbarCreatedMsgId = RegisterWindowMessage(L"TaskbarButtonCreated");
|
||||||
|
}
|
||||||
|
if (!UseNativeDecorations()) {
|
||||||
subscribe(Window::Theme::Background(), [this](const Window::Theme::BackgroundUpdate &update) {
|
subscribe(Window::Theme::Background(), [this](const Window::Theme::BackgroundUpdate &update) {
|
||||||
if (update.paletteChanged()) {
|
if (update.paletteChanged()) {
|
||||||
_psShadowWindows.setColor(st::windowShadowFg->c);
|
_psShadowWindows.setColor(st::windowShadowFg->c);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_taskbarCreatedMsgId) {
|
|
||||||
_taskbarCreatedMsgId = RegisterWindowMessage(L"TaskbarButtonCreated");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::TaskbarCreated() {
|
void MainWindow::TaskbarCreated() {
|
||||||
|
|
@ -1008,9 +1007,7 @@ MainWindow::~MainWindow() {
|
||||||
}
|
}
|
||||||
if (ps_tbHider_hWnd) DestroyWindow(ps_tbHider_hWnd);
|
if (ps_tbHider_hWnd) DestroyWindow(ps_tbHider_hWnd);
|
||||||
|
|
||||||
if (!UseNativeDecorations()) {
|
EventFilter::Destroy();
|
||||||
EventFilter::Destroy();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Platform
|
} // namespace Platform
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,10 @@ bool EventFilter::mainWindowEvent(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (UseNativeDecorations()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
switch (msg) {
|
switch (msg) {
|
||||||
|
|
||||||
case WM_TIMECHANGE: {
|
case WM_TIMECHANGE: {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue