~k0li


#85 Segmentation fault 1 year, 4 months ago

Comment by ~k0li on ~emersion/grim

Can I have grim take screenshots from only one monitor, so as to work around this?

The bug report on Hyprland is stuck

#85 Segmentation fault 1 year, 4 months ago

Comment by ~k0li on ~emersion/grim

But now the compositor is not advertising the external monitor anymore?

interface: 'zxdg_output_manager_v1',                     version:  3, name: 21
	xdg_output_v1
		output: 45
		name: 'eDP-1'
		description: 'AU Optronics 0xAF90 (eDP-1)'
		logical_x: 0, logical_y: 0
		logical_width: 1920, logical_height: 1080
interface: 'wl_output',                                  version:  4, name: 45
	name: eDP-1
	description: AU Optronics 0xAF90 (eDP-1)
	x: 0, y: 0, scale: 1,
	physical_width: 340 mm, physical_height: 190 mm,
	make: 'AU Optronics', model: '0xAF90',
	subpixel_orientation: unknown, output_transform: normal,
	mode:
		width: 1920 px, height: 1080 px, refresh: 144.149 Hz,
		flags: current

So when it worked you were not given the external monitor.

#85 Segmentation fault 1 year, 4 months ago

Comment by ~k0li on ~emersion/grim

Here it works:

❯ WAYLAND_DEBUG=1 ./build/grim
[2836790.541]  -> wl_display@1.get_registry(new id wl_registry@2)
[2836790.569]  -> wl_display@1.sync(new id wl_callback@3)
[2836792.627] wl_display@1.delete_id(3)
[2836792.651] wl_registry@2.global(1, "wl_shm", 1)
[2836792.663]  -> wl_registry@2.bind(1, "wl_shm", 1, new id [unknown]@4)
[2836792.669] wl_registry@2.global(2, "wl_drm", 2)
[2836792.673] wl_registry@2.global(3, "zwp_linux_dmabuf_v1", 4)
[2836792.676] wl_registry@2.global(4, "wl_compositor", 5)
[2836792.679] wl_registry@2.global(5, "wl_subcompositor", 1)
[2836792.683] wl_registry@2.global(6, "wl_data_device_manager", 3)
[2836792.686] wl_registry@2.global(7, "zwlr_export_dmabuf_manager_v1", 1)
[2836792.689] wl_registry@2.global(8, "zwlr_screencopy_manager_v1", 3)
[2836792.694]  -> wl_registry@2.bind(8, "zwlr_screencopy_manager_v1", 1, new id [unknown]@5)
[2836792.698] wl_registry@2.global(9, "zwlr_data_control_manager_v1", 2)
[2836792.701] wl_registry@2.global(10, "zwlr_gamma_control_manager_v1", 1)
[2836792.704] wl_registry@2.global(11, "zwp_primary_selection_device_manager_v1", 1)
[2836792.708] wl_registry@2.global(12, "wp_viewporter", 1)
[2836792.711] wl_registry@2.global(13, "zwlr_output_power_manager_v1", 1)
[2836792.715] wl_registry@2.global(14, "xdg_wm_base", 5)
[2836792.718] wl_registry@2.global(15, "wl_seat", 8)
[2836792.722] wl_registry@2.global(16, "wp_presentation", 1)
[2836792.725] wl_registry@2.global(17, "org_kde_kwin_idle", 1)
[2836792.729] wl_registry@2.global(18, "zwlr_layer_shell_v1", 4)
[2836792.732] wl_registry@2.global(19, "org_kde_kwin_server_decoration_manager", 1)
[2836792.736] wl_registry@2.global(20, "zxdg_decoration_manager_v1", 1)
[2836792.739] wl_registry@2.global(21, "zxdg_output_manager_v1", 3)
[2836792.743]  -> wl_registry@2.bind(21, "zxdg_output_manager_v1", 2, new id [unknown]@6)
[2836792.747] wl_registry@2.global(22, "zwlr_output_manager_v1", 4)
[2836792.750] wl_registry@2.global(23, "zwlr_input_inhibit_manager_v1", 1)
[2836792.758] wl_registry@2.global(24, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[2836792.762] wl_registry@2.global(25, "zext_workspace_manager_v1", 1)
[2836792.768] wl_registry@2.global(26, "zwp_pointer_constraints_v1", 1)
[2836792.774] wl_registry@2.global(27, "zwp_relative_pointer_manager_v1", 1)
[2836792.781] wl_registry@2.global(28, "zwp_virtual_keyboard_manager_v1", 1)
[2836792.788] wl_registry@2.global(29, "zwlr_virtual_pointer_manager_v1", 2)
[2836792.793] wl_registry@2.global(30, "zwlr_foreign_toplevel_manager_v1", 3)
[2836792.799] wl_registry@2.global(31, "wp_drm_lease_device_v1", 1)
[2836792.806] wl_registry@2.global(32, "zwp_tablet_manager_v2", 1)
[2836792.812] wl_registry@2.global(33, "zwp_idle_inhibit_manager_v1", 1)
[2836792.819] wl_registry@2.global(34, "zxdg_exporter_v1", 1)
[2836792.826] wl_registry@2.global(35, "zxdg_importer_v1", 1)
[2836792.833] wl_registry@2.global(36, "zxdg_exporter_v2", 1)
[2836792.839] wl_registry@2.global(37, "zxdg_importer_v2", 1)
[2836792.846] wl_registry@2.global(38, "zwp_pointer_gestures_v1", 3)
[2836792.852] wl_registry@2.global(39, "zwp_text_input_manager_v3", 1)
[2836792.858] wl_registry@2.global(40, "zwp_input_method_manager_v2", 1)
[2836792.865] wl_registry@2.global(41, "xdg_activation_v1", 1)
[2836792.871] wl_registry@2.global(42, "xwayland_shell_v1", 1)
[2836792.877] wl_registry@2.global(43, "hyprland_toplevel_export_manager_v1", 2)
[2836792.880] wl_registry@2.global(44, "wp_fractional_scale_manager_v1", 1)
[2836792.886] wl_registry@2.global(45, "wl_output", 4)
[2836792.896]  -> wl_registry@2.bind(45, "wl_output", 3, new id [unknown]@7)
[2836792.904] wl_callback@3.done(152)
[2836792.913]  -> zxdg_output_manager_v1@6.get_xdg_output(new id zxdg_output_v1@3, wl_output@7)
[2836792.923]  -> wl_display@1.sync(new id wl_callback@8)
[2836796.265] wl_display@1.delete_id(8)
[2836796.294] wl_output@7.geometry(0, 0, 340, 190, 0, "AU Optronics", "0xAF90", 0)
[2836796.304] wl_output@7.mode(1, 1920, 1080, 144149)
[2836796.309] wl_output@7.scale(1)
[2836796.314] wl_output@7.done()
[2836796.317] zxdg_output_v1@3.name("eDP-1")
[2836796.322] zxdg_output_v1@3.description("AU Optronics 0xAF90 (eDP-1)")
[2836796.326] zxdg_output_v1@3.logical_position(0, 0)
[2836796.335] zxdg_output_v1@3.logical_size(1920, 1080)
[2836796.340] zxdg_output_v1@3.done()
[2836796.344] wl_callback@8.done(152)
[2836796.354]  -> zwlr_screencopy_manager_v1@5.capture_output(new id zwlr_screencopy_frame_v1@8, 0, wl_output@7)
[2836796.557] zwlr_screencopy_frame_v1@8.buffer(1, 1920, 1080, 7680)
[2836796.669]  -> wl_shm@4.create_pool(new id wl_shm_pool@9, fd 5, 8294400)
[2836796.683]  -> wl_shm_pool@9.create_buffer(new id wl_buffer@10, 0, 1920, 1080, 7680, 1)
[2836796.690]  -> wl_shm_pool@9.destroy()
[2836796.699]  -> zwlr_screencopy_frame_v1@8.copy(wl_buffer@10)
[2836814.205] wl_display@1.delete_id(9)
[2836814.226] zwlr_screencopy_frame_v1@8.flags(0)
[2836814.230] zwlr_screencopy_frame_v1@8.ready(0, 70948, 700431766)
[2837066.194]  -> zwlr_screencopy_frame_v1@8.destroy()
[2837066.491]  -> wl_buffer@10.destroy()
[2837066.499]  -> zxdg_output_v1@3.destroy()
[2837066.501]  -> wl_output@7.release()
[2837066.503]  -> zwlr_screencopy_manager_v1@5.destroy()
[2837066.505]  -> zxdg_output_manager_v1@6.destroy()

#85 Segmentation fault 1 year, 4 months ago

Comment by ~k0li on ~emersion/grim

So you are telling me that when it works, the two monitors have the same logical position and logical size?

So now Hyprland decided it was proper to change the logical position of one of them for some reason?

#85 Segmentation fault 1 year, 4 months ago

Comment by ~k0li on ~emersion/grim

But when it works, because most of the time it works, I only capture one monitor.

I don't capture an image file with two monitors side-by-side that display the same thing.

I don't understand how that is possible, if we always captured both of them?

#85 Segmentation fault 1 year, 4 months ago

Comment by ~k0li on ~emersion/grim

I don't think you should try to capture both monitors if the external one is a mirror?

Why you don't capture just one of them?

#85 Segmentation fault 1 year, 4 months ago

Comment by ~k0li on ~emersion/grim

So I paste the following and the link to this issue in the hyprland issue report?

interface: 'zxdg_output_manager_v1',                     version:  3, name: 21
	xdg_output_v1
		output: 47
		name: 'HDMI-A-1'
		description: 'Samsung Electric Company C24F390 H4LT305839 (HDMI-A-1)'
		logical_x: -1337420, logical_y: -1337420
		logical_width: 1920, logical_height: 1080
	xdg_output_v1
		output: 45
		name: 'eDP-1'
		description: 'AU Optronics 0xAF90 (eDP-1)'
		logical_x: 0, logical_y: 0
		logical_width: 1920, logical_height: 1080

#85 Segmentation fault 1 year, 4 months ago

Comment by ~k0li on ~emersion/grim

This is the relevant config in my hyprland.conf file:

# MONITORS
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=eDP-1,preferred,auto,1
monitor=HDMI-A-1,preferred,auto,1,mirror,eDP-1

#85 Segmentation fault 1 year, 4 months ago

Comment by ~k0li on ~emersion/grim

I configured my external monitor HDMI-A-1 to mirror my laptop monitor, and in fact Hyprland only reports 1 monitor:

❯ hyprctl monitors
Monitor eDP-1 (ID 0):
	1920x1080@144.149002 at 0x0
	description: AU Optronics 0xAF90 (eDP-1)
	make: AU Optronics
	model: 0xAF90
	serial: 
	active workspace: 3 (3)
	reserved: 0 30 0 0
	scale: 1.00
	transform: 0
	focused: yes
	dpmsStatus: 1

Can you tell me how you figured out there was an external monitor too?

#85 Segmentation fault 1 year, 4 months ago

Comment by ~k0li on ~emersion/grim

and in order to don't have the error and take the screenshot we should .... ?