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.13k stars 884 forks source link

Possible bug with fractional scaling? #4600

Open Cloudef opened 8 months ago

Cloudef commented 8 months ago

Hyprland Version

System/Version info ```sh Hyprland, built from branch at commit 7447be822080fac5b8515a177773ec74b4d6c925 (). Date: 2024-02-02 Tag: flags: (if any) System Information: System name: Linux Node name: nixos Release: 6.6.13-xanmod1 Version: #1-NixOS SMP PREEMPT_DYNAMIC Tue Jan 1 00:00:00 UTC 1980 GPU information: 0c:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] [1002:731f] (rev ca) (prog-if 00 [VGA controller]) os-release: BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues" BUILD_ID="24.05.20240129.97b17f3" 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.05 (Uakari)" SUPPORT_URL="https://nixos.org/community.html" VERSION="24.05 (Uakari)" VERSION_CODENAME=uakari VERSION_ID="24.05" plugins: ```

Bug or Regression?

Bug

Description

Bemenu recently landed fractional scaling support that you can enable with BEMENU_WL_FRACTIONAL_SCALING=1. It's disabled for now because it seems to not work at least on hyprland.

How to reproduce

git clone https://github.com/Cloudef/bemenu.git
cd bemenu
BEMENU_WL_FRACTIONAL_SCALING=1 nix run .

Crash reports, logs, images, videos

Fails with output wp_fractional_scale_manager_v1@9: error 0: Fractional scale exists.

This error in protocol is described as:

    <enum name="error">
      <entry name="fractional_scale_exists" value="0"
        summary="the surface already has a fractional_scale object associated"/>
    </enum>

However the surface never had fractional scaling interface, but it was given for different surface before.

