Add support for DESKTOP_APP_DISABLE_WEBKITGTK

Co-authored-by: mid-kid <esteve.varela@gmail.com>
This commit is contained in:
Ilya Fedin 2021-07-19 21:53:11 +04:00 committed by John Preston
parent ae70dfb1f4
commit 6f151f20e9
2 changed files with 12 additions and 2 deletions

View File

@ -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

View File

@ -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 <QtCore/QProcess>
#include <private/qguiapplication_p.h>
@ -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 {