Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bagasik opened this issue Oct 11, 2023 · 38 comments
Labels

Comments

@bagasik
Copy link

bagasik commented Oct 11, 2023

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

@bagasik bagasik added the bug label Oct 11, 2023
@ilya-fedin
Copy link
Contributor

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

@bagasik
Copy link
Author

bagasik commented Oct 11, 2023

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
Copy link
Contributor

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

@bagasik
Copy link
Author

bagasik commented Oct 11, 2023

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
Copy link
Author

bagasik commented Oct 11, 2023

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
Copy link
Contributor

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

@bagasik
Copy link
Author

bagasik commented Oct 11, 2023

мдааа

@ilya-fedin
Copy link
Contributor

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
Copy link
Contributor

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

And users, please stay polite and write in English.

henning-schild added a commit to henning-schild/gentoo that referenced this issue Oct 16, 2023
Closes: https://bugs.gentoo.org/915598
Fixes: 50ef5d2 ("net-im/telegram-desktop-bin: add missing gtk+:3 dep")
Related-to: telegramdesktop/tdesktop#26919
Signed-off-by: Henning Schild <henning@hennsch.de>
henning-schild added a commit to henning-schild/gentoo that referenced this issue Oct 30, 2023
Closes: https://bugs.gentoo.org/915598
Fixes: 50ef5d2 ("net-im/telegram-desktop-bin: add missing gtk+:3 dep")
Related-to: telegramdesktop/tdesktop#26919
Signed-off-by: Henning Schild <henning@hennsch.de>
gentoo-bot pushed a commit to gentoo/gentoo that referenced this issue Oct 30, 2023
Closes: https://bugs.gentoo.org/915598
Fixes: 50ef5d2 ("net-im/telegram-desktop-bin: add missing gtk+:3 dep")
Related-to: telegramdesktop/tdesktop#26919
Signed-off-by: Henning Schild <henning@hennsch.de>
Closes: #33359
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
@vitaly-zdanevich
Copy link

But I will not switch to Wayland because of Telegram.

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Nov 3, 2023

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

@Phazeus
Copy link

Phazeus commented Nov 17, 2023

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

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Nov 17, 2023

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

@Phazeus
Copy link

Phazeus commented Nov 17, 2023

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
Copy link
Contributor

ilya-fedin commented Nov 17, 2023

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
Copy link

Phazeus commented Nov 17, 2023

I use GTK+ without wayland flag compiled.

@ilya-fedin
Copy link
Contributor

You have to build gtk with wayland

@Phazeus
Copy link

Phazeus commented Nov 17, 2023

And crashing whole the system? No thanks.

@Phazeus
Copy link

Phazeus commented Nov 17, 2023

Just don't use that function.

@Phazeus
Copy link

Phazeus commented Nov 17, 2023

Or use exception-safe methods.

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Nov 17, 2023

Just don't use that function.

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

@Phazeus
Copy link

Phazeus commented Nov 17, 2023

Or make portable version with needed libs ...

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Nov 17, 2023

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
Copy link
Contributor

ilya-fedin commented Nov 17, 2023

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
Copy link

Phazeus commented Nov 17, 2023

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

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Nov 17, 2023

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
Copy link

Phazeus commented Nov 17, 2023

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
Copy link

Phazeus commented Nov 17, 2023

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

@ilya-fedin
Copy link
Contributor

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
Copy link

Phazeus commented Nov 17, 2023

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

@ilya-fedin
Copy link
Contributor

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
Copy link

Phazeus commented Nov 17, 2023

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
Copy link
Contributor

Ah. Some gentoo weirdness.

@henning-schild
Copy link
Contributor

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
Copy link

Phazeus commented Nov 17, 2023

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
Copy link
Contributor

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
Copy link

beelze commented Nov 23, 2023

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
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants