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.73k stars 901 forks source link

Window not rescalled after disabling monitor #7567

Open leiserfg opened 2 months ago

leiserfg commented 2 months ago

Regression?

Yes

System Info and Version

System/Version info ```sh Hyprland, built from branch at commit c5feee1e357f3c3c59ebe406630601c627807963 (). Date: 2024-08-16 Tag: , commits: c5feee1e357f3c3c59ebe406630601c627807963 flags: (if any) System Information: System name: Linux Node name: rahmen Release: 6.10.6 Version: #1-NixOS SMP PREEMPT_DYNAMIC Mon Aug 19 04:05:40 UTC 2024 GPU information: c1:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Phoenix1 [1002:15bf] (rev c4) (prog-if 00 [VGA controller]) os-release: ANSI_COLOR="1;34" BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues" BUILD_ID="24.11.20240821.c374d94" 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/leiserfg/.config/hypr/hyprland.conf: Read Succeeded exec-once = /nix/store/sb8wn0zw1mk1g4mny8mqmn9h8q0ldvjj-dbus-1.14.10/bin/dbus-update-activation-environment --systemd DISPLAY HYPRLAND_INSTANCE_SIGNATURE WAYLAND_DISPLAY XDG_CURRENT_DESKTOP && systemctl --user stop hyprland-session.target && systemctl --user start hyprland-session.target env = HYPRCURSOR_SIZE,16 env = HYPRCURSOR_THEME,Hypr-Bibata-Original-Classic env = XDG_CURRENT_DESKTOP,Hyprland env = XDG_SESSION_DESKTOP,Hyprland env = XDG_SESSION_TYPE,wayland $mod = SUPER # Move focus bind = $mod, H, movefocus, l bind = $mod, L, movefocus, r bind = $mod, K, movefocus, u bind = $mod, J, movefocus, d bind = $mod SHIFT, H, movewindow, l bind = $mod SHIFT, L, movewindow, r bind = $mod SHIFT, K, movewindow, u bind = $mod SHIFT, J, movewindow, d bind = $mod, Escape, killactive bind = $mod , X, exec, hyprctl kill # fn buttons binde=,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- binde=,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ bind =,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle bind =,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle binde=,XF86MonBrightnessUp, exec, /nix/store/xf3h3zcqy12k0812y33bilwwcn4bf6gx-light-1.2.2/bin/light -A 10 binde=,XF86MonBrightnessDown, exec, /nix/store/xf3h3zcqy12k0812y33bilwwcn4bf6gx-light-1.2.2/bin/light -U 10 # bind =,XF86AudioPlay, exec, playerctl play-pause # bind =,XF86AudioPrev, exec, playerctl previous # bind =,XF86AudioNext, exec, playerctl next # Move/resize windows with mod + LMB/RMB and dragging bindm = $mod, mouse:272, movewindow bindm = $mod, mouse:273, resizewindow bind=$mod,f,fullscreen bind = $mod, Slash, exec, firefox bind = $mod, Return, exec, kitty -1 bind = $mod, S, exec, sh -c "hyprctl monitors | grep eDP-1 && hyprctl keyword monitor eDP-1,disable || hyprctl keyword monitor eDP-1,preferred,auto,auto" bind = $mod,Print, exec, /nix/store/0whp8lirbwj3icd4wqxf0bf8bx691r8y-grimblast-unstable-2024-01-11/bin/grimblast save output bind = $mod+SHIFT,Print, exec, /nix/store/0whp8lirbwj3icd4wqxf0bf8bx691r8y-grimblast-unstable-2024-01-11/bin/grimblast save area bind = ,Print, exec, /nix/store/0whp8lirbwj3icd4wqxf0bf8bx691r8y-grimblast-unstable-2024-01-11/bin/grimblast copy output bind = SHIFT,Print, exec, /nix/store/0whp8lirbwj3icd4wqxf0bf8bx691r8y-grimblast-unstable-2024-01-11/bin/grimblast copy area bind = $mod, G, exec, game-picker bind = $mod, 0, exec, rofi_power bind = $mod, P, exec, rofi_power bind = $mod, D, exec, rofi-launch # workspaces bind = $mod, Q, workspace, 1 bind = $mod SHIFT, Q, movetoworkspace, 1 bind = $mod, 1, workspace, 1 bind = $mod SHIFT, 1, movetoworkspace, 1 bind = $mod, W, workspace, 2 bind = $mod SHIFT, W, movetoworkspace, 2 bind = $mod, 2, workspace, 2 bind = $mod SHIFT, 2, movetoworkspace, 2 bind = $mod, E, workspace, 3 bind = $mod SHIFT, E, movetoworkspace, 3 bind = $mod, 3, workspace, 3 bind = $mod SHIFT, 3, movetoworkspace, 3 bind = $mod, R, workspace, 4 bind = $mod SHIFT, R, movetoworkspace, 4 bind = $mod, 4, workspace, 4 bind = $mod SHIFT, 4, movetoworkspace, 4 bind = $mod, T, workspace, 5 bind = $mod SHIFT, T, movetoworkspace, 5 bind = $mod, 5, workspace, 5 bind = $mod SHIFT, 5, movetoworkspace, 5 bind = $mod, Y, workspace, 6 bind = $mod SHIFT, Y, movetoworkspace, 6 bind = $mod, 6, workspace, 6 bind = $mod SHIFT, 6, movetoworkspace, 6 bind = $mod, U, workspace, 7 bind = $mod SHIFT, U, movetoworkspace, 7 bind = $mod, 7, workspace, 7 bind = $mod SHIFT, 7, movetoworkspace, 7 bind = $mod, I, workspace, 8 bind = $mod SHIFT, I, movetoworkspace, 8 bind = $mod, 8, workspace, 8 bind = $mod SHIFT, 8, movetoworkspace, 8 bind = $mod, O, workspace, 9 bind = $mod SHIFT, O, movetoworkspace, 9 bind = $mod, 9, workspace, 9 bind = $mod SHIFT, 9, movetoworkspace, 9 general { layout = master gaps_out = 4 } cursor { inactive_timeout = 10 } misc { # enable_swallow = true # swallow_regex = ^(kitty)$ # disable_hyprland_logo = true # background_color=rgb(000000) } gestures { workspace_swipe = true workspace_swipe_fingers = 4 } master { no_gaps_when_only = 3 } binds { workspace_back_and_forth = true } xwayland { force_zero_scaling = true } input { kb_layout = us kb_variant = altgr-intl follow_mouse = 2 touchpad { disable_while_typing = true natural_scroll = true } } #RULES windowrule = workspace 1,firefox windowrule = workspace 4,org.telegram.desktop windowrule = center,pavucontrol windowrule = float,pavucontrol windowrule = pin,dragon windowrulev2 = idleinhibit fullscreen, fullscreen:1 # debug { # disable_logs = false # } layerrule = noanim,rofi layerrule = dimaround,rofi # here and not as a systemd unit so it inherits PATH # exec-once = hypridle exec-once = swaybg -i ~/wall.png -m fill ======Config-End======== ```

