Repository navigation
X11: Reduce blocking XSync calls when showing main window - #3485
Conversation
Codecov Reportâ Patch coverage is
â Your patch status has failed because the patch coverage (64.10%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #3485 +/- ##
==========================================
- Coverage 80.77% 80.68% -0.10%
==========================================
Files 245 245
Lines 30977 31011 +34
==========================================
- Hits 25023 25021 -2
- Misses 5954 5990 +36 â View full report in Codecov by Harness. ð New features to boost your workflow:
|
6f43a41 to
09946a4
Compare
There was a problem hiding this comment.
Pull request overview
This PR targets X11 responsiveness when activating/showing the main window by reducing synchronous X11 round-trips and avoiding costly hide/show remaps, addressing delays reported in #2877.
Changes:
- Removed an unnecessary
XSync()before_NET_ACTIVE_WINDOWproperty retrieval. - Reworked âmove to current workspaceâ to use EWMH
_NET_WM_DESKTOPon X11 (and kept hide-based behavior for non-X11/Wayland). - Replaced
XSync()calls in X11 window raising with a singleXFlush().
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/platform/x11/x11platformwindow.cpp |
Reduces blocking X11 sync calls in focus/raise and current-window detection. |
src/gui/geometry.cpp |
Implements X11 workspace move via EWMH client message; keeps non-X11 hide behavior. |
.github/actions/download-miniaudio/action.yml |
No functional change (formatting/whitespace only). |
ðĄ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Remove or replace synchronous XSync round-trips that block the event loop when the X server/compositor is slow to respond after idle periods, causing multi-second delays when activating the main window via global shortcut. Changes: 1. getCurrentWindow(): Remove XSync before XGetProperty. XGetProperty is already a synchronous round-trip; the preceding XSync served no purpose since the _NET_ACTIVE_WINDOW property is maintained by the window manager, not by CopyQ pending requests. 2. moveToCurrentWorkspace(): On X11, replace hide/show cycle with _NET_WM_DESKTOP client message (standard EWMH). The old approach unmapped and remapped the window, forcing the compositor to destroy and recreate textures â expensive when the GPU is in a low-power state after idle. On non-X11 (Wayland), preserve the hide/show behavior needed for focus stealing via compositor re-initialization. 3. raise(): Replace two XSync calls with a single XFlush. No caller depends on synchronous completion of the raise operation. Fixes: #2877 Assisted-by: Claude (Anthropic)
09946a4 to
fb19a79
Compare
Remove or replace synchronous XSync round-trips that block the event loop when the X server/compositor is slow to respond after idle periods, causing multi-second delays when activating the main window via global shortcut.
Changes
getCurrentWindow(): Remove XSync before XGetProperty.
XGetProperty is already a synchronous round-trip; the preceding XSync served no purpose since the
_NET_ACTIVE_WINDOWproperty is maintained by the window manager, not by CopyQ pending requests.moveToCurrentWorkspace(): On X11, replace hide/show cycle with
_NET_WM_DESKTOPclient message (standard EWMH). The old approach unmapped and remapped the window, forcing the compositor to destroy and recreate textures â expensive when the GPU is in a low-power state after idle. On non-X11 (Wayland), preserve the hide/show behavior needed for focus stealing via compositor re-initialization.raise(): Replace two XSync calls with a single XFlush. No caller depends on synchronous completion of the raise operation.
moveToCurrentWorkspace(): Fix potential
XGetWindowPropertymemory leak â always callXFreewhen data is non-null, validatetype/formatbeforereinterpret_cast, and extractgetCardinalProperty()helper to eliminate duplication.Fixes #2877
Assisted-by: Claude (Anthropic)