mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-24 23:31:32 +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.
|
||||
// This then leads to flickering and a nasty endless loop (also buggy behaviour on Ubuntu).
|
||||
// So we just do it ourself.
|
||||
if(QGuiApplication::platformName() == QLatin1String("xcb"))
|
||||
{
|
||||
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)
|
||||
{
|
||||
@ -559,8 +566,16 @@ bool CDockManager::eventFilter(QObject *obj, QEvent *e)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user