telegramdesktop / tdesktop

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

Bad UI performance on Linux Wayland session #26343

Closed LDVSOFT closed 6 months ago

LDVSOFT commented 1 year ago

Steps to reproduce

I've tried using Telegram Desktop on my Linux desktop running Ubuntu 22.04 with AMD videocard and 4K display, and when running under Wayland the UI is very slow (low fps? high latency?).

Expected behaviour

Should run as always.

Actual behaviour

Way slower than on X11.

Operating system

Ubuntu 22.04

Version of Telegram Desktop

4.8.1

Installation source

Static binary from official website

Crash ID

No response

Logs

[2023.05.29 10:47:43] Launched version: 4008001, install beta: [FALSE], alpha: 0, debug mode: [FALSE]
[2023.05.29 10:47:43] Executable dir: /opt/Telegram/, name: Telegram
[2023.05.29 10:47:43] Initial working dir: /home/ldvsoft/.local/share/TelegramDesktop/
[2023.05.29 10:47:43] Working dir: /home/ldvsoft/.local/share/TelegramDesktop/
[2023.05.29 10:47:43] Command line: /opt/Telegram/Telegram -workdir /home/ldvsoft/.local/share/TelegramDesktop/ -autostart
[2023.05.29 10:47:43] Executable path before check: /opt/Telegram/Telegram
[2023.05.29 10:47:43] Logs started
[2023.05.29 10:47:43] Launcher filename: org.telegram.desktop._6feb56bf3e01ae72605dedc0d4727bb7.desktop
[2023.05.29 10:47:49] Connecting local socket to 6feb56bf3e01ae72605dedc0d4727bb7-{87A94AB0-E370-4cde-98D3-ACC110C5967D}...
[2023.05.29 10:47:49] Socket connect error 0, starting server and app...
[2023.05.29 10:47:49] Moved logging from '/home/ldvsoft/.local/share/TelegramDesktop/log_start0.txt' to '/home/ldvsoft/.local/share/TelegramDesktop/log.txt'!
[2023.05.29 10:47:49] Opened '/home/ldvsoft/.local/share/TelegramDesktop/tdata/working' for reading, the previous Telegram Desktop launch was not finished properly :( Crash log size: 0
[2023.05.29 10:47:49] Global devicePixelRatio: 2
[2023.05.29 10:47:49] Primary screen DPI: 96, Base: 96.
[2023.05.29 10:47:49] Computed screen scale: 100
[2023.05.29 10:47:49] DevicePixelRatio: 2
[2023.05.29 10:47:49] ScreenScale: 100
[2023.05.29 10:47:49] System tray available: [TRUE]
[2023.05.29 10:47:49] Font: from ':/gui/fonts/DAOpenSansRegular.ttf' loaded 'DAOpenSansRegular'
[2023.05.29 10:47:49] Font: from ':/gui/fonts/DAVazirRegular.ttf' loaded 'DAVazirRegular'
[2023.05.29 10:47:49] Font: from ':/gui/fonts/DAOpenSansRegularItalic.ttf' loaded 'DAOpenSansRegularItalic'
[2023.05.29 10:47:49] Font: from ':/gui/fonts/DAVazirRegular.ttf' loaded 'DAVazirRegular'
[2023.05.29 10:47:49] Font: from ':/gui/fonts/DAOpenSansSemiboldAsBold.ttf' loaded 'DAOpenSansSemibold'
[2023.05.29 10:47:49] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2023.05.29 10:47:49] Font: from ':/gui/fonts/DAOpenSansSemiboldItalicAsBold.ttf' loaded 'DAOpenSansSemiboldItalic'
[2023.05.29 10:47:49] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2023.05.29 10:47:49] Font: from ':/gui/fonts/DAOpenSansSemiboldAsBold.ttf' loaded 'DAOpenSansSemibold'
[2023.05.29 10:47:49] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2023.05.29 10:47:49] Font: from ':/gui/fonts/DAOpenSansSemiboldItalicAsBold.ttf' loaded 'DAOpenSansSemiboldItalic'
[2023.05.29 10:47:49] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2023.05.29 10:47:49] Icon theme: Yaru
[2023.05.29 10:47:49] Fallback icon theme: 
[2023.05.29 10:47:49] App Info: reading settings...
[2023.05.29 10:47:49] App Info: reading encrypted settings...
[2023.05.29 10:47:50] Lang Info: Loaded cached, keys: 4994
[2023.05.29 10:47:51] OpenAL Logging Level: (not set)
[2023.05.29 10:47:51] Audio Playback Devices: Встроенное аудио Цифровой стерео (IEC958);Navi 21 HDMI Audio [Radeon RX 6800/6800 XT / 6900 XT] Digital Stereo (HDMI 2)
[2023.05.29 10:47:51] Audio Playback Default Device: Встроенное аудио Цифровой стерео (IEC958)
[2023.05.29 10:47:51] Audio Capture Devices: Monitor of Встроенное аудио Цифровой стерео (IEC958);Monitor of Navi 21 HDMI Audio [Radeon RX 6800/6800 XT / 6900 XT] Digital Stereo (HDMI 2)
[2023.05.29 10:47:51] Audio Capture Default Device: Monitor of Встроенное аудио Цифровой стерео (IEC958)
[2023.05.29 10:47:52] OpenGL Profile: Compatibility.
[2023.05.29 10:47:52] OpenGL Renderer: AMD Radeon RX 6650 XT (navi23, LLVM 15.0.7, DRM 3.47, 5.19.0-42-generic)
[2023.05.29 10:47:52] OpenGL Vendor: AMD
[2023.05.29 10:47:52] OpenGL Version: 4.6 (Compatibility Profile) Mesa 22.2.5
[2023.05.29 10:47:52] OpenGL Extensions: GL_ARB_compatibility, GL_EXT_EGL_image_storage, GL_ARB_transform_feedback_overflow_query, GL_EXT_framebuffer_multisample_blit_scaled, GL_ARB_fragment_layer_viewport, GL_EXT_texture_buffer_object, GL_ARB_shader_texture_image_samples, GL_ARB_polygon_offset_clamp, GL_EXT_shadow_funcs, GL_ARB_ES3_1_compatibility, GL_EXT_texture_shared_exponent, GL_ARB_shader_precision, GL_ARB_sample_shading, GL_ARB_shading_language_420pack, GL_ARB_conservative_depth, GL_EXT_subtexture, GL_EXT_framebuffer_sRGB, GL_EXT_stencil_two_side, GL_ARB_timer_query, GL_ARB_uniform_buffer_object, GL_EXT_texture3D, GL_NV_fog_distance, GL_OES_EGL_image, GL_KHR_debug, GL_ARB_get_program_binary, GL_NV_vdpau_interop, GL_EXT_polygon_offset_clamp, GL_ARB_draw_buffers_blend, GL_ARB_texture_rectangle, GL_EXT_framebuffer_blit, GL_ARB_texture_rg, GL_ATI_texture_float, GL_AMD_seamless_cubemap_per_texture, GL_ARB_texture_multisample, GL_AMD_shader_trinary_minmax, GL_ATI_fragment_shader, GL_EXT_transform_feedback, GL_NV_packed_depth_stencil, GL_MESA_texture_signed_rgba, GL_INTEL_blackhole_render, GL_EXT_packed_depth_stencil, GL_ARB_shading_language_include, GL_ATI_draw_buffers, GL_EXT_memory_object_fd, GL_ATI_texture_env_combine3, GL_ARB_shader_viewport_layer_array, GL_EXT_texture_integer, GL_ARB_point_sprite, GL_ARB_framebuffer_object, GL_EXT_shader_image_load_formatted, GL_ARB_texture_stencil8, GL_ARB_texture_env_dot3, GL_ARB_sync, GL_ARB_cull_distance, GL_ARB_parallel_shader_compile, GL_ATI_meminfo, GL_ARB_half_float_pixel, GL_ARB_query_buffer_object, GL_ARB_depth_clamp, GL_ARB_texture_view, GL_ARB_internalformat_query2, GL_ARB_vertex_type_10f_11f_11f_rev, GL_NV_copy_image, GL_AMD_conservative_depth, GL_EXT_point_parameters, GL_EXT_copy_texture, GL_ARB_conditional_render_inverted, GL_EXT_gpu_program_parameters, GL_ARB_gpu_shader5, GL_EXT_EGL_sync, GL_KHR_parallel_shader_compile, GL_EXT_shader_integer_mix, GL_ARB_point_parameters, GL_ARB_texture_query_lod, GL_ARB_ES3_2_compatibility, GL_EXT_framebuffer_multisample, GL_KHR_blend_equation_advanced, GL_ARB_texture_gather, GL_SGIS_texture_border_clamp, GL_EXT_texture_snorm, GL_ARB_copy_image, GL_ARB_shader_group_vote, GL_KHR_robust_buffer_access_behavior, GL_EXT_shader_image_load_store, GL_AMD_performance_monitor, GL_EXT_separate_specular_color, GL_ARB_get_texture_sub_image, GL_ARB_pixel_buffer_object, GL_ARB_vertex_attrib_binding, GL_EXT_texture_mirror_clamp, GL_ARB_texture_mirrored_repeat, GL_EXT_texture_env_dot3, GL_ARB_map_buffer_alignment, GL_EXT_blend_subtract, GL_ANGLE_texture_compression_dxt3, GL_EXT_secondary_color, GL_EXT_blend_func_separate, GL_ARB_sparse_texture, GL_ARB_ES2_compatibility, GL_ARB_viewport_array, GL_SUN_multi_draw_arrays, GL_AMD_pinned_memory, GL_IBM_multimode_draw_arrays, GL_ARB_spirv_extensions, GL_ARB_map_buffer_range, GL_EXT_semaphore, GL_ARB_texture_compression_bptc, GL_MESA_shader_integer_functions, GL_ARB_shader_storage_buffer_object, GL_ARB_compressed_texture_pixel_storage, GL_EXT_draw_instanced, GL_ARB_texture_cube_map_array, GL_EXT_texture_sRGB_RG8, GL_ARB_window_pos, GL_ARB_shader_bit_encoding, GL_ARB_gl_spirv, GL_ARB_stencil_texturing, GL_ARB_shader_clock, GL_EXT_direct_state_access, GL_EXT_texture_lod_bias, GL_ARB_robustness, GL_AMD_vertex_shader_layer, GL_MESA_pack_invert, GL_ARB_draw_instanced, GL_ARB_fragment_program_shadow, GL_ARB_texture_buffer_range, GL_ARB_texture_buffer_object, GL_ARB_texture_buffer_object_rgb32, GL_ARB_shading_language_packing, GL_ARB_texture_non_power_of_two, GL_ARB_fragment_coord_conventions, GL_ARB_texture_border_clamp, GL_EXT_texture_sRGB_decode, GL_ARB_texture_mirror_clamp_to_edge, GL_EXT_vertex_array_bgra, GL_ARB_shader_atomic_counter_ops, GL_EXT_draw_buffers2, GL_ARB_gpu_shader_fp64, GL_AMD_shader_stencil_export, GL_EXT_texture_swizzle, GL_KHR_robustness, GL_ARB_ES3_compatibility, GL_ARB_debug_output, GL_SGIS_texture_lod, GL_NV_copy_depth_to_color, GL_EXT_packed_float, GL_AMD_texture_texture4, GL_EXT_depth_bounds_test, GL_EXT_bgra, GL_NV_primitive_restart, GL_ARB_seamless_cube_map, GL_EXT_texture_rectangle, GL_ARB_base_instance, GL_IBM_texture_mirrored_repeat, GL_NV_shader_atomic_int64, GL_EXT_demote_to_helper_invocation, GL_EXT_packed_pixels, GL_ARB_shader_objects, GL_ARB_shader_ballot, GL_ARB_texture_compression, GL_EXT_fog_coord, GL_ARB_texture_env_combine, GL_ARB_blend_func_extended, GL_ARB_enhanced_layouts, GL_AMD_draw_buffers_blend, GL_EXT_stencil_wrap, GL_EXT_texture_edge_clamp, GL_ARB_sparse_texture_clamp, GL_EXT_blend_minmax, GL_NV_blend_square, GL_ARB_derivative_control, GL_ARB_texture_cube_map, GL_ARB_clear_buffer_object, GL_EXT_texture_env_add, GL_EXT_texture_compression_latc, GL_NV_depth_clamp, GL_ARB_indirect_parameters, GL_ARB_texture_compression_rgtc, GL_KHR_context_flush_control, GL_KHR_texture_compression_astc_ldr, GL_ARB_texture_storage, GL_NV_alpha_to_coverage_dither_control, GL_ARB_depth_buffer_float, GL_ARB_shader_image_size, GL_ARB_provoking_vertex, GL_EXT_texture_shadow_lod, GL_ARB_framebuffer_sRGB, GL_ARB_shader_atomic_counters, GL_NV_texture_barrier, GL_ARB_sampler_objects, GL_NV_half_float, GL_AMD_query_buffer_object, GL_ARB_arrays_of_arrays, GL_AMD_framebuffer_multisample_advanced, GL_EXT_memory_object, GL_ARB_explicit_attrib_location, GL_MESA_window_pos, GL_ARB_vertex_array_object, GL_EXT_texture_sRGB, GL_ARB_transform_feedback2, GL_ARB_sparse_texture2, GL_OES_read_format, GL_S3_s3tc, GL_ARB_texture_storage_multisample, GL_ARB_shading_language_100, GL_EXT_framebuffer_object, GL_NV_conditional_render, GL_EXT_draw_range_elements, GL_ARB_vertex_buffer_object, GL_EXT_multi_draw_arrays, GL_ARB_explicit_uniform_location, GL_EXT_blend_equation_separate, GL_NV_light_max_exponent, GL_ARB_depth_texture, GL_ARB_vertex_program, GL_NV_texture_rectangle, GL_EXT_texture, GL_ARB_shader_draw_parameters, GL_ARB_clear_texture, GL_ARB_texture_swizzle, GL_ARB_buffer_storage, GL_INGR_blend_func_separate, GL_ARB_fragment_shader, GL_ARB_occlusion_query2, GL_ARB_draw_buffers, GL_ARB_draw_elements_base_vertex, GL_MESA_framebuffer_flip_y, GL_EXT_abgr, GL_ARB_shadow, GL_ARB_program_interface_query, GL_ARB_copy_buffer, GL_EXT_rescale_normal, GL_SGIS_generate_mipmap, GL_EXT_texture_compression_rgtc, GL_EXT_timer_query, GL_EXT_vertex_attrib_64bit, GL_ARB_seamless_cubemap_per_texture, GL_KHR_no_error, GL_AMD_multi_draw_indirect, GL_ARB_texture_float, GL_EXT_texture_sRGB_R8, GL_NV_compute_shader_derivatives, GL_ARB_robust_buffer_access_behavior, GL_EXT_texture_filter_anisotropic, GL_SGIS_texture_edge_clamp, GL_EXT_semaphore_fd, GL_EXT_vertex_array, GL_AMD_depth_clamp_separate, GL_ARB_texture_query_levels, GL_EXT_texture_compression_s3tc, GL_ARB_tessellation_shader, GL_ARB_shader_stencil_export, GL_ARB_shader_image_load_store, GL_EXT_texture_compression_dxt1, GL_ARB_texture_rgb10_a2ui, GL_EXT_provoking_vertex, GL_ARB_invalidate_subdata, GL_NV_texture_env_combine4, GL_ATI_blend_equation_separate, GL_ARB_vertex_type_2_10_10_10_rev, GL_ARB_direct_state_access, GL_ATI_texture_mirror_once, GL_ARB_sparse_buffer, GL_ARB_shader_subroutine, GL_ARB_transform_feedback3, GL_ATI_texture_compression_3dc, GL_ARB_post_depth_coverage, GL_EXT_shader_samples_identical, GL_ARB_instanced_arrays, GL_ARB_occlusion_query, GL_KHR_texture_compression_astc_sliced_3d, GL_ARB_separate_shader_objects, GL_EXT_texture_cube_map, GL_EXT_compiled_vertex_array, GL_EXT_texture_env_combine, GL_ARB_internalformat_query, GL_EXT_gpu_shader4, GL_ARB_bindless_texture, GL_ARB_gpu_shader_int64, GL_ARB_multi_bind, GL_ARB_texture_env_add, GL_IBM_rasterpos_clip, GL_EXT_pixel_buffer_object, GL_ARB_texture_barrier, GL_ARB_transform_feedback_instanced, GL_APPLE_packed_pixels, GL_ARB_vertex_attrib_64bit, GL_NV_texgen_reflection, GL_ARB_multitexture, GL_ARB_multisample, GL_ATI_separate_stencil, GL_EXT_texture_object, GL_ARB_pipeline_statistics_query, GL_ARB_color_buffer_float, GL_ARB_multi_draw_indirect, GL_ARB_framebuffer_no_attachments, GL_ARB_compute_shader, GL_ARB_transpose_matrix, GL_ARB_vertex_array_bgra, GL_NVX_gpu_memory_info, GL_ARB_shader_texture_lod, GL_ARB_fragment_program, GL_AMD_vertex_shader_viewport_index, GL_EXT_texture_array, GL_ARB_draw_indirect, GL_ARB_half_float_vertex, GL_EXT_blend_color, GL_ARB_texture_filter_anisotropic, GL_ANGLE_texture_compression_dxt5, GL_ARB_texture_env_crossbar, GL_EXT_window_rectangles, GL_ARB_clip_control, GL_ARB_vertex_shader, GL_ARB_compute_variable_group_size
[2023.05.29 10:47:52] OpenGL: QOpenGLContext created, version: 4.4.
[2023.05.29 10:47:52] App Info: reading accounts info...
[2023.05.29 10:47:52] App Info: reading encrypted info...
[2023.05.29 10:47:52] App Info: reading map...
[2023.05.29 10:47:52] App Info: reading encrypted map...
[2023.05.29 10:47:52] App Info: reading encrypted user settings...
[2023.05.29 10:47:52] App Info: encrypted user settings read.
[2023.05.29 10:47:52] App Info: reading encrypted mtp data...
[2023.05.29 10:47:52] MTP Info: read keys, current: 5, to destroy: 0
[2023.05.29 10:47:52] Map read time: 2
[2023.05.29 10:47:52] App Info: reading encrypted mtp config...
[2023.05.29 10:47:53] Export Info: Destroy top bar by controller removal.
[2023.05.29 10:47:54] OpenGL: [TRUE] (Window)
[2023.05.29 10:47:54] Notification daemon product name: gnome-shell
[2023.05.29 10:47:54] Notification daemon vendor name: GNOME
[2023.05.29 10:47:54] Notification daemon version: 42.5
[2023.05.29 10:47:54] Notification daemon specification version: 1.2
[2023.05.29 10:47:54] Notification daemon capabilities: actions, body, body-markup, icon-static, persistence, sound
[2023.05.29 10:47:54] API Warning: not loaded minimal channel applied.
[2023.05.29 10:47:55] API Warning: not loaded minimal channel applied.
[2023.05.29 10:47:55] API Warning: not loaded minimal channel applied.
[2023.05.29 10:47:55] API Warning: not loaded minimal channel applied.
[2023.05.29 10:47:55] API Warning: not loaded minimal channel applied.
[2023.05.29 10:47:57] API Warning: not loaded minimal channel applied.
[2023.05.29 10:51:44] Audio Info: recreating audio device and reattaching the tracks
[2023.05.29 10:51:46] Audio Info: Closing audio playback device.
ilya-fedin commented 1 year ago

