hyprwm / Hyprland

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

Monitor switches when using `workspace, previous_per_monitor` #6641

Open leon-erd opened 5 days ago

leon-erd commented 5 days ago

Regression?

No

System Info and Version

System/Version info ```sh Hyprland, built from branch at commit 7f09646ab8b5b6d9f835681d0af5d7a0dc29d8f1 (). Date: 2024-06-22 Tag: , commits: 7f09646ab8b5b6d9f835681d0af5d7a0dc29d8f1 flags: (if any) System Information: System name: Linux Node name: leon-inspiron Release: 6.9.6 Version: #1-NixOS SMP PREEMPT_DYNAMIC Fri Jun 21 12:40:40 UTC 2024 GPU information: 0000:00:02.0 VGA compatible controller [0300]: Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics] [8086:9a49] (rev 01) (prog-if 00 [VGA controller]) os-release: ANSI_COLOR="1;34" BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues" BUILD_ID="24.11.20240622.a71e967" 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/leon/.config/hypr/hyprland.conf: Read Succeeded exec-once = /nix/store/y29cbwfiwb9nyi4db4apk9dgylzdjm1v-dbus-1.14.10/bin/dbus-update-activation-environment --systemd --all && systemctl --user stop hyprland-session.target && systemctl --user start hyprland-session.target $mainMod=SUPER bezier=linear, 0, 0, 1, 1 source=./monitors.conf source=./workspaces.conf source=./monitors.conf source=./workspaces.conf binds { allow_workspace_cycles=yes } decoration { blur { ignore_opacity=true passes=4 popups=true size=4 special=true } rounding=5 } device { name=cust0000:00-04f3:2a4a-stylus output=eDP-1 } dwindle { force_split=2 preserve_split=true pseudotile=true } general { border_size=2 col.active_border=rgba(33ccffff) rgba(00ff99ff) 45deg col.inactive_border=rgba(444444aa) gaps_in=3 gaps_out=3 layout=master resize_on_border=true } gestures { workspace_swipe=true workspace_swipe_forever=true } group { groupbar { col.active=rgba(6600ccee) col.inactive=rgba(6600cc99) } col.border_active=rgba(8800ffff) rgba(aa0055ff) 45deg col.border_inactive=rgba(444444aa) } input { touchpad { drag_lock=true natural_scroll=true } kb_layout=de numlock_by_default=true } misc { animate_manual_resizes=true animate_mouse_windowdragging=true focus_on_activate=true force_default_wallpaper=0 initial_workspace_tracking=false new_window_takes_over_fullscreen=2 } animation=specialWorkspace, 1, 5, default, slidefadevert animation=borderangle, 1, 40, linear, loop animation=layers, 1, 5, default, popin bind=$mainMod, B, togglespecialworkspace, btop bind=$mainMod, H, togglespecialworkspace, htop bind=$mainMod, S, togglespecialworkspace, spotify bind=$mainMod, T, togglespecialworkspace, terminal bind=ALT, F4 , killactive, bind=$mainMod, F, togglefloating, bind=$mainMod, G, togglegroup bind=$mainMod, M, fullscreen, bind=$mainMod, E, exec, dolphin bind=, XF86Calculator , exec, qalculate-qt bind=$mainMod + SHIFT, left, movewindoworgroup, l bind=$mainMod + SHIFT, right, movewindoworgroup, r bind=$mainMod + SHIFT, up, movewindoworgroup, u bind=$mainMod + SHIFT, down, movewindoworgroup, d bind=$mainMod + CTRL, left, movecurrentworkspacetomonitor, l bind=$mainMod + CTRL, right, movecurrentworkspacetomonitor, r bind=$mainMod + CTRL, up, movecurrentworkspacetomonitor, u bind=$mainMod + CTRL, down, movecurrentworkspacetomonitor, d bind=$mainMod, RETURN, layoutmsg, swapwithmaster bind=$mainMod + SHIFT, RETURN, layoutmsg, addmaster bind=$mainMod + SHIFT + CTRL, RETURN, layoutmsg, removemaster bind=ALT, Tab, cyclenext, bind=ALT + CTRL, Tab, changegroupactive 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 bind=$mainMod, Tab, workspace, previous_per_monitor bind=$mainMod SHIFT, 1, movetoworkspacesilent, 1 bind=$mainMod SHIFT, 2, movetoworkspacesilent, 2 bind=$mainMod SHIFT, 3, movetoworkspacesilent, 3 bind=$mainMod SHIFT, 4, movetoworkspacesilent, 4 bind=$mainMod SHIFT, 5, movetoworkspacesilent, 5 bind=$mainMod SHIFT, 6, movetoworkspacesilent, 6 bind=$mainMod SHIFT, 7, movetoworkspacesilent, 7 bind=$mainMod SHIFT, 8, movetoworkspacesilent, 8 bind=$mainMod SHIFT, 9, movetoworkspacesilent, 9 bind=$mainMod SHIFT, 0, movetoworkspacesilent, 10 bind=$mainMod, mouse_down, workspace, e+1 bind=$mainMod, mouse_up, workspace, e-1 bind=CTRL + ALT, B, exec, ~/scripts/launch_waybar.sh bind=CTRL + ALT, W, exec, ~/scripts/wallpaper/update_wallpaper.sh bind=$mainMod, N, exec, swaync-client -t -sw bind=CTRL + ALT, S, exec, wl-paste | swappy -f - bind=, Print, exec, grimblast --notify --freeze copy area bind=$mainMod, P, exec, nwg-displays bind=$mainMod, V, exec, cliphist list | rofi -dmenu -theme /nix/store/r5gfsxb7srsncmxd996bh39ag8h64qcl-spotlight-dark.rasi | cliphist decode | wl-copy && wtype -M ctrl v -m ctrl bind=CTRL + ALT, T, exec, alacritty binde=$mainMod, left, resizeactive, -30 0 binde=$mainMod, right, resizeactive, 30 0 binde=$mainMod, up, resizeactive, 0 -30 binde=$mainMod, down, resizeactive, 0 30 bindl=, XF86AudioMute, exec, swayosd-client --output-volume mute-toggle bindl=, XF86AudioPlay, exec, playerctl play-pause bindl=, XF86AudioStop, exec, playerctl stop bindl=, XF86AudioPrev, exec, playerctl previous bindl=, XF86AudioNext, exec, playerctl next bindl=CTRL, left, exec, playerctl previous bindl=CTRL, right, exec, playerctl next bindle=, XF86AudioRaiseVolume, exec, pamixer --unmute; swayosd-client --output-volume raise bindle=, XF86MonBrightnessUp, exec, swayosd-client --brightness raise bindle=, XF86MonBrightnessDown, exec, swayosd-client --brightness lower bindle=, XF86AudioLowerVolume, exec, pamixer --unmute; swayosd-client --output-volume lower bindm=$mainMod, mouse:272, movewindow bindm=$mainMod, mouse:273, resizewindow bindr=$mainMod, $mainMod_L, exec, pkill --exact tofi-drun || tofi-drun --drun-launch=true bindr=$mainMod, L, exec, /nix/store/h53bah665mn9zvn5wfqznbvpfzawr1j1-hyprlock.sh env=XCURSOR_SIZE, 12 env=QT_QPA_PLATFORMTHEME, qt5ct env=XCURSOR_THEME, breeze_cursors env=XCURSOR_SIZE, 24 exec-once=sleep 5 && nextcloud --background exec-once=sleep 5 && ~/scripts/hibernate_on_low_battery.sh exec-once=sleep 5 && ~/scripts/restart_failed_systemd_user_services.sh exec-once=~/scripts/launch_waybar.sh exec-once=sleep 1 && swww init exec-once=sleep 2 && swww img --transition-type grow ~/scripts/wallpaper/wallpaper.jpg exec-once=swaync exec-once=rm ~/.cache/tofi-drun exec-once=/nix/store/qjfzpww5g3zahmb8gx3d5nm13irc81hd-polkit-kde-agent-1-5.27.11/libexec/polkit-kde-authentication-agent-1 exec-once=wl-paste --type text --watch cliphist store exec-once=wl-paste --type image --watch cliphist store layerrule=blur, waybar layerrule=blurpopups, waybar layerrule=ignorealpha 0.1, waybar layerrule=blur, swaync-control-center layerrule=blur, swaync-notification-window layerrule=ignorezero, swaync-control-center layerrule=ignorezero, swaync-notification-window layerrule=animation popin 90%, swaync-control-center layerrule=animation popin, swaync-notification-window layerrule=noanim, hyprpicker layerrule=noanim, selection layerrule=blur, launcher layerrule=animation slide, launcher layerrule=blur, swayosd layerrule=ignorezero, swayosd layerrule=animation slide, rofi layerrule=blur, rofi monitor=, preferred, auto, 1 windowrulev2=float, class:^(org.kde.polkit-kde-authentication-agent-1)$ windowrulev2=tile, class:^(DesktopEditors)$ windowrulev2=tag +vscode, class:^(code-url-handler)$ windowrulev2=tag +vscode, class:^(codium-url-handler)$ windowrulev2=opacity 0.85, tag:vscode windowrulev2=opacity 1.00, tag:vscode, title:.pdf windowrulev2=workspace 1, tag:vscode windowrulev2=workspace 5, class:^(firefox)$ windowrulev2=tag +social, class:^(org.telegram.desktop)$ windowrulev2=tag +social, class:^(Signal)$ windowrulev2=tag +social, class:^(Slack)$ windowrulev2=tag +social, class:^(thunderbird)$ windowrulev2=tag +social, class:^(WebCord)$ windowrulev2=tag +social, class:^(whatsapp-for-linux)$ windowrulev2=workspace 9, tag:social windowrulev2=noblur, class:^(org.kde.kdeconnect.daemon)$ windowrulev2=noborder, class:^(org.kde.kdeconnect.daemon)$ windowrulev2=noshadow, class:^(org.kde.kdeconnect.daemon)$ windowrulev2=noanim, class:^(org.kde.kdeconnect.daemon)$ windowrulev2=nofocus, class:^(org.kde.kdeconnect.daemon)$ windowrulev2=suppressevent fullscreen, class:^(org.kde.kdeconnect.daemon)$ windowrulev2=float, class:^(org.kde.kdeconnect.daemon)$ windowrulev2=move 0 0, class:^(org.kde.kdeconnect.daemon)$ windowrulev2=size 100% 100%, class:^(org.kde.kdeconnect.daemon)$ windowrulev2=noblur, onworkspace:special:hyprlock workspace=2, on-created-empty:dolphin workspace=5, on-created-empty:firefox workspace=special:btop, on-created-empty:[fullscreen] alacritty -e btop workspace=special:htop, border:false, on-created-empty:[float; size 100% 35%; move 0% 65%] alacritty -e htop workspace=special:spotify, on-created-empty:[fullscreen] spotify workspace=special:terminal, on-created-empty:[fullscreen] alacritty workspace=name:hyprlock, monitor:eDP-1 workspace=name:hyprlock, decorate:false workspace=name:hyprlock, border:false workspace=name:hyprlock, shadow:false workspace=special:hyprlock, monitor:eDP-1 workspace=special:hyprlock, decorate:false workspace=special:hyprlock, border:false workspace=special:hyprlock, shadow:false Config File: /home/leon/.config/hypr/monitors.conf: Read Succeeded # Generated by myKanshiPlus (2024-06-23 13:58:07.099108). Do not edit manually. monitor = desc:Dell Inc. DELL P2412H TTMDG2AQ15EU, preferred, 0x0, 1 monitor = desc:LG Display 0x0637, preferred, 3600x0, 1 monitor = desc:LG Electronics E2210 205NDMT1D051, preferred, 1920x0, 1 Config File: /home/leon/.config/hypr/workspaces.conf: Read Succeeded # Generated by myKanshiPlus (2024-06-23 13:58:07.099217). Do not edit manually. workspace = 1, monitor:desc:Dell Inc. DELL P2412H TTMDG2AQ15EU, default:true workspace = 10, monitor:desc:LG Display 0x0637, default:true workspace = 2, monitor:desc:LG Electronics E2210 205NDMT1D051, default:true Config File: /home/leon/.config/hypr/monitors.conf: Read Succeeded # Generated by myKanshiPlus (2024-06-23 13:58:07.099108). Do not edit manually. monitor = desc:Dell Inc. DELL P2412H TTMDG2AQ15EU, preferred, 0x0, 1 monitor = desc:LG Display 0x0637, preferred, 3600x0, 1 monitor = desc:LG Electronics E2210 205NDMT1D051, preferred, 1920x0, 1 Config File: /home/leon/.config/hypr/workspaces.conf: Read Succeeded # Generated by myKanshiPlus (2024-06-23 13:58:07.099217). Do not edit manually. workspace = 1, monitor:desc:Dell Inc. DELL P2412H TTMDG2AQ15EU, default:true workspace = 10, monitor:desc:LG Display 0x0637, default:true workspace = 2, monitor:desc:LG Electronics E2210 205NDMT1D051, default:true ======Config-End======== ```

