From 68ad56db793256510878ecc5dc8f028322821a9d Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sun, 7 Aug 2022 04:10:36 +0400 Subject: [PATCH] Use QtWaylandCompositor for webview embedding on Linux --- Telegram/Resources/langs/lang.strings | 2 -- Telegram/SourceFiles/payments/ui/payments_panel.cpp | 6 ------ Telegram/SourceFiles/ui/chat/attach/attach_bot_webview.cpp | 6 ------ Telegram/build/docker/centos_env/Dockerfile | 3 +-- Telegram/lib_webview | 2 +- cmake | 2 +- snap/snapcraft.yaml | 4 ++-- 7 files changed, 5 insertions(+), 20 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 77130446c..171193cb6 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -2493,8 +2493,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_payments_webview_no_use" = "Unfortunately, you can't use payments with current system configuration."; "lng_payments_webview_install_edge" = "Please install {link}."; "lng_payments_webview_install_webkit" = "Please install WebKitGTK (webkit2gtk-5.0/webkit2gtk-4.1/webkit2gtk-4.0) using your package manager."; -"lng_payments_webview_switch_mutter" = "Qt's window embedding doesn't work well with Mutter window manager. Please switch to another window manager or desktop environment."; -"lng_payments_webview_switch_wayland" = "There is no way to embed WebView window on Wayland. Please switch to X11."; "lng_payments_webview_update_windows" = "Please update your system to Windows 8.1 or later."; "lng_payments_sure_close" = "Are you sure you want to close this payment form? The changes you made will be lost."; "lng_payments_receipt_label" = "Receipt"; diff --git a/Telegram/SourceFiles/payments/ui/payments_panel.cpp b/Telegram/SourceFiles/payments/ui/payments_panel.cpp index cb1fc5a2e..2b93e08b2 100644 --- a/Telegram/SourceFiles/payments/ui/payments_panel.cpp +++ b/Telegram/SourceFiles/payments/ui/payments_panel.cpp @@ -917,12 +917,6 @@ void Panel::showWebviewError( case Error::NoGtkOrWebkit2Gtk: rich.append(tr::lng_payments_webview_install_webkit(tr::now)); break; - case Error::MutterWM: - rich.append(tr::lng_payments_webview_switch_mutter(tr::now)); - break; - case Error::Wayland: - rich.append(tr::lng_payments_webview_switch_wayland(tr::now)); - break; case Error::OldWindows: rich.append(tr::lng_payments_webview_update_windows(tr::now)); break; diff --git a/Telegram/SourceFiles/ui/chat/attach/attach_bot_webview.cpp b/Telegram/SourceFiles/ui/chat/attach/attach_bot_webview.cpp index 7d3b75a0e..1d4fbc8a2 100644 --- a/Telegram/SourceFiles/ui/chat/attach/attach_bot_webview.cpp +++ b/Telegram/SourceFiles/ui/chat/attach/attach_bot_webview.cpp @@ -1088,12 +1088,6 @@ void Panel::showWebviewError( case Error::NoGtkOrWebkit2Gtk: rich.append(tr::lng_payments_webview_install_webkit(tr::now)); break; - case Error::MutterWM: - rich.append(tr::lng_payments_webview_switch_mutter(tr::now)); - break; - case Error::Wayland: - rich.append(tr::lng_payments_webview_switch_wayland(tr::now)); - break; default: rich.append(QString::fromStdString(information.details)); break; diff --git a/Telegram/build/docker/centos_env/Dockerfile b/Telegram/build/docker/centos_env/Dockerfile index b1acea14e..a285c030c 100644 --- a/Telegram/build/docker/centos_env/Dockerfile +++ b/Telegram/build/docker/centos_env/Dockerfile @@ -679,7 +679,7 @@ ENV OPENSSL_ROOT_DIR {{ OPENSSL_PREFIX }} RUN git clone -b {{ QT_TAG }} --depth=1 git://code.qt.io/qt/qt5.git qt_{{ QT }} \ && cd qt_{{ QT }} \ - && git submodule update --init --recursive --depth=1 qtbase qtwayland qtimageformats qtsvg qt5compat \ + && git submodule update --init --recursive --depth=1 qtbase qtdeclarative qtwayland qtimageformats qtsvg qt5compat qtshadertools \ && cd qtbase \ && find ../../patches/qtbase_{{ QT }} -type f -print0 | sort -z | xargs -r0 git apply \ && cd .. \ @@ -697,7 +697,6 @@ RUN git clone -b {{ QT_TAG }} --depth=1 git://code.qt.io/qt/qt5.git qt_{{ QT }} -no-icu \ -no-feature-xcb-sm \ -no-feature-egl-extension-platform-wayland \ - -no-feature-wayland-server \ -no-feature-highdpiscaling \ -static \ -dbus-runtime \ diff --git a/Telegram/lib_webview b/Telegram/lib_webview index 1d14bb480..6ee92c066 160000 --- a/Telegram/lib_webview +++ b/Telegram/lib_webview @@ -1 +1 @@ -Subproject commit 1d14bb480a38b02fa93403f511076d3135d9b934 +Subproject commit 6ee92c066c6b75349980670edf795990f26b2f62 diff --git a/cmake b/cmake index e8bc7cfd1..36ee4977b 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit e8bc7cfd1d8f284ac5bc3addc5dcc7fdd6a93524 +Subproject commit 36ee4977bbac6d5de4f3c463777a4e0588c661f9 diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index a86e0419b..bfa50c738 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -376,6 +376,7 @@ parts: - libwayland-client0 - libwayland-cursor0 - libwayland-egl1 + - libwayland-server0 - libx11-6 - libx11-xcb1 - libxcb1 @@ -400,7 +401,7 @@ parts: QT=6_4_0 git clone -b v6.4.0 --depth=1 git://code.qt.io/qt/qt5.git . - perl init-repository --module-subset=qtbase,qtwayland,qtimageformats,qtsvg,qt5compat + git submodule update --init --recursive --depth=1 qtbase qtdeclarative qtwayland qtimageformats qtsvg qt5compat qtshadertools cd qtbase find $CRAFT_STAGE/patches/qtbase_${QT} -type f -print0 | sort -z | xargs -r0 git apply @@ -416,7 +417,6 @@ parts: -no-feature-renameat2 \ -no-feature-statx \ -no-feature-egl-extension-platform-wayland \ - -no-feature-wayland-server \ -no-feature-highdpiscaling \ -openssl-linked \ -nomake examples \