I can't reproduce, provide a screen record of the issue please

LDVSOFT commented 1 year ago

How could I share recording privately? It obviously would expose my chats.

Aokromes commented 1 year ago

How could I share recording privately? It obviously would expose my chats.

you can create a folder with for example telegram beta chat and screenrecord only that folder.

LDVSOFT commented 1 year ago

Ok, GitHub limits file to 10Mb, so you can look here.

ilya-fedin commented 1 year ago

Apparently this is hardware-dependent, I still can't reproduce. Or maybe GNOME is bad at performance, I use KDE.

LDVSOFT commented 1 year ago

Other apps seem not to be affected (Firefox works fine), I'll try to check that.

ilya-fedin commented 1 year ago

Well, GNOME always makes everything for Qt apps to work badly, I'm not surprised. I don't think it will ever be possible to get a good UX with tdesktop on GNOME desktop, due to all these silent cross-toolkit wars.

PoSayDone commented 1 year ago

I have the same issue with Telegram from Arch Linux repo and with Telegram from official website. I am using Hyprland, not gnome and have massive stutters and lags, but don't have them on X11

Specs

ilya-fedin commented 1 year ago

Will it lag on Plasma Wayland for you? I wonder whether it's DE-dependent, hardware-dependent or both... I have AMD hardware and Plasma Wayland, it works pretty fine...

