Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid calling XCB functions under non-XCB Linux platform #405

Merged
merged 1 commit into from
Mar 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions src/DockManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
internal::xcb_update_prop(true, _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(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)
{
Expand All @@ -559,8 +566,16 @@ bool CDockManager::eventFilter(QObject *obj, QEvent *e)
{
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();
}
}
Expand Down