eww icon indicating copy to clipboard operation
eww copied to clipboard

[BUG] Tooltip issues with defpoll

Open m0tholith opened this issue 1 year ago • 1 comments

Checklist before submitting an issue

  • [X] I have searched through the existing closed and open issues for eww and made sure this is not a duplicate
  • [X] I have specifically verified that this bug is not a common user error
  • [X] I am providing as much relevant information as I am able to in this bug report (Minimal config to reproduce the issue for example, if applicable)

Description of the bug

When using a defpoll variable in the tooltip property, the tooltip doesn't appear after hovering, and also blocks other widgets' tooltips to appear. However, when using a defvar variable, everything works fine.

Reproducing the issue

Attached is a small file containing only a couple lines of yuck, demonstrating the issue. A small bash script, which could also be the problem, is attached as well.

;; eww.yuck

(defwindow bar
  (box
    (label :text brightness :tooltip brightness
      )
    (label :text "This should have a tooltip..." :tooltip "...but it doesn't."
      )
    )
  )

;; uncomment one of these
;; 
;;
;; (defpoll brightness :interval "1s"
;;                 :initial  "??"
;;   `./bar_info.sh brightness`)                            ;; bash script
;;   `cat /sys/class/backlight/intel_backlight/brightness`) ;; just some output of a command
;;
(defvar brightness 50)
#!/bin/sh
# bar_info.sh

case $1 in
	brightness)
		echo $(($(cat /sys/class/backlight/intel_backlight/brightness) * 100 / $(cat /sys/class/backlight/intel_backlight/max_brightness)))
	;;
esac

With these two files in the same directory, uncomment one of the variable definitions. For convenience, I defined two script calls that you can use (afaik there is no difference), after that you can call eww open bar --debug --config ./path/to/dir (safe to eww kill first), and you should get a bar that looks similar to the attached screenshot. uncommented cat command With defvar, both tooltips work normally, but with defpoll, none of them work at all.

Expected behaviour

Working tooltips with both defvar and defpoll.

Additional context

No response

m0tholith avatar Jan 21 '24 13:01 m0tholith

I played some more with this issue, and discovered it sometimes appears and sometimes doesn't. It either takes some time after hovering, or simply hovering and unhovering a couple times fixes the issue.

m0tholith avatar Jan 21 '24 19:01 m0tholith