-
-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cpu widget gets placed off screen sometimes #408
Comments
Hello @saevarb, I did some poking around to understand what's going on here.
Basically, when you click on the widget, a timer is started to regularly "query" all the data and draw/update the widget displayed in the popup. The very first time the popup is visible, the timer has never run before, hence the widget is empty and Awesome tries to place a As a little experiment, if I change the following code awesome-wm-widgets/cpu-widget/cpu-widget.lua Lines 141 to 145 in 2889ef4
with a delayed call for the -- popup:move_next_to(mouse.current_widget_geometry)
gears.timer {
timeout = 0.5,
single_shot = true,
autostart = true,
callback = function()
popup:move_next_to(mouse.current_widget_geometry)
end,
}
-- Restart the timer, when the popup becomes visible
-- Emit the signal to start the timer directly and not wait the timeout first
popup_timer:start()
popup_timer:emit_signal("timeout") The popup is correctly place from the first call! This is NOT the solution you are looking for, but at least it points out the real issue. This timer logic was introduced with PR #246, so CC @atopion :) I think the path forward is to separate the UI logic from the business logic. AKA the |
Problem
After starting or restarting awesome, and clicking the CPU widget, the popup gets placed off screen when using multiple monitors(or even when using a small xephyr window), but only in the beginning. Hiding it and then clicking again correctly respects screen boundaries.
Right after restarting and clicking widget
After hiding popup and clicking again
Yellow line indicates screen boundary.
Additional info
awm version
Also happens on stable awm.
Notes
I looked at the code and saw that it is using
popup:move_next_to
which claims to take care of this, and also found this issue comment which is related.I'm pretty new to awm and lua, but I did play around with some
awful.placement
s but the only thing that really worked was just placing it in the top right corner, and while that would be fine for me, it's not a general solution that works if people are using e.g. vertical bars or at the bottom.The text was updated successfully, but these errors were encountered: