mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 15:47:11 +02:00
Make gdk backend limit more permissive
This commit is contained in:
parent
841908fe31
commit
ab95751a66
1 changed files with 3 additions and 10 deletions
|
@ -7,10 +7,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
*/
|
||||
#include "platform/linux/linux_libs.h"
|
||||
|
||||
#include "base/platform/base_platform_info.h"
|
||||
#include "platform/linux/linux_xlib_helper.h"
|
||||
#include "platform/linux/linux_gdk_helper.h"
|
||||
#include "platform/linux/linux_desktop_environment.h"
|
||||
#include "platform/linux/specific_linux.h"
|
||||
#include "core/sandbox.h"
|
||||
#include "core/core_settings.h"
|
||||
|
@ -112,17 +110,12 @@ bool setupGtkBase(QLibrary &lib_gtk) {
|
|||
if (!LOAD_SYMBOL(lib_gtk, "gdk_atom_intern", gdk_atom_intern)) return false;
|
||||
|
||||
if (LOAD_SYMBOL(lib_gtk, "gdk_set_allowed_backends", gdk_set_allowed_backends)) {
|
||||
// We work only with X11 GDK backend.
|
||||
// We work only with Wayland and X11 GDK backends.
|
||||
// Otherwise we get segfault in Ubuntu 17.04 in gtk_init_check() call.
|
||||
// See https://github.com/telegramdesktop/tdesktop/issues/3176
|
||||
// See https://github.com/telegramdesktop/tdesktop/issues/3162
|
||||
if(Platform::IsWayland() && !lib_gtk.fileName().contains("gtk-x11-2.0")) {
|
||||
DEBUG_LOG(("Limit allowed GDK backends to wayland"));
|
||||
gdk_set_allowed_backends("wayland");
|
||||
} else {
|
||||
DEBUG_LOG(("Limit allowed GDK backends to x11"));
|
||||
gdk_set_allowed_backends("x11");
|
||||
}
|
||||
DEBUG_LOG(("Limit allowed GDK backends to wayland and x11"));
|
||||
gdk_set_allowed_backends("wayland,x11");
|
||||
}
|
||||
|
||||
// gtk_init will reset the Xlib error handler, and that causes
|
||||
|
|
Loading…
Add table
Reference in a new issue