mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-25 07:31:33 +08:00
Avoid calling XCB functions under non-XCB Linux platform (#405)
This commit is contained in:
parent
ad06241c9d
commit
3d3b694040
@ -547,9 +547,16 @@ bool CDockManager::eventFilter(QObject *obj, QEvent *e)
|
|||||||
// setWindowFlags(Qt::WindowStaysOnTopHint) will hide the window and thus requires a show call.
|
// setWindowFlags(Qt::WindowStaysOnTopHint) will hide the window and thus requires a show call.
|
||||||
// This then leads to flickering and a nasty endless loop (also buggy behaviour on Ubuntu).
|
// This then leads to flickering and a nasty endless loop (also buggy behaviour on Ubuntu).
|
||||||
// So we just do it ourself.
|
// So we just do it ourself.
|
||||||
internal::xcb_update_prop(true, _window->window()->winId(),
|
if(QGuiApplication::platformName() == QLatin1String("xcb"))
|
||||||
"_NET_WM_STATE", "_NET_WM_STATE_ABOVE", "_NET_WM_STATE_STAYS_ON_TOP");
|
{
|
||||||
}
|
internal::xcb_update_prop(true, _window->window()->winId(),
|
||||||
|
"_NET_WM_STATE", "_NET_WM_STATE_ABOVE", "_NET_WM_STATE_STAYS_ON_TOP");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window->setWindowFlag(Qt::WindowStaysOnTopHint, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (e->type() == QEvent::WindowDeactivate)
|
else if (e->type() == QEvent::WindowDeactivate)
|
||||||
{
|
{
|
||||||
@ -559,8 +566,16 @@ bool CDockManager::eventFilter(QObject *obj, QEvent *e)
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
internal::xcb_update_prop(false, _window->window()->winId(),
|
|
||||||
"_NET_WM_STATE", "_NET_WM_STATE_ABOVE", "_NET_WM_STATE_STAYS_ON_TOP");
|
if(QGuiApplication::platformName() == QLatin1String("xcb"))
|
||||||
|
{
|
||||||
|
internal::xcb_update_prop(false, _window->window()->winId(),
|
||||||
|
"_NET_WM_STATE", "_NET_WM_STATE_ABOVE", "_NET_WM_STATE_STAYS_ON_TOP");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window->setWindowFlag(Qt::WindowStaysOnTopHint, false);
|
||||||
|
}
|
||||||
_window->raise();
|
_window->raise();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user