PoSayDone commented 1 year ago

Will it lag on Plasma Wayland for you? I wonder whether it's DE-dependent, hardware-dependent or both... I have AMD hardware and Plasma Wayland, it works pretty fine...

Seems that I don't have such issue in plasma

ilya-fedin commented 1 year ago

Does that mean Qt has bad compatibility with everything except of Plasma? Is it reproducible with Weston?

PoSayDone commented 1 year ago

Does that mean Qt has bad compatibility with everything except of Plasma? Is it reproducible with Weston?

No, don't have such issue in Weston. Also checked gnome and the issue is reproducible in it.

ilya-fedin commented 1 year ago

I wonder what GNOME and Hyprland do that Qt operates slowly? :thinking:

PoSayDone commented 1 year ago

I wonder what GNOME and Hyprland do that Qt operates slowly? thinking

Also, other QT apps don't have such issue, for example qbittorrent, OBS and WPS Office

ilya-fedin commented 1 year ago

Are you sure they're based on Qt 6 and use OpenGL as well as tdesktop?

vitordelucca commented 1 year ago

I have the exactly same problem. It also weirdly consume way, way more RAM than necessary. Running on gnome here. GPU is intel integrated. All other apps are fine.

ilya-fedin commented 1 year ago

@vitordelucca how much?

