Comments (1)
Hello @saevarb,
I did some poking around to understand what's going on here.
[...] but only in the beginning. Hiding it and then clicking again correctly respects screen boundaries.
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 { width = 1, heigth = 1 }
popup.
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
(0,5 so that the timer callback has enough time to complete the work once)
-- 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 popup_timer:connect_signal('timeout'
callback shouldn't be building the widget, but only updating the values. With this kind of separation, it's easier to have a "first draw" with default values to initialize the popup content.
from awesome-wm-widgets.
Related Issues (20)
- Pactl volume-widget only updates on one screen HOT 5
- Consider using wttr.in for weather widget HOT 2
- Weather widget does not work, but there are 0 errors
- volume-widget: Mixer selection
- pactl-widget: No way to set limit on max volume HOT 2
- brightness_widget: incorrect brightnessctl command for getting current brightness level HOT 1
- Change color font on the spotify-widget Widget HOT 3
- Install dir not found
- README.md installation info is missing HOT 2
- Are there any plans to support hibernate in logout popup? HOT 1
- scripts
- Batteryarc shows battery warning when battery is fully charged
- [Calendar] `focus_date_bg` and `focus_date_fg` broken after updating to last commits HOT 4
- apt widget not working because icon does not show in bar HOT 3
- calendar-widget: 'today' day is not set when opening the calendar
- Battery widget doesn't handle well two batteries
- OpenWeatherMap API 2.5 deprecation
- Typo in logout-popup-widget
- Volume widget seems to malfunction after upgrading pavucontrol to v6.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from awesome-wm-widgets.