[1364355.467]  -> wl_display@1.get_registry(new id wl_registry@2)
[1364355.474]  -> wl_display@1.sync(new id wl_callback@3)
[1364355.540] wl_display@1.delete_id(3)
[1364355.543] wl_registry@2.global(1, "wl_shm", 1)
[1364355.546]  -> wl_registry@2.bind(1, "wl_shm", 1, new id [unknown]@4)
[1364355.548] wl_registry@2.global(2, "wl_drm", 2)
[1364355.550] wl_registry@2.global(3, "zwp_linux_dmabuf_v1", 4)
[1364355.552] wl_registry@2.global(4, "wl_compositor", 6)
[1364355.554]  -> wl_registry@2.bind(4, "wl_compositor", 4, new id [unknown]@5)
[1364355.558] wl_registry@2.global(5, "wl_subcompositor", 1)
[1364355.561] wl_registry@2.global(6, "wl_data_device_manager", 3)
[1364355.563] wl_registry@2.global(7, "zwlr_export_dmabuf_manager_v1", 1)
[1364355.565] wl_registry@2.global(8, "zwlr_data_control_manager_v1", 2)
[1364355.566] wl_registry@2.global(9, "zwp_primary_selection_device_manager_v1", 1)
[1364355.568] wl_registry@2.global(10, "wp_viewporter", 1)
[1364355.571]  -> wl_registry@2.bind(10, "wp_viewporter", 1, new id [unknown]@6)
[1364355.573] wl_registry@2.global(11, "zwlr_gamma_control_manager_v1", 1)
[1364355.575] wl_registry@2.global(12, "zwlr_output_power_manager_v1", 1)
[1364355.577] wl_registry@2.global(13, "xdg_wm_base", 6)
[1364355.579] wl_registry@2.global(14, "wl_seat", 9)
[1364355.581]  -> wl_registry@2.bind(14, "wl_seat", 7, new id [unknown]@7)
[1364355.584] wl_registry@2.global(15, "wp_presentation", 1)
[1364355.586] wl_registry@2.global(16, "ext_idle_notifier_v1", 1)
[1364355.588] wl_registry@2.global(17, "zwlr_layer_shell_v1", 4)
[1364355.590]  -> wl_registry@2.bind(17, "zwlr_layer_shell_v1", 2, new id [unknown]@8)
[1364355.592] wl_registry@2.global(18, "org_kde_kwin_server_decoration_manager", 1)
[1364355.594] wl_registry@2.global(19, "zxdg_decoration_manager_v1", 1)
[1364355.596] wl_registry@2.global(20, "zwlr_output_manager_v1", 4)
[1364355.598] wl_registry@2.global(21, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[1364355.600] wl_registry@2.global(22, "zwp_pointer_constraints_v1", 1)
[1364355.601] wl_registry@2.global(23, "zwp_relative_pointer_manager_v1", 1)
[1364355.603] wl_registry@2.global(24, "zwp_virtual_keyboard_manager_v1", 1)
[1364355.605] wl_registry@2.global(25, "zwlr_virtual_pointer_manager_v1", 2)
[1364355.607] wl_registry@2.global(26, "zwlr_foreign_toplevel_manager_v1", 3)
[1364355.609] wl_registry@2.global(27, "wp_drm_lease_device_v1", 1)
[1364355.612] wl_registry@2.global(28, "zwp_tablet_manager_v2", 1)
[1364355.614] wl_registry@2.global(29, "zwp_idle_inhibit_manager_v1", 1)
[1364355.616] wl_registry@2.global(30, "zxdg_exporter_v1", 1)
[1364355.618] wl_registry@2.global(31, "zxdg_importer_v1", 1)
[1364355.621] wl_registry@2.global(32, "zxdg_exporter_v2", 1)
[1364355.623] wl_registry@2.global(33, "zxdg_importer_v2", 1)
[1364355.625] wl_registry@2.global(34, "zwp_pointer_gestures_v1", 3)
[1364355.626] wl_registry@2.global(35, "zwp_text_input_manager_v3", 1)
[1364355.628] wl_registry@2.global(36, "zwp_input_method_manager_v2", 1)
[1364355.631] wl_registry@2.global(37, "xdg_activation_v1", 1)
[1364355.633] wl_registry@2.global(38, "ext_session_lock_manager_v1", 1)
[1364355.635] wl_registry@2.global(39, "wp_cursor_shape_manager_v1", 1)
[1364355.637] wl_registry@2.global(40, "wp_tearing_control_manager_v1", 1)
[1364355.640] wl_registry@2.global(41, "wp_single_pixel_buffer_manager_v1", 1)
[1364355.642] wl_registry@2.global(42, "xwayland_shell_v1", 1)
[1364355.644] wl_registry@2.global(43, "hyprland_toplevel_export_manager_v1", 2)
[1364355.646] wl_registry@2.global(44, "wp_fractional_scale_manager_v1", 1)
[1364355.648]  -> wl_registry@2.bind(44, "wp_fractional_scale_manager_v1", 1, new id [unknown]@9)
[1364355.651] wl_registry@2.global(45, "zwp_text_input_manager_v1", 1)
[1364355.654] wl_registry@2.global(46, "hyprland_global_shortcuts_manager_v1", 1)
[1364355.656] wl_registry@2.global(47, "zwlr_screencopy_manager_v1", 3)
[1364355.658] wl_registry@2.global(48, "zxdg_output_manager_v1", 3)
[1364355.660] wl_registry@2.global(49, "wl_output", 4)
[1364355.662]  -> wl_registry@2.bind(49, "wl_output", 4, new id [unknown]@10)
[1364355.664] wl_registry@2.global(50, "wl_output", 4)
[1364355.666]  -> wl_registry@2.bind(50, "wl_output", 4, new id [unknown]@11)
[1364355.669] wl_callback@3.done(1009)
[1364355.671]  -> wl_display@1.sync(new id wl_callback@3)
[1364355.764] wl_display@1.delete_id(3)
[1364355.776] wl_shm@4.format(0)
[1364355.780] wl_shm@4.format(1)
[1364355.782] wl_shm@4.format(875709016)
[1364355.785] wl_shm@4.format(875708993)
[1364355.788] wl_shm@4.format(875710274)
[1364355.790] wl_shm@4.format(842094674)
[1364355.792] wl_shm@4.format(842088786)
[1364355.795] wl_shm@4.format(892426322)
[1364355.798] wl_shm@4.format(892420434)
[1364355.801] wl_shm@4.format(909199186)
[1364355.803] wl_shm@4.format(808665688)
[1364355.806] wl_shm@4.format(808665665)
[1364355.808] wl_shm@4.format(1211384408)
[1364355.811] wl_shm@4.format(1211384385)
[1364355.813] wl_shm@4.format(942948952)
[1364355.815] wl_shm@4.format(942948929)
[1364355.816] wl_seat@7.name("seat0")
[1364355.818] wl_seat@7.capabilities(3)
[1364355.821]  -> wl_seat@7.get_keyboard(new id wl_keyboard@12)
[1364355.824]  -> wl_seat@7.get_pointer(new id wl_pointer@13)
[1364355.826] wl_output@10.geometry(0, 0, 340, 190, 0, "UGD", "Artisr15.6Pro", 0)
[1364355.829] wl_output@10.mode(1, 1920, 1080, 60042)
[1364355.831] wl_output@10.scale(1)
[1364355.833] wl_output@10.name("DP-1")
[1364355.835] wl_output@10.description("UGD Artisr15.6Pro 20200316 (DP-1 via HDMI)")
[1364355.837] wl_output@10.done()
[1364355.839] wl_output@11.geometry(0, 0, 590, 330, 0, "Dell Inc.", "DELL S2722DC", 0)
[1364355.842] wl_output@11.mode(1, 2560, 1440, 74983)
[1364355.844] wl_output@11.scale(1)
[1364355.845] wl_output@11.name("HDMI-A-1")
[1364355.847] wl_output@11.description("Dell Inc. DELL S2722DC B8N0HD3 (HDMI-A-1)")
[1364355.850] wl_output@11.done()
[1364355.851] wl_callback@3.done(1009)
[1364355.859]  -> wl_compositor@5.create_surface(new id wl_surface@3)
[1364355.862]  -> wp_fractional_scale_manager_v1@9.get_fractional_scale(new id wp_fractional_scale_v1@14, wl_surface@3)
[1364355.864]  -> wp_viewporter@6.get_viewport(new id wp_viewport@15, wl_surface@3)
[1364355.867]  -> zwlr_layer_shell_v1@8.get_layer_surface(new id zwlr_layer_surface_v1@16, wl_surface@3, nil, 3, "menu")
[1364355.870]  -> zwlr_layer_surface_v1@16.set_anchor(13)
[1364355.873]  -> zwlr_layer_surface_v1@16.set_size(0, 32)
[1364355.875]  -> wl_surface@3.commit()
[1364355.877]  -> wl_display@1.sync(new id wl_callback@17)
[1364355.968] wl_display@1.delete_id(17)
[1364355.974] wl_keyboard@12.keymap(1, fd 5, 66427)
[1364357.292] wl_keyboard@12.repeat_info(50, 600)
[1364357.297] wp_fractional_scale_v1@14.preferred_scale(120)
[1364357.299] zwlr_layer_surface_v1@16.configure(1010, 2560, 32)
[1364357.301]  -> zwlr_layer_surface_v1@16.ack_configure(1010)
[1364357.305] wp_fractional_scale_v1@14.preferred_scale(120)
[1364357.307] wl_callback@17.done(1010)
[1364357.309]  -> zwlr_layer_surface_v1@16.set_size(2560, 32)
[1364357.312]  -> zwlr_layer_surface_v1@16.set_exclusive_zone(0)
[1364357.313]  -> wl_surface@3.commit()
[1364357.316]  -> wl_display@1.sync(new id wl_callback@17)
[1364357.345] wl_display@1.delete_id(17)
[1364357.347] wp_fractional_scale_v1@14.preferred_scale(120)
[1364357.349] wl_callback@17.done(1010)
[1364357.351]  -> zwlr_layer_surface_v1@16.set_keyboard_interactivity(0)
[1364357.354]  -> wl_surface@3.commit()
[1364357.356]  -> wl_display@1.sync(new id wl_callback@17)
[1364357.373] wl_display@1.delete_id(17)
[1364357.375] wp_fractional_scale_v1@14.preferred_scale(120)
[1364357.377] wl_callback@17.done(1010)
[1364357.392]  -> zwlr_layer_surface_v1@16.destroy()
[1364357.394]  -> wl_surface@3.destroy()
[1364357.395]  -> wl_compositor@5.create_surface(new id wl_surface@17)
[1364357.398]  -> wp_fractional_scale_manager_v1@9.get_fractional_scale(new id wp_fractional_scale_v1@18, wl_surface@17)
[1364357.400]  -> wp_viewporter@6.get_viewport(new id wp_viewport@19, wl_surface@17)
[1364357.403]  -> zwlr_layer_shell_v1@8.get_layer_surface(new id zwlr_layer_surface_v1@20, wl_surface@17, nil, 3, "menu")
[1364357.405]  -> zwlr_layer_surface_v1@20.set_anchor(13)
[1364357.407]  -> zwlr_layer_surface_v1@20.set_size(0, 32)
[1364357.409]  -> wl_surface@17.commit()
[1364357.411]  -> wl_display@1.sync(new id wl_callback@21)
[1364357.471] wl_display@1.delete_id(16)
[1364357.473] wl_display@1.delete_id(3)
[1364357.475] wl_display@1.error(wp_fractional_scale_manager_v1@9, 0, "Fractional scale exists.")

Perhaps this is some sort of dangling wayland resource issue?

proycon commented 7 months ago

We run into this issue as well with wvkbd with this patch applied (without it works fine): https://git.sr.ht/~proycon/wvkbd/commit/d623a135ce05327e2ad5ff478b7a15941a195e75 . (the error may only reproduce on multi-monitor setups if there is one portrait one and one landscaped one, and wvkbd is opened on the former)

On wayfire and sway it is fine also with the patch.