vitordelucca commented 1 year ago

@vitordelucca how much?

Easily 500mb... I was used to tdesktop on Windows, when after hours and hours of use, was always less than 100mb.

I wonder if there is some flag to enable xwayland on tdesktop to see if perf improves?

ilya-fedin commented 1 year ago

Easily 500mb... I was used to tdesktop on Windows, when after hours and hours of use, was always less than 100mb.

Well, it starts from 400MB on Linux so it's normal... I guess that's some difference in how the systems work.

I wonder if there is some flag to enable xwayland on tdesktop to see if perf improves?

QT_QPA_PLATFORM=xcb

About OpenGL for media (which was removed from the comment), disabling it forces SHM flush which is reported to be working poorly on GNOME, leading to graphics artifacts on some GNOME systems. Apparently OpenGL flush also works poorly on some GNOME systems, which means both Qt's flush mechanisms are broken on GNOME's Wayland implementation in various ways... The slow performance is probably better than graphics artifacts so I guess switching the default is not a good idea. And I have no idea how to get this fixed given that the one who can reproduce (I can't) should create a minimal reproducible example for Qt developers to accept a bug report.

vitordelucca commented 1 year ago

QT_QPA_PLATFORM=xcb

How can I set it?

ilya-fedin commented 1 year ago

QT_QPA_PLATFORM=xcb ./Telegram Telegram shouldn't running in background or it would just send a message to an already running instance.

vitordelucca commented 1 year ago

QT_QPA_PLATFORM=xcb ./Telegram

Indeed this way is much faster.... I'm wondering if this could be put into experimental settings for those who might have problems turn on easily?

ilya-fedin commented 1 year ago

@vitordelucca

  1. I'm not sure it's worth doing. Especially given that you say disabling OpenGL helps. It's way better than Xwayland.
  2. Environment variables leak into child processes so if you open some downloaded file in tdesktop that involves launching an external application, it will inherit tdesktop's environment including this variable. If that application is a Qt one, it will apply the value. This usually leads to bug reports like #10487.
vitordelucca commented 1 year ago

Found a way to disable Wayland for QT Flatpak apps: Using Flatseal, just unselect Wayland, and then Telegram will run as X11 (so in this case, xwayland)

ZerdoX-x commented 1 year ago

Hi gnome users :) As Ilya mentioned

