Skip to content

Conversation

@alimirjamali
Copy link
Contributor

@alimirjamali alimirjamali commented Apr 19, 2025

If the window title is very long and trimmed, then replace the end of it
with U+2026 (Horizontal Ellipsis) to let user know about it.

fixes: QubesOS/qubes-issues#5986
related: QubesOS/qubes-gui-daemon#155

@alimirjamali alimirjamali force-pushed the issue-5986-long-titles branch from 14f0ceb to 290c3da Compare April 19, 2025 14:31
alimirjamali added a commit to alimirjamali/qubes-gui-daemon that referenced this pull request Apr 23, 2025
Agent side should have replaced the end of very long window titles to
U+2026 (Horizontal Ellipsis). But the Daemon side might have been
configured to disallow UTF8 characters. Replace that character with ...

Supplements: QubesOS/qubes-gui-agent-linux#227
Main issue: QubesOS/qubes-issues#5986
@alimirjamali alimirjamali force-pushed the issue-5986-long-titles branch from 290c3da to ad0798e Compare April 23, 2025 16:13
@alimirjamali alimirjamali changed the title Change end of trimmed long window titles to . . . Change end of trimmed long window titles to U+2026 Apr 23, 2025
@alimirjamali alimirjamali marked this pull request as ready for review April 23, 2025 16:17
@alimirjamali alimirjamali requested a review from marmarek April 23, 2025 16:17
@marmarek
Copy link
Member

as said on matrix, this could use an integration test (in core-admin)

@qubesos-bot
Copy link

qubesos-bot commented Jun 2, 2025

OpenQA test summary

Complete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2025061118-4.3&flavor=pull-requests

Test run included the following:

New failures, excluding unstable

