telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
25.66k stars 5.08k forks source link

When uploading files to telegram, telegram closes completely and me have to start again telegram. #26919

Closed bagasik closed 10 months ago

bagasik commented 10 months ago

Steps to reproduce

Hello. When uploading files to telegram, telegram closes completely and me have to start again telegram. Linux 6.1.53-gentoo-r1 x86_64 xfce4 4.18.4 net-im/telegram-desktop-bin-4.10.3

Expected behaviour

When uploading files to telegram, telegram closes completely and me have to start again telegram.

Actual behaviour

When uploading files to telegram, telegram closes completely and me have to start again telegram.

Operating system

Linux 6.1.53-gentoo-r1 x86_64

Version of Telegram Desktop

telegram-desktop-bin-4.10.3

Installation source

Static binary from official website

Crash ID

No response

Logs

No response

ilya-fedin commented 10 months ago

Please do the steps required by the issue template to get crash ID and provide it.

bagasik commented 10 months ago

Crash ID not.

$ telegram-desktop QPainter::begin: Paint device returned engine == 0, type: 2 QWidget::render: Cannot render with an inactive painter implib-gen: libgdk-3.so.0: failed to resolve symbol 'gdk_wayland_window_get_type' via dlsym: /usr/lib64/libgdk-3.so.0: undefined symbol: gdk_wayland_window_get_type Аварийный останов

ilya-fedin commented 10 months ago

Your system is supported up to 4.9.x. Please downgrade or or get a gtk with wayland.

bagasik commented 10 months ago

Launched from the console. Then I tried to upload a file to the chat and then the telegram turned off completely. I had to restart telegram.

bagasik commented 10 months ago

Installed on gtk system.

dev-util/gtk-doc-am-1.33.2 dev-util/gtk-update-icon-cache-3.24.31 x11-libs/gtk+-3.24.38 x11-libs/gtk+-2.24.33-r3 x11-libs/gtksourceview-4.8.4 x11-misc/lightdm-gtk-greeter-2.0.8-r1 x11-themes/gtk-engines-adwaita-3.28 x11-themes/gtk-engines-murrine-0.98.2-r3

wayland not using!

ilya-fedin commented 10 months ago

Yeah, that's the thing. gtk with wayland is required since 4.10.0. Your system is uncapable to run new versions.

bagasik commented 10 months ago

мдааа

ilya-fedin commented 10 months ago

Well, it's just a matter of pragmatism. There was a ~1kloc patch to qtbase to make gtk optional in Qt static build. Since 4.10.0 no longer supports major distros without Wayland nor gtk3, there's no sense to continue to maintain that huge patch. So the Qt build now requires gtk3 and requires it with both x11 & wayland (as Qt uses both GdkWaylandWindow and GdkX11Window API). It's just a matter of building a very little libwayland for you while a big simplification of Qt update process for tdesktop. If you don't like that you can always build tdesktop from sources with Qt configured in a way you would like.

henning-schild commented 10 months ago

@ilya-fedin thanks. We will add the dependencies to the gentoo package metadata.

And users, please stay polite and write in English.

vitaly-zdanevich commented 9 months ago

But I will not switch to Wayland because of Telegram.

ilya-fedin commented 9 months ago

Don't switch? No one forces you to switch to Wayland, just build libwayland.

Phazeus commented 9 months ago

Why not to use x11 in a case of no wayland?

ilya-fedin commented 9 months ago

Not sure what you mean, that's exactly how it works

Phazeus commented 9 months ago

implib-gen: libgdk-3.so.0: failed to resolve symbol 'gdk_wayland_window_get_type' via dlsym: /usr/lib64/libgdk-3.so.0: undefined symbol: gdk_wayland_window_get_type I don't use Wayland

ilya-fedin commented 9 months ago

You don't have to use Wayland but you have to have GTK built with Wayland backend as Qt checks whether the dialog's GdkWindow is an instance of GdkWaylandWindow in order to know whether GTK is running under Wayland.

You also need to have gtk built with X11 if you're using Wayland as Qt checks for GdkX11Window instance as well so it uses the gdk_x11_window_get_type symbol as well.

Phazeus commented 9 months ago

I use GTK+ without wayland flag compiled.

ilya-fedin commented 9 months ago

You have to build gtk with wayland

Phazeus commented 9 months ago

And crashing whole the system? No thanks.

Phazeus commented 9 months ago

Just don't use that function.

Phazeus commented 9 months ago

