WayfireWM / wayfire

A modular and extensible wayland compositor
https://wayfire.org/
MIT License
2.35k stars 174 forks source link

wlsunset only has effect on the mirrored ouput, but not on the mirroring one #2089

Open je-vv opened 8 months ago

je-vv commented 8 months ago

Description I'm using wayfire 0.8.0 patched with commit output-layout: use wlr_texture_from_buffer directly and wlsunset 0.3.0. The patch is to allow mirroring to work. Then on wayfire.ini:

[output:eDP-1]
mode = enabled

[output:HDMI-A-4]
mode = mirror eDP-1

That actually makes the external HDMI monitor to mirror the laptop screen. Both use the same mode (same resolution and same frequency).

Bad thing, only on the output being mirrored (eDP-1), wlsunset has effect. wlsunset has no effect on the mirroring output (HDMI-A-4).

Running wlsunset with WAYLAND_DEBUG=1 shows:

[  50894.109]  -> wl_display@1.get_registry(new id wl_registry@2)
[  50894.117]  -> wl_display@1.sync(new id wl_callback@3)
[  50896.555] wl_display@1.delete_id(3)
[  50896.562] wl_registry@2.global(1, "wl_shm", 1)
[  50896.564] wl_registry@2.global(2, "wl_drm", 2)
[  50896.566] wl_registry@2.global(3, "zwp_linux_dmabuf_v1", 4)
[  50896.567] wl_registry@2.global(4, "wl_compositor", 5)
[  50896.568] wl_registry@2.global(5, "wl_subcompositor", 1)
[  50896.569] wl_registry@2.global(6, "wl_data_device_manager", 3)
[  50896.571] wl_registry@2.global(7, "zwp_primary_selection_device_manager_v1", 1)
[  50896.572] wl_registry@2.global(8, "zwlr_data_control_manager_v1", 2)
[  50896.573] wl_registry@2.global(9, "zwlr_output_manager_v1", 4)
[  50896.574] wl_registry@2.global(10, "zwlr_output_power_manager_v1", 1)
[  50896.576] wl_registry@2.global(11, "xdg_wm_base", 2)
[  50896.577] wl_registry@2.global(12, "zwlr_layer_shell_v1", 4)
[  50896.579] wl_registry@2.global(13, "zwp_tablet_manager_v2", 1)
[  50896.580] wl_registry@2.global(14, "wl_seat", 8)
[  50896.581] wl_registry@2.global(15, "zwlr_screencopy_manager_v1", 3)
[  50896.583] wl_registry@2.global(16, "zwlr_gamma_control_manager_v1", 1)
[  50896.585]  -> wl_registry@2.bind(16, "zwlr_gamma_control_manager_v1", 1, new id [unknown]@4)
[  50896.587] wl_registry@2.global(17, "zwlr_export_dmabuf_manager_v1", 1)
[  50896.588] wl_registry@2.global(18, "zxdg_output_manager_v1", 3)
[  50896.589] wl_registry@2.global(19, "zwlr_input_inhibit_manager_v1", 1)
[  50896.591] wl_registry@2.global(20, "org_kde_kwin_server_decoration_manager", 1)
[  50896.592] wl_registry@2.global(21, "zxdg_decoration_manager_v1", 1)
[  50896.593] wl_registry@2.global(22, "zwp_virtual_keyboard_manager_v1", 1)
[  50896.595] wl_registry@2.global(23, "zwlr_virtual_pointer_manager_v1", 2)
[  50896.596] wl_registry@2.global(24, "zwp_idle_inhibit_manager_v1", 1)
[  50896.597] wl_registry@2.global(25, "org_kde_kwin_idle", 1)
[  50896.598] wl_registry@2.global(26, "zwp_pointer_gestures_v1", 3)
[  50896.600] wl_registry@2.global(27, "zwp_relative_pointer_manager_v1", 1)
[  50896.601] wl_registry@2.global(28, "zwp_pointer_constraints_v1", 1)
[  50896.602] wl_registry@2.global(29, "zwp_input_method_manager_v2", 1)
[  50896.604] wl_registry@2.global(30, "zwp_text_input_manager_v3", 1)
[  50896.605] wl_registry@2.global(31, "wp_presentation", 1)
[  50896.606] wl_registry@2.global(32, "wp_viewporter", 1)
[  50896.607] wl_registry@2.global(33, "zxdg_exporter_v1", 1)
[  50896.609] wl_registry@2.global(34, "zxdg_importer_v1", 1)
[  50896.610] wl_registry@2.global(35, "zxdg_exporter_v2", 1)
[  50896.611] wl_registry@2.global(36, "zxdg_importer_v2", 1)
[  50896.612] wl_registry@2.global(37, "wl_output", 4)
registry: adding output 37
[  50896.615]  -> wl_registry@2.bind(37, "wl_output", 1, new id [unknown]@5)
[  50896.617]  -> zwlr_gamma_control_manager_v1@4.get_gamma_control(new id zwlr_gamma_control_v1@6, wl_output@5)
[  50896.618] wl_registry@2.global(38, "zwlr_foreign_toplevel_manager_v1", 3)
[  50896.620] wl_registry@2.global(39, "gtk_shell1", 3)
[  50896.621] wl_callback@3.done(914)
[  50896.623]  -> wl_display@1.sync(new id wl_callback@3)
[  50896.736] wl_display@1.delete_id(3)
[  50896.743] zwlr_gamma_control_v1@6.gamma_size(1024)
[  50896.768] wl_callback@3.done(914)
calculated sun trajectory: polar night
setting temperature on output '37' to 4000 K
[  50896.870]  -> zwlr_gamma_control_v1@6.set_gamma(fd 7)

I first filed a ticket on wlsunset Not working on mirroring monitor, which can work as a reference. But there it was mentioned:

... wlsunset is only being advised of one output here so it can only manage such.

Either wayfire is responsible for copying the gamma, or wlsunset must be made aware of all outputs.

... Wayfire only exposes one output in this setup, so we're doing all we can.

To Reproduce Set one output to mirror another one, and let wlsunset run. You'll notice only the mirrored (sort of original) output is affected by wlsunset. See the description before.

Expected behavior Both outputs should be affected by wlsunset.

Wayfire version wayfire 0.8.0 patched with commit output-layout: use wlr_texture_from_buffer directly and wlsunset 0.3.0.

Reference wlsunset ticket Not working on mirroring monitor

ammen99 commented 8 months ago

Yeah Wayfire ought to copy the gamma to all outputs that are being mirrored. It is our bug :)