diff --git a/Telegram/SourceFiles/core/application.cpp b/Telegram/SourceFiles/core/application.cpp index ca232a4c7..f1730efc3 100644 --- a/Telegram/SourceFiles/core/application.cpp +++ b/Telegram/SourceFiles/core/application.cpp @@ -22,6 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "core/ui_integration.h" #include "chat_helpers/emoji_keywords.h" #include "storage/localstorage.h" +#include "base/platform/base_platform_info.h" #include "platform/platform_specific.h" #include "mainwindow.h" #include "dialogs/dialogs_entry.h" @@ -772,9 +773,13 @@ void Application::notifyFileDialogShown(bool shown) { } QWidget *Application::getModalParent() { - return QGuiApplication::platformName().startsWith(qsl("wayland"), Qt::CaseInsensitive) +#ifdef Q_OS_LINUX + return Platform::IsWayland() ? App::wnd() : nullptr; +#endif // Q_OS_LINUX + + return nullptr; } diff --git a/Telegram/SourceFiles/platform/linux/linux_libs.cpp b/Telegram/SourceFiles/platform/linux/linux_libs.cpp index 21364c92c..3465099cb 100644 --- a/Telegram/SourceFiles/platform/linux/linux_libs.cpp +++ b/Telegram/SourceFiles/platform/linux/linux_libs.cpp @@ -7,6 +7,7 @@ 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_gdk_helper.h" #include "platform/linux/linux_desktop_environment.h" #include "platform/linux/specific_linux.h" @@ -15,8 +16,6 @@ extern "C" { #include } -#include - namespace Platform { namespace Libs { namespace { @@ -144,8 +143,7 @@ bool setupGtkBase(QLibrary &lib_gtk) { // 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(QGuiApplication::platformName().startsWith(qsl("wayland"), Qt::CaseInsensitive) - && !lib_gtk.fileName().contains("gtk-x11-2.0")) { + 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 { diff --git a/Telegram/lib_base b/Telegram/lib_base index 2f9ae1250..486003d41 160000 --- a/Telegram/lib_base +++ b/Telegram/lib_base @@ -1 +1 @@ -Subproject commit 2f9ae1250f36881ffb985b1e0af24be53481a9df +Subproject commit 486003d41751c1c775513598c8a4154cd294a136 diff --git a/Telegram/lib_ui b/Telegram/lib_ui index e27395cf1..6451ae507 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit e27395cf1878662f177f7aaea48a82e044da6b53 +Subproject commit 6451ae50741a13b6b8e48835da654e24f34695aa