File: 2018-Prefer-Xwayland.patch

package info (click to toggle)
telegram-desktop 5.7.2%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 63,488 kB
  • sloc: cpp: 756,228; python: 4,383; ansic: 1,505; javascript: 1,366; sh: 884; makefile: 820; objc: 652; xml: 565
file content (24 lines) | stat: -rw-r--r-- 758 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Description: Override default Qt platform
 Prefer X11 even under Wayland due to a number of visual issues with custom
 window frame and other shortcomings of video chats (group calls).
 .
 Need Qt6 to fix these issues properly.
Author: Nicholas Guriev <guriev-ns@ya.ru>
Last-Update: Wed, 19 Nov 2025 18:20:22 +0300

--- a/Telegram/SourceFiles/core/launcher.cpp
+++ b/Telegram/SourceFiles/core/launcher.cpp
@@ -72,6 +72,13 @@ FilteredCommandLineArguments::FilteredCo
 	}
 #endif // Q_OS_WIN || Q_OS_MAC
 
+#if defined Q_OS_LINUX && QT_VERSION < QT_VERSION_CHECK(6, 0 ,0)
+	if (qEnvironmentVariableIsEmpty("QT_QPA_PLATFORM")) {
+		pushArgument("-platform");
+		pushArgument("xcb;wayland");
+	}
+#endif // Q_OS_LINUX && Qt < 6.0
+
 	pushArgument(nullptr);
 }