hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.09k stars 882 forks source link

Groupbar text is misaligned and out-of-bounds #6334

Closed squeaktoy closed 4 months ago

squeaktoy commented 4 months ago

System Info and Version

System/Version info ```sh Hyprland, built from branch at commit 358e59e69d27a69381bc0872b5b8d1184bc6b6a1 (layout: fix centering of new floating windows). Date: Sun Jun 2 23:11:55 2024 Tag: v0.40.0-150-g358e59e6, commits: 4756 flags: (if any) System Information: System name: Linux Node name: weerwolf Release: 6.6.30-gentoo-dist Version: #1 SMP PREEMPT_DYNAMIC Sat May 11 06:06:48 CEST 2024 GPU information: 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP107 [GeForce GTX 1050 Ti] [10de:1c82] (rev a1) (prog-if 00 [VGA controller]) os-release: NAME=Gentoo ID=gentoo PRETTY_NAME="Gentoo Linux" ANSI_COLOR="1;32" HOME_URL="https://www.gentoo.org/" SUPPORT_URL="https://www.gentoo.org/support/" BUG_REPORT_URL="https://bugs.gentoo.org/" VERSION_ID="2.15" plugins: ======Config-Start====== Config File: /home/user/.config/hypr/hyprland.conf: Read Succeeded # ####################################################################################### # AUTOGENERATED HYPR CONFIG. # PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT, # OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS. # ####################################################################################### # This is an example Hyprland config file. # Refer to the wiki for more information. # https://wiki.hyprland.org/Configuring/Configuring-Hyprland/ # Please note not all available settings / options are set here. # For a full list, see the wiki # You can split this configuration into multiple files # Create your files separately and then link them to this file like this: # source = ~/.config/hypr/myColors.conf ################ ### MONITORS ### ################ # See https://wiki.hyprland.org/Configuring/Monitors/ monitor=DP-1,1920x1080@165,0x0,1 ################### ### MY PROGRAMS ### ################### # See https://wiki.hyprland.org/Configuring/Keywords/ # Set programs that you use $terminal = alacritty $menu = rofi -show combi ################# ### AUTOSTART ### ################# # Autostart necessary processes (like notifications daemons, status bars, etc.) # Or execute your favorite apps at launch like this: exec-once = hyprpaper exec-once = ckb-next --background exec-once = dinitctl setenv DISPLAY=$DISPLAY exec-once = dinitctl start dunst exec-once = dinitctl start kwalletd ############################# ### ENVIRONMENT VARIABLES ### ############################# # See https://wiki.hyprland.org/Configuring/Environment-variables/ env = XCURSOR_SIZE,24 env = HYPRCURSOR_THEME,rose-pine-hyprcursor env = HYPRCURSOR_SIZE,32 env = SDL_VIDEODRIVER,wayland # NVIDIA env = LIBVA_DRIVER_NAME,nvidia env = XDG_SESSION_TYPE,wayland env = GBM_BACKEND,nvidia-drm env = __GLX_VENDOR_LIBRARY_NAME,nvidia ##################### ### LOOK AND FEEL ### ##################### # Refer to https://wiki.hyprland.org/Configuring/Variables/ # https://wiki.hyprland.org/Configuring/Variables/#general general { gaps_in = 5 gaps_out = 20 border_size = 2 # https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg col.inactive_border = rgba(595959aa) # Set to true enable resizing windows by clicking and dragging on borders and gaps resize_on_border = false # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on allow_tearing = true layout = dwindle } # https://wiki.hyprland.org/Configuring/Variables/#decoration decoration { rounding = 10 # Change transparency of focused and unfocused windows active_opacity = 1.0 inactive_opacity = 1.0 drop_shadow = true shadow_range = 4 shadow_render_power = 3 col.shadow = rgba(1a1a1aee) # https://wiki.hyprland.org/Configuring/Variables/#blur blur { enabled = true size = 3 passes = 1 vibrancy = 0.1696 } } # https://wiki.hyprland.org/Configuring/Variables/#animations animations { enabled = false # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more bezier = myBezier, 0.05, 0.9, 0.1, 1.05 animation = windows, 1, 7, myBezier animation = windowsOut, 1, 7, default, popin 80% animation = border, 1, 10, default animation = borderangle, 1, 8, default animation = fade, 1, 7, default animation = workspaces, 1, 6, default } # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more dwindle { pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = true # You probably want this } # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more master { new_is_master = true } # https://wiki.hyprland.org/Configuring/Variables/#misc misc { force_default_wallpaper = 0 # Set to 0 or 1 to disable the anime mascot wallpapers disable_hyprland_logo = true # If true disables the random hyprland logo / anime girl background. :( allow_session_lock_restore = true } group { col.border_active = rgba(33ccffee) rgba(00ff99ee) 45deg col.border_inactive = rgba(595959aa) groupbar { font_size = 16 col.active = rgba(1188cc88) col.inactive = rgba(595959aa) } } ############# ### INPUT ### ############# # https://wiki.hyprland.org/Configuring/Variables/#input input { kb_layout = us kb_variant = kb_model = kb_options = compose:ralt kb_rules = repeat_delay = 300 repeat_rate = 40 follow_mouse = 1 sensitivity = -0.5 # -1.0 - 1.0, 0 means no modification. touchpad { natural_scroll = false } } # https://wiki.hyprland.org/Configuring/Variables/#gestures gestures { workspace_swipe = false } binds { allow_workspace_cycles = true } # Example per-device config # See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more device { name = epic-mouse-v1 sensitivity = -0.5 } #################### ### KEYBINDINGSS ### #################### # See https://wiki.hyprland.org/Configuring/Keywords/ $mainMod = SUPER # Sets "Windows" key as main modifier bind = $mainMod, Return, exec, $terminal bind = $mainMod & SHIFT, Q, killactive, bind = $mainMod & SHIFT, E, exit, bind = $mainMod, Space, togglefloating, bind = $mainMod, D, exec, $menu bind = $mainMod, F, fullscreen bind = $mainMod, M, fullscreen, 1 bind = $mainMod, Z, pin bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, V, togglesplit, # dwindle bind = $mainMod CTRL, Q, exec, hyprctl kill bind = $mainMod ALT, L, exec, swaylock -c 000000 # Move focus with mainMod + arrow keys bind = $mainMod, left, movefocus, l bind = $mainMod, right, movefocus, r bind = $mainMod, up, movefocus, u bind = $mainMod, down, movefocus, d # Move focus with mainMod + hjkl bind = $mainMod, H, movefocus, l bind = $mainMod, L, movefocus, r bind = $mainMod, K, movefocus, u bind = $mainMod, J, movefocus, d # Move focus with mainMod + arrow keys bind = $mainMod SHIFT, left, movewindoworgroup, l bind = $mainMod SHIFT, right, movewindoworgroup, r bind = $mainMod SHIFT, up, movewindoworgroup, u bind = $mainMod SHIFT, down, movewindoworgroup, d # Move focus with mainMod + hjkl bind = $mainMod SHIFT, H, movewindoworgroup, l bind = $mainMod SHIFT, L, movewindoworgroup, r bind = $mainMod SHIFT, K, movewindoworgroup, u bind = $mainMod SHIFT, J, movewindoworgroup, d # Window cycle bind = $mainMod, Period, cyclenext bind = $mainMod, Comma, cyclenext, prev # Window swap bind = $mainMod SHIFT, Period, swapnext bind = $mainMod SHIFT, Comma, swapnext, prev # Group cycle bind = $mainMod CTRL, H, changegroupactive, b bind = $mainMod CTRL, J, changegroupactive, bind = $mainMod CTRL, K, changegroupactive, b bind = $mainMod CTRL, L, changegroupactive bind = $mainMod CTRL, left, changegroupactive, b bind = $mainMod CTRL, down, changegroupactive, bind = $mainMod CTRL, up, changegroupactive, b bind = $mainMod CTRL, right, changegroupactive # Group swap bind = $mainMod CTRL SHIFT, H, movegroupwindow, b bind = $mainMod CTRL SHIFT, J, movegroupwindow, bind = $mainMod CTRL SHIFT, K, movegroupwindow, b bind = $mainMod CTRL SHIFT, L, movegroupwindow bind = $mainMod CTRL SHIFT, left, movegroupwindow, b bind = $mainMod CTRL SHIFT, down, movegroupwindow, bind = $mainMod CTRL SHIFT, up, movegroupwindow, b bind = $mainMod CTRL SHIFT, right, movegroupwindow # Switch to previous workspace bind = $mainMod, B, workspace, previous bind = $mainMod SHIFT, B, movetoworkspace, previous # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 bind = $mainMod, 2, workspace, 2 bind = $mainMod, 3, workspace, 3 bind = $mainMod, 4, workspace, 4 bind = $mainMod, 5, workspace, 5 bind = $mainMod, 6, workspace, 6 bind = $mainMod, 7, workspace, 7 bind = $mainMod, 8, workspace, 8 bind = $mainMod, 9, workspace, 9 bind = $mainMod, 0, workspace, 10 # Switch workspaces with mainMod + [F1-F10] bind = $mainMod, F1, workspace, 11 bind = $mainMod, F2, workspace, 12 bind = $mainMod, F3, workspace, 13 bind = $mainMod, F4, workspace, 14 bind = $mainMod, F5, workspace, 15 bind = $mainMod, F6, workspace, 16 bind = $mainMod, F7, workspace, 17 bind = $mainMod, F8, workspace, 18 bind = $mainMod, F9, workspace, 19 bind = $mainMod, F10, workspace, 20 # Move active window to a workspace with mainMod + SHIFT + [0-9] bind = $mainMod SHIFT, 1, movetoworkspace, 1 bind = $mainMod SHIFT, 2, movetoworkspace, 2 bind = $mainMod SHIFT, 3, movetoworkspace, 3 bind = $mainMod SHIFT, 4, movetoworkspace, 4 bind = $mainMod SHIFT, 5, movetoworkspace, 5 bind = $mainMod SHIFT, 6, movetoworkspace, 6 bind = $mainMod SHIFT, 7, movetoworkspace, 7 bind = $mainMod SHIFT, 8, movetoworkspace, 8 bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 0, movetoworkspace, 10 # Move active window to a workspace with mainMod + SHIFT + [F1-F10] bind = $mainMod SHIFT, F1, movetoworkspace, 11 bind = $mainMod SHIFT, F2, movetoworkspace, 12 bind = $mainMod SHIFT, F3, movetoworkspace, 13 bind = $mainMod SHIFT, F4, movetoworkspace, 14 bind = $mainMod SHIFT, F5, movetoworkspace, 15 bind = $mainMod SHIFT, F6, movetoworkspace, 16 bind = $mainMod SHIFT, F7, movetoworkspace, 17 bind = $mainMod SHIFT, F8, movetoworkspace, 18 bind = $mainMod SHIFT, F9, movetoworkspace, 19 bind = $mainMod SHIFT, F10, movetoworkspace, 20 # Example special workspace (scratchpad) bind = $mainMod, S, togglespecialworkspace, magic bind = $mainMod SHIFT, S, movetoworkspace, special:magic # Groups bind = $mainMod, G, togglegroup # Scroll through existing workspaces with mainMod + scroll bind = $mainMod, mouse_down, workspace, e+1 bind = $mainMod, mouse_up, workspace, e-1 # Scroll through existing workspaces with keyboard bind = $mainMod, N, workspace, e+1 bind = $mainMod SHIFT, N, workspace, e-1 bind = $mainMod, Period, workspace, e+1 bind = $mainMod, Comma, workspace, e-1 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow # Audio bindings bind =, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle bind = CTRL, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle # MPD media bindings bind =, Pause, exec, mpc toggle bind =, XF86AudioPlay, exec, mpc toggle binde =, XF86AudioNext, exec, mpc next binde =, XF86AudioPrev, exec, mpc prev binde = SHIFT, XF86AudioNext, exec, mpc seek +10 binde = SHIFT, XF86AudioPrev, exec, mpc seek -10 bind = SHIFT, XF86AudioRaiseVolume, exec, mpc seek +10 bind = SHIFT, XF86AudioLowerVolume, exec, mpc seek -10 bind = CTRL, XF86AudioRaiseVolume, exec, mpc volume +2 bind = CTRL, XF86AudioLowerVolume, exec, mpc volume -2 # Notifications bind = $mainMod, Grave, exec, dunstctl close bind = $mainMod SHIFT, Grave, exec, dunstctl close-all bind = $mainMod CTRL, Grave, exec, dunstctl history-pop # Screenshot bind = CTRL, Print, exec, grimblast copysave area ~/Screenshots/$(date +%Y-%m-%dT%H-%M-%S).png bind =, Print, exec, grimblast copysave output ~/Screenshots/$(date +%Y-%m-%dT%H-%M-%S).png bind = $mainMod, Print, exec, grimblast copysave active ~/Screenshots/$(date +%Y-%m-%dT%H-%M-%S).png ############### ### SUBMAPS ### ############### bind = $mainMod, R, submap, resize # will start a submap called "resize" submap = resize # sets repeatable binds for resizing the active window binde =, right, resizeactive, 10 0 binde =, left, resizeactive, -10 0 binde =, up, resizeactive, 0 -10 binde =, down, resizeactive, 0 10 # sets repeatable binds for resizing the active window binde =, L, resizeactive, 10 0 binde =, H, resizeactive, -10 0 binde =, K, resizeactive, 0 -10 binde =, J, resizeactive, 0 10 # use reset to go back to the global submap bind =, escape, submap, reset # will reset the submap, which will return to the global submap submap = reset ############################## ### WINDOWS AND WORKSPACES ### ############################## # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules # Example windowrule v1 # windowrule = float, ^(kitty)$ # Example windowrule v2 # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ windowrulev2 = suppressevent maximize, class:.* # You'll probably like this. exec-once = waybar ======Config-End======== ```

