Skip to content

Fix XEmbed tray docking initialization - #264

Merged
marmarek merged 1 commit into
QubesOS:mainfrom
besendorf:agent/fix-xembed-tray-docking
Aug 7, 2026
Merged

Fix XEmbed tray docking initialization#264
marmarek merged 1 commit into
QubesOS:mainfrom
besendorf:agent/fix-xembed-tray-docking

Conversation

@besendorf

Copy link
Copy Markdown
Contributor

Summary

Fix XEmbed tray clients that remain mapped as blank 1x1 icons when proxied to a desktop tray.

The live tray-docking path now:

  • sends the constructed XEMBED_EMBEDDED_NOTIFY event instead of the address of the incoming-event pointer;
  • reads XEMBED_MAPPED using the unsigned long representation returned by XGetWindowProperty();
  • sizes the client to the existing 32x32 default embedder geometry; and
  • sends that geometry to the GUI daemon before MSG_DOCK, matching the ordering used when full window state is resent.

Root cause

The incorrect XSendEvent() argument prevented clients from receiving XEMBED_EMBEDDED_NOTIFY.

Fixing only that call was insufficient for clients initially created at 1x1: dom0 still knew the pre-dock window as 1x1 and configured the docked client back to that size. Additionally, reading a format-32 X property through int * selects the wrong slot on 64-bit systems, so the mapped flag could be missed.

Validation

  • Rebuilt gui-agent/qubes-gui from a clean object state with the project's -Wall -Wextra -Werror flags.
  • Tested on Qubes OS 4.3 with Fedora 43 guests and KDE Plasma/X11 plus xembedsniproxy in dom0.
  • A minimal XEmbed client initially created at 1x1 changed from receiving no embedded notification and remaining 1x1 to receiving XEMBED_EMBEDDED_NOTIFY, MapNotify, and a stable 32x32 configure event.
  • Verified directly in the guest as 32x32 and IsViewable.
  • Tested the resulting agent in sys-net with the real nm-applet; the previously blank NetworkManager icon became visible and was tinted with the qube's red label color.

AI assistance disclosure

This change was developed and tested with assistance from OpenAI Codex. The runtime tests and final visual confirmation were performed interactively on the affected Qubes OS system.

@qubesos-bot

qubesos-bot commented Jul 20, 2026

Copy link
Copy Markdown

OpenQA test summary

Complete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2026080611-devel&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=2026050504-devel&flavor=update

  • system_tests_extra

  • system_tests_usbproxy

    • TC_20_USBProxy_core3_debian-13-xfce: test_030_detach (error)
      qubesusbproxy.core3ext.QubesUSBException: Device detach failed: 20...
  • system_tests_guivm_gpu_gui_interactive@hw13

    • update_guivm: wait_serial (wait serial expected)
      # wait_serial expected: "root"...

    • update_guivm: Failed (test died)
      # Test died: Root prompt not there at qubesos/lib/qubesdistribution...

Failed tests

