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

Toggling between pseudotile & floating mode reduces window size, even beyond limits #6051

Closed SpomJ closed 5 months ago

SpomJ commented 5 months ago

Hyprland Version

System/Version info ```sh Hyprland, built from branch main at commit 79a139c9495568f69dd995bce1ca579247a98a17 (flake.lock: update). Date: Mon Apr 15 23:57:27 2024 Tag: v0.39.0-12-g79a139c9, commits: 4456 flags: (if any) System Information: System name: Linux Node name: arch-btw Release: 6.8.9-arch1-2 Version: #1 SMP PREEMPT_DYNAMIC Tue, 07 May 2024 21:35:54 +0000 GPU information: 00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 620 [8086:5916] (rev 07) (prog-if 00 [VGA controller]) os-release: NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=archlinux-logo plugins: ```

Bug or Regression?

Bug

Description

Toggling between pseudotile & floating mode shrinks the window, even to the point where it's invisible.

How to reproduce

  1. Summon window
  2. Enable pseudotiling
  3. Toggle float
  4. Repeat 3., notice the shrinking (works best with animations disabled & borders set to 1 for some reason)

Crash reports, logs, images, videos

https://github.com/hyprwm/Hyprland/assets/75751809/a4e66f14-a33d-41f5-844b-f674844ce1b0

SpomJ commented 5 months ago

To be fair, it's quite a minor issue, but a seemingly quick fix is also quite obvious - just keep the size when toggling float from pseudotile (and in reverse).

ikalco commented 5 months ago

try with git first cause I can't reproduce

SpomJ commented 5 months ago

It may take specific configurations to reproduce. For me it works best when the window is pseudotile is slightly scaled down beforehand.

also it's git already.

ikalco commented 5 months ago

Hyprland, built from branch main at commit 79a139c9495568f69dd995bce1ca579247a98a17 (flake.lock: update). Date: Mon Apr 15 23:57:27 2024 Tag: v0.39.0-12-g79a139c9, commits: 4456

this is last month no?

For me it works best when the window is pseudotile is slightly scaled down beforehand.

I'll try

The-Briel-Deal commented 5 months ago

I can't reproduce either. Could you share a version of your config this happens with along with the corresponding commit you are on with the config.

SpomJ commented 5 months ago
Config: ``` source=~/.config/hypr/mocha.conf exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP # See https://wiki.hyprland.org/Configuring/Monitors/ monitor=eDP-1,1920x1080,0x0,1 monitor=,preferred,auto,1 # monitor = eDP-1,addreserved, 24,0,0,0 # monitor=eDP-1, disabled # monitor=HDMI-A-1,2560x1440@60,0x0,1.5 # monitor = ,addreserved, 0, 0, 0, 0 exec-once = waybar & hyprpaper & mako & firefox input { kb_layout = us,ru kb_variant = kb_model = kb_options = grp:caps_toggle kb_rules = follow_mouse = 1 accel_profile = adaptive touchpad { natural_scroll = yes disable_while_typing = no } sensitivity = 0 # -1.0 - 1.0, 0 means no modification. } general { gaps_in = 8 gaps_out = 16 border_size = 1 col.active_border = $mauve $maroon # rgba(33ccffee) rgba(00ff99ee) 45deg col.inactive_border = $surface0 #rgba(00000000) #rgba(595959aa) layout = dwindle } decoration { rounding = 0 #inactive_opacity = 0.85 dim_special = 0.7 blur { enabled = true size = 6 passes = 3 new_optimizations = on xray = off #contrast = 0.7 vibrancy_darkness = 0.2 special = 0 } drop_shadow = no #shadow_range = 30 shadow_render_power = 0 col.shadow = $base col.shadow_inactive = 0x00000000 } animations { enabled = yes bezier = myBezier, 0.05, 0.9, 0.1, 1.05 bezier = sine_in_out, 0.37, 0, 0.63, 1 bezier = overshot, 0.05, 0.9, 0.1, 1.1 bezier = test, 0, 0.5, 0.5, 1.5 animation = windows, 1, 5, test, popin 70% animation = windowsOut, 1, 5, sine_in_out, popin 80% animation = windowsMove, 1, 3, sine_in_out, popin animation = border, 1, 10, default animation = borderangle, 1, 8, default animation = fade, 1, 7, default animation = workspaces, 1, 7, overshot, slidefade 25% animation = specialWorkspace, 1, 5, overshot, slidefadevert 25% bezier = linear, 0.0, 0.0, 1.0, 1.0 animation = borderangle, 1, 100, linear, loop } group { col.border_active = $yellow col.border_inactive = $surface0 groupbar { gradients = false render_titles = false col.active = $green col.inactive = $overlay0 } } 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_forever = true } misc { } xwayland { force_zero_scaling = true } plugin { hyprwinwrap { # class is an EXACT match and NOT a regex! class = foot-bg } } bind = SUPER, grave, exec, hyprctl keyword animations:enabled off bind = SUPER, escape, exec, hyprctl keyword animations:enabled on plugin { hyprexpo { columns = 3 gap_size = 5 bg_col = rgb(111111) workspace_method = center current # [center/first] [workspace] e.g. first 1 or center m+1 enable_gesture = true # laptop touchpad, 4 fingers gesture_distance = 300 # how far is the "max" gesture_positive = true # positive = swipe down. Negative = swipe up. } } # 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 = bordercolor[ $rosewater $overlay2], pinned:1 windowrulev2 = float, title:^(nnn)$ windowrulev2 = float, class:^(float)$ #windowrulev2 = rounding 10, floating:1 workspace = w[t1], rounding:0, gapsout:0, windowrulev2 = dimaround, class:(gcr-prompter) windowrulev2 = dimaround, class:(xdg-desktop-portal-gtk) windowrulev2 = workspace 2, class:(firefox) windowrulev2 = workspace 4, class:(org.telegram.desktop) # windowrulev2 = nearestneighbor, class:(foot) layerrule = blur, (launcher) # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER $runner = tofi-drun -c ~/.config/tofi/config | sh # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bind = $mainMod, Q, exec, kitty bind = $mainMod SHIFT, Q, exec, kitty --class float bind = $mainMod, D, exec, pypr toggle term bind = $mainMod, C, killactive, bind = $mainMod, M, exit, bind = $mainMod, E, exec, foot -T nnn -e nnn bind = $mainMod, V, togglefloating, bind = $mainMod, R, exec, $runner bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, J, togglesplit, # dwindle bind = $mainMod, G, pin, bind = $mainMod SHIFT, W, togglegroup bind = $mainMod, W, changegroupactive, bind = $mainMod, B, exec, qutebrowser # Fullscreen bind = $mainMod, F, fullscreen, 0 bind = $mainMod ALT, F, fullscreen, 1 bind = $mainMod CTRL,F, fakefullscreen # Screenshot bind = , Print, exec, grim bind = SHIFT, Print, exec, hyprshot -m region bind = CTRL, Print, exec, hyprshot -m window # 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 windows bind = $mainMod SHIFT, left, swapwindow, l bind = $mainMod SHIFT, right, swapwindow, r bind = $mainMod SHIFT, up, swapwindow, u bind = $mainMod SHIFT, down, swapwindow, d # Resize windows binde = $mainMod SHIFT ALT, left, resizeactive, -16 0 binde = $mainMod SHIFT ALT, right, resizeactive, 16 0 binde = $mainMod SHIFT ALT, up, resizeactive, 0 -16 binde = $mainMod SHIFT ALT, down, resizeactive, 0 16 # 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 bind = $mainMod, S, togglespecialworkspace, 11 bind = $mainMod ALT, left, workspace, -1 bind = $mainMod ALT, right, workspace, +1 # bind = ,code:87, workspace, 1 # bind = ,code:88, workspace, 2 # bind = ,code:89, workspace, 3 # bind = ,code:83, workspace, 4 # bind = ,code:84, workspace, 5 # bind = ,code:85, workspace, 6 # bind = ,code:79, workspace, 7 # bind = ,code:80, workspace, 8 # bind = ,code:81, workspace, 9 # bind = ,code:90, workspace, 10 bind = , code:91, submap, panel submap = panel bind = , code:90, exec, wl-copy ghp_aOE5tImN0ttElL1n6youMyGh7OkenB2cg8y7 bind = , code:91, submap, reset submap = reset # 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 bind = $mainMod SHIFT, S, movetoworkspace, special:11 bind = $mainMod, Z, exec, ~/.config/hypr/scratchpad -t # 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 # MPD playback control bind = SHIFT, XF86AudioPlay, exec, mpc toggle bind = SHIFT, XF86AudioStop, exec, mpc stop bind = SHIFT, XF86AudioNext, exec, mpc next bind = SHIFT, XF86AudioPrev, exec, mpc prev ```

I'm currently updating hyprland-git to see if it was fixed

UPD: confirmed, it's still there

I'm not sure you got what I meant when I said scaling down. What I mean is just resizing it in pseudotile mode to be smaller than it was initially (not changing the cell size)

SpomJ commented 5 months ago

Here's another vid, as a sanity check

https://github.com/hyprwm/Hyprland/assets/75751809/d6f82914-905e-483f-a412-f6cd363331a7

The-Briel-Deal commented 5 months ago

I actually was able to Repro, I must have misunderstood earlier. I was floating the window below the pseudotile, but it works when resizing pseudotile. I'll make a fix.

The-Briel-Deal commented 5 months ago

Interestingly enough, something in my debug conf here makes it so that its not reproducible, but in my normal conf it is reproducible. Can you try testing with the hyprlandd.conf in the repo I sent you? (make sure to rename it to hyprland.conf if you are using a release build)

The-Briel-Deal commented 5 months ago

Oh yea, its just because I have windowrulev2=minsize 500 300, initialClass:^(kitty)$ in my debug config because that caused a bug in another issue lol. It looks like setting a minsize fixes this (which should be obvious lol). Going to try to figure out where the size is getting shrunk. Currently thinking this line is to blame. https://github.com/hyprwm/Hyprland/blob/2ead1fd22103ce065661555513bace5897083ded/src/events/Windows.cpp#L467

The-Briel-Deal commented 5 months ago

Should be fixed here https://github.com/hyprwm/Hyprland/pull/6143. If you could test @SpomJ that would be great. Lmk if this works for you.

SpomJ commented 5 months ago

yes