Skip to content
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

Tooltip font rendering is slightly garbled sometimes #766

Open
ZimbiX opened this issue Jan 17, 2023 · 2 comments
Open

Tooltip font rendering is slightly garbled sometimes #766

ZimbiX opened this issue Jan 17, 2023 · 2 comments

Comments

@ZimbiX
Copy link
Collaborator

ZimbiX commented Jan 17, 2023

Sometimes it renders properly:

Screenshot from 2023-01-18 06-33-07

But most of the time, it looks like this:

Screenshot from 2023-01-18 06-33-48

When a tooltip appears, it's either garbled or not, and stays that way. Moving the cursor away, waiting a second, and hovering again, rolls the dice again on whether it'll be garbled.

Unlike the other tooltips, the network one seems to be always garbled. Of my graphs' refresh time settings, network and CPU have the shortest - 1000ms - but it doesn't affect the CPU tooltip to the same extent, strangely.

It's rather odd. It's been like this for a few years now.

The last graph is an addition from my fork, but the issue is unrelated to that.

➜ dconf dump /org/gnome/shell/extensions/system-monitor/
[/]
battery-display=false
battery-hidesystem=false
battery-show-menu=false
battery-show-text=false
battery-style='digit'
battery-time=true
center-display=false
compact-display=false
cpu-graph-width=100
cpu-individual-cores=false
cpu-refresh-time=1000
cpu-show-text=false
disk-display=true
disk-show-text=false
disk-style='graph'
disk-usage-style='bar'
fan-display=false
fan-fan0-color='#865e3cff'
fan-graph-width=30
fan-sensor-file='/sys/class/hwmon/hwmon4/fan1_input'
fan-show-menu=false
fan-show-text=false
fan-style='graph'
freq-display=false
freq-show-menu=false
freq-show-text=true
freq-style='both'
gpu-display=false
icon-display=false
memory-refresh-time=5000
memory-show-text=false
memory-style='graph'
move-clock=false
net-show-text=false
net-speed-in-bits=false
show-tooltip=true
swap-display=true
swap-graph-width=100
swap-show-text=false
thermal-display=true
thermal-fahrenheit-unit=false
thermal-graph-width=100
thermal-sensor-file='/sys/class/hwmon/hwmon4/temp1_input'
thermal-show-menu=true
thermal-show-text=false
thermal-style='graph'
thermal-threshold=0
thermal-tz0-color='#c17d11ff'
@ZimbiX
Copy link
Collaborator Author

ZimbiX commented Jan 17, 2023

Ok, weird. I enabled the GPU graph and adjusted the width of all my graphs to compensate, and now the network tooltip renders fine! It might have moved the consistent problem elsewhere though.

for g in memory swap cpu gpu freq net disk thermal fan solar battery; do dconf write /org/gnome/shell/extensions/system-monitor/$g-graph-width 85; done

@ZimbiX
Copy link
Collaborator Author

ZimbiX commented Jan 23, 2023

I figured it out! The fact that it seemed related to width and that some of the garbling presented as blurriness led me to wonder if it was from a fractional x position. I added some logging to check this:

diff --git a/system-monitor@paradoxxx.zero.gmail.com/extension.js b/system-monitor@paradoxxx.zero.gmail.com/extension.js
index 146e279..16355ba 100644
--- a/system-monitor@paradoxxx.zero.gmail.com/extension.js
+++ b/system-monitor@paradoxxx.zero.gmail.com/extension.js
@@ -792,6 +792,7 @@ const TipMenu = class SystemMonitor_TipMenu extends PopupMenu.PopupMenuBase {
         let tipx = cx - width / 2;
         tipx = Math.max(tipx, monitor.x);
         tipx = Math.min(tipx, monitor.x + monitor.width - width);
+        console.log(`tipx orig: ${tipx}`);
         let tipy = Math.floor(ym);
         // Hacky condition to determine if the status bar is at the top or at the bottom of the screen
         if (sourceTopLeftY / monitor.height > 0.3) {

And yep - some tooltips have fractional x values, and it's exactly correlated to the garbling - see the below screen recording. The last one is harder to notice as it's just blurry with no artifacting - view the video at 100% scale to see it: right-click -> Open video in new tab.

system-monitor.fractional.tooltip.x.values-2023-01-24_03.24.48.mp4

A simple rounding of the x position fixed it 🙂 I'll submit a PR in a moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant