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.83k stars 908 forks source link

VSCode context menu appears in the wrong window when windows are grouped in Hyprland #8035

Open HTSchoenfelder opened 1 month ago

HTSchoenfelder commented 1 month ago

Already reported ? *

Regression?

No

System Info and Version

System/Version info ```sh Hyprland, built from branch at commit 0d70c442538ba0d1efc63558c859c184367c95ad (). Date: 2024-10-08 Tag: , commits: 5306 built against aquamarine 0.4.1 flags: (if any) System Information: System name: Linux Node name: nixos Release: 6.6.54 Version: #1-NixOS SMP PREEMPT_DYNAMIC Fri Oct 4 14:30:05 UTC 2024 GPU information: 00:02.0 VGA compatible controller [0300]: Intel Corporation RocketLake-S GT1 [UHD Graphics 750] [8086:4c8a] (rev 04) (prog-if 00 [VGA controller]) os-release: ANSI_COLOR="1;34" BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues" BUILD_ID="24.11.20241006.c31898a" DOCUMENTATION_URL="https://nixos.org/learn.html" HOME_URL="https://nixos.org/" ID=nixos IMAGE_ID="" IMAGE_VERSION="" LOGO="nix-snowflake" NAME=NixOS PRETTY_NAME="NixOS 24.11 (Vicuna)" SUPPORT_URL="https://nixos.org/community.html" VERSION="24.11 (Vicuna)" VERSION_CODENAME=vicuna VERSION_ID="24.11" plugins: ======Config-Start====== Config File: /home/henrik/.config/hypr/hyprland.conf: Read Succeeded source = ~/.config/hypr/mocha.conf $mainMod = SUPER_L # env = NOTIFY,true bind = $mainMod, F1, exec, export NOTIFY=true && notify-send "Hyprland" "Notification enabled" bind = $mainMod, F2, exec, export NOTIFY=false && notify-send "Hyprland" "Notification disabled" bind = $mainMod, equal, exec, $HOME/.config/hypr/scripts/hallo.sh ################ ### MONITORS ### ################ source = ~/.config/hypr/hyprland.monitor.conf ############################## ### WINDOWS AND WORKSPACES ### ############################## #  exec-once = [workspace 1] kitty workspace = 1, defaultName:, monitor:$monitorMain, default:true bind = $mainMod, j, workspace, 1 bind = $mainMod SHIFT, j, movetoworkspace, 1 #  $projectA = ~/dotfiles workspace = 2, defaultName:, monitor:$monitorMain windowrulev2 = workspace 2 silent, class:^(code-url-handler)$ windowrulev2 = group, class:^(code-url-handler)$ bind = $mainMod, k, workspace, 2 bind = $mainMod SHIFT, k, movetoworkspace, 2 bind = $mainMod, a, focuswindow, title:^($projectA \| Code)$ bind = $mainMod, s, exec, $HOME/.config/hypr/scripts/shortcut-execute.sh "s" bind = $mainMod CTRL, s, exec, $HOME/.config/hypr/scripts/shortcut-set.sh "s" bind = $mainMod, d, exec, $HOME/.config/hypr/scripts/shortcut-execute.sh "d" bind = $mainMod CTRL, d, exec, $HOME/.config/hypr/scripts/shortcut-set.sh "d" bind = $mainMod, f, exec, $HOME/.config/hypr/scripts/shortcut-execute.sh "f" bind = $mainMod CTRL, f, exec, $HOME/.config/hypr/scripts/shortcut-set.sh "f" exec-once = code $projectA exec-once = $HOME/.config/hypr/scripts/launch-code-project.sh "s" exec-once = $HOME/.config/hypr/scripts/launch-code-project.sh "d" exec-once = $HOME/.config/hypr/scripts/launch-code-project.sh "f" # 󰖟 workspace = 3, defaultName:󰖟, monitor:$monitorMain windowrulev2 = workspace 3 silent, class:^(google-chrome)$ windowrulev2 = group, class:^(google-chrome)$ bind = $mainMod, l, workspace, 3 bind = $mainMod SHIFT, l, movetoworkspace, 3 bind = $mainMod, v, focuswindow, title:( \| default - Google Chrome) bind = $mainMod CTRL, v, exec, google-chrome-stable --force-dark-mode --profile-directory="Default" bind = $mainMod, c, focuswindow, title:( \| work - Google Chrome) bind = $mainMod CTRL, c, exec, google-chrome-stable --force-dark-mode --profile-directory="Profile 1" bind = $mainMod, x, focuswindow, title:( \| p1 - Google Chrome) bind = $mainMod CTRL, x, exec, google-chrome-stable --force-dark-mode --profile-directory="Profile 2" bind = $mainMod, z, focuswindow, title:( \| p2 - Google Chrome) bind = $mainMod CTRL, z, exec, google-chrome-stable --force-dark-mode --profile-directory="Profile 3" # exec-once = firefox -P defaultprofile # exec-once = google-chrome-stable --profile-directory="Default" # exec-once = google-chrome-stable --profile-directory="Profile 1" # exec-once = google-chrome-stable --profile-directory="Profile 2" # exec-once = google-chrome-stable --profile-directory="Profile 3" exec-once = $HOME/.config/hypr/scripts/launch-chrome-instances.sh #  workspace = 4, defaultName:, monitor:$monitorMain bind = $mainMod, semicolon, workspace, 4 bind = $mainMod SHIFT, semicolon, movetoworkspace, 4 exec-once = [workspace 4] obsidian # 󰻞 workspace = 5, defaultName:󰻞, monitor:$monitorMain windowrulev2 = workspace 5 silent, initialtitle:^(Teams) windowrulev2 = group, initialtitle:^(Teams) bind = $mainMod, u, workspace, 5 bind = $mainMod SHIFT, u, movetoworkspace, 5 # bind = $mainMod, i, exec, $HOME/.config/hypr/scripts/reset-submap.sh # bind = $mainMod, i, submap, groupselectteams # submap = groupselectteams # bind = $mainMod, i, changegroupactive, f # submap = reset exec-once = teams-for-linux exec-once = teams-for-linux --user-data-dir=/home/henrik/.local/share/teams-for-linux/instance2 #  workspace = 6, defaultName:, monitor:$monitorMain windowrulev2 = workspace 6 silent, initialtitle:^(Outlook) windowrulev2 = group, initialtitle:^(Outlook) bind = $mainMod, i, workspace, 6 bind = $mainMod SHIFT, i, movetoworkspace, 6 # exec-once = $HOME/.config/hypr/scripts/launch-firefox-pwa.sh "Outlook 1" # exec-once = $HOME/.config/hypr/scripts/launch-firefox-pwa.sh "Outlook 2" #  workspace = 7, defaultName:, monitor:$monitorMain windowrulev2 = workspace 7 silent, class:^(org.keepassxc.KeePassXC)$ bind = $mainMod, o, workspace, 7 bind = $mainMod SHIFT, o, movetoworkspace, 7 exec-once = keepassxc #  workspace = 8, defaultName:, monitor:$monitorMain windowrulev2 = workspace 8 silent, initialTitle:Spotify Premium bind = $mainMod, p, workspace, 8 bind = $mainMod SHIFT, p, movetoworkspace, 8 exec-once = spotify #  workspace = 9, defaultName:, monitor:$monitorMain bind = $mainMod, apostrophe, workspace, 9 bind = $mainMod SHIFT, apostrophe, movetoworkspace, 9 # 󰍹 workspace = 10, defaultName:󰍹, monitor:$monitorSide bind = $mainMod, backslash, workspace, 10 bind = $mainMod SHIFT, backslash, movetoworkspace, 10 workspace = special, monitor:$monitorMain bind = $mainMod, minus, togglespecialworkspace bind = $mainMod SHIFT, minus, movetoworkspacesilent, special windowrulev2 = suppressevent maximize, class:.* # You'll probably like this. # Clipse windowrulev2 = float, class:(clipse) windowrulev2 = size 622 652, class:(clipse) bind = $mainMod, equal, exec, kitty --class clipse -e clipse #################### ### KEYBINDINGSS ### #################### bind = $mainMod, r, exec, pkill tofi-drun || tofi-drun | xargs hyprctl dispatch exec -- bind = $mainMod SHIFT, r, exec, $HOME/.config/hypr/scripts/launcher-execute.sh bind = $mainMod, g, exec, $HOME/.config/hypr/scripts/launcher-focus-window.sh "| Code" bind = $mainMod SHIFT, g, exec, $HOME/.config/hypr/scripts/launcher-focus-window.sh "" bind = $mainMod, q, exec, $HOME/.config/hypr/scripts/launcher-snippets.sh bind = $mainMod SHIFT, q, exec, $HOME/.config/hypr/scripts/launcher-emojipicker.sh bind = $mainMod, SUPER_L, exec, $HOME/.config/hypr/scripts/hide-special-workspace.sh bind = $mainMod, t, exec, kitty bind = $mainMod, e, exec, nautilus bind = $mainMod, grave, exec, $HOME/.local/bin/grimblast copysave area $HOME/screenshots/$(date +'%F-%T.png') bind = $mainMod, backspace, workspace, previous bind = $mainMod, w, killactive bind = $mainMod, h, fullscreen bind = $mainMod, n, togglefloating bind = $mainMod, m, layoutmsg, rollnext bind = $mainMod SHIFT, m, layoutmsg, rollprev bind = $mainMod, comma, changegroupactive , f bind = $mainMod SHIFT, comma, changegroupactive, b # additionalactions bind = $mainMod, period, submap, additionalactions submap = additionalactions bind = , o, moveoutofgroup bind = , t, togglegroup bind = , left, moveintogroup, l bind = , right, moveintogroup, r bind = , up, moveintogroup, u bind = , down, moveintogroup, d bind = , s, movegroupwindow, f bind = , k, exec, pkill tofi bind = , c, layoutmsg, orientationcycle bind = , catchall, submap, reset submap = reset bind = $mainMod SHIFT, right, movecurrentworkspacetomonitor, $monitorMain bind = $mainMod SHIFT, left, movecurrentworkspacetomonitor, $monitorSide bind = $mainMod CTRL, y, exec, playerctl previous -p spotify bind = $mainMod SHIFT, y, exec, playerctl next -p spotify bind = $mainMod, y, exec, playerctl play-pause -p spotify # bind = $mainMod SHIFT, i, exec, playerctl stop --all-players # 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 # 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 # 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 # Scroll through existing workspaces with mainMod + scroll bind = $mainMod, mouse_down, workspace, e+1 bind = $mainMod, mouse_up, workspace, e-1 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow ############################# ### ENVIRONMENT VARIABLES ### ############################# env = HYPRCURSOR_THEME,catppuccin-mocha-mauve-cursors env = HYPRCURSOR_SIZE,28 env = XCURSOR_THEME,catppuccin-mocha-mauve-cursors env = XCURSOR_SIZE,28 env = ELECTRON_OZONE_PLATFORM_HINT,wayland env = XDG_CURRENT_DESKTOP,Hyprland env = XDG_SESSION_TYPE,wayland env = XDG_SESSION_DESKTOP,Hyprland env = XDG_CONFIG_HOME,$HOME/.config/ env = QT_QPA_PLATFORM,wayland env = QT_QPA_PLATFORMTHEME,qt5ct env = GTK_USE_PORTAL,1 env = GTK_THEME,Adwaita:dark env = GTK_FONT_NAME,"Agave Nerd Font" env = GDK_BACKEND,wayland env = SSH_AUTH_SOCK,$XDG_RUNTIME_DIR/ssh-agent.socket ################# ### AUTOSTART ### ################# exec-once = waybar exec-once = dunst exec-once = hyprpaper exec-once = clipse -listen exec-once = udiskie --tray exec-once = synology-drive start exec-once = eval "$(ssh-agent -a $XDG_RUNTIME_DIR/ssh-agent.socket)" exec-once = dconf write /org/gnome/desktop/interface/cursor-theme "'catppuccin-mocha-mauve-cursors'" exec-once = dconf write /org/gnome/desktop/interface/cursor-size 32 ##################### ### LOOK AND FEEL ### ##################### # https://wiki.hyprland.org/Configuring/Variables/#general general { gaps_in = 5 gaps_out = 10 border_size = 2 col.active_border = rgba($greenAlphaee) rgba($skyAlphaee) $mauve col.inactive_border = rgba(595959aa) resize_on_border = true allow_tearing = false layout = master } group { col.border_active = rgba($greenAlphaee) rgba($skyAlphaee) $mauve col.border_inactive = rgba(595959aa) groupbar { enabled = true col.active = rgba($lavenderAlphaEE) col.inactive = rgba($lavenderAlpha66) } } # https://wiki.hyprland.org/Configuring/Variables/#decoration decoration { rounding = 5 # Change transparency of focused and unfocused windows active_opacity = 0.9 inactive_opacity = 0.8 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 = true # 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_status = master mfact = 0.70 } # https://wiki.hyprland.org/Configuring/Variables/#misc misc { font_family = "Agave Nerd Font" force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers disable_hyprland_logo = false # If true disables the random hyprland logo / anime girl background. :( } ############# ### INPUT ### ############# # https://wiki.hyprland.org/Configuring/Variables/#input input { kb_layout = us kb_variant = altgr-intl kb_model = kb_options = kb_rules = follow_mouse = 1 sensitivity = 0 # -1.0 - 1.0, 0 means no modification. touchpad { natural_scroll = false } } Config File: /home/henrik/.config/hypr/mocha.conf: Read Succeeded $rosewater = rgb(f5e0dc) $rosewaterAlpha = f5e0dc $flamingo = rgb(f2cdcd) $flamingoAlpha = f2cdcd $pink = rgb(f5c2e7) $pinkAlpha = f5c2e7 $mauve = rgb(cba6f7) $mauveAlpha = cba6f7 $red = rgb(f38ba8) $redAlpha = f38ba8 $maroon = rgb(eba0ac) $maroonAlpha = eba0ac $peach = rgb(fab387) $peachAlpha = fab387 $yellow = rgb(f9e2af) $yellowAlpha = f9e2af $green = rgb(a6e3a1) $greenAlpha = a6e3a1 $teal = rgb(94e2d5) $tealAlpha = 94e2d5 $sky = rgb(89dceb) $skyAlpha = 89dceb $sapphire = rgb(74c7ec) $sapphireAlpha = 74c7ec $blue = rgb(89b4fa) $blueAlpha = 89b4fa $lavender = rgb(b4befe) $lavenderAlpha = b4befe $text = rgb(cdd6f4) $textAlpha = cdd6f4 $subtext1 = rgb(bac2de) $subtext1Alpha = bac2de $subtext0 = rgb(a6adc8) $subtext0Alpha = a6adc8 $overlay2 = rgb(9399b2) $overlay2Alpha = 9399b2 $overlay1 = rgb(7f849c) $overlay1Alpha = 7f849c $overlay0 = rgb(6c7086) $overlay0Alpha = 6c7086 $surface2 = rgb(585b70) $surface2Alpha = 585b70 $surface1 = rgb(45475a) $surface1Alpha = 45475a $surface0 = rgb(313244) $surface0Alpha = 313244 $base = rgb(1e1e2e) $baseAlpha = 1e1e2e $mantle = rgb(181825) $mantleAlpha = 181825 $crust = rgb(11111b) $crustAlpha = 11111b Config File: /home/henrik/.config/hypr/hyprland.monitor.conf: Read Succeeded ################ ### MONITORS ### ################ $monitorMain = HDMI-A-1 $monitorSide = HDMI-A-2 #monitor=,preferred,auto,auto monitor = $monitorMain, 1920x1080, 1920x0, 1 monitor = $monitorSide, 1920x1080, 0x0, 1 # ln -sf ~/dotfiles/home/.config/hypr/hyprland.monitor.desktop-pc.conf ~/.config/hypr/hyprland.monitor.conf ======Config-End======== ```