Well, GNOME always makes everything for Qt apps to work badly, I'm not surprised

Wayland gnome implements protocols very poorly in contrast with other DEs and WMs, do not use it if you want good wayland setup and environment, you may encounter issues in many apps. Especially if its combo with nvidia gpu, that's the worst setup you can do :) I am sure that telegram-desktop can do nothing about issues on gnome's wayland. It just uses qt and opengl, that's it.


I was using telegram-desktop for years. My wayland experience with it included 2 setups:

So current official distribution uses qt6? I think I'll find some time to compile it under qt6 and give feedback here. I was just looking through some open issues and stumbled across this one, so why not to help you testing this :)


BTW, Ilya, is it possible to hide these icons on telegram window?

Screenshot ![image](https://github.com/telegramdesktop/tdesktop/assets/49815452/59bdc022-7ef7-4c9f-a27d-c5e481f9bd21)

I tried setting env variable QT_WAYLAND_DISABLE_WINDOWDECORATION to 1 but tg window just ignores it. Please let me know if there is a quick way to hide them :)

ilya-fedin commented 1 year ago

Enable Qt window frame? Telegram's window frame follows GTK's window frame layout via portal.

ilya-fedin commented 1 year ago

I am sure Hyprland does nothing with Qt or any other frameworks, it's just a simple wlroots based WM.