Compared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2025061004-4.3&flavor=update

  • system_tests_dispvm

  • system_tests_audio

  • system_tests_qwt_win10@hw13

    • windows_install: wait_serial (wait serial expected)
      # wait_serial expected: qr/LDWI1-\d+-/...

    • windows_install: Failed (test died + timed out)
      # Test died: command 'script -e -c 'bash -x /usr/bin/qvm-create-win...

  • system_tests_qwt_win10_seamless@hw13

    • windows_clipboard_and_filecopy: unnamed test (unknown)
    • windows_clipboard_and_filecopy: Failed (test died)
      # Test died: no candidate needle with tag(s) 'windows-Edge-address-...
  • system_tests_qwt_win11@hw13

    • windows_clipboard_and_filecopy: unnamed test (unknown)
    • windows_clipboard_and_filecopy: Failed (test died)
      # Test died: no candidate needle with tag(s) 'windows-Explorer-new-...
  • system_tests_basic_vm_qrexec_gui_xfs

    • TC_00_Basic: test_211_bootmode_standalone (error)
      subprocess.CalledProcessError: Command 'qubes.PostInstall' returned...

    • TC_00_Basic: test_212_bootmode_default_user (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_03_QvmRevertTemplateChanges: test_000_revert_linux (failure)
      AssertionError: 'bcaae198e01192d26f18a66110b6841fba8b063d' != '2878...

    • TC_30_Gui_daemon: test_000_clipboard (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_30_Gui_daemon: test_002_clipboard_200k_truncated (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_30_Gui_daemon: test_002_clipboard_300k (error + cleanup)
      raise TimeoutError from exc_val... TimeoutError

    • TC_05_StandaloneVM_debian-12-xfce-pool: test_000_create_start (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_05_StandaloneVM_fedora-41-xfce-pool: test_000_create_start (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_05_StandaloneVM_whonix-gateway-17-pool: test_000_create_start (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_05_StandaloneVM_whonix-workstation-17-pool: test_100_resize_root_img (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

Failed tests

30 failures
  • system_tests_extra

    • TC_00_QVCTest_whonix-workstation-17: test_010_screenshare (failure)
      AssertionError: 1 != 0 : Timeout waiting for /dev/video0 in test-in...
  • system_tests_dispvm

  • system_tests_audio

  • system_tests_qwt_win10@hw13

    • windows_install: wait_serial (wait serial expected)
      # wait_serial expected: qr/LDWI1-\d+-/...

    • windows_install: Failed (test died + timed out)
      # Test died: command 'script -e -c 'bash -x /usr/bin/qvm-create-win...

  • system_tests_qwt_win10_seamless@hw13

    • windows_clipboard_and_filecopy: unnamed test (unknown)
    • windows_clipboard_and_filecopy: Failed (test died)
      # Test died: no candidate needle with tag(s) 'windows-Edge-address-...
  • system_tests_qwt_win11@hw13

    • windows_clipboard_and_filecopy: unnamed test (unknown)
    • windows_clipboard_and_filecopy: Failed (test died)
      # Test died: no candidate needle with tag(s) 'windows-Explorer-new-...
  • system_tests_basic_vm_qrexec_gui_xfs

    • TC_00_Basic: test_211_bootmode_standalone (error)
      subprocess.CalledProcessError: Command 'qubes.PostInstall' returned...

    • TC_00_Basic: test_212_bootmode_default_user (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_03_QvmRevertTemplateChanges: test_000_revert_linux (failure)
      AssertionError: 'bcaae198e01192d26f18a66110b6841fba8b063d' != '2878...

    • TC_30_Gui_daemon: test_000_clipboard (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_30_Gui_daemon: test_002_clipboard_200k_truncated (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_30_Gui_daemon: test_002_clipboard_300k (error + cleanup)
      raise TimeoutError from exc_val... TimeoutError

    • TC_05_StandaloneVM_debian-12-xfce-pool: test_000_create_start (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_05_StandaloneVM_fedora-41-xfce-pool: test_000_create_start (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_05_StandaloneVM_whonix-gateway-17-pool: test_000_create_start (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_05_StandaloneVM_whonix-workstation-17-pool: test_100_resize_root_img (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

  • system_tests_kde_gui_interactive

    • gui_keyboard_layout: wait_serial (wait serial expected)
      # wait_serial expected: "echo -e '[Layout]\nLayoutList=us,de' | sud...

    • gui_keyboard_layout: Failed (test died)
      # Test died: command 'test "$(cd ~user;ls e1*)" = "$(qvm-run -p wor...

Fixed failures

Compared to: https://openqa.qubes-os.org/tests/142375#dependencies

10 fixed

Unstable tests

Performance Tests

Performance degradation:

6 performance degradations
  • debian-12-xfce_exec-data-duplex-root: 90.43 🔺 ( previous job: 70.01, degradation: 129.17%)
  • whonix-gateway-17_exec-root: 45.24 🔺 ( previous job: 39.57, degradation: 114.31%)
  • dom0_root_rnd4k_q32t1_read 3:read_bandwidth_kb: 15230.00 :small_red_triangle: ( previous job: 17102.00, degradation: 89.05%)
  • dom0_root_rnd4k_q1t1_read 3:read_bandwidth_kb: 8393.00 :small_red_triangle: ( previous job: 11086.00, degradation: 75.71%)
  • dom0_varlibqubes_rnd4k_q32t1_write 3:write_bandwidth_kb: 6789.00 :small_red_triangle: ( previous job: 8874.00, degradation: 76.50%)
  • fedora-41-xfce_root_seq1m_q1t1_write 3:write_bandwidth_kb: 58508.00 :small_red_triangle: ( previous job: 75708.00, degradation: 77.28%)

Remaining performance tests:

66 tests
  • debian-12-xfce_exec: 7.83 🟢 ( previous job: 8.63, improvement: 90.72%)
  • debian-12-xfce_exec-root: 28.68 🟢 ( previous job: 29.44, improvement: 97.42%)
  • debian-12-xfce_socket: 8.42 🟢 ( previous job: 8.50, improvement: 99.06%)
  • debian-12-xfce_socket-root: 8.39 🔺 ( previous job: 8.31, degradation: 100.89%)
  • debian-12-xfce_exec-data-simplex: 68.91 🔺 ( previous job: 65.51, degradation: 105.18%)
  • debian-12-xfce_exec-data-duplex: 73.46 🟢 ( previous job: 73.55, improvement: 99.88%)
  • debian-12-xfce_socket-data-duplex: 158.95 🟢 ( previous job: 161.35, improvement: 98.51%)
  • fedora-41-xfce_exec: 9.19 🟢 ( previous job: 9.30, improvement: 98.74%)
  • fedora-41-xfce_exec-root: 60.32 🟢 ( previous job: 60.59, improvement: 99.56%)
  • fedora-41-xfce_socket: 8.57 🔺 ( previous job: 8.48, degradation: 101.02%)
  • fedora-41-xfce_socket-root: 8.80 🟢 ( previous job: 8.81, improvement: 99.82%)
  • fedora-41-xfce_exec-data-simplex: 66.54 🟢 ( previous job: 76.90, improvement: 86.52%)
  • fedora-41-xfce_exec-data-duplex: 67.91 🟢 ( previous job: 68.34, improvement: 99.37%)
  • fedora-41-xfce_exec-data-duplex-root: 95.57 🟢 ( previous job: 109.83, improvement: 87.02%)
  • fedora-41-xfce_socket-data-duplex: 145.76 🟢 ( previous job: 156.23, improvement: 93.30%)
  • whonix-gateway-17_exec: 7.14 🟢 ( previous job: 7.34, improvement: 97.22%)
  • whonix-gateway-17_socket: 8.04 🔺 ( previous job: 7.85, degradation: 102.40%)
  • whonix-gateway-17_socket-root: 7.87 🟢 ( previous job: 7.89, improvement: 99.64%)
  • whonix-gateway-17_exec-data-simplex: 75.61 🟢 ( previous job: 77.76, improvement: 97.23%)
  • whonix-gateway-17_exec-data-duplex: 72.19 🟢 ( previous job: 78.39, improvement: 92.10%)
  • whonix-gateway-17_exec-data-duplex-root: 78.92 🟢 ( previous job: 90.74, improvement: 86.97%)
  • whonix-gateway-17_socket-data-duplex: 164.09 🔺 ( previous job: 161.95, degradation: 101.32%)
  • whonix-workstation-17_exec: 7.86 🟢 ( previous job: 8.27, improvement: 95.05%)
  • whonix-workstation-17_exec-root: 53.41 🟢 ( previous job: 57.61, improvement: 92.72%)
  • whonix-workstation-17_socket: 8.61 🟢 ( previous job: 8.97, improvement: 95.99%)
  • whonix-workstation-17_socket-root: 9.06 🟢 ( previous job: 9.46, improvement: 95.76%)
  • whonix-workstation-17_exec-data-simplex: 69.44 🟢 ( previous job: 74.54, improvement: 93.16%)
  • whonix-workstation-17_exec-data-duplex: 70.46 🟢 ( previous job: 74.84, improvement: 94.15%)
  • whonix-workstation-17_exec-data-duplex-root: 86.46 🔺 ( previous job: 86.00, degradation: 100.53%)
  • whonix-workstation-17_socket-data-duplex: 152.25 🟢 ( previous job: 160.20, improvement: 95.04%)
  • dom0_root_seq1m_q8t1_read 3:read_bandwidth_kb: 321649.00 :green_circle: ( previous job: 289982.00, improvement: 110.92%)
  • dom0_root_seq1m_q8t1_write 3:write_bandwidth_kb: 143288.00 :green_circle: ( previous job: 101988.00, improvement: 140.49%)
  • dom0_root_seq1m_q1t1_read 3:read_bandwidth_kb: 73605.00 :green_circle: ( previous job: 14284.00, improvement: 515.30%)
  • dom0_root_seq1m_q1t1_write 3:write_bandwidth_kb: 53591.00 :green_circle: ( previous job: 32696.00, improvement: 163.91%)
  • dom0_root_rnd4k_q32t1_write 3:write_bandwidth_kb: 9674.00 :green_circle: ( previous job: 1091.00, improvement: 886.71%)
  • dom0_root_rnd4k_q1t1_write 3:write_bandwidth_kb: 1982.00 :green_circle: ( previous job: 1840.00, improvement: 107.72%)
  • dom0_varlibqubes_seq1m_q8t1_read 3:read_bandwidth_kb: 473825.00 :green_circle: ( previous job: 289182.00, improvement: 163.85%)
  • dom0_varlibqubes_seq1m_q8t1_write 3:write_bandwidth_kb: 235212.00 :green_circle: ( previous job: 122848.00, improvement: 191.47%)
  • dom0_varlibqubes_seq1m_q1t1_read 3:read_bandwidth_kb: 439286.00 :green_circle: ( previous job: 433654.00, improvement: 101.30%)
  • dom0_varlibqubes_seq1m_q1t1_write 3:write_bandwidth_kb: 202632.00 :green_circle: ( previous job: 167872.00, improvement: 120.71%)
  • dom0_varlibqubes_rnd4k_q32t1_read 3:read_bandwidth_kb: 106090.00 :small_red_triangle: ( previous job: 108760.00, degradation: 97.55%)
  • dom0_varlibqubes_rnd4k_q1t1_read 3:read_bandwidth_kb: 7016.00 :green_circle: ( previous job: 6356.00, improvement: 110.38%)
  • dom0_varlibqubes_rnd4k_q1t1_write 3:write_bandwidth_kb: 4529.00 :green_circle: ( previous job: 4420.00, improvement: 102.47%)
  • fedora-41-xfce_root_seq1m_q8t1_read 3:read_bandwidth_kb: 375833.00 :small_red_triangle: ( previous job: 401292.00, degradation: 93.66%)
  • fedora-41-xfce_root_seq1m_q8t1_write 3:write_bandwidth_kb: 172465.00 :green_circle: ( previous job: 138008.00, improvement: 124.97%)
  • fedora-41-xfce_root_seq1m_q1t1_read 3:read_bandwidth_kb: 334154.00 :green_circle: ( previous job: 306332.00, improvement: 109.08%)
  • fedora-41-xfce_root_rnd4k_q32t1_read 3:read_bandwidth_kb: 84165.00 :small_red_triangle: ( previous job: 88110.00, degradation: 95.52%)
  • fedora-41-xfce_root_rnd4k_q32t1_write 3:write_bandwidth_kb: 3659.00 :green_circle: ( previous job: 3547.00, improvement: 103.16%)
  • fedora-41-xfce_root_rnd4k_q1t1_read 3:read_bandwidth_kb: 8298.00 :green_circle: ( previous job: 7675.00, improvement: 108.12%)
  • fedora-41-xfce_root_rnd4k_q1t1_write 3:write_bandwidth_kb: 1211.00 :green_circle: ( previous job: 950.00, improvement: 127.47%)
  • fedora-41-xfce_private_seq1m_q8t1_read 3:read_bandwidth_kb: 413966.00 :green_circle: ( previous job: 404699.00, improvement: 102.29%)
  • fedora-41-xfce_private_seq1m_q8t1_write 3:write_bandwidth_kb: 151586.00 :green_circle: ( previous job: 99783.00, improvement: 151.92%)
  • fedora-41-xfce_private_seq1m_q1t1_read 3:read_bandwidth_kb: 299507.00 :small_red_triangle: ( previous job: 330572.00, degradation: 90.60%)
  • fedora-41-xfce_private_seq1m_q1t1_write 3:write_bandwidth_kb: 67871.00 :green_circle: ( previous job: 43760.00, improvement: 155.10%)
  • fedora-41-xfce_private_rnd4k_q32t1_read 3:read_bandwidth_kb: 92342.00 :green_circle: ( previous job: 86107.00, improvement: 107.24%)
  • fedora-41-xfce_private_rnd4k_q32t1_write 3:write_bandwidth_kb: 2143.00 :green_circle: ( previous job: 1209.00, improvement: 177.25%)
  • fedora-41-xfce_private_rnd4k_q1t1_read 3:read_bandwidth_kb: 8155.00 :small_red_triangle: ( previous job: 8908.00, degradation: 91.55%)
  • fedora-41-xfce_private_rnd4k_q1t1_write 3:write_bandwidth_kb: 1057.00 :green_circle: ( previous job: 653.00, improvement: 161.87%)
  • fedora-41-xfce_volatile_seq1m_q8t1_read 3:read_bandwidth_kb: 325442.00 :small_red_triangle: ( previous job: 335115.00, degradation: 97.11%)
  • fedora-41-xfce_volatile_seq1m_q8t1_write 3:write_bandwidth_kb: 179062.00 :green_circle: ( previous job: 88088.00, improvement: 203.28%)
  • fedora-41-xfce_volatile_seq1m_q1t1_read 3:read_bandwidth_kb: 335329.00 :green_circle: ( previous job: 323135.00, improvement: 103.77%)
  • fedora-41-xfce_volatile_seq1m_q1t1_write 3:write_bandwidth_kb: 66044.00 :green_circle: ( previous job: 62556.00, improvement: 105.58%)
  • fedora-41-xfce_volatile_rnd4k_q32t1_read 3:read_bandwidth_kb: 86969.00 :green_circle: ( previous job: 86131.00, improvement: 100.97%)
  • fedora-41-xfce_volatile_rnd4k_q32t1_write 3:write_bandwidth_kb: 3946.00 :green_circle: ( previous job: 2636.00, improvement: 149.70%)
  • fedora-41-xfce_volatile_rnd4k_q1t1_read 3:read_bandwidth_kb: 8551.00 :green_circle: ( previous job: 8052.00, improvement: 106.20%)
  • fedora-41-xfce_volatile_rnd4k_q1t1_write 3:write_bandwidth_kb: 2318.00 :green_circle: ( previous job: 1713.00, improvement: 135.32%)

// Trim at correct utf8 boundary and set end to U+2026 (Horizontal Ellipsis)
msg.data[sizeof(msg.data) - 4] = 0;
for (int i=0; i < 4; i++) {
uint8_t * last_byte = (uint8_t *)msg.data + strlen(msg.data) - 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can avoid calling strlen over and over by simply using loop iterator here:

Suggested change
uint8_t * last_byte = (uint8_t *)msg.data + strlen(msg.data) - 1;
uint8_t * last_byte = (uint8_t *)msg.data + sizeof(msg.data) - 5 - i;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done. But I have not tested it (only checked if this compiles). Could I make a PR to make custom gui daemon/agent per domain possible (via two features)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The important part of this suggestion was to replace strlen with sizeof...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced with sizeof...

break;
} else {
// trim one invalid byte at end of string
msg.data[strlen(msg.data) - 1] = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here you can avoid re-calculation by using last_byte:

Suggested change
msg.data[strlen(msg.data) - 1] = 0;
*last_byte = 0;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also done

@marmarek
Copy link
Member

as said on matrix, this could use an integration test (in core-admin)

QubesOS/qubes-core-admin#687

@alimirjamali alimirjamali force-pushed the issue-5986-long-titles branch from ad0798e to c4f6e37 Compare June 10, 2025 10:37
@alimirjamali alimirjamali requested a review from marmarek June 10, 2025 10:38
If the window title is very long and trimmed, then replace the end of it
with U+2026 (Horizontal Ellipsis) to let user know about it.

fixes: QubesOS/qubes-issues#5986
related: QubesOS/qubes-gui-daemon#155
@marmarek marmarek merged commit cbb969d into QubesOS:main Jun 12, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Titles/captions of all Windows are truncated (cut, croped, limited) after 128 chars

3 participants