Add yad_check_x11() for Wayland compatibility#316
Open
mg-dev25 wants to merge 1 commit intov1cont:masterfrom
Open
Add yad_check_x11() for Wayland compatibility#316mg-dev25 wants to merge 1 commit intov1cont:masterfrom
mg-dev25 wants to merge 1 commit intov1cont:masterfrom
Conversation
Adds a simple API for checking if running on X11 display server. Used by cpicker.c and print.c to warn about or skip X11-only features. Changes: - Add yad_check_x11() in main.c returning the is_x11 variable - Add declaration in yad.h - cpicker.c: Warn and skip color picker on non-X11 (needs screen grab) - print.c: Skip mouse positioning on Wayland (compositor-controlled) Addresses feedback from PR v1cont#314 about simplifying Wayland detection.
2fa95e5 to
790d604
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add yad_check_x11() for Wayland compatibility
Adds a simple API for checking if running on X11. This follows the feedback on PR #314 about using the existing
is_x11variable instead of adding redundantis_waylanddetection.What changed
New
yad_check_x11()function in main.c that exposes the internalis_x11variable. Callers can use!yad_check_x11()for Wayland detection.Files modified:
src/main.c- added the functionsrc/yad.h- added declarationsrc/cpicker.c- warns and skips color picker on non-X11src/print.c- skips mouse positioning on WaylandWhy
Some features need X11 and don't work on Wayland:
Instead of silently failing, these now check
yad_check_x11()and either warn or gracefully skip the feature.Testing
Tested on both X11 and Wayland sessions. Color picker shows warning on Wayland. Print dialog skips mouse positioning.