Well, almost every Qt update leads to bug reports from wlroots and GNOME users. These issues are frequently reproducible even with weston but testing under kwin never shows issues. So there's definitely some difference between kwin and every other compositor that makes Qt utterly buggy on everything but kwin.

Your good experience might be because you're stumbled upon Qt 5 that had no minor updates for years...

ZerdoX-x commented 1 year ago

Your good experience might be because you're stumbled upon Qt 5 that had no minor updates for years...

Just unmasked qt6 use flag on my arm64 gentoo and recompiled all packages that can use it. Qt6 is still masked in gentoo for all architectures except amd64 unstable as it's considered not ready for migration from 5 version for all users, and most packages still use qt5 afaik.

So now some of my qt apps like obs and telegram use qt6. Feels like transparent themes in telegram-desktop work better then before, nice :D And again I did not stumbled upon any performance issues.

May this be related that guys using not the latest qt dependencies? I have ton of them on gentoo, and sometimes after @world upgrade I can stumble upon some issues like "freezing when reading images", I came across some of issues like this in this repo, but I don't really care about them as they can appear when some little dependency was updated like dev-qt/qtsvg, etc.. May this be related to ubuntu/debian having legacy libs/dependencies/packages and all that? I update my packages once a week and sometimes it can cause issues in telegram, even on updates that came to qt5 components, and even if tg itself wasn't upgraded. Though I can't remember huge performance loss as being reported in this issue.

Maybe we can list all telegram dependencies and require at least somewhat up to date? Here are all qt dependencies from telegram-desktop I have:

dev-qt/qtcore-5.15.11-r1
dev-qt/qtgui-5.15.11
dev-qt/qtnetwork-5.15.11
dev-qt/qtwidgets-5.15.11
kde-frameworks/kcoreaddons-5.111.0
dev-qt/qtbase-6.6.0-r1
dev-qt/qtimageformats-6.6.0
dev-qt/qtsvg-6.6.0-r1
dev-qt/qtdeclarative-6.6.0
dev-qt/qtwayland-6.6.0

And while typing this I found that when upgraded to qt6 my WM workspace gets switched to one where telegram-desktop is opened, so it just requires focus every time I get a message, notification. This is really awful :0 Is there a way to disable this? Is this considered an expected behavior? I know I can disable this globally in WM, but sometimes it's useful, in some apps, but not every time you receive a notification..