Or use exception-safe methods.

ilya-fedin commented 9 months ago

Just don't use that function.

How? tdesktop just creates an instance of QFileDialog, this function is used by Qt internals.

Phazeus commented 9 months ago

Or make portable version with needed libs ...

ilya-fedin commented 9 months ago

And crashing whole the system? No thanks.

I'm not sure what you mean by that, you would just need to build the little libwayland library and re-build GTK with it. In any case I don't think there's enough users to start to patch Qt or create a separate build (every build takes around 4 hours so having a different build for such users is a big headache) so you have to handle that yourself.

ilya-fedin commented 9 months ago

Or make portable version with needed libs ...

That won't work. GTK relies on plugins a lot so it will crash for sure due to system having various plugins built for system GTK build. It will also bug with themes as GTK had theme API break during 3.x. Not even mentioning the use of webkit2gtk which will also have to be bundled then which will enlarge the bundle to the unacceptable extent.

Phazeus commented 9 months ago

"You have to use wayland to make me sure that you don't use it". Ok. Can't use TG any more.

ilya-fedin commented 9 months ago

There's a difference between building libwayland/gtk wayland backend and using a Wayland compositor. All the binary distros have all Qt/gtk backends built and people use both Wayland and X11 just fine.

Upstream builds are made for those typical users. If you aren't a typical user, you can build from source code just fine.

Phazeus commented 9 months ago

But it is stupid to do such checks that way. If system doesn't use wayland at all, it is stupid to need in libwayland to check it. If you see that there no wayland at all, don't use such checks....

Phazeus commented 9 months ago

I use Gentoo. I can't change hardware just for TG working...

ilya-fedin commented 9 months ago

But it is stupid to do such checks that way. If system doesn't use wayland at all, it is stupid to need in libwayland to check it. If you see that there no wayland at all, don't use such checks....

I understand. But as I said, tdesktop is not of control for that code, it's done in third party dependency, the Qt toolkit.

I use Gentoo. I can't change hardware just for TG working...

I'm not sure why you need to change hardware

Phazeus commented 9 months ago

I understand, but ... damn ... :(

ilya-fedin commented 9 months ago

I don't understand your problem. Building libwayland is a couple of seconds and then once rebuild GTK whose build will be increased only by a few Wayland-related source files. If that's a problem for you then maybe install Arch/Fedora/Ubuntu/etc and just use prebuilt libraries?

Phazeus commented 9 months ago

I need to find old ebuilds for my current versions. I can't recompile whole the system with tons of deps. So, will try to find old GTKs, Mesa, etc...

ilya-fedin commented 9 months ago

Ah. Some gentoo weirdness.

henning-schild commented 9 months ago

Ah. Some gentoo weirdness.

Not at all. Gentoo is requiring the lib to be built with wayland support since this one came up. So it is all good as far as i can tell (gentoo maintainer for telegram-desktop-bin).

What we see here is people failing to explain their point and choosing to use weird ways. Like old packages and basically freezing/forking parts of their setup. Still no clue why. I suggest to ignore until we see good reasoning.

Phazeus commented 9 months ago

Ah. Some gentoo weirdness.

Not at all. Gentoo is requiring the lib to be built with wayland support since this one came up. So it is all good as far as i can tell (gentoo maintainer for telegram-desktop-bin).

What we see here is people failing to explain their point and choosing to use weird ways. Like old packages and basically freezing/forking parts of their setup. Still no clue why. I suggest to ignore until we see good reasoning.

I use Mesa 21.1.8-r1 and can't use never version for some reasons. I used to compile the packages with "-wayland" global USE flag everywhere. Now, to recompile it with "+wayland" I need to ... find old ebuilds and sources for Mesa and old version for GTK+ to recompile. Because my portages a bit updated and I lost my current compiled versions of software installed...

henning-schild commented 9 months ago

Your mesa is outdated. If newer versions have a bug, look into that. And now please stop bothering upstream with your problems .... likely caused by your own changes.

beelze commented 9 months ago

There is no need to set +wayland USE flag globally. To get rid of the issue is enough to add:

x11-libs/gtk+:3 wayland
media-libs/mesa wayland

and rebuild these packages.

henning-schild commented 9 months ago

There is no need to set +wayland USE flag globally. To get rid of the issue is enough to add:

x11-libs/gtk+:3 wayland
media-libs/mesa wayland

and rebuild these packages.

In fact you simply do nothing. Because what was described here happens automatically unless one messed too much with USE.