mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 22:46:10 +00:00
Add support for showing window menu on Wayland
This commit is contained in:
@@ -585,6 +585,21 @@ bool StartWaylandResize(QWindow *window, Qt::Edges edges) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ShowWaylandWindowMenu(QWindow *window) {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0) || defined DESKTOP_APP_QT_PATCHED
|
||||
if (const auto waylandWindow = static_cast<QWaylandWindow*>(
|
||||
window->handle())) {
|
||||
if (const auto seat = waylandWindow->display()->lastInputDevice()) {
|
||||
if (const auto shellSurface = waylandWindow->shellSurface()) {
|
||||
return shellSurface->showWindowMenu(seat);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // Qt >= 5.13 || DESKTOP_APP_QT_PATCHED
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Window::Control GtkKeywordToWindowControl(const QString &keyword) {
|
||||
if (keyword == qstr("minimize")) {
|
||||
return Window::Control::Minimize;
|
||||
@@ -956,6 +971,14 @@ bool StartSystemResize(QWindow *window, Qt::Edges edges) {
|
||||
}
|
||||
}
|
||||
|
||||
bool ShowWindowMenu(QWindow *window) {
|
||||
if (IsWayland()) {
|
||||
return ShowWaylandWindowMenu(window);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Window::ControlsLayout WindowControlsLayout() {
|
||||
#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
|
||||
if (Libs::GtkSettingSupported()
|
||||
|
Reference in New Issue
Block a user