After update (not sure what exactly has been updated) I have CSD in sway for telegram. Telegram built with Qt6, and for a long time there were no issues with that. I checked that other Qt6 apps does not start with CSD, so likely this is telegram related thing. However I'm not even sure how to debug this. Reproducible: Always
What is CSD?
Client side decorations. Ugly window, border etc which draws app
This is a known issue upstream https://github.com/telegramdesktop/tdesktop/issues/8734 You were likely building Qt without USE=wayland before, or something else caused telegram to run under Xwayland. If you believe that's not the case, test the official binary release, and if it doesn't happen there, re-open this bug.
Well, official telegram binary also draws decorations. And it does not run under Xwayland.
After some investigation I figured out several things. 1. Default client does *not* show CSD. For some reason this option is not enabled by default, that's why I thought it does. 2. CMake sets DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION to ON *regardless* to value which has been passed by command line and it's not even in cache. I removed option definition from external/qt/package.cmake (https://github.com/desktop-app/cmake_helpers/blob/0620bb7b87a0ec9195151fd5eb0cf38656c1280b/external/qt/package.cmake#L51) and it built fine. So I assume that condition has not passed. In cache I see > grep -e QT_VERSION -e LINUX CMakeCache.txt QT_VERSION_MAJOR:UNINITIALIZED=6 Maybe that's is the reason..
From what I gather the official binary still has X support so it should be possible to runnundr Xwayland, but I digress. So if DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION is ON, this issue is solved for you? That's at least a bit odd, does that force it to run under Xwayland or does it do something else? Have you tried simply running with QT_QPA_PLATFORM=xcb (I think)? I'll fix this to be properly configurable in the ebuild but I must say that running telegram on wayland with USE=-wayland is at least a bit questionable, and I can't promise things won't break further down the line. Thanks a lot for figuring this out, anyway.
Issue solved for me when https://github.com/desktop-app/cmake_helpers/blob/0620bb7b87a0ec9195151fd5eb0cf38656c1280b/external/qt/package.cmake#L51 this line removed. If so, cmake uses passed DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION (which is in my case OFF, as I use wayland and have this flag enabled). The issue is, that cmake is broken for me - it does not properly detects that I'm building on linux & qt>6.5 at that place.
Oh, I see. Thanks for clarifying. It's weird thought that the QT_VERSION_MINOR variable doesn't appear in your CMakeCache.txt. Could you check if it's being set in /usr/lib64/cmake/Qt6/Qt6Config.cmake and QtAutogenHelpers.cmake ? I want the DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION option to remain configurable, and I'd rather force using the newest qt6 version rather than patching around this. Maybe removing these lines in the ebuild works? https://github.com/gentoo/gentoo/blob/8a5a0205dc4f55b099c6ccffd6599458a154dd78/net-im/telegram-desktop/telegram-desktop-4.8.4-r2.ebuild#L134-L139 You don't have to rebuild the entire program to test this, just check if -DDESKTOP_APP_DISABLE_WAYLAND_INTEGRATION appears in your build log.
I commented out that part, and looks like nothing changed. I addedd message() to CMakeLists to show actual IF/ELSE branch, as in cache it's DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION:INTERNAL=no while actual branch is for DISABLE_WAYLAND_INTEGRATION=ON I also added messages to show values which are used to take that expression: LINUX=1 qt_version_6_5_or_greater=0 QT_VERSION_MAJOR=6 QT_VERSION_MINOR= Regarding /usr/lib64/cmake/Qt6/Qt6Config.cmake I'm not sure I do have good understanding what is going on there. There is branch if (NOT QT_NO_CREATE_TARGETS) include("${CMAKE_CURRENT_LIST_DIR}/Qt6Targets.cmake") if(NOT QT_NO_CREATE_VERSIONLESS_TARGETS) include("${CMAKE_CURRENT_LIST_DIR}/Qt6VersionlessTargets.cmake") endif() else() # For examples using `find_package(...)` inside their CMakeLists.txt files: # Make CMake's AUTOGEN detect this Qt version properly set_directory_properties(PROPERTIES QT_VERSION_MAJOR 6 QT_VERSION_MINOR 5 QT_VERSION_PATCH 2) endif() However I'm not sure how it works.
Created attachment 866013 [details] CMakeCache
Created attachment 866014 [details] CMakeCache.txt
This might be a dev-qt/qtbase bug then? Not sure how to further this.
FWIW, telegram-desktop-4.10.3 allows you to disable CSD Settings->Advanced->Window title bar->Use Qt window frame I am using qt 6.5.3 if that matters
Does that work in wayland now? If that's the case then I can close this issue when that version stabilizes. Thanks for pointing it out!
(In reply to Esteve Varela Colominas from comment #14) > Does that work in wayland now? If that's the case then I can close this > issue when that version stabilizes. Thanks for pointing it out! Yeah, it's a wayland-only build of telegram. You're welcome, btw please CC me in wayland-related bugs.
Looks fine
> FWIW, telegram-desktop-4.10.3 allows you to disable CSD Settings->Advanced->Window title bar->Use Qt window frame It's weird that checking this box makes CSD go away for me. But I can confirm it does in 4.10.3.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7497d83f469b739fcc81775878c5e59c2000e5c8 commit 7497d83f469b739fcc81775878c5e59c2000e5c8 Author: Esteve Varela Colominas <esteve.varela@gmail.com> AuthorDate: 2023-12-10 22:30:20 +0000 Commit: Yixun Lan <dlan@gentoo.org> CommitDate: 2023-12-11 13:23:32 +0000 net-im/telegram-desktop: Drop stable The list of bugs has become untenable, the package is essentially unusable, and there's no clear idea of when glibmm will be bumped. Sorry for the inconveniences... Bug: https://bugs.gentoo.org/915992 Closes: https://bugs.gentoo.org/877067 Closes: https://bugs.gentoo.org/910544 Closes: https://bugs.gentoo.org/911395 Closes: https://bugs.gentoo.org/912896 Closes: https://bugs.gentoo.org/914419 Closes: https://bugs.gentoo.org/914902 Closes: https://bugs.gentoo.org/915109 Closes: https://bugs.gentoo.org/915237 Closes: https://bugs.gentoo.org/915982 Signed-off-by: Esteve Varela Colominas <esteve.varela@gmail.com> Signed-off-by: Yixun Lan <dlan@gentoo.org> net-im/telegram-desktop/Manifest | 1 - .../files/tdesktop-4.4.1-fix-dupe-main-decl.patch | 26 --- .../telegram-desktop-4.8.1-r3.ebuild | 210 --------------------- 3 files changed, 237 deletions(-)