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

Context menus (right-click menus) from tray icons in Waybar are drawn underneath windows #2132

Closed Hubro closed 1 year ago

Hubro commented 1 year ago

When I right click an application icon in the Waybar tray, the resulting context menu is drawn below regular docked windows:

image

image

This means I have to go to an empty workspace before I can use these context menus, which is pretty tedious.

I'm guessing there's probably a way to fix this with configuration, maybe some window rules, but I don't know where to start.

I tried finding existing bug reports about this, but couldn't find anything, which is weird. This issue seems like it would immediately cause other people to file a bug report :smile:

This makes me think it could be something with my configuration, so I've attached it:

hyprland.conf:


monitor=desc:Samsung Electric Company LC49G95T H4ZNA01469,5120x1440@240,0x0,1
monitor=desc:Philips Consumer Electronics Company PHL BDM4065 0x000009F8,3840x2160@60,3840x0,1
monitor=DP-2,3840x2160@144,0x0,1
wsbind=1,DP-1
wsbind=2,DP-1
wsbind=3,DP-1
wsbind=4,DP-1
wsbind=5,DP-1
wsbind=6,DP-1
wsbind=7,DP-1
wsbind=8,DP-1
wsbind=8,DP-1
wsbind=9,DP-2
#monitor=desc:"GIGA-BYTE TECHNOLOGY CO., LTD. M28U 22120B003932",3840x2160@144,0x0,1
#monitor=desc:"Philips Consumer Electronics Company PHL BDM4065 0x000009F8",3840x2160@60,3840x0,1

misc {
    vrr = 1
    mouse_move_enables_dpms = true
    key_press_enables_dpms = true
}

env = XCURSOR_SIZE,24

input {
    kb_layout = no
    kb_variant =
    kb_model =
    kb_options =
    kb_rules =

    repeat_rate = 40
    repeat_delay = 300

    follow_mouse = 1

    touchpad {
        natural_scroll = false
    }

    accel_profile flat
    sensitivity = -0.5
}

device:logitech-g900-1 {
    accel_profile flat
    sensitivity -1.0
    pointer_accel -1.0
}

device:logitech-gaming-mouse-g900-1 {
    accel_profile flat
    sensitivity -1.0
    pointer_accel -1.0
}

device:logitech-gaming-mouse-g900-2 {
    accel_profile flat
    sensitivity -1.0
    pointer_accel -1.0
}

general {
    gaps_in = 10
    gaps_out = 20
    border_size = 2
    col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
    col.inactive_border = rgba(595959aa)

    layout = dwindle
}

decoration {
    rounding = 3
    blur = true
    blur_size = 1
    blur_passes = 5
    blur_new_optimizations = true

    drop_shadow = true
    shadow_range = 4
    shadow_render_power = 3
    col.shadow = rgba(1a1a1aee)
}

animations {
    enabled = true

    bezier = myBezier, 0.05, 0.9, 0.1, 1.05
    bezier = easeOutQuad, 0.5, 1.0, 0.89, 1.0
    bezier = easeOutQuint, 0.22, 1.0, 0.36, 1.0

    animation = global, 1, 4, easeOutQuint
}

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
    no_gaps_when_only = true
}

master {
    new_is_master = true
}

gestures {
    workspace_swipe = false
}

source=~/.config/hypr/keybinds.conf
source=~/.config/hypr/windowrules.conf

# Wallpaper
exec-once=hyprpaper

exec-once=dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once=/bin/bash -c '[[ -f $HOME/autostart.sh ]] && . $HOME/autostart.sh &>> $HOME/autostart.log'

keybinds.conf:

binds {
    scroll_event_delay 0.1
}

# Push-to-talk in Discord?
#bind = ALT, Alt_L, pass, ^discord$
bind = ALT, less, pass, ^discord$

bind = SUPER, Return, exec, kitty
bind = SUPER SHIFT, Return, exec, kitty --class=kitty-floating
bind = SUPER SHIFT, Q, killactive,
bind = SUPER CTRL ALT, Escape, exit,
bind = SUPER, F10, exec, nautilus
bind = SUPER, F12, exec, darkman toggle
bind = SUPER, Plus, exec, pavucontrol

