yad icon indicating copy to clipboard operation
yad copied to clipboard

feat: Wayland detection, text sizing fix, signal handling

Open mg-dev25 opened this issue 1 month ago • 2 comments

Combined improvements

This commit addresses multiple related issues:

1. Wayland backend detection and warnings

Addresses #159, #261, #158, #216, #49

On Wayland, X11-only features now show clear warnings instead of failing silently:

WARNING: --mouse option is not supported on Wayland.
WARNING: Window positioning (--posx/--posy) is controlled by the Wayland compositor.

2. Text sizing fix

Fixes #107, #140, #32, #297, #300

Dialog windows no longer grow excessively large when --text contains long content with --wrap enabled. The --width and --geometry options now properly constrain text.

3. Graceful signal handling

Addresses #181

SIGTERM/SIGINT now trigger graceful exit instead of abrupt termination.

Files changed

  • src/yad.h: Function declarations
  • src/main.c: Detection logic, text sizing, signal handling
  • src/cpicker.c, src/print.c: Wayland warnings
  • src/notebook.c, src/paned.c: Timeout messages

Test

# Text sizing
yad --text="Long text" --wrap --width=400

# Wayland warning
GDK_BACKEND=wayland yad --text="Test" --posx=100

# Signal handling
yad --form --field="Test" &
kill -TERM $!

mg-dev25 avatar Nov 30 '25 23:11 mg-dev25

hi and thank you. but can you split your pr into a separate parts which fixes different issues?

and some comments:

  • in signal handling more reasonable will be use an existing sa_usr2() handler instead of adding the same
  • for wayland detection the variable is_x11 is more than enough. no need to add a new variable with the almost same functionality and getter/setter functions for them

v1cont avatar Dec 01 '25 10:12 v1cont

Closing per maintainer feedback to split into separate atomic changes.

The Wayland API simplification (using existing is_x11 instead of adding redundant is_wayland) will be submitted as a separate PR if still needed.

The signal handling improvements (using existing sa_usr2 instead of new sa_term) have been incorporated into the updated PR #312.

Thanks for the feedback!

mg-dev25 avatar Dec 02 '25 09:12 mg-dev25