Enable Qt window frame? Telegram's window frame follows GTK's window frame layout via portal.

~I remember there was a setting like this in telegram-desktop, but I could not find it anymore, even in dev settings~ Found it, thank you! Maybe it appeared when I migrated to qt6, not sure why I was not able to find it.

ilya-fedin commented 1 year ago

May this be related that guys using not the latest qt dependencies?

I'd rather assume it's related to GL drivers and Qt<->GL (mesa)<->compositor communication

ilya-fedin commented 1 year ago

so it just requires focus every time I get a message, notification

Apparently that's how your compositor reacts to QWindow::alert? It blinks in taskbar/dock on KDE (both X11/Wayland), Windows and macOS.

ZerdoX-x commented 1 year ago

I'd rather assume it's related to GL drivers and Qt<->GL (mesa)<->compositor communication

Hm, this issue, maybe. I was just thinking about my cases when I saw freezes after upgrading some little qt deps.


Apparently that's how your compositor reacts to QWindow::alert?

Oookayy.. Seems like this is intended in hyprland. There are some issues and discussion related to this:

  1. https://github.com/hyprwm/Hyprland/issues/2732
  2. https://github.com/hyprwm/Hyprland/issues/1350

Hyprland creator quote from https://github.com/hyprwm/Hyprland/issues/1350#issuecomment-1377065229:

the reason I keep it off and generally not work on it is that it was causing me more issues than switching workspaces to firefox. Maybe it's my shady impl, maybe not, but some apps would repeatedly spam activation a kjhillion times a second (e.g. obs)

I'll post your message above to one of the threads and we'll discuss this behavior, maybe something wrong with implementation of focus request. Thanks.


It blinks in taskbar/dock on KDE

I don't use any taskbars or docks :)


Anyways I don't want this issue gets flooded by off topic messages, so thank you for all that info, and I gave you as much info as I can. I am not subscribing to the thread, so do not hesitate pinging me if you want me to test anything. The problem here is that I am using asahi video drivers which is crazy and only few people here use it :)

vitordelucca commented 1 year ago

Hi gnome users :) As Ilya mentioned

Well, GNOME always makes everything for Qt apps to work badly, I'm not surprised

Wayland gnome implements protocols very poorly in contrast with other DEs and WMs, do not use it if you want good wayland setup and environment, you may encounter issues in many apps. Especially if its combo with nvidia gpu, that's the worst setup you can do :) I am sure that telegram-desktop can do nothing about issues on gnome's wayland. It just uses qt and opengl, that's it.

I was using telegram-desktop for years. My wayland experience with it included 2 setups:

* huawei laptop with amd graphics, void linux, river wm

* apple air m1 laptop, gentoo linux, hyprland wm

In both cases it's high res and scaling, do not experience any issues. On my second setup it's even pure wayland, I don't have X installed.

Current setup:

* 2560x1600@60 monitor with 1.5 scaling

* `net-im/telegram-desktop-4.10.3-r1` compiled with source with `wayland dbus fonts screencast -X -enchant -qt6-imageformats -webkit` compilation flags

* qt5, did not have time yet figuring out how to migrate to qt6

* hyprland 0.30.0. wlroots 0.16.2

* latest asahi video drivers

I am not sure if it's 4k or not, but should be pretty close. I also use blur behind telegram window and lot's of opacity in my theme, it does not give me any performance issues.

I wonder what GNOME and Hyprland do that Qt operates slowly? 🤔

I am sure Hyprland does nothing with Qt or any other frameworks, it's just a simple wlroots based WM.

So current official distribution uses qt6? I think I'll find some time to compile it under qt6 and give feedback here. I was just looking through some open issues and stumbled across this one, so why not to help you testing this :)

BTW, Ilya, is it possible to hide these icons on telegram window? Screenshot

I tried setting env variable QT_WAYLAND_DISABLE_WINDOWDECORATION to 1 but tg window just ignores it. Please let me know if there is a quick way to hide them :)

I don't think it's related to Gnome. I'm now running EndeavourOS with KDE, and I still have bad Telegram perf under Wayland. When I run Telegram as xwayland, it runs much better.

I didn't notice this problem on any other QT app (after all, I'm on KDE, everything is QT!). Even SDDM I'm running under wayland and is working fine.

Only Telegram have this issue.

K900 commented 1 year ago

Can reproduce on Plasma Wayland too.

ilya-fedin commented 1 year ago

It's quite sad that no one who reproduces manage to debug the issue...

ilya-fedin commented 12 months ago

