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

[BUG] Weird visual glitch when using the emoji plugin #2036

Open
2 tasks done
madprops opened this issue Oct 3, 2024 · 9 comments
Open
2 tasks done

[BUG] Weird visual glitch when using the emoji plugin #2036

madprops opened this issue Oct 3, 2024 · 9 comments
Labels
Milestone

Comments

@madprops
Copy link

madprops commented Oct 3, 2024

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

skullemoji

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

  • No, I don't use the wayland display server protocol

I've checked if the issue exists in the latest stable release

  • Yes, I have checked the problem exists in the latest stable version
@madprops madprops added the bug label Oct 3, 2024
@DaveDavenport
Copy link
Collaborator

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.

@madprops madprops changed the title [BUG] [BUG] Weird visual glitch when using the emoji plugin Oct 3, 2024
@DaveDavenport
Copy link
Collaborator

Pushed possible fix, if this does not fix it, I am not sure if it is easily fixable in rofi.

@DaveDavenport DaveDavenport added this to the 1.7.6 milestone Oct 4, 2024
@xsy420
Copy link

xsy420 commented Oct 17, 2024

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

@DaveDavenport
Copy link
Collaborator

Thanks for testing and the trace.

@DaveDavenport
Copy link
Collaborator

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.

@DaveDavenport
Copy link
Collaborator

What distro are you using?

@xsy420
Copy link

xsy420 commented Oct 17, 2024

I'm using Arch Linux

@xsy420
Copy link

xsy420 commented Oct 18, 2024

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);
        }

@DaveDavenport
Copy link
Collaborator

aah stupid error by me, Thanks!

(/me goes to add -Wshadow to compile flags)

DaveDavenport added a commit that referenced this issue Oct 18, 2024
DaveDavenport added a commit that referenced this issue Oct 20, 2024
* Add -Wshadow to build system.

Issue: #2036

* Take out unintended change

* [Icon] Add more descriptive variable name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants