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
19.55k stars 821 forks source link

movewindow acts like swapwindow in dwindle layout #2804

Closed edward-shen closed 1 year ago

edward-shen commented 1 year ago

Hyprland Version

Hyprland, built from branch at commit b08b72358ad549fd066e5be0fc3aa4c9df367607 dirty (). Tag: v0.27.2 flags: (if any)

Bug or Regression?

Bug

Description

Hi! Trying Hyprland out as a sway/i3 user, so please bear with me if this isn't supported or is working as intended.

I'm trying to replicate the behavior where Shift + Mod + <direction> moves a window and changes the layout as if it was re-nested under that branch.

I use bind = SHIFT_$mainMod, H, movewindow, l to bind Shift + Super + H to move a window to the left, but when I do, it doesn't work as expected.

For example, given the following window layout:

Monitor 1
┌─────────────────────────────────────┐
│                                     │
│ ┌───────────────┐ ┌───────────────┐ │
│ │               │ │               │ │
│ │ App 1         │ │ App 2         │ │
│ │               │ │               │ │
│ │               │ │               │ │
│ │               │ └───────────────┘ │
│ │               │                   │
│ │               │ ┌───────────────┐ │
│ │               │ │               │ │
│ │               │ │ App 3         │ │
│ │               │ │ Active Window │ │
│ │               │ │               │ │
│ └───────────────┘ └───────────────┘ │
│                                     │
└─────────────────────────────────────┘

I expect the following window state:

Monitor 1
┌─────────────────────────────────────┐
│                                     │
│ ┌───────────────┐ ┌───────────────┐ │
│ │               │ │               │ │
│ │ App 1         │ │ App 2         │ │
│ │               │ │               │ │
│ │               │ │               │ │
│ └───────────────┘ │               │ │
│                   │               │ │
│ ┌───────────────┐ │               │ │
│ │               │ │               │ │
│ │ App 3         │ │               │ │
│ │ Active Window │ │               │ │
│ │               │ │               │ │
│ └───────────────┘ └───────────────┘ │
│                                     │
└─────────────────────────────────────┘

However, instead, I see this behavior:

Monitor 1
┌─────────────────────────────────────┐
│                                     │
│ ┌───────────────┐ ┌───────────────┐ │
│ │               │ │               │ │
│ │ App 3         │ │ App 2         │ │
│ │ Active Window │ │               │ │
│ │               │ │               │ │
│ │               │ └───────────────┘ │
│ │               │                   │
│ │               │ ┌───────────────┐ │
│ │               │ │               │ │
│ │               │ │ App 1         │ │
│ │               │ │               │ │
│ │               │ │               │ │
│ └───────────────┘ └───────────────┘ │
│                                     │
└─────────────────────────────────────┘

This result seems to be identical in behavior to swapwindow.

How to reproduce

Arch Linux

sudo pacman -Syu hyprland

Because I'm still trying out hypr, the config is still relatively vanilla.

hyprland.conf ``` monitor=,preferred,auto,auto monitor=DP-1,preferred,0x480,auto monitor=DP-2,preferred,2560x0,auto,transform,1 # See https://wiki.hyprland.org/Configuring/Keywords/ for more # Execute your favorite apps at launch # exec-once = waybar & hyprpaper & firefox # Source a file (multi-file configs) # source = ~/.config/hypr/myColors.conf # Some default env vars. env = XCURSOR_SIZE,24 # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ input { kb_layout = us kb_variant = kb_model = kb_options = kb_rules = # Cursor focus will be detached from keyboard focus. Clicking on a window # will move keyboard focus to that window. follow_mouse = 2 touchpad { natural_scroll = no } sensitivity = 0 # -1.0 - 1.0, 0 means no modification. } general { # See https://wiki.hyprland.org/Configuring/Variables/ for more gaps_in = 5 gaps_out = 20 border_size = 2 col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg col.inactive_border = rgba(595959aa) layout = dwindle } decoration { # See https://wiki.hyprland.org/Configuring/Variables/ for more rounding = 10 blur = yes blur_size = 3 blur_passes = 1 blur_new_optimizations = on drop_shadow = yes shadow_range = 4 shadow_render_power = 3 col.shadow = rgba(1a1a1aee) } animations { enabled = yes # Some 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 } dwindle { # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = yes # you probably want this } master { # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more new_is_master = true } gestures { # See https://wiki.hyprland.org/Configuring/Variables/ for more workspace_swipe = on workspace_swipe_fingers = 4 } # Example per-device config # See https://wiki.hyprland.org/Configuring/Keywords/#executing for more device:epic-mouse-v1 { sensitivity = -0.5 } # Example windowrule v1 # windowrule = float, ^(kitty)$ # Example windowrule v2 # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more windowrulev2=windowdance,title:^(Rhythm Doctor)$ # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bind = $mainMod, Return, exec, alacritty bind = $mainMod, C, killactive, bind = $mainMod, M, exit, bind = $mainMod, E, exec, dolphin bind = SHIFT_$mainMod, Space, togglefloating, bind = $mainMod, D, exec, kickoff bind = $mainMod, P, pseudo, # dwindle # bind = $mainMod, J, togglesplit, # dwindle # Move focus with mainMod + vim direction keys bind = $mainMod, H, movefocus, l bind = $mainMod, Left, movefocus, l bind = $mainMod, J, movefocus, d bind = $mainMod, Down, movefocus, d bind = $mainMod, K, movefocus, u bind = $mainMod, Up, movefocus, u bind = $mainMod, L, movefocus, r bind = $mainMod, Right, movefocus, r # Swap windows with shift + mainMod + vim direction keys bind = SHIFT_$mainMod, H, movewindow, l bind = SHIFT_$mainMod, Left, movewindow, l bind = SHIFT_$mainMod, J, movewindow, d bind = SHIFT_$mainMod, Down, movewindow, d bind = SHIFT_$mainMod, K, movewindow, u bind = SHIFT_$mainMod, Up, movewindow, u bind = SHIFT_$mainMod, L, movewindow, r bind = SHIFT_$mainMod, Right, movewindow, r # 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, 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 # 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 ```

Crash reports, logs, images, videos

No response

MightyPlaza commented 1 year ago

unsure what the behaviour should be on dwindle since that's up to vaxry but you may want to try hy3

vaxerski commented 1 year ago

by design. I have better move planned but havent gotten around to it