telegramdesktop / tdesktop

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

Telegram Windows on mixed DPI setup, monitor DPMS, toggles off, window sort of broken after resuming #27093

Closed kode54 closed 11 months ago

kode54 commented 11 months ago

Steps to reproduce

  1. Configure two monitors in different scale factors (200%, 100%)
  2. DPMS timeout the displays
  3. Have Telegram Desktop at 200% scale on the 200% scale monitor.
  4. Dodgy LG 4k panel disconnects itself and reconnects itself instantly when powered back on by the OS, possible to simulate by unplugging and replugging it.
  5. Telegram Desktop will instantly migrate to the 100% scale monitor, then back again as the 200% one reconnects.
  6. Telegram Desktop will get stuck in a state where it's drawing the actual window contents at 100% scale in the top left quadrant of the window size. The rest of the space will retain its graphics and not repaint any further.
  7. Fixable by dragging the window onto the 100% scale monitor, leaving it there, then dragging it back again.

Expected behaviour

The window should switch to the scale of the 200% monitor after it's migrated back to it.

Actual behaviour

Telegram Desktop gets stuck displaying a 100% scale drawn interface inside the 200% sized window. The remaining 3/4 of the window will not repaint further, but retains the former interface image from before the scaling got stuck.

Operating system

Windows 11 23H2

Version of Telegram Desktop

4.11.6

Installation source

Static binary from official website

Crash ID

No response

Logs

