[BUG] Weird visual glitch when using the emoji plugin
Rofi version (rofi -v)
Version: 1.7.5
Configuration
https://gist.github.com/madprops/fb40662a5eb644dcfcd931b14ba5e8ab
Theme
https://gist.github.com/madprops/3ab74683add2faebfbb44a411a35722d
Timing report
No response
Launch command
rofi -modi emoji -show emoji
Step to reproduce
Search for skull
As you can see below the first item, the second item looks weird.
Is that a rofi bug?
Expected behavior
No glitch.
Actual behavior
Glitch.
Additional information
I'm using the emoji plugin.
Which I think is this one: https://archlinux.org/packages/extra/x86_64/rofi-emoji/
Using wayland display server protocol
- [X] No, I don't use the wayland display server protocol
I've checked if the issue exists in the latest stable release
- [X] Yes, I have checked the problem exists in the latest stable version
This is kinda a rofi bug.. rofi determines the size of a row in the listview based by creating a row and getting the size of the widget.. This is computed based on the pixel extend pango returns for a small string ("aAjb") this is then saved so it can pre-compute everything. This is for speed reasons.
If fonts has, mostly with icons, suddenly a glyph that is bigger then expected, this happens. Last time I looked (years ago) there was not a quick way to find the largest glyph in available.
Pushed possible fix, if this does not fix it, I am not sure if it is easily fixable in rofi.
I build it with commit 186b0e7b. when I run rofi -show drun, it receive a segmentation fault. gdb.log build command
autoreconf -i
./configure --prefix=/usr --sysconfdir=/etc --enable-imdkit
make
Thanks for testing and the trace.
To bad I am missing entries from the trace that crashes. I don't really see how we can get this crash, with the newly added code (unless its an issue in pango). Hope I can reproduce.
What distro are you using?
I'm using Arch Linux
well, it's because variable name redefined. at line 129 in textbox.c:
const char *font = rofi_theme_get_string(WIDGET(tb), "font", NULL);
but at line 147
PangoFont *font = pango_context_load_font(p_context, tbfc->pfd);
I tried rename to pfont it works (no segmentation fault at least)
PangoFont *pfont = pango_context_load_font(p_context, tbfc->pfd);
if (pfont) {
PangoFontMetrics *fm = pango_font_get_metrics(pfont, NULL);
if (fm) {
int h = pango_font_metrics_get_height(fm) / PANGO_SCALE;
if (h > 0) {
tbfc->height = h;
}
pango_font_metrics_unref(fm);
}
g_object_unref(pfont);
}
aah stupid error by me, Thanks!
(/me goes to add -Wshadow to compile flags)
Any update if the commit fixes the reported glitch ?
Arch is still packaging an older version I think 1.7.5-3 - The glitch on the emoji picker is still present.
It seems not to fix it..
Debugging further, the FontMetrics used by rofi to find the size, return that the distance between baselines is 22 px.. while that icon is 24 pixels high..
The bounding box for ☠ is 49. If I use that for every row it also is very odd..
You can see only the ☠ is normal... I think there is not an easy fix for this.
Gave it some more thought.. I am closing this issue, I am pretty sure there is very little I can do about this beside having dynamic row height. I want to avoid this as it makes the logic in rofi more difficult and might slow it down (I need to implement this at some point to see what the impact is).
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.