# Screenshots
bind = , 107, exec, screenshot
bind = ALT, 107, exec, screenshot -r
bind = CTRL, 107, exec, screenshot -f

#bind = SUPER, P, pseudo, # dwindle
#bind = SUPER, J, togglesplit, # dwindle

# Focus browser
bind = SUPER, i, focuswindow, vivaldi-stable

# Application launcher
bind = SUPER, d, exec, tofi-run | xargs hyprctl dispatch exec --
bind = SUPER SHIFT, d, exec, j4-dmenu-desktop --dmenu="tofi --prompt-text 'Application: ' --padding-left 25%"

bind = SUPER CTRL ALT, P, exec, systemctl poweroff
bind = SUPER CTRL ALT, R, exec, systemctl reboot
bind = SUPER CTRL ALT, S, exec, systemctl suspend
bind = SUPER CTRL ALT, H, exec, systemctl hibernate
bind = SUPER, F7, exec, sleep 0.5; hyprctl dispatch dpms off

# Start Obsidian
bind = SUPER, F1, exec, obsidian-personal
bind = SUPER, F2, exec, obsidian-telia

# Volume
bind = , 127, exec, toggle-audio.py output
bind = , 78, exec, toggle-audio.py input
bind = , 121, exec, toggle-mute
bind = , 122, exec, vol -5%
bind = , 123, exec, vol +5%

# Media
bind = , 171, exec, playerctl next
bind = , 172, exec, playerctl play-pause
bind = , 173, exec, playerctl previous
bind = , 208, exec, playerctl play # Play/pause from bluetooth headset
bind = , 209, exec, playerctl pause # Play/pause from bluetooth headset

#
# Mouse
#

bindm = SUPER, mouse:272, movewindow        # Left mouse button
bindm = SUPER, mouse:273, resizewindow      # Right mouse button

#
# Navigation
#

bind = SUPER SHIFT, Space, togglefloating,
bind = SUPER, P, pin,
bind = SUPER, F, fullscreen, 0
bind = SUPER SHIFT, F, fullscreen, 1   # Maximize (show status bar)

# Window groups
bind = SUPER, T, togglegroup
bind = SUPER SHIFT, T, moveoutofgroup
bind = SUPER, Tab, changegroupactive, f
bind = SUPER SHIFT, Tab, changegroupactive, b
bind = SUPER CTRL, k, moveintogroup, u
bind = SUPER CTRL, l, moveintogroup, r
bind = SUPER CTRL, j, moveintogroup, d
bind = SUPER CTRL, h, moveintogroup, l

# Change split direction (Dwindle)
bind = SUPER, E, togglesplit

# Focus previous window
bind = ALT, Tab, focuscurrentorlast

# Move focus with mainMod + arrow keys
bind = SUPER, H, movefocus, l
bind = SUPER, L, movefocus, r
bind = SUPER, K, movefocus, u
bind = SUPER, J, movefocus, d

# Move window with mainMod + arrow keys
bind = SUPER SHIFT, H, movewindow, l
bind = SUPER SHIFT, L, movewindow, r
bind = SUPER SHIFT, K, movewindow, u
bind = SUPER SHIFT, J, movewindow, d

# Switch workspaces with mainMod + [0-9]
bind = SUPER, 1, workspace, 1
bind = SUPER, 2, workspace, 2
bind = SUPER, 3, workspace, 3
bind = SUPER, 4, workspace, 4
bind = SUPER, 5, workspace, 5
bind = SUPER, 6, workspace, 6
bind = SUPER, 7, workspace, 7
bind = SUPER, 8, workspace, 8
bind = SUPER, 9, workspace, 9
bind = SUPER, 0, workspace, 10
bind = SUPER, Bar, workspace, previous

# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = SUPER SHIFT, 1, movetoworkspace, 1
bind = SUPER SHIFT, 2, movetoworkspace, 2
bind = SUPER SHIFT, 3, movetoworkspace, 3
bind = SUPER SHIFT, 4, movetoworkspace, 4
bind = SUPER SHIFT, 5, movetoworkspace, 5
bind = SUPER SHIFT, 6, movetoworkspace, 6
bind = SUPER SHIFT, 7, movetoworkspace, 7
bind = SUPER SHIFT, 8, movetoworkspace, 8
bind = SUPER SHIFT, 9, movetoworkspace, 9
bind = SUPER SHIFT, 0, movetoworkspace, 10
bind = SUPER SHIFT, Bar, movetoworkspace, previous

# Scroll through existing workspaces with mainMod + scroll
bind = SUPER, mouse_down, workspace, e-1
bind = SUPER, mouse_up, workspace, e+1

windowrules.conf:

# Gnome Calculator
windowrule = float,^org.gnome.Calculator$

# Kitty
windowrule = float,^kitty-floating$

# Solaar
windowrule = float,^solaar$

# Virtual Machine Manager
windowrule = float,^virt-manager$

# Obsidian
windowrule = float,^obsidian$

# Viber
$viber = class:^com\.viber\.Viber$,title:^Viber$
$vibernotification = class:^com\.viber\.Viber$,title:^ViberPC$
windowrulev2 = workspace 3,$viber
windowrulev2 = float,$vibernotification
windowrulev2 = nofocus,$vibernotification
windowrulev2 = move 100%-20 100%-20,$vibernotification
windowrulev2 = pin,$vibernotification

# Slack
windowrule = workspace 3,^Slack$

# Telegram
windowrule = workspace 3,^org.telegram.desktop$

# Discord
windowrule = workspace 3,^discord$

# Steam
windowrule = workspace 5,^Steam$
windowrulev2 = pin,class:^Steam$,title:^$

# Game: World of Warcraft (Classic)
windowrule = workspace 6,^wowclassic\.exe$
vaxerski commented 1 year ago

layer to top in waybar config READ THE WIKI AAAAAAAAAAAAAAAAAAAAAAAAAA https://wiki.hyprland.org/Useful-Utilities/Status-Bars/#waybar-popups-render-behind-the-windows

Hubro commented 1 year ago

I have actually read the entire wiki :sweat_smile: But unfortunately I am severely limited by having normal human brain.

Sorry for wasting your time. Hopefully this closed issue will help other people Googling the same issue with different wording.

vaxerski commented 1 year ago

yeah the other 10 as well

image

Hubro commented 1 year ago

I used the words "context menu", "under" and "below"... :sweat_smile:

On the bright side, without the Wiki I would probably have opened 30 dumb issues instead of just 2!

Hubro commented 1 year ago

Interesting observation though, setting "layer": "top" means that the entire waybar is rendered above windows, which feels very weird (if you drag a floating window over the bar). In Sway this isn't necessary, and context menus are still always displayed above windows :thinking:

So it seems like there's room for Hyprland to handle this better? Can Hyprland detect which surfaces are context menus and choose to draw those on top of all other windows? Is this what Sway does?

vaxerski commented 1 year ago

technically layer popups should be rendered above windows but I disagree with that methodology cuz its dumb

Hubro commented 1 year ago

I don't know enough about wayland to have any opinion on what the best methodology is, but from a user perspective it's definitely weird that popups render below windows by default :wink:

kcrmson commented 1 year ago

@Hubro, in your waybar config, if you have a setting for "mode" try commenting it out. I found the dock mode seems to still keep the context menus and tooltips behind windows if that setting is actually set. Commenting it out fixed the issue for me.

Hubro commented 1 year ago

@kcrmson I don't have that setting in my config, unfortunately.

So are you saying that you don't have "layer": "top" in your Waybar config, and your context menus are still correctly drawn on top of other windows? :thinking:

kcrmson commented 1 year ago

I do have "layer": "top" set, i do not have "mode": "dock" set (which I did have set originally but having it on caused the same problem you were having).

jficz commented 1 year ago

The mode: dock part should also be mentioned (and possibly explained) in the wiki. I had the same issue, feeling pretty stupid when I read all the comments and posts all over the internet, some more open, some rather hostile, all pointing at the single thing in wiki (layer: top) which just isn't enough apparently.