From 6f151f20e93998847fa4c70b060fd1da1a2e46fc Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Mon, 19 Jul 2021 21:53:11 +0400 Subject: [PATCH] Add support for DESKTOP_APP_DISABLE_WEBKITGTK Co-authored-by: mid-kid --- .github/workflows/linux.yml | 5 ++++- .../SourceFiles/platform/linux/linux_gtk_integration.cpp | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index bd232a871..7a3e721cf 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -94,7 +94,10 @@ jobs: if [ -n "${{ matrix.defines }}" ]; then DEFINE="-D ${{ matrix.defines }}=ON" if [ "${{ matrix.defines }}" == "DESKTOP_APP_DISABLE_DBUS_INTEGRATION" ]; then - DEFINE="$DEFINE -D DESKTOP_APP_DISABLE_GTK_INTEGRATION=ON" + DEFINE="$DEFINE -D DESKTOP_APP_DISABLE_GTK_INTEGRATION=ON -D DESKTOP_APP_DISABLE_WEBKITGTK=ON" + fi + if [ "${{ matrix.defines }}" == "DESKTOP_APP_DISABLE_GTK_INTEGRATION" ]; then + DEFINE="$DEFINE -D DESKTOP_APP_DISABLE_WEBKITGTK=ON" fi echo Define from matrix: $DEFINE echo "ARTIFACT_NAME=Telegram_${{ matrix.defines }}" >> $GITHUB_ENV diff --git a/Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp b/Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp index bb57ebbfb..60f109c9d 100644 --- a/Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp +++ b/Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp @@ -16,7 +16,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/platform/linux/base_linux_glibmm_helper.h" #include "base/platform/linux/base_linux_dbus_utilities.h" #include "base/platform/base_platform_info.h" -#include "webview/platform/linux/webview_linux_webkit2gtk.h" #include "platform/linux/linux_gtk_integration_p.h" #include "platform/linux/linux_gdk_helper.h" #include "platform/linux/linux_gtk_open_with_dialog.h" @@ -24,6 +23,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "window/window_controller.h" #include "core/application.h" +#ifndef DESKTOP_APP_DISABLE_WEBKITGTK +#include "webview/platform/linux/webview_linux_webkit2gtk.h" +#endif // !DESKTOP_APP_DISABLE_WEBKITGTK + #include #include @@ -588,9 +591,11 @@ int GtkIntegration::Exec( if (const auto integration = BaseGtkIntegration::Instance()) { return integration->exec(parentDBusName); } +#ifndef DESKTOP_APP_DISABLE_WEBKITGTK } else if (type == Type::Webview) { Webview::WebKit2Gtk::SetServiceName(serviceName.toStdString()); return Webview::WebKit2Gtk::Exec(parentDBusName.toStdString()); +#endif // !DESKTOP_APP_DISABLE_WEBKITGTK } else if (type == Type::TDesktop) { ServiceName = serviceName.toStdString(); if (const auto integration = Instance()) { @@ -615,8 +620,10 @@ void GtkIntegration::Start(Type type) { if (type == Type::Base) { BaseGtkIntegration::SetServiceName(kBaseService.utf16().arg(h)); } else if (type == Type::Webview) { +#ifndef DESKTOP_APP_DISABLE_WEBKITGTK Webview::WebKit2Gtk::SetServiceName( kWebviewService.utf16().arg(h).arg("%1").toStdString()); +#endif // !DESKTOP_APP_DISABLE_WEBKITGTK return; } else {