Description

Some windows don't rescale when they get adopted to another output because of output enabling/disabling.

How to reproduce

Two monitors with different resolutions and scales, open firefox in one of them and disable it. The instance of firefox will be adopted by the other monitor but it will look blurry. The same happens if the monitor is originally disabled and the firefox moves because of enabling it.

After more testing it seems like only GTK apps are affected, cause I tried with Telegram desktop (qt) and kitty (glfw) and they did scale, but Firefox and pcmanfm didn't.

The issue has been happening since aquamarine merge.

Crash reports, logs, images, videos

No response

leiserfg commented 2 months ago

I tried forcing the rescale with

 void CWindow::updateToplevel() {
-   updateSurfaceScaleTransformDetails();
+   updateSurfaceScaleTransformDetails(true);
}

But that didn't work, no idea why gtk is not "behaving" I remember it worked fine before aquamarine.

leiserfg commented 2 months ago

@vaxerski I have been trying to fix this myself without results, do you have any tip/pointer?

vaxerski commented 2 months ago

wayland_debug?

leiserfg commented 2 months ago

I stared with both monitors on : mon.txt Then focused on eDP-1 and ran

env WAYLAND_DEBUG=1 pcmanfm 2>&1 |tee /tmp/wayland.logs

which renders pcmanfm correctly, after that I turned off eDP-1 with hyprctl keyword monitor eDP-1,disable and pcmanfm moved to the Dell one rendering correctly.

Then I re-enabled eDP-1 with hyprctl keyword monitor eDP-1,preferred,auto,auto and it became blurry. As you can see, both monitors have the same scale, but not the same dpi. Wayland logs: wayland.logs.txt

leiserfg commented 1 month ago

More data: I'm using two monitors, both with scale >1.5 I'm using https://github.com/wmww/wayland-debug like this (for now on the_command):

python main.py -f "A: wl_surface.[set_buffer_scale]" -r pcmanfm  

If I have the external monitor connected (which in my seput disables the internal)
and then run the_command I get a lot of wl_surface@29a.set_buffer_scale(scale=2).

Then I enable the internal monitor and unplug the external which causes the workspace to move to the internal, I start getting: wl_surface@29a.set_buffer_scale(scale=1).

But if I stop the_command and start it again in that monitor it starts showing wl_surface@29a.set_buffer_scale(scale=2) .

If instead of turning monitors on and off, I move the window by hand from one monitor to the other I get wl_surface@29a.set_buffer_scale(scale=2) as I should.

leiserfg commented 1 month ago

Using movecurrentworkspacetomonitor also works as it should.

leiserfg commented 1 month ago

@vaxerski let me know if you need any other log.

carlo711 commented 2 weeks ago

+1