Can everyone tell their screen resolution & screen scale of all screens mentioning Telegram is slow on which of them, Telegram window size (mentioning whether it's physical size or divided by scale), whether the issue disappears after shrinking the window size?

PoSayDone commented 12 months ago

Can everyone tell their screen resolution & screen scale of all screens mentioning Telegram is slow on which of them, Telegram window size (mentioning whether it's physical size or divided by scale), whether the issue disappears after shrinking the window size?

2880x1800 scale 1.8

pranayadmn commented 12 months ago

Can everyone tell their screen resolution & screen scale of all screens mentioning Telegram is slow on which of them, Telegram window size (mentioning whether it's physical size or divided by scale), whether the issue disappears after shrinking the window size?

1920x1080, TDesktop is laggy for me when using a screen scale of 1.25 but seems to be fine on the default scale. Also, the issue is indeed fixed when the window is shrunk from the maximum size. The "Enable precise High DPI scaling" option in Experimental settings also helps to some extent.

ilya-fedin commented 12 months ago

@pranayadmn what's the CPU and GPU in your case? As I also have 1920x1080 with 1.25 and can't reproduce :(

andresilva commented 12 months ago

3840x2160 resolution with 1.5 scaling (using Hyprland). Can confirm that the issue seems to be gone if scaling is disabled or the window is set to a smaller size. Graphics card is AMD Vega 56, should be good enough to handle this.

The "Enable precise High DPI scaling" option in Experimental settings also helps to some extent.

Indeed it seems to make it better, although it introduces some other weird behavior (icons and emojis look a bit pixelated).

pranayadmn commented 12 months ago

@pranayadmn what's the CPU and GPU in your case? As I also have 1920x1080 with 1.25 and can't reproduce :(

i3-8100 with an NVIDIA GT 1030 w/ 545.29.02 drivers, running on GNOME.

ilya-fedin commented 12 months ago

@pranayadmn are you sure it's NVIDIA? sometimes people with dual GPU systems say NVIDIA but NVIDIA is not used on such systems for anything but games

pranayadmn commented 12 months ago

@pranayadmn are you sure it's NVIDIA? sometimes people with dual GPU system say NVIDIA but NVIDIA is not used on such systems for anything but games?

I can confirm the GPU in use is indeed the GT 1030 via resource monitoring tools which show its utilisation and the iGPU utilisation to be constantly 0%. Although I don't think it matters in my case for a desktop since the display is directly plugged in to the external GPU.

ilya-fedin commented 12 months ago

@pranayadmn can you provide tdesktop's log.txt?

pranayadmn commented 12 months ago

@pranayadmn can you provide tdesktop's log.txt?

log.txt Here you go!

ilya-fedin commented 12 months ago

@pranayadmn Will it still happen if you click reset the experimental options and restart the client?

pranayadmn commented 12 months ago

@pranayadmn Will it still happen if you click reset the experimental options and restart the client?

It might have been left accidentally enabled by me when I was trying to find what could possibly fix the issue. Yes, it does happen even when the experimental settings are disabled.

ilya-fedin commented 12 months ago

Does it happen with animations disabled and when no moving parts are on screen? Maybe the CPU just can't keep up with drawing the animations/moving content fast enough (yeah, tdesktop main window is painted using CPU as any QtWidgets application) on a scaled surface (which is way bigger as it's painted at the next integer factor which is 2x)... If it is then apparently it's not possible to fix without fixing #1121 first, which in turn is not possible to fix without full rewrite of application 😭

I guess no other QtWidgets application has animations nor such moving content which would explain why it's not possible to reproduce with any other Qt application.

PoSayDone commented 12 months ago

@pranayadmn are you sure it's NVIDIA? sometimes people with dual GPU systems say NVIDIA but NVIDIA is not used on such systems for anything but games

I'm using intel gpu, so it's not nvidia thing

pranayadmn commented 12 months ago

Does it happen with animations disabled and when no moving parts are on screen? Maybe the CPU just can't keep up with drawing the animations/moving content fast enough (yeah, tdesktop main window is painted using CPU as any QtWidgets application) on a scaled surface (which is way bigger as it's painted at the next integer factor which is 2x)... If it is then apparently it's not possible to fix without fixing #1121 first, which in turn is not possible to fix without full rewrite of application 😭

I guess no other QtWidgets application has animations nor such moving content which would explain why it's not possible to reproduce with any other Qt application.

It is indeed snappier when interface animations are disabled, but, isn't that kinda expected? 😅 I could consider switching to Xorg but the lack of fractional scaling support makes the display elements miserably small, while Xorg apps under Wayland look awful with fractional scaling :/ I guess for now I'll keep using the "Enable precise High DPI scaling" option under Experimental settings.

ilya-fedin commented 12 months ago

Yeah, as you can see, tdesktop is a legacy application regarding scaling. This is unlikely to improve so you can switch to the Electron version from the official Web A repo if that's something you really need. The best thing could be done in tdesktop is to patch Qt in official builds to always work at 1x scale but I guess this will make things worse as the compositor will upscale then and tdesktop window will be blurry.