philj56 / tofi

Tiny dynamic menu for Wayland
MIT License
845 stars 35 forks source link

Stretch issue with a taller geometry ratio on niri wm #190

Open BRS5672023 opened 4 weeks ago

BRS5672023 commented 4 weeks ago

The font and border (and presumably all the elements else) stretches weirdly when I set the geometry with a taller ratio (shown by the following screenshot), and this issue happens only on niri wm but not on hyprland..

Maybe this issue is related to #165 (while seemingly I'm not having the scaling issue here).

For example, run tofi with tofi-drun --width=600 --height=800 Screenshot from 2024-08-15 22-39-43

The remaining contents within the tofi config file are

fuzzy-match=true
drun-launch=true

font-size=18
font="monospace bold"

background-color=#181818
outline-width=0
outline-color=#1a1a1a
border-width=4
border-color=#7cafc2
text-color=#b8b8b8
result-spacing=5
corner-radius=10
width=0

prompt-text="❯   "
prompt-color=#5291e2

selection-color=#ffffff
selection-background=#383c4a
selection-match-color=#ff0000
selection-background-padding=0,10
selection-background-corner-radius=5
itshog commented 3 weeks ago

Can you try the patch in #189?

BRS5672023 commented 3 weeks ago

Can you try the patch in #189?

Thx, your patch indeed fixes my problem, I missed the part setting anchor=center in my tofi config explicitly, which seems to be necessary?

itshog commented 3 weeks ago

Thx, your patch indeed fixes my problem, I missed the part setting anchor=center in my tofi config explicitly, which seems to be necessary?

anchor=center is necessary only if you want tofi to appear in the center of the screen (but i believe center is the default value, so even if you don't specify it explicitly it should appear in the center). Other possible anchors are top-left, top, top-right, right, bottom-right, bottom, bottom-left, left, but the issue should be solved by the patch regardless of the chosen anchor

itshog commented 3 weeks ago

@BRS5672023 Could you please try the patch with other anchor values? I'm almost sure that this issue is a duplicate of #165

BRS5672023 commented 3 weeks ago

@BRS5672023 Could you please try the patch with other anchor values? I'm almost sure that this issue is a duplicate of #165

All values work as intended, but if I comment out the anchor line in tofi config, then its position is at top-left and stretched abnormally.

itshog commented 3 weeks ago

All values work as intended, but if I comment out the anchor line in tofi config, then its position is at top-left and stretched abnormally.

Probably there is something wrong in the patch or in some other part of the code responsible for setting the anchor, thank you! I'll try to update the patch and see what I can do

itshog commented 3 weeks ago

@BRS5672023 I updated the patch, does it work as expected now?

BRS5672023 commented 3 weeks ago

@BRS5672023 I updated the patch, does it work as expected now?

Yes, it is fixed now, thanks for your patch.