Description

I am experiencing an issue where the context menu in VSCode always appears in the wrong instance when multiple VSCode windows are grouped in Hyprland. If I right-click in any instance, the context menu consistently opens in the first window of the group, regardless of which window I right-click in. This issue does not occur if the VSCode instances are not grouped. The behavior suggests a problem with how context menus and grouped windows are managed in Hyprland.

I have tested the following:

How to reproduce

  1. Open two or more instances of VSCode.
  2. Group the VSCode windows together (via windows rule or manually).
  3. Right-click in any window other than the first in the group.
  4. Observe that the context menu opens in the first window of the group, not the window where the right-click occurred.

Crash reports, logs, images, videos

hyprland_logs.txt

Aqa-Ib commented 1 month ago

I can reproduce when running under Wayland. Under XWayland it works fine.

I am also able to reproduce it in Cosmic. This is a Electron bug, I guess.

HTSchoenfelder commented 1 month ago

Thank you for the feedback. I have to admit that I'm not very familiar with the inner workings of Hyprland or Electron, so I probably can't contribute much to solving this issue. However, it’s unfortunate that this problem prevents me from using the group feature in Hyprland with VS Code.

I’m curious about the assumption that this is an Electron bug. The issue seems to occur only under Hyprland when windows are grouped, while Electron apps outside of groups work fine. It feels like the context menu is treated like a kind of popup, and there might be an interaction with how popups are handled in Hyprland.

That being said, I appreciate your expertise and any support you can provide towards a solution!

Aqa-Ib commented 1 month ago

Thanks for your input, I have investigated this further and you seem to be correct.

First, I tried to reproduce it in Sway and I was not able to.

Then, I have been able to reproduce this with Nautilus and Dolphin popups too, so this is not a bug in VSCode or Electron, but in multiple grouped instances of the same program's popups.

So this seems like a bug in Hyprland indeed (and also in COSMIC).

Aqa-Ib commented 1 month ago

Sorry, I was definitely triggering a different popup bug with Dolphin and Nautilus.

So I think that this one is a Hyprland+Electron bug, given that I can't reproduce it on Qt, Gtk, nor Iced; and it does not happen on Sway.

Aqa-Ib commented 1 month ago

I can reproduce with other Electron programs like drawio.

I have reported it to COSMIC. Let see if together we can fix it. https://github.com/pop-os/cosmic-comp/issues/915