[2023.11.12 22:10:18] Launched version: 4011006, install beta: [FALSE], alpha: 0, debug mode: [FALSE]
[2023.11.12 22:10:18] Executable dir: C:/Users/kode5/AppData/Roaming/Telegram Desktop/, name: Telegram.exe
[2023.11.12 22:10:18] Initial working dir: C:/Users/kode5/AppData/Roaming/Telegram Desktop/
[2023.11.12 22:10:18] Working dir: C:/Users/kode5/AppData/Roaming/Telegram Desktop/
[2023.11.12 22:10:18] Command line: C:\Users\kode5\AppData\Roaming\Telegram Desktop\Telegram.exe -autostart
[2023.11.12 22:10:18] Executable path before check: C:/Users/kode5/AppData/Roaming/Telegram Desktop/Telegram.exe
[2023.11.12 22:10:18] Logs started
[2023.11.12 22:10:18] App Info: Shortcut validated at "C:/Users/kode5/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Telegram Desktop/Telegram.lnk"
[2023.11.12 22:10:18] AppUserModelID: Telegram.TelegramDesktop
[2023.11.12 22:10:18] Connecting local socket to Global\f7c12e7e4125910fd064c6a94fca1f7c-{87A94AB0-E370-4cde-98D3-ACC110C5967D}...
[2023.11.12 22:10:18] This is the only instance of Telegram, starting server and app...
[2023.11.12 22:10:18] Moved logging from 'C:/Users/kode5/AppData/Roaming/Telegram Desktop/log_start0.txt' to 'C:/Users/kode5/AppData/Roaming/Telegram Desktop/log.txt'!
[2023.11.12 22:10:18] Opened 'C:/Users/kode5/AppData/Roaming/Telegram Desktop/tdata/working' for reading, the previous Telegram Desktop launch was not finished properly :( Crash log size: 0
[2023.11.12 22:10:18] Global devicePixelRatio: 2
[2023.11.12 22:10:18] QT_DPI_ADJUSTMENT_POLICY: AdjustDpi
[2023.11.12 22:10:18] Primary screen DPI: 96, Base: 96.
[2023.11.12 22:10:18] Computed screen scale: 100
[2023.11.12 22:10:18] DevicePixelRatio: 2
[2023.11.12 22:10:18] ScreenScale: 100
[2023.11.12 22:10:18] Font: from ':/gui/fonts/DAOpenSansRegular.ttf' loaded 'DAOpenSansRegular'
[2023.11.12 22:10:18] Font: from ':/gui/fonts/DAVazirRegular.ttf' loaded 'DAVazirRegular'
[2023.11.12 22:10:18] Font: from ':/gui/fonts/DAOpenSansRegularItalic.ttf' loaded 'DAOpenSansRegularItalic'
[2023.11.12 22:10:18] Font: from ':/gui/fonts/DAVazirRegular.ttf' loaded 'DAVazirRegular'
[2023.11.12 22:10:18] Font: from ':/gui/fonts/DAOpenSansSemiboldAsBold.ttf' loaded 'DAOpenSansSemibold'
[2023.11.12 22:10:18] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2023.11.12 22:10:18] Font: from ':/gui/fonts/DAOpenSansSemiboldItalicAsBold.ttf' loaded 'DAOpenSansSemiboldItalic'
[2023.11.12 22:10:18] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2023.11.12 22:10:18] Font: from ':/gui/fonts/DAOpenSansSemiboldAsBold.ttf' loaded 'DAOpenSansSemibold'
[2023.11.12 22:10:18] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2023.11.12 22:10:18] Font: from ':/gui/fonts/DAOpenSansSemiboldItalicAsBold.ttf' loaded 'DAOpenSansSemiboldItalic'
[2023.11.12 22:10:18] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2023.11.12 22:10:18] Using DirectX compiler 'C:\Users\kode5\AppData\Roaming\Telegram Desktop\modules\x64\d3d\d3dcompiler_47.dll'.
[2023.11.12 22:10:18] App Info: reading settings...
[2023.11.12 22:10:18] App Info: reading encrypted settings...
[2023.11.12 22:10:18] Lang Info: Loaded cached, keys: 5860
[2023.11.12 22:10:18] OpenAL Logging Level: (not set)
[2023.11.12 22:10:18] Audio Playback Devices: OpenAL Soft on SPDIF Interface (2- FiiO USB DAC-E07K);OpenAL Soft on Speakers (2- High Definition Audio Device);OpenAL Soft on Speakers (Yeti Stereo Microphone);OpenAL Soft on 4 - LG Ultra HD (AMD High Definition Audio Device)
[2023.11.12 22:10:18] Audio Playback Default Device: OpenAL Soft on SPDIF Interface (2- FiiO USB DAC-E07K)
[2023.11.12 22:10:18] Audio Capture Devices: OpenAL Soft on Microphone (Yeti Stereo Microphone);OpenAL Soft on Microphone (Logi C615 HD WebCam)
[2023.11.12 22:10:18] Audio Capture Default Device: OpenAL Soft on Microphone (Yeti Stereo Microphone)
[2023.11.12 22:10:18] App Info: reading accounts info...
[2023.11.12 22:10:18] App Info: reading encrypted info...
[2023.11.12 22:10:18] App Info: reading map...
[2023.11.12 22:10:18] App Info: reading encrypted map...
[2023.11.12 22:10:18] App Info: reading encrypted user settings...
[2023.11.12 22:10:18] App Info: encrypted user settings read.
[2023.11.12 22:10:18] App Info: reading encrypted mtp data...
[2023.11.12 22:10:18] MTP Info: read keys, current: 5, to destroy: 0
[2023.11.12 22:10:18] Map read time: 3
[2023.11.12 22:10:18] App Info: reading encrypted mtp config...
[2023.11.12 22:10:18] Export Info: Destroy top bar by controller removal.
[2023.11.12 22:10:18] OpenGL: Using custom 'gpu_driver_bug_list.json'.
[2023.11.12 22:10:19] OpenGL Profile: OpenGLES.
[2023.11.12 22:10:19] OpenGL Renderer: ANGLE (AMD, AMD Radeon RX 6700 XT Direct3D11 vs_5_0 ps_5_0, D3D11-31.0.22023.1014)
[2023.11.12 22:10:19] OpenGL Vendor: Google Inc. (AMD)
[2023.11.12 22:10:19] OpenGL Version: OpenGL ES 3.0.0 (ANGLE 2.1.10 git hash: e3f59e8d0c3e)
[2023.11.12 22:10:19] OpenGL Extensions: GL_CHROMIUM_bind_uniform_location, GL_ANGLE_multi_draw, GL_EXT_base_instance, GL_EXT_texture_rg, GL_ANGLE_get_tex_level_parameter, GL_ANGLE_copy_texture_3d, GL_KHR_parallel_shader_compile, GL_NV_pack_subimage, GL_OES_texture_border_clamp, GL_EXT_texture_norm16, GL_EXT_color_buffer_half_float, GL_NV_EGL_stream_consumer_external, GL_OES_draw_elements_base_vertex, GL_ANGLE_instanced_arrays, GL_ANGLE_texture_compression_dxt3, GL_EXT_debug_marker, GL_EXT_texture_compression_dxt1, GL_CHROMIUM_sync_query, GL_EXT_draw_buffers, GL_OES_EGL_image_external_essl3, GL_OES_packed_depth_stencil, GL_EXT_disjoint_timer_query, GL_EXT_texture_type_2_10_10_10_REV, GL_NV_shader_noperspective_interpolation, GL_ANGLE_renderability_validation, GL_EXT_sRGB, GL_ANGLE_polygon_mode, GL_OES_compressed_EAC_R11_unsigned_texture, GL_ANGLE_depth_texture, GL_ANGLE_framebuffer_multisample, GL_OVR_multiview, GL_EXT_shader_texture_lod, GL_EXT_render_snorm, GL_CHROMIUM_bind_generates_resource, GL_EXT_draw_buffers_indexed, GL_OES_depth32, GL_KHR_debug, GL_OES_shader_multisample_interpolation, GL_OES_vertex_array_object, GL_ANGLE_request_extension, GL_OES_compressed_ETC2_sRGB8_alpha8_texture, GL_EXT_color_buffer_float, GL_EXT_texture_mirror_clamp_to_edge, GL_OES_compressed_ETC2_punchthroughA_sRGB8_alpha_texture, GL_ANGLE_memory_size, , GL_EXT_clip_control, GL_OES_sample_variables, GL_OES_rgb8_rgba8, GL_EXT_occlusion_query_boolean, GL_ANGLE_lossy_etc_decode, GL_OES_EGL_image, GL_OES_compressed_ETC2_RGB8_texture, GL_EXT_clip_cull_distance, GL_EXT_instanced_arrays, GL_OES_depth24, GL_EXT_debug_label, GL_EXT_depth_clamp, GL_EXT_texture_storage, GL_OVR_multiview2, GL_EXT_robustness, GL_EXT_texture_compression_rgtc, GL_EXT_frag_depth, GL_EXT_texture_filter_anisotropic, GL_ANGLE_texture_usage, GL_ANGLE_client_arrays, GL_ANGLE_provoking_vertex, GL_ANGLE_shader_pixel_local_storage_coherent, GL_EXT_texture_format_BGRA8888, GL_NV_framebuffer_blit, GL_OES_compressed_EAC_RG11_unsigned_texture, GL_EXT_conservative_depth, GL_EXT_draw_elements_base_vertex, GL_ANGLE_base_vertex_base_instance, GL_EXT_map_buffer_range, GL_EXT_float_blend, GL_EXT_multi_draw_indirect, GL_EXT_texture_border_clamp, GL_OES_compressed_EAC_R11_signed_texture, GL_OES_compressed_ETC2_punchthroughA_RGBA8_texture, GL_OES_fbo_render_mipmap, GL_CHROMIUM_copy_compressed_texture, GL_EXT_multisampled_render_to_texture, GL_OES_get_program_binary, GL_ANGLE_multiview_multisample, GL_NV_fence, GL_ANGLE_clip_cull_distance, GL_ANGLE_texture_compression_dxt5, GL_CHROMIUM_copy_texture, GL_NV_pixel_buffer_object, GL_EXT_read_format_bgra, GL_AMD_performance_monitor, GL_ANGLE_robust_client_memory, GL_OES_mapbuffer, GL_CHROMIUM_lose_context, GL_OES_texture_half_float, GL_OES_compressed_ETC2_RGBA8_texture, GL_ANGLE_pack_reverse_row_order, GL_OES_texture_float, GL_EXT_blend_func_extended, GL_OES_EGL_image_external, GL_OES_texture_npot, GL_ANGLE_shader_pixel_local_storage, GL_OES_texture_half_float_linear, GL_EXT_discard_framebuffer, GL_EXT_texture_compression_s3tc_srgb, GL_ANGLE_framebuffer_blit, GL_ANGLE_translated_shader_source, GL_OES_surfaceless_context, GL_OES_texture_stencil8, GL_OES_element_index_uint, GL_WEBGL_video_texture, GL_ANGLE_stencil_texturing, GL_EXT_blend_minmax, GL_EXT_texture_compression_bptc, GL_OES_standard_derivatives, GL_OES_compressed_EAC_RG11_signed_texture, GL_ANGLE_program_cache_control, GL_APPLE_clip_distance, GL_EXT_EGL_image_external_wrap_modes, GL_ANGLE_base_vertex_base_instance_shader_builtin, GL_EXT_polygon_offset_clamp, GL_OES_compressed_ETC2_sRGB8_texture, GL_OES_draw_buffers_indexed, GL_OES_texture_float_linear, GL_EXT_unpack_subimage, GL_ANGLE_get_serialized_context_string, GL_ANGLE_texture_multisample
[2023.11.12 22:10:19] EGL Extensions: EGL_EXT_create_context_robustness, EGL_ANGLE_d3d_share_handle_client_buffer, EGL_ANGLE_d3d_texture_client_buffer, EGL_ANGLE_surface_d3d_texture_2d_share_handle, EGL_ANGLE_query_surface_pointer, EGL_ANGLE_window_fixed_size, EGL_ANGLE_keyed_mutex, EGL_ANGLE_surface_orientation, EGL_ANGLE_direct_composition, EGL_ANGLE_windows_ui_composition, EGL_NV_post_sub_buffer, EGL_KHR_create_context, EGL_KHR_image, EGL_KHR_image_base, EGL_KHR_gl_texture_2D_image, EGL_KHR_gl_texture_cubemap_image, EGL_KHR_gl_renderbuffer_image, EGL_KHR_get_all_proc_addresses, EGL_KHR_stream, EGL_KHR_stream_consumer_gltexture, EGL_NV_stream_consumer_gltexture_yuv, EGL_ANGLE_stream_producer_d3d_texture, EGL_ANGLE_create_context_webgl_compatibility, EGL_CHROMIUM_create_context_bind_generates_resource, EGL_CHROMIUM_sync_control, EGL_EXT_pixel_format_float, EGL_KHR_surfaceless_context, EGL_ANGLE_display_texture_share_group, EGL_ANGLE_display_semaphore_share_group, EGL_ANGLE_create_context_client_arrays, EGL_ANGLE_program_cache_control, EGL_ANGLE_robust_resource_initialization, EGL_ANGLE_create_context_extensions_enabled, EGL_ANDROID_blob_cache, EGL_ANDROID_recordable, EGL_ANGLE_image_d3d11_texture, EGL_ANGLE_create_context_backwards_compatible, EGL_KHR_no_config_context, EGL_KHR_create_context_no_error, EGL_KHR_reusable_sync, 
[2023.11.12 22:10:19] OpenGL: QOpenGLContext created, version: 3.3.
[2023.11.12 22:10:19] OpenGL: [TRUE] (Window)
[2023.11.12 22:16:09] Audio Info: recreating audio device and reattaching the tracks
[2023.11.12 22:16:11] Audio Info: Closing audio playback device.
[2023.11.12 22:16:24] Audio Info: recreating audio device and reattaching the tracks
[2023.11.12 22:16:26] Audio Info: Closing audio playback device.
[2023.11.12 22:26:01] Audio Info: OnDeviceStateChanged("{0.0.0.00000000}.{f600db68-dc07-430f-9514-46124ebc79af}", 8) scheduling detach from audio device.
[2023.11.12 22:31:14] Audio Info: OnDeviceStateChanged("{0.0.0.00000000}.{f600db68-dc07-430f-9514-46124ebc79af}", 4) scheduling detach from audio device.
[2023.11.12 22:31:14] Audio Info: OnDeviceStateChanged("{0.0.0.00000000}.{f600db68-dc07-430f-9514-46124ebc79af}", 1) scheduling detach from audio device.
[2023.11.12 22:36:11] Audio Info: OnDeviceStateChanged("{0.0.0.00000000}.{f600db68-dc07-430f-9514-46124ebc79af}", 8) scheduling detach from audio device.
[2023.11.12 22:47:50] Audio Info: OnDeviceStateChanged("{0.0.0.00000000}.{f600db68-dc07-430f-9514-46124ebc79af}", 4) scheduling detach from audio device.
[2023.11.12 22:47:51] Audio Info: OnDeviceStateChanged("{0.0.0.00000000}.{f600db68-dc07-430f-9514-46124ebc79af}", 1) scheduling detach from audio device.
[2023.11.12 22:49:57] Message Info: bad message notification received (error_code 33) for msg_id = 7300835366946265016, seq_no = 6
[2023.11.12 22:49:57] Message Info: bad message notification received, msgId 7300835366946265016, error_code 33
[2023.11.12 22:49:58] Skipping message, because it is already in blocks!
ilya-fedin commented 11 months ago

Do you want to help tdesktop project by reporting this to Qt (which means creating a minimal reproducible example)? If not, the issue is likely to be a long-standing one as no one is having spare time to report + multi-monitor environment to reproduce at once.

evlo commented 10 months ago

How did you manage telegram desktop to follow DPI of the system primary monitor? I have ui scale set to system, but it never follows dpi change - disconnecting from external display results in huge ui and i need to restart telegram, connecting external display reults in tiny ui for me, again, i need to restart telegram

in my opinion it sould at least do the refresh when recalling from system tray if it does not follow immediately. I'm on win11 :( so for you on windows telegram at least somewhat attempts change of dpi based on the primary display dpi?

ilya-fedin commented 10 months ago

Qt manages that if your monitors use integer scaling (100%, 200%, 300%). If you have fractional scaling (like 125%, 150%, 175%) then it won't.