14 failures
  • system_tests_whonix

    • [unstable] whonixcheck: fail (unknown)
      Whonixcheck for anon-whonix failed...

    • [unstable] whonixcheck: fail (unknown)
      Whonixcheck for whonix-gateway-18 failed...

    • [unstable] whonixcheck: fail (unknown)
      Whonixcheck for sys-whonix failed...

    • [unstable] whonixcheck: Failed (test died)
      # Test died: systemcheck failed at qubesos/tests/whonixcheck.pm lin...

  • system_tests_extra

  • system_tests_whonix@hw1

    • [unstable] whonixcheck: fail (unknown)
      Whonixcheck for anon-whonix failed...

    • [unstable] whonixcheck: fail (unknown)
      Whonixcheck for sys-whonix failed...

    • [unstable] whonixcheck: Failed (test died)
      # Test died: systemcheck failed at qubesos/tests/whonixcheck.pm lin...

  • system_tests_usbproxy

    • TC_20_USBProxy_core3_debian-13-xfce: test_030_detach (error)
      qubesusbproxy.core3ext.QubesUSBException: Device detach failed: 20...
  • system_tests_network_updates

    • [unstable] TC_00_Dom0Upgrade_whonix-gateway-18: test_000_update_salt (failure)
      ?[0;31mDuration: 179146.41 ms?[0;0m... ?[0;31m Changes: ?[0;0m
  • system_tests_guivm_gpu_gui_interactive@hw13

    • update_guivm: wait_serial (wait serial expected)
      # wait_serial expected: "root"...

    • update_guivm: Failed (test died)
      # Test died: Root prompt not there at qubesos/lib/qubesdistribution...

Fixed failures

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

30 fixed
  • system_tests_pvgrub_salt_storage

    • system_tests: Fail (unknown)
      Tests qubes.tests.integ.grub failed (exit code 1), details reported...

    • system_tests: Failed (test died)
      # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...

    • TC_41_HVMGrub_debian-13-xfce: test_000_standalone_vm (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_41_HVMGrub_debian-13-xfce: test_001_standalone_vm_dracut (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_41_HVMGrub_debian-13-xfce: test_010_template_based_vm (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_41_HVMGrub_debian-13-xfce: test_011_template_based_vm_dracut (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_41_HVMGrub_fedora-43-xfce: test_010_template_based_vm (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

  • system_tests_extra

    • TC_01_InputProxyExclude_debian-13-xfce: test_000_qemu_tablet (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_01_InputProxyExclude_fedora-43-xfce: test_000_qemu_tablet (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_00_QVCTest_fedora-43-xfce: test_010_screenshare (failure + cleanup)
      ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^... AssertionError: 1179648 != 0

    • TC_00_QVCTest_whonix-gateway-18: test_010_screenshare (failure + cleanup)
      AssertionError: 2.3156185715769593 not less than 2.0

    • TC_00_PDFConverter_fedora-43-xfce: test_004_cancel_stops_conversion (failure)
      AssertionError: DispVM not cleaned up 10s after cancel: {<DispVM at...

  • system_tests_network_ipv6

    • system_tests: Fail (unknown)
      Tests qubes.tests.integ.network_ipv6 failed (exit code 1), details ...

    • system_tests: Failed (test died)
      # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...

    • VmIPv6Networking_fedora-43-xfce: test_001_simple_networking_paused_from_none_to_existent (error)
      raise TimeoutError from exc_val... TimeoutError

  • system_tests_audio@hw1

    • system_tests: Fail (unknown)
      Tests qubes.tests.integ.audio failed (exit code 1), details reporte...

    • system_tests: Failed (test died)
      # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...

    • TC_20_AudioVM_Pulse_debian-13-xfce: test_222_audio_rec_unmuted_pulseaudio (failure)
      AssertionError: only silence detected, no useful audio data

  • system_tests_usbproxy

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

    • TC_20_USBProxy_core3_fedora-43-xfce: test_090_attach_stubdom (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

  • system_tests_audio

  • system_tests_guivm_gpu_gui_interactive@hw13

    • shutdown: unnamed test (unknown)
    • shutdown: Failed (test died)
      # Test died: no candidate needle with tag(s) 'text-logged-in-root' ...

Unstable tests

Details
  • system_tests_whonix

    whonixcheck/Failed (1/5 times with errors)
    • job 189348 # Test died: command 'qvm-run -ap whonix-gateway-18 'LC_ALL=C whon...
    whonixcheck/fail (1/5 times with errors)
    • job 189348 Whonixcheck for anon-whonix failed...
    whonixcheck/wait_serial (1/5 times with errors)
    • job 189348 # Command: qvm-run -ap whonix-gateway-18 'LC_ALL=C whonixcheck --v...
    whonixcheck/wait_serial (1/5 times with errors)
    • job 189348 # Command: curl --form upload=@/var/log/libvirt/libxl/libxl-driver....
  • system_tests_gui_tools

    qui_widgets_update/ (1/5 times with errors)
    qui_widgets_update/ (1/5 times with errors)
    qui_widgets_update/Failed (1/5 times with errors)
    • job 189375 # Test died: no candidate needle with tag(s) 'qubes-update-finish' ...
  • system_tests_network

    system_tests/Fail (1/5 times with errors)
    • job 190295 Tests qubes.tests.integ.network failed (exit code 1), details repor...
    system_tests/Failed (1/5 times with errors)
    • job 191203 # Test died: command 'curl --form upload=@tests-qubes.tests.integ.n...
    system_tests/Failed (1/5 times with errors)
    • job 190295 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    VmNetworking_debian-13-xfce/test_001_simple_networking_paused_from_none_to_existent (1/5 times with errors)
    • job 190295 raise TimeoutError from exc_val... TimeoutError
    VmNetworking_debian-13-xfce/test_110_dynamic_attach (1/5 times with errors)
    • job 190295 raise TimeoutError from exc_val... TimeoutError
  • system_tests_pvgrub_salt_storage

    system_tests/Fail (2/5 times with errors)
    • job 190476 Tests qubes.tests.integ.grub failed (exit code 1), details reported...
    • job 191206 Tests qubes.tests.integ.grub failed (exit code 1), details reported...
    system_tests/Failed (1/5 times with errors)
    • job 190298 # Test died: command 'curl --form upload=@nose2-junit.xml --form up...
    system_tests/Failed (2/5 times with errors)
    • job 190476 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    • job 191206 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    TC_41_HVMGrub_debian-13-xfce/test_010_template_based_vm (2/5 times with errors)
    • job 190476 qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...
    • job 191206 qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...
    TC_41_HVMGrub_fedora-44-xfce/test_010_template_based_vm (2/5 times with errors)
    • job 190476 qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...
    • job 191206 qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...
    TC_41_HVMGrub_debian-13-xfce/test_011_template_based_vm_dracut (1/5 times with errors)
    • job 190476 qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...
  • system_tests_extra

    system_tests/Fail (1/5 times with errors)
    • job 190469 Tests qubes.tests.extra failed (exit code 1), details reported sepa...
    system_tests/Failed (1/5 times with errors)
    • job 190469 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    TC_00_PDFConverter_debian-13-xfce/test_004_cancel_stops_conversion (1/5 times with errors)
    • job 190469 AssertionError: DispVM not cleaned up 10s after cancel: {<DispVM at...
    TC_00_PDFConverter_fedora-44-xfce/test_004_cancel_stops_conversion (1/5 times with errors)
    • job 190469 AssertionError: DispVM not cleaned up 10s after cancel: {<DispVM at...
  • system_tests_qrexec

    system_tests/Fail (2/5 times with errors)
    • job 190299 Tests qubes.tests.integ.qrexec failed (exit code 1), details report...
    • job 190314 Tests qubes.tests.integ.qrexec failed (exit code 1), details report...
    system_tests/Failed (2/5 times with errors)
    • job 190299 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    • job 190314 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    TC_00_Qrexec_whonix-workstation-18/test_095_qrexec_service_socket_vm (2/5 times with errors)
    • job 190299 AssertionError: waiting for /etc/qubes-rpc/test.Socket in VM timed out
    • job 190314 AssertionError: waiting for /etc/qubes-rpc/test.Socket in VM timed out
  • system_tests_network_ipv6

    system_tests/Fail (3/5 times with errors)
    • job 189378 Tests qubes.tests.integ.network_ipv6 failed (exit code 1), details ...
    • job 190296 Tests qubes.tests.integ.network_ipv6 failed (exit code 1), details ...
    • job 191204 Tests qubes.tests.integ.network_ipv6 failed (exit code 1), details ...
    system_tests/Failed (1/5 times with errors)
    • job 190474 # Test died: command 'curl --form upload=@tests-qubes.tests.integ.n...
    system_tests/Failed (3/5 times with errors)
    • job 189378 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    • job 190296 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    • job 191204 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    VmIPv6Networking_debian-13-xfce/test_001_simple_networking_paused_from_none_to_existent (1/5 times with errors)
    • job 189378 subprocess.CalledProcessError: Command 'qubes.WaitForNetworkUplink'...
    VmIPv6Networking_debian-13-xfce/test_001_simple_networking_paused_restart_netvm (1/5 times with errors)
    • job 190296 AssertionError: Timeout while waiting for VM test-inst-netvm1 shutdown
    VmIPv6Networking_fedora-44-xfce/test_501_simple_networking_paused_from_none_to_existent (1/5 times with errors)
    • job 191204 raise TimeoutError from exc_val... TimeoutError
    VmIPv6Networking_fedora-44-xfce/test_510_ipv6_simple_proxyvm (1/5 times with errors)
    • job 190296 qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...
  • system_tests_kde_gui_interactive

    gui_keyboard_layout/Failed (1/5 times with errors)
    • job 189137 # Test died: command 'qvm-shutdown --wait work' timed out at /usr/l...
    gui_keyboard_layout/wait_serial (1/5 times with errors)
    • job 189137 # Command: qvm-shutdown --wait work...
  • system_tests_audio@hw1

    system_tests/Fail (3/5 times with errors)
    • job 189136 Tests qubes.tests.integ.audio failed (exit code 1), details reporte...
    • job 190447 Tests qubes.tests.integ.audio failed (exit code 1), details reporte...
    • job 191177 Tests qubes.tests.integ.audio failed (exit code 1), details reporte...
    system_tests/Failed (2/5 times with errors)
    • job 190447 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    • job 191177 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    system_tests/Failed (1/5 times with errors)
    • job 189136 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    TC_20_AudioVM_PipeWire_whonix-workstation-18/test_251_audio_playback_audiovm_pipewire_late_start (1/5 times with errors)
    • job 189136 AssertionError: too short audio, expected 10s, got 9.09505668934240...
    TC_20_AudioVM_PipeWire_debian-13-xfce/test_260_audio_mic_enabled_switch_audiovm (1/5 times with errors)
    • job 191177 AssertionError: pacat for test-inst-vm1 (xid 50) running(False) in ...
    TC_20_AudioVM_PipeWire_fedora-44-xfce/test_260_audio_mic_enabled_switch_audiovm (1/5 times with errors)
    • job 191177 AssertionError: pacat for test-inst-vm1 (xid 59) running(False) in ...
    TC_20_AudioVM_PipeWire_whonix-workstation-18/test_260_audio_mic_enabled_switch_audiovm (1/5 times with errors)
    • job 190447 AssertionError: 0 not greater than 0 : Failed to move-source-output
  • system_tests_whonix@hw1

    whonixcheck/Failed (1/5 times with errors)
    • job 189348 # Test died: command 'qvm-run -ap whonix-gateway-18 'LC_ALL=C whon...
    whonixcheck/fail (1/5 times with errors)
    • job 189348 Whonixcheck for anon-whonix failed...
    whonixcheck/wait_serial (1/5 times with errors)
    • job 189348 # Command: qvm-run -ap whonix-gateway-18 'LC_ALL=C whonixcheck --v...
    whonixcheck/wait_serial (1/5 times with errors)
    • job 189348 # Command: curl --form upload=@/var/log/libvirt/libxl/libxl-driver....
  • system_tests_gui_tools@hw7

    qui_widgets_update/ (1/5 times with errors)
    qui_widgets_update/ (1/5 times with errors)
    qui_widgets_update/Failed (1/5 times with errors)
    • job 189375 # Test died: no candidate needle with tag(s) 'qubes-update-finish' ...
  • system_tests_usbproxy

    system_tests/Fail (1/5 times with errors)
    • job 190443 Tests qubes.tests.extra failed (exit code 1), details reported sepa...
    system_tests/Failed (1/5 times with errors)
    • job 190443 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    TC_00_USBProxy_fedora-44-xfce/test_020_detach_on_remove (1/5 times with errors)
    • job 190443 AssertionError: 0 != 1 : Device not cleaned up
  • system_tests_audio

    system_tests/Fail (3/5 times with errors)
    • job 189136 Tests qubes.tests.integ.audio failed (exit code 1), details reporte...
    • job 190447 Tests qubes.tests.integ.audio failed (exit code 1), details reporte...
    • job 191177 Tests qubes.tests.integ.audio failed (exit code 1), details reporte...
    system_tests/Failed (2/5 times with errors)
    • job 190447 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    • job 191177 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    system_tests/Failed (1/5 times with errors)
    • job 189136 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    TC_20_AudioVM_PipeWire_whonix-workstation-18/test_251_audio_playback_audiovm_pipewire_late_start (1/5 times with errors)
    • job 189136 AssertionError: too short audio, expected 10s, got 9.09505668934240...
    TC_20_AudioVM_PipeWire_debian-13-xfce/test_260_audio_mic_enabled_switch_audiovm (1/5 times with errors)
    • job 191177 AssertionError: pacat for test-inst-vm1 (xid 50) running(False) in ...
    TC_20_AudioVM_PipeWire_fedora-44-xfce/test_260_audio_mic_enabled_switch_audiovm (1/5 times with errors)
    • job 191177 AssertionError: pacat for test-inst-vm1 (xid 59) running(False) in ...
    TC_20_AudioVM_PipeWire_whonix-workstation-18/test_260_audio_mic_enabled_switch_audiovm (1/5 times with errors)
    • job 190447 AssertionError: 0 not greater than 0 : Failed to move-source-output
  • system_tests_network_updates

    system_tests/Fail (3/5 times with errors)
    • job 190297 Tests qubes.tests.integ.dom0_update failed (exit code 1), details r...
    • job 190312 Tests qubes.tests.integ.dom0_update failed (exit code 1), details r...
    • job 190475 Tests qubes.tests.integ.dom0_update failed (exit code 1), details r...
    system_tests/Fail (1/5 times with errors)
    • job 191227 Tests qubes.tests.integ.vm_update failed (exit code 1), details rep...
    fetch_packages_list/Failed (1/5 times with errors)
    system_tests/Failed (4/5 times with errors)
    • job 190297 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    • job 190312 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    • job 190475 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    • job 191227 # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...
    TC_11_QvmTemplateMgmtVM_whonix-gateway-18/test_000_template_list (1/5 times with errors)
    • job 190475 subprocess.CalledProcessError: Command 'timeout=120; while ! tor-ci...
    TC_00_Dom0Upgrade_whonix-gateway-18/test_000_update_salt (2/5 times with errors)
    • job 190297 ?[0;31mDuration: 140907.985 ms?[0;0m... ?[0;31m Changes: ?[0;0m
    • job 190312 ?[0;31mDuration: 135117.105 ms?[0;0m... ?[0;31m Changes: ?[0;0m
    TC_00_Dom0Upgrade_whonix-gateway-18/test_001_update_check (2/5 times with errors)
    VmUpdates_fedora-44-xfce/test_011_pkcon_via_proxy (1/5 times with errors)
    • job 191227 AssertionError: 7 not found in [0, 100] : pkcon install -y test-pkg...
    VmUpdates_debian-13-xfce/test_110_update_via_proxy_qubes_vm_update (1/5 times with errors)
    • job 191227 qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

Performance Tests

Performance degradation:

19 performance degradations
  • whonix-gateway-18_exec-root: 154.78 🔻 ( previous job: 126.14, degradation: 122.71%)
  • whonix-gateway-18_socket-data-duplex: 106.55 🔻 ( previous job: 90.03, degradation: 118.34%)
  • whonix-workstation-18_exec-root: 160.47 🔻 ( previous job: 144.02, degradation: 111.42%)
  • whonix-workstation-18_socket: 9.99 🔻 ( previous job: 7.66, degradation: 130.33%)
  • whonix-workstation-18_socket-root: 10.32 🔻 ( previous job: 8.87, degradation: 116.34%)
  • whonix-workstation-18_exec-data-duplex-root: 157.44 🔻 ( previous job: 130.67, degradation: 120.49%)
  • dom0_root_seq1m_q1t1_write 3:write_bandwidth_kb: 170291.00 🔻 ( previous job: 199974.00, degradation: 85.16%)
  • dom0_root_rnd4k_q1t1_read 3:read_bandwidth_kb: 7378.00 🔻 ( previous job: 8963.00, degradation: 82.32%)
  • dom0_root_rnd4k_q1t1_write 3:write_bandwidth_kb: 3228.00 🔻 ( previous job: 5055.00, degradation: 63.86%)
  • dom0_varlibqubes_rnd4k_q32t1_read 3:read_bandwidth_kb: 16526.00 🔻 ( previous job: 102155.00, degradation: 16.18%)
  • dom0_varlibqubes_rnd4k_q32t1_write 3:write_bandwidth_kb: 4754.00 🔻 ( previous job: 10623.00, degradation: 44.75%)
  • debian-13-xfce_dom0-dispvm-gui-api (mean:8.614): 103.37 🔻 ( previous job: 93.50, degradation: 110.56%)
  • debian-13-xfce_dom0-dispvm-preload-4-api (mean:3.008): 36.10 🔻 ( previous job: 30.73, degradation: 117.46%)
  • debian-13-xfce_dom0-dispvm-preload-4-gui-api (mean:4.075): 48.90 🔻 ( previous job: 44.40, degradation: 110.14%)
  • whonix-workstation-18_dom0-dispvm-api (mean:9.601): 115.21 🔻 ( previous job: 97.14, degradation: 118.61%)
  • whonix-workstation-18_dom0-dispvm-gui-api (mean:11.817): 141.80 🔻 ( previous job: 121.86, degradation: 116.37%)
  • whonix-workstation-18_dom0-dispvm-preload-2-delay-0-api (mean:4.571): 54.85 🔻 ( previous job: 48.26, degradation: 113.66%)
  • whonix-workstation-18_dom0-dispvm-preload-4-api (mean:3.593): 43.11 🔻 ( previous job: 38.29, degradation: 112.60%)
  • whonix-workstation-18_dom0-dispvm-preload-4-delay-minus-1d2-api (mean:4.065): 48.78 🔻 ( previous job: 42.67, degradation: 114.33%)

Remaining performance tests:

92 tests
  • debian-13-xfce_exec: 8.58 🔻 ( previous job: 7.85, degradation: 109.21%)
  • debian-13-xfce_exec-root: 27.37 🔻 ( previous job: 26.74, degradation: 102.35%)
  • debian-13-xfce_socket: 8.77 🔻 ( previous job: 8.37, degradation: 104.79%)
  • debian-13-xfce_socket-root: 9.32 🔻 ( previous job: 9.13, degradation: 102.07%)
  • debian-13-xfce_exec-data-simplex: 64.76 🔻 ( previous job: 63.05, degradation: 102.71%)
  • debian-13-xfce_exec-data-duplex: 66.25 🔻 ( previous job: 62.45, degradation: 106.08%)
  • debian-13-xfce_exec-data-duplex-root: 79.13 🔻 ( previous job: 78.04, degradation: 101.39%)
  • debian-13-xfce_socket-data-duplex: 78.95 🟢 ( previous job: 85.67, improvement: 92.16%)
  • fedora-44-xfce_exec: 9.11
  • fedora-44-xfce_exec-root: 71.40
  • fedora-44-xfce_socket: 9.11
  • fedora-44-xfce_socket-root: 9.46
  • fedora-44-xfce_exec-data-simplex: 71.86
  • fedora-44-xfce_exec-data-duplex: 70.90
  • fedora-44-xfce_exec-data-duplex-root: 109.78
  • fedora-44-xfce_socket-data-duplex: 84.16
  • whonix-gateway-18_exec: 8.05 🔻 ( previous job: 8.01, degradation: 100.55%)
  • whonix-gateway-18_socket: 8.43 🟢 ( previous job: 8.63, improvement: 97.70%)
  • whonix-gateway-18_socket-root: 8.59 🔻 ( previous job: 8.37, degradation: 102.60%)
  • whonix-gateway-18_exec-data-simplex: 67.57 🔻 ( previous job: 62.50, degradation: 108.12%)
  • whonix-gateway-18_exec-data-duplex: 65.92 🟢 ( previous job: 68.01, improvement: 96.93%)
  • whonix-gateway-18_exec-data-duplex-root: 145.02 🔻 ( previous job: 137.28, degradation: 105.64%)
  • whonix-workstation-18_exec: 8.90 🔻 ( previous job: 8.14, degradation: 109.40%)
  • whonix-workstation-18_exec-data-simplex: 69.86 🔻 ( previous job: 66.36, degradation: 105.28%)
  • whonix-workstation-18_exec-data-duplex: 58.05 🟢 ( previous job: 65.56, improvement: 88.56%)
  • whonix-workstation-18_socket-data-duplex: 86.42 🟢 ( previous job: 92.97, improvement: 92.95%)
  • dom0_root_seq1m_q8t1_read 3:read_bandwidth_kb: 478801.00 🟢 ( previous job: 388793.00, improvement: 123.15%)
  • dom0_root_seq1m_q8t1_write 3:write_bandwidth_kb: 155817.00 🟢 ( previous job: 119690.00, improvement: 130.18%)
  • dom0_root_seq1m_q1t1_read 3:read_bandwidth_kb: 436179.00 🟢 ( previous job: 245223.00, improvement: 177.87%)
  • dom0_root_rnd4k_q32t1_read 3:read_bandwidth_kb: 109706.00 🟢 ( previous job: 13948.00, improvement: 786.54%)
  • dom0_root_rnd4k_q32t1_write 3:write_bandwidth_kb: 8769.00 🟢 ( previous job: 6899.00, improvement: 127.11%)
  • dom0_varlibqubes_seq1m_q8t1_read 3:read_bandwidth_kb: 445255.00 🟢 ( previous job: 429040.00, improvement: 103.78%)
  • dom0_varlibqubes_seq1m_q8t1_write 3:write_bandwidth_kb: 333304.00 🟢 ( previous job: 257066.00, improvement: 129.66%)
  • dom0_varlibqubes_seq1m_q1t1_read 3:read_bandwidth_kb: 448300.00 🟢 ( previous job: 446202.00, improvement: 100.47%)
  • dom0_varlibqubes_seq1m_q1t1_write 3:write_bandwidth_kb: 198417.00 🔻 ( previous job: 201978.00, degradation: 98.24%)
  • dom0_varlibqubes_rnd4k_q1t1_read 3:read_bandwidth_kb: 8507.00 🟢 ( previous job: 8179.00, improvement: 104.01%)
  • dom0_varlibqubes_rnd4k_q1t1_write 3:write_bandwidth_kb: 5101.00 🟢 ( previous job: 4404.00, improvement: 115.83%)
  • fedora-44-xfce_root_seq1m_q8t1_read 3:read_bandwidth_kb: 405168.00
  • fedora-44-xfce_root_seq1m_q8t1_write 3:write_bandwidth_kb: 110889.00
  • fedora-44-xfce_root_seq1m_q1t1_read 3:read_bandwidth_kb: 308132.00
  • fedora-44-xfce_root_seq1m_q1t1_write 3:write_bandwidth_kb: 48231.00
  • fedora-44-xfce_root_rnd4k_q32t1_read 3:read_bandwidth_kb: 84300.00
  • fedora-44-xfce_root_rnd4k_q32t1_write 3:write_bandwidth_kb: 2964.00
  • fedora-44-xfce_root_rnd4k_q1t1_read 3:read_bandwidth_kb: 9235.00
  • fedora-44-xfce_root_rnd4k_q1t1_write 3:write_bandwidth_kb: 1130.00
  • fedora-44-xfce_private_seq1m_q8t1_read 3:read_bandwidth_kb: 413966.00
  • fedora-44-xfce_private_seq1m_q8t1_write 3:write_bandwidth_kb: 229850.00
  • fedora-44-xfce_private_seq1m_q1t1_read 3:read_bandwidth_kb: 335544.00
  • fedora-44-xfce_private_seq1m_q1t1_write 3:write_bandwidth_kb: 33222.00
  • fedora-44-xfce_private_rnd4k_q32t1_read 3:read_bandwidth_kb: 91117.00
  • fedora-44-xfce_private_rnd4k_q32t1_write 3:write_bandwidth_kb: 1782.00
  • fedora-44-xfce_private_rnd4k_q1t1_read 3:read_bandwidth_kb: 8068.00
  • fedora-44-xfce_private_rnd4k_q1t1_write 3:write_bandwidth_kb: 880.00
  • fedora-44-xfce_volatile_seq1m_q8t1_read 3:read_bandwidth_kb: 354968.00
  • fedora-44-xfce_volatile_seq1m_q8t1_write 3:write_bandwidth_kb: 100949.00
  • fedora-44-xfce_volatile_seq1m_q1t1_read 3:read_bandwidth_kb: 347210.00
  • fedora-44-xfce_volatile_seq1m_q1t1_write 3:write_bandwidth_kb: 68921.00
  • fedora-44-xfce_volatile_rnd4k_q32t1_read 3:read_bandwidth_kb: 79582.00
  • fedora-44-xfce_volatile_rnd4k_q32t1_write 3:write_bandwidth_kb: 2236.00
  • fedora-44-xfce_volatile_rnd4k_q1t1_read 3:read_bandwidth_kb: 7680.00
  • fedora-44-xfce_volatile_rnd4k_q1t1_write 3:write_bandwidth_kb: 882.00
  • debian-13-xfce_dom0-dispvm-api (mean:6.513): 78.16 🔻 ( previous job: 74.50, degradation: 104.92%)
  • debian-13-xfce_dom0-dispvm-preload-2-api (mean:3.132): 37.59 🟢 ( previous job: 37.79, improvement: 99.47%)
  • debian-13-xfce_dom0-dispvm-preload-2-delay-0-api (mean:3.004): 36.05 🔻 ( previous job: 34.29, degradation: 105.13%)
  • debian-13-xfce_dom0-dispvm-preload-2-delay-minus-1d2-api (mean:3.304): 39.65 🔻 ( previous job: 38.52, degradation: 102.94%)
  • debian-13-xfce_dom0-dispvm-preload-4-delay-0-api (mean:2.472): 29.66 🔻 ( previous job: 29.50, degradation: 100.54%)
  • debian-13-xfce_dom0-dispvm-preload-4-delay-minus-1d2-api (mean:2.537): 30.45 🔻 ( previous job: 28.74, degradation: 105.93%)
  • debian-13-xfce_dom0-dispvm-preload-2-gui-api (mean:4.857): 58.28 🔻 ( previous job: 53.65, degradation: 108.63%)
  • debian-13-xfce_dom0-dispvm-preload-6-gui-api (mean:3.429): 41.15 🟢 ( previous job: 41.47, improvement: 99.24%)
  • debian-13-xfce_dom0-vm-api (mean:0.029): 0.35 🟢 ( previous job: 0.62, improvement: 56.29%)
  • debian-13-xfce_dom0-vm-gui-api (mean:0.029): 0.35 🟢 ( previous job: 0.47, improvement: 74.62%)
  • fedora-44-xfce_dom0-dispvm-api (mean:8.476): 101.72
  • fedora-44-xfce_dom0-dispvm-gui-api (mean:10.157): 121.88
  • fedora-44-xfce_dom0-dispvm-preload-2-api (mean:3.885): 46.62
  • fedora-44-xfce_dom0-dispvm-preload-2-delay-0-api (mean:3.928): 47.13
  • fedora-44-xfce_dom0-dispvm-preload-2-delay-minus-1d2-api (mean:4.213): 50.55
  • fedora-44-xfce_dom0-dispvm-preload-4-api (mean:2.861): 34.33
  • fedora-44-xfce_dom0-dispvm-preload-4-delay-0-api (mean:2.87): 34.44
  • fedora-44-xfce_dom0-dispvm-preload-4-delay-minus-1d2-api (mean:3.034): 36.41
  • fedora-44-xfce_dom0-dispvm-preload-2-gui-api (mean:5.476): 65.71
  • fedora-44-xfce_dom0-dispvm-preload-4-gui-api (mean:4.305): 51.66
  • fedora-44-xfce_dom0-dispvm-preload-6-gui-api (mean:3.664): 43.97
  • fedora-44-xfce_dom0-vm-api (mean:0.029): 0.35
  • fedora-44-xfce_dom0-vm-gui-api (mean:0.035): 0.42
  • whonix-workstation-18_dom0-dispvm-preload-2-api (mean:4.415): 52.98 🔻 ( previous job: 48.39, degradation: 109.47%)
  • whonix-workstation-18_dom0-dispvm-preload-2-delay-minus-1d2-api (mean:5.246): 62.95 🔻 ( previous job: 59.22, degradation: 106.30%)
  • whonix-workstation-18_dom0-dispvm-preload-4-delay-0-api (mean:3.54): 42.48 🟢 ( previous job: 43.23, improvement: 98.27%)
  • whonix-workstation-18_dom0-dispvm-preload-2-gui-api (mean:6.372): 76.46 🔻 ( previous job: 72.05, degradation: 106.13%)
  • whonix-workstation-18_dom0-dispvm-preload-4-gui-api (mean:4.687): 56.25 🔻 ( previous job: 52.81, degradation: 106.50%)
  • whonix-workstation-18_dom0-dispvm-preload-6-gui-api (mean:4.167): 50.00 🟢 ( previous job: 50.72, improvement: 98.59%)
  • whonix-workstation-18_dom0-vm-api (mean:0.02): 0.24 🟢 ( previous job: 0.43, improvement: 55.43%)
  • whonix-workstation-18_dom0-vm-gui-api (mean:0.035): 0.42 🟢 ( previous job: 0.56, improvement: 75.54%)

Comment thread gui-agent/vmside.c
conf.width = 32;
conf.height = 32;
conf.override_redirect = 0;
write_message(g->vchan, hdr, conf);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks a bit risky, because the above XMoveResizeWindow() call will eventually also result in a MSG_CONFIGURE message (in response to X11 event). But, IIUC the order or messages is important here, and the other MSG_CONFIGURE will be send after MSG_DOCK. So, maybe duplicate message is less bad...

@marmarek

Copy link
Copy Markdown
Member

Finally the nm-applet icon is visible: https://openqa.qubes-os.org/tests/189082#step/clipboard_and_web/3 :)

@marmarek

Copy link
Copy Markdown
Member

Is it draft because of unverified commit signature? Or something else?

@besendorf
besendorf marked this pull request as ready for review July 22, 2026 15:07
@besendorf

Copy link
Copy Markdown
Contributor Author

Converted. Can sign in about two weeks

Correct the embedded-notify event, decode the mapped flag using the Xlib property representation, and publish the initial embedder geometry before docking.
@besendorf
besendorf force-pushed the agent/fix-xembed-tray-docking branch from 5e552d5 to 77c2a09 Compare August 6, 2026 16:10
@besendorf

Copy link
Copy Markdown
Contributor Author

@marmarek I signed the commits. Is anything else blocking this?

@marmarek
marmarek merged commit e7dceda into QubesOS:main Aug 7, 2026
2 of 3 checks passed
@ben-grande

Copy link
Copy Markdown
Contributor

Some reports on the forum that running certain software when this patch is present, does slow down the system. More information on:

@besendorf

Copy link
Copy Markdown
Contributor Author

I will try to reproduce it. I have updated qubes-gui-agent in my appvms but not dom0 yet. I can see the icons and dont experience the performance issues mentioned in the thread so far

@ben-grande

Copy link
Copy Markdown
Contributor

Could you please try the mentioned program, fcitx5 in an archlinux based qube? It seems that it is happening if those two conditions are met.

@besendorf

Copy link
Copy Markdown
Contributor Author

I could not reproduce with kde in dom0. Trying xfce next. Users in the forum mentioned high cpu usage for xfwm4

@besendorf

Copy link
Copy Markdown
Contributor Author

This fixes it for me: #265

marmarek added a commit that referenced this pull request Aug 20, 2026
* origin/pr/265:
  Limit XEmbed size normalization to 1x1 clients

Pull request description:

- read the tray client's actual geometry before docking;
- apply the existing `32x32` fallback and pre-dock `MSG_CONFIGURE` only to clients whose initial size is `1x1`; and
- preserve the geometry of clients such as Fcitx5 that already provide a usable size.

PR #264 correctly repaired the XEmbed notification and property decoding, and added geometry initialization for tray clients that otherwise remain at `1x1`. However, it applies the `32x32` resize and synthetic configure message to every XEmbed tray client.

Fcitx5 creates its tray window with a valid size and reacts to configure events by updating its size hints and resizing the tray window. Forcing another size before docking can therefore create a configure/resize feedback loop with some dom0 tray implementations. This matches the reported regression where starting Fcitx5 with GUI agent 4.3.19 makes an Xfce dom0 session sluggish and drives `Xorg`, `qubes-guid`, and `xfwm4` CPU usage upward.

The decision must use geometry alone rather than the current `XEMBED_MAPPED` flag. A dock trace showed that `nm-applet` requests docking at `1x1` while that flag is still clear, then sets it shortly afterward. Requiring the flag caused it to remain a white `1x1` square.

This change retains the `1x1` recovery needed by clients such as `nm-applet`, while avoiding an unnecessary geometry change for healthy clients.

Related reports:

- #264 (comment)
- https://forum.qubes-os.org/t/qubes-became-extremely-sluggish-after-a-dom0-update/42922/7

Tray clients that start at `1x1` continue to receive the `32x32` initialization introduced by PR #264, including clients that set `XEMBED_MAPPED` after requesting the dock. Clients with an existing usable geometry are only reparented and moved to the embedder origin, restoring the pre-PR size handling for that case.

- Built `gui-agent/qubes-gui` from a clean object state with the project's `-Wall -Wextra -Werror` flags on Arch Linux.
- Installed the equivalent v4.3.19 hotfix in an Arch Qubes AppVM with Fcitx5 5.1.21 and `nm-applet` 1.36.0.
- Captured the initial dock state: Fcitx5 arrived at `48x48` with `XEMBED_MAPPED` set and skipped normalization; `nm-applet` arrived at `1x1` with the flag clear and was normalized.
- Confirmed both tray icons were displayed correctly. Their final mapped geometry was `32x32`.
- Replaced and redocked Fcitx5 ten times over 25 seconds: the GUI agent used 0.32% CPU, guest Xorg used 3.40% CPU, and the service remained active with zero restarts.
- Toggled the input method twenty times; the GUI agent consumed 0.01 seconds of CPU.
- During a later 20-second steady-state interval with both clients present, the GUI agent consumed 0.07 seconds and guest Xorg consumed 0.64 seconds of CPU.
- The GUI-agent journal contained only the expected X-server connection and temporary dock-probe messages.

The runtime checks validate the guest-side docking behavior. The dom0-side Xfce process behavior still needs confirmation on an affected system.

This change was investigated, developed, and tested with assistance from OpenAI Codex. The author directed the investigation and requested publication; the diff and validation evidence are provided here for maintainer review.
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.

4 participants