Open shodan8192 opened 4 years ago
Do you have a HiDPI display, by any chance?
No, I have 1920x1200 24'' monitor.
I have the same issue running Arch with a 1920x1080 24" monitor, but shodan8192's fix works great. I replicated the issue and the fix several times without fail by locking the computer and then logging in. Applying the fix did require logging out and then back in, although there may be easier means.
Can I submit a PR to get this fixed, at least until someone finds a better method?
shodan8192's fix:
--- extension.js.original 2020-06-22 09:25:56.969755762 -0400
+++ extension.js 2020-06-22 09:26:16.566081515 -0400
@@ -48,7 +48,7 @@
}
signalHandlerID = lbl.connect("notify::text", overrider);
last = lbl.get_text();
- overrider(lbl);
+ GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1000, () => {overrider(lbl)});
}
function disable() {
No. I won’t except a timing based work-around. It’ll be way too fragile.
@shodan8192 and @KyleWJohnston could you try adding a second signal handler and hook it up to lbl.connect("allocation-changed", overrider)
? That should call overrider
again when the lbl
’s dimension changes. (1–3 px changes are expected due to variable width fonts.) If that works, then we can improve on that to only double-execute overrider
when the dimension shrinks.
Occurs (but not always) in Ubuntu 19.04, 19.10 on Top bar and Dash to panel.
If clock text after override is longer than original one, then after unlock, text is displayed with ellipsis; if is shorter there is margin on the right side.
Example :
It seems like that happen when function
overrider(lbl)
fromenable()
is called earlier than desktop if fully repainted.After refreshing (on mouse hover or wait minute or second depending on format) container width is set properly.
I have workaround it by adding 1000ms timeout, instead of calling
overrider(lbl)
immediately :GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1000, () => {overrider(lbl)});
but maybe there is a better way to do it, like force repaint/refresh of container - I know nearly nothing about Gjs/GTK+ programming.