Bug or Regression?

Regression

Description

The text of the groupbar is out-of-bounds and misaligned as can be seen here. image

I did a git bisect and this bug has been introduced in commit ca0833c9ed6d6034b360d0ea83f3ac942ffb45b5

Before commit ca0833c9ed6d6034b360d0ea83f3ac942ffb45b5 it looked like this: image

In both cases the text seems to go out-of-bounds, but since commit ca0833c9ed6d6034b360d0ea83f3ac942ffb45b5 it's more out-of-bounds than it used to be.

How to reproduce

Config to reproduce: ~/.config/hypr/hyprland.conf:

group {
    col.border_active = rgba(33ccffee) rgba(00ff99ee) 45deg
    col.border_inactive = rgba(595959aa)

    groupbar {
        font_family = Terminus
        font_size = 16
        col.active = rgba(1188cc88)
        col.inactive = rgba(595959aa)
    }
}

This bug can also be reproduces with font_family = DejaVuSans. Maybe the font_size is causing it.

Crash reports, logs, images, videos

No response

MightyPlaza commented 4 months ago

can't you use height?

vaxerski commented 4 months ago

tagging @zakk4223 as the regressor

squeaktoy commented 4 months ago

can't you use height?

This doesn't work. The text is still misaligned.

zakk4223 commented 4 months ago

It's broken both before and after the change I made. It looks ok until the text has a letter that has a 'below the line' component, like 'g' or 'y'.

It looks like there is some side effect of my change but it's a matter of using the bottom of the 'tail letter' vs the center line. So instead of the bottom of those letters intruding outside of the bar, the top of the text does.

Also noticed if you are running 0.40.0 (before my change) and you set a large font size, and then set a large height (that should be able to fit the font) it renders the font but cuts off the top/bottom depending on what letters are rendered. The text rendering is broken.

I had to deal with this weird shit when I did the easymotion plugin; I'll see if I can use what I did there to make the bar text not suck. I'm not sure I'll be able to save users from setting fonts that don't fit in the bar tho.

MightyPlaza commented 4 months ago

I actually tried to fixed the font box being smaller than the real space it uses a while back but didn't succeed at finding how to get the real font height with pango added height so it would use the wrong size provided by pango

image iirc only the center size is being used