elkowar / eww

ElKowars wacky widgets

Home Page:https://elkowar.github.io/eww

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Tooltip issues with defpoll

m0tholith opened this issue · comments

Checklist before submitting an issue

  • I have searched through the existing closed and open issues for eww and made sure this is not a duplicate
  • I have specifically verified that this bug is not a common user error
  • 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

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.