mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Move IsWayland() checks into WaylandIntegration
This commit is contained in:
@@ -55,6 +55,7 @@ WaylandIntegration::WaylandIntegration() {
|
||||
}
|
||||
|
||||
WaylandIntegration *WaylandIntegration::Instance() {
|
||||
if (!IsWayland()) return nullptr;
|
||||
static WaylandIntegration instance;
|
||||
return &instance;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "platform/linux/linux_wayland_integration.h"
|
||||
|
||||
#include "base/platform/base_platform_info.h"
|
||||
|
||||
namespace Platform {
|
||||
namespace internal {
|
||||
|
||||
@@ -14,6 +16,7 @@ WaylandIntegration::WaylandIntegration() {
|
||||
}
|
||||
|
||||
WaylandIntegration *WaylandIntegration::Instance() {
|
||||
if (!IsWayland()) return nullptr;
|
||||
static WaylandIntegration instance;
|
||||
return &instance;
|
||||
}
|
||||
|
||||
@@ -809,8 +809,7 @@ bool SkipTaskbarSupported() {
|
||||
}
|
||||
|
||||
bool StartSystemMove(QWindow *window) {
|
||||
if (IsWayland()) {
|
||||
const auto integration = WaylandIntegration::Instance();
|
||||
if (const auto integration = WaylandIntegration::Instance()) {
|
||||
return integration->startMove(window);
|
||||
} else {
|
||||
return StartXCBMoveResize(window, 16);
|
||||
@@ -818,8 +817,7 @@ bool StartSystemMove(QWindow *window) {
|
||||
}
|
||||
|
||||
bool StartSystemResize(QWindow *window, Qt::Edges edges) {
|
||||
if (IsWayland()) {
|
||||
const auto integration = WaylandIntegration::Instance();
|
||||
if (const auto integration = WaylandIntegration::Instance()) {
|
||||
return integration->startResize(window, edges);
|
||||
} else {
|
||||
return StartXCBMoveResize(window, edges);
|
||||
@@ -827,8 +825,7 @@ bool StartSystemResize(QWindow *window, Qt::Edges edges) {
|
||||
}
|
||||
|
||||
bool ShowWindowMenu(QWindow *window) {
|
||||
if (IsWayland()) {
|
||||
const auto integration = WaylandIntegration::Instance();
|
||||
if (const auto integration = WaylandIntegration::Instance()) {
|
||||
return integration->showWindowMenu(window);
|
||||
} else {
|
||||
return ShowXCBWindowMenu(window);
|
||||
|
||||
Reference in New Issue
Block a user