Description

In a specific use case the dispatcher workspace, previous_per_monitor switches the monitor which is not expected from this dispatcher (see how to reproduce). Also https://github.com/hyprwm/Hyprland/issues/6545

How to reproduce

  1. go to monitor 1
  2. open two workspaces with apps on it
  3. use dispatcher movecurrentworkspacetomonitor to move one of the workspaces to monitor 2
  4. go back to monitor 1
  5. dispatcher workspace, previous_per_monitor will change to monitor 2 instead of staying on 1

Crash reports, logs, images, videos

@Truenya

Truenya commented 3 days ago

@leon-erd can u check please?

https://github.com/hyprwm/Hyprland/pull/6665

leon-erd commented 3 days ago

Now workspace, previous_per_monitor only switches workspace if there is no window open on the workspace corresponding to previous_per_monitor :sweat_smile:

Truenya commented 3 days ago

hmm, it looks like it's some kind of magic when no windows in the workspace = no monitor remembered

I'll try to look into it

Or it is "everything is broken" situation?

leon-erd commented 3 days ago

Maybe mark the PR as draft until you found a solution :)

Truenya commented 3 days ago

No)

It was some kind of brain lag

fixed

leon-erd commented 2 days ago

Can confirm that it works as intended now! :) Only thing that is left now:

  1. go to monitor 1 and open a workspace with an app on it (lets say ws number 1)
  2. go to monitor 2 and open a workspace with an app on it (lets say ws number 2)
  3. use dispatcher movecurrentworkspacetomonitor to move ws 2 to monitor 1
  4. on ws 2 the dispatcher workspace, previous_per_monitor will not change to ws 1 even though that's the previous ws on that monitor

