From 513054a30770809e299afc24656afb444fee0476 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Fri, 19 Feb 2021 08:57:53 +0400 Subject: [PATCH] Get rid of unneeded material wayland decorations --- .gitmodules | 3 --- .../platform/linux/main_window_linux.cpp | 26 ------------------- .../platform/linux/main_window_linux.h | 1 - .../platform/linux/specific_linux.cpp | 4 --- Telegram/ThirdParty/materialdecoration | 1 - 5 files changed, 35 deletions(-) delete mode 160000 Telegram/ThirdParty/materialdecoration diff --git a/.gitmodules b/.gitmodules index d4624361b..17a1be422 100644 --- a/.gitmodules +++ b/.gitmodules @@ -64,9 +64,6 @@ [submodule "Telegram/ThirdParty/hunspell"] path = Telegram/ThirdParty/hunspell url = https://github.com/hunspell/hunspell -[submodule "Telegram/ThirdParty/materialdecoration"] - path = Telegram/ThirdParty/materialdecoration - url = https://github.com/desktop-app/materialdecoration.git [submodule "Telegram/ThirdParty/range-v3"] path = Telegram/ThirdParty/range-v3 url = https://github.com/ericniebler/range-v3.git diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp index c5349ed8f..4cfc4b0d0 100644 --- a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp @@ -601,12 +601,6 @@ void MainWindow::initHook() { #endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION LOG(("System tray available: %1").arg(Logs::b(trayAvailable()))); - - updateWaylandDecorationColors(); - style::PaletteChanged( - ) | rpl::start_with_next([=] { - updateWaylandDecorationColors(); - }, lifetime()); } bool MainWindow::hasTrayIcon() const { @@ -896,26 +890,6 @@ void MainWindow::updateIconCounters() { } } -void MainWindow::updateWaylandDecorationColors() { - windowHandle()->setProperty( - "__material_decoration_backgroundColor", - st::titleBgActive->c); - - windowHandle()->setProperty( - "__material_decoration_foregroundColor", - st::titleFgActive->c); - - windowHandle()->setProperty( - "__material_decoration_backgroundInactiveColor", - st::titleBg->c); - windowHandle()->setProperty( - "__material_decoration_foregroundInactiveColor", - st::titleFg->c); - - // Trigger a QtWayland client-side decoration update - windowHandle()->resize(windowHandle()->size()); -} - void MainWindow::initTrayMenuHook() { _trayIconMenuXEmbed.emplace(nullptr, trayIconMenu); _trayIconMenuXEmbed->deleteOnHide(false); diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.h b/Telegram/SourceFiles/platform/linux/main_window_linux.h index ee7ecbee5..cc2ca4f16 100644 --- a/Telegram/SourceFiles/platform/linux/main_window_linux.h +++ b/Telegram/SourceFiles/platform/linux/main_window_linux.h @@ -79,7 +79,6 @@ private: base::unique_qptr _trayIconMenuXEmbed; void updateIconCounters(); - void updateWaylandDecorationColors(); #ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION StatusNotifierItem *_sniTrayIcon = nullptr; diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 566bb1d40..b5e4d41a6 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -654,10 +654,6 @@ void start() { "this may lead to font issues."); #endif // DESKTOP_APP_USE_PACKAGED_FONTS - if (AreQtPluginsBundled()) { - qputenv("QT_WAYLAND_DECORATION", "material"); - } - #ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION // Tell the user when XDP file dialog is used DEBUG_LOG(("Checking for XDG Desktop Portal...")); diff --git a/Telegram/ThirdParty/materialdecoration b/Telegram/ThirdParty/materialdecoration deleted file mode 160000 index 90b26e827..000000000 --- a/Telegram/ThirdParty/materialdecoration +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 90b26e827e27b829b208a3d906c38ca91cb2c50d