But that's a minor thing :)

Truenya commented 2 days ago

can u please create new issue with that?)

rofe33 commented 2 days ago

Hello all,

I am quite confused a little with what workspace, previous_per_monitor does...

I was searching for a way to switch between workspaces back and forth, for example if I have 1 and 3 open and 1 is the previous of 3, I need to be able to do for example $mainMod, Tab which goes to 1 and then $mainMod, Tab goes back to 3. I wanted this feature per monitor.

I tried the dispatcher workspace, previous and it didn't work as I imagined to work. Today, (hyprland version 0.41.2), I tried the dispatcher workspace, previous_per_monitor, and it didn't work as I imagined to work.

I was using the focuscurrentorlast dispatcher for quite a while now that switch focus between current window and last focused window. I tried to created a focuscurrentorlastpermon dispatcher but I don't have that deep knowledge in cpp.

Currently when I use for example the dispatcher workspace, previous and I have 1 and 2, and then switched back to 3 from 1 and then go back to one and press $mainMod, Tab it doesn't go back to 3.

I don't know if this the way that the dispatcher workspace, previous or previous_per_monitor works. If I am mistaken, please let me know.

Truenya commented 2 days ago

@rofe33 I'm sorry, I didn't really understand the question

leon-erd commented 2 days ago

@rofe33 try setting

binds {
  allow_workspace_cycles=true
}

in your hyprland.conf

rofe33 commented 2 days ago

@rofe33 try setting

binds {
  allow_workspace_cycles=true
}

in your hyprland.conf

Thank you! This is how I want my setup to be :) I was just missing allow_workspace_cycles with previous_per_monitor. Thank you @Truenya for you contribution. Love your work.

Hope you are all doing well. God bless you all.