Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Transparent screenshots #17

Closed
DawidLoubser opened this issue Aug 6, 2018 · 20 comments
Closed

Transparent screenshots #17

DawidLoubser opened this issue Aug 6, 2018 · 20 comments
Labels
bug Something isn't working

Comments

@DawidLoubser
Copy link

Hi,

Grim just grabs fully-transparent images in latest wlroots + sway (Git master).
I also just built grim from source (using the grim-git AUR package for Arch).

Am I missing something?

@emersion
Copy link
Owner

emersion commented Aug 6, 2018

How do you invoke grim? Any error messages?

Works for me™.

@DawidLoubser
Copy link
Author

DawidLoubser commented Aug 6, 2018

Hmm, weird. Any of the ways which I invoke it... slurp | grim -g - /tmp/image.png or simply grim /tmp/image.png grabs a PNG image of the correct dimensions, but fully transparent. Also no error messages.

@DawidLoubser
Copy link
Author

BTW, I did forget to mention, this is running on a second (external) display, not laptop's built-in display. Might that be a factor?

@emersion
Copy link
Owner

emersion commented Aug 6, 2018

What is the output of swaymsg -t get_outputs?

@DawidLoubser
Copy link
Author

DawidLoubser commented Aug 6, 2018

$ swaymsg -t get_outputs
Output eDP-1 'Unknown 0x61ED 0x00000000'
  Current mode: 1920x1080 @ 60.051998 Hz
  Position: 3840,0
  Scale factor: 1x
  Transform: normal
  Workspace: 9
  Available modes:
    640x350 @ 59.842999 Hz
    640x400 @ 59.964001 Hz
<snip>
    1920x1080 @ 60.051998 Hz

Output DP-1 'Dell Inc. DELL S2817Q J42MC81N098I'
  Current mode: 3840x2160 @ 59.997002 Hz
  Position: 0,0
  Scale factor: 1x
  Transform: normal
  Workspace: 1
  Available modes:
    720x400 @ 70.082001 Hz
    640x480 @ 59.939999 Hz
<snip>
    2560x1440 @ 59.951000 Hz
    1920x2160 @ 59.987999 Hz
    3840x2160 @ 29.981001 Hz
    3840x2160 @ 59.997002 Hz

@PluMGMK
Copy link

PluMGMK commented Aug 9, 2018

FWIW I've got exactly the same issue.

$ swaymsg -t get_outputs
Output DVI-I-1 'Acer Technologies S220HQL LYKEE0108517'
  Current mode: 1920x1080 @ 60.000000 Hz
  Position: 0,0
  Scale factor: 1x
  Transform: normal
  Workspace: 3
  Available modes:
    720x400 @ 70.082001 Hz
    640x480 @ 59.939999 Hz
    640x480 @ 66.667000 Hz
    640x480 @ 72.808998 Hz
    640x480 @ 75.000000 Hz
    800x600 @ 56.250000 Hz
    800x600 @ 60.317001 Hz
    800x600 @ 72.188004 Hz
    800x600 @ 75.000000 Hz
    832x624 @ 74.551003 Hz
    1024x768 @ 60.004002 Hz
    1024x768 @ 70.069000 Hz
    1024x768 @ 75.028999 Hz
    1280x720 @ 60.000000 Hz
    1152x864 @ 75.000000 Hz
    1280x800 @ 59.910000 Hz
    1280x960 @ 60.000000 Hz
    1440x900 @ 59.901001 Hz
    1280x1024 @ 60.020000 Hz
    1280x1024 @ 75.025002 Hz
    1680x1050 @ 59.882999 Hz
    1920x1080 @ 60.000000 Hz


@emersion
Copy link
Owner

emersion commented Aug 9, 2018

Can you try the screencopy example in wlroots? You can do so by compiling wlroots and then running build/examples/screencopy.

@PluMGMK
Copy link

PluMGMK commented Aug 9, 2018

That's actually giving me the same result, all right…

@emersion
Copy link
Owner

emersion commented Aug 9, 2018

Can you try with WAYLAND_DEBUG=1? Can you check sway's logs too?

@PluMGMK
Copy link

PluMGMK commented Aug 10, 2018

Nothing jumps out at me here.

$ WAYLAND_DEBUG=1 grim wayland-screenshot.png 
[2409459.153]  -> wl_display@1.get_registry(new id wl_registry@2)
[2409459.249] wl_registry@2.global(1, "wl_shm", 1)
[2409459.283]  -> wl_registry@2.bind(1, "wl_shm", 1, new id [unknown]@3)
[2409459.298] wl_registry@2.global(2, "wl_drm", 2)
[2409459.308] wl_registry@2.global(3, "wl_compositor", 4)
[2409459.317] wl_registry@2.global(4, "wl_subcompositor", 1)
[2409459.326] wl_registry@2.global(5, "wl_data_device_manager", 3)
[2409459.335] wl_registry@2.global(6, "gamma_control_manager", 1)
[2409459.345] wl_registry@2.global(7, "zwlr_gamma_control_manager_v1", 1)
[2409459.356] wl_registry@2.global(8, "gtk_primary_selection_device_manager", 1)
[2409459.367] wl_registry@2.global(9, "zxdg_output_manager_v1", 2)
[2409459.376]  -> wl_registry@2.bind(9, "zxdg_output_manager_v1", 2, new id [unknown]@4)
[2409459.389] wl_registry@2.global(10, "org_kde_kwin_idle", 1)
[2409459.399] wl_registry@2.global(11, "zwp_idle_inhibit_manager_v1", 1)
[2409459.407] wl_registry@2.global(12, "zwlr_layer_shell_v1", 1)
[2409459.418] wl_registry@2.global(13, "zxdg_shell_v6", 1)
[2409459.427] wl_registry@2.global(14, "xdg_wm_base", 2)
[2409459.438] wl_registry@2.global(15, "org_kde_kwin_server_decoration_manager", 1)
[2409459.448] wl_registry@2.global(16, "zwp_linux_dmabuf_v1", 3)
[2409459.457] wl_registry@2.global(17, "zwlr_export_dmabuf_manager_v1", 1)
[2409459.468] wl_registry@2.global(18, "zwlr_screencopy_manager_v1", 1)
[2409459.477]  -> wl_registry@2.bind(18, "zwlr_screencopy_manager_v1", 1, new id [unknown]@5)
[2409459.491] wl_registry@2.global(19, "wl_seat", 6)
[2409459.500] wl_registry@2.global(20, "zwp_virtual_keyboard_manager_v1", 1)
[2409459.510] wl_registry@2.global(21, "zwlr_input_inhibit_manager_v1", 1)
[2409459.520] wl_registry@2.global(22, "wl_output", 3)
[2409459.532]  -> wl_registry@2.bind(22, "wl_output", 3, new id [unknown]@6)
[2409459.548]  -> wl_display@1.sync(new id wl_callback@7)
[2409459.611] wl_display@1.delete_id(7)
[2409459.621] wl_output@6.geometry(0, 0, 477, 268, 0, "Acer Technologies", "S220HQL", 0)
[2409459.645] wl_output@6.mode(0, 720, 400, 70082)
[2409459.657] wl_output@6.mode(0, 640, 480, 59940)
[2409459.667] wl_output@6.mode(0, 640, 480, 66667)
[2409459.679] wl_output@6.mode(0, 640, 480, 72809)
[2409459.690] wl_output@6.mode(0, 640, 480, 75000)
[2409459.702] wl_output@6.mode(0, 800, 600, 56250)
[2409459.714] wl_output@6.mode(0, 800, 600, 60317)
[2409459.724] wl_output@6.mode(0, 800, 600, 72188)
[2409459.736] wl_output@6.mode(0, 800, 600, 75000)
[2409459.752] wl_output@6.mode(0, 832, 624, 74551)
[2409459.762] wl_output@6.mode(0, 1024, 768, 60004)
[2409459.774] wl_output@6.mode(0, 1024, 768, 70069)
[2409459.787] wl_output@6.mode(0, 1024, 768, 75029)
[2409459.798] wl_output@6.mode(0, 1280, 720, 60000)
[2409459.809] wl_output@6.mode(0, 1152, 864, 75000)
[2409459.823] wl_output@6.mode(0, 1280, 800, 59910)
[2409459.833] wl_output@6.mode(0, 1280, 960, 60000)
[2409459.844] wl_output@6.mode(0, 1440, 900, 59901)
[2409459.856] wl_output@6.mode(0, 1280, 1024, 60020)
[2409459.868] wl_output@6.mode(0, 1280, 1024, 75025)
[2409459.879] wl_output@6.mode(0, 1680, 1050, 59883)
[2409459.890] wl_output@6.mode(1, 1920, 1080, 60000)
[2409459.900] wl_output@6.scale(1)
[2409459.905] wl_output@6.done()
[2409459.909] wl_callback@7.done(15)
[2409459.917]  -> zxdg_output_manager_v1@4.get_xdg_output(new id zxdg_output_v1@7, wl_output@6)
[2409459.951] zxdg_output_v1@7.logical_position(0, 0)
[2409459.961] zxdg_output_v1@7.logical_size(1920, 1080)
[2409459.967] zxdg_output_v1@7.name("DVI-I-1")
[2409459.973] zxdg_output_v1@7.description("Acer Technologies S220HQL LYKEE0108517 (DVI-I-1)")
[2409459.979] zxdg_output_v1@7.done()
[2409459.984]  -> wl_display@1.sync(new id wl_callback@8)
[2409460.009] wl_display@1.delete_id(8)
[2409460.017] wl_callback@8.done(15)
[2409460.021]  -> zwlr_screencopy_manager_v1@5.capture_output(new id zwlr_screencopy_frame_v1@8, 1, wl_output@6)
[2409460.049] zwlr_screencopy_frame_v1@8.buffer(1, 1920, 1080, 7680)
[2409460.087]  -> wl_shm@3.create_pool(new id wl_shm_pool@9, fd 5, 8294400)
[2409460.100]  -> wl_shm_pool@9.create_buffer(new id wl_buffer@10, 0, 1920, 1080, 7680, 1)
[2409460.118]  -> wl_shm_pool@9.destroy()
[2409460.129]  -> zwlr_screencopy_frame_v1@8.copy(wl_buffer@10)
[2409473.110] wl_display@1.delete_id(9)
[2409473.138] zwlr_screencopy_frame_v1@8.flags(1)
[2409473.144] zwlr_screencopy_frame_v1@8.ready(0, 15359, 448424749)
[2409653.839]  -> zwlr_screencopy_frame_v1@8.destroy()
[2409654.117]  -> wl_buffer@10.destroy()
[2409654.126]  -> zxdg_output_v1@7.destroy()
[2409654.133]  -> wl_output@6.release()
[2409654.136]  -> zwlr_screencopy_manager_v1@5.destroy()
[2409654.140]  -> zxdg_output_manager_v1@4.destroy()

Nothing comes up in sway's logs upon running grim either, when running in verbose mode.

@emersion
Copy link
Owner

Damn, this is pretty weird. Since this is a wlroots issue, can you create a new issue on the wlroots tracker and link this one? Can you also include your graphics card model and the graphics driver you use?

@DawidLoubser Graphics card, driver?

@PluMGMK
Copy link

PluMGMK commented Aug 10, 2018

Okay, so as I mentioned at the new issue swaywm/wlroots#1186, my card is a GeForce GTX 970, and I use nouveau (bad combination I know!).

@emersion
Copy link
Owner

swaywm/wlroots#1186 (comment)

@emersion emersion changed the title Doesn't seem to be working on latest wlroots + sway Transparent screenshots Aug 13, 2018
@emersion emersion added the bug Something isn't working label Aug 13, 2018
@bbigras
Copy link

bbigras commented Dec 11, 2018

I also have transparent screenshots. Should I open a new issue?

NVIDIA Quadro FX 580 with nouveau. Dual screen.

I'm using 9c2e630.
wlroots swaywm/wlroots@c70b8f6

@emersion
Copy link
Owner

Can you post a log of grim with the env variable WAYLAND_DEBUG=client set?

@bbigras
Copy link

bbigras commented Dec 11, 2018

grim.log
$ WAYLAND_DEBUG=client grim test.png
[4004904.037]  -> wl_display@1.get_registry(new id wl_registry@2)
[4004904.184] wl_registry@2.global(1, "wl_shm", 1)
[4004904.217]  -> wl_registry@2.bind(1, "wl_shm", 1, new id [unknown]@3)
[4004904.253] wl_registry@2.global(2, "zwp_linux_dmabuf_v1", 3)
[4004904.279] wl_registry@2.global(3, "wl_drm", 2)
[4004904.305] wl_registry@2.global(4, "wl_compositor", 4)
[4004904.331] wl_registry@2.global(5, "wl_subcompositor", 1)
[4004904.356] wl_registry@2.global(6, "wl_data_device_manager", 3)
[4004904.391] wl_registry@2.global(7, "gamma_control_manager", 1)
[4004904.419] wl_registry@2.global(8, "zwlr_gamma_control_manager_v1", 1)
[4004904.444] wl_registry@2.global(9, "gtk_primary_selection_device_manager", 1)
[4004904.470] wl_registry@2.global(10, "zxdg_output_manager_v1", 2)
[4004904.496]  -> wl_registry@2.bind(10, "zxdg_output_manager_v1", 2, new id [unknown]@4)
[4004904.532] wl_registry@2.global(11, "org_kde_kwin_idle", 1)
[4004904.558] wl_registry@2.global(12, "zwp_idle_inhibit_manager_v1", 1)
[4004904.583] wl_registry@2.global(13, "zwlr_layer_shell_v1", 1)
[4004904.609] wl_registry@2.global(14, "zxdg_shell_v6", 1)
[4004904.634] wl_registry@2.global(15, "xdg_wm_base", 2)
[4004904.660] wl_registry@2.global(16, "org_kde_kwin_server_decoration_manager", 1)
[4004904.686] wl_registry@2.global(17, "zxdg_decoration_manager_v1", 1)
[4004904.711] wl_registry@2.global(18, "wp_presentation", 1)
[4004904.737] wl_registry@2.global(19, "zwlr_export_dmabuf_manager_v1", 1)
[4004904.763] wl_registry@2.global(20, "zwlr_screencopy_manager_v1", 1)
[4004904.789]  -> wl_registry@2.bind(20, "zwlr_screencopy_manager_v1", 1, new id [unknown]@5)
[4004904.825] wl_registry@2.global(21, "zwp_virtual_keyboard_manager_v1", 1)
[4004904.851] wl_registry@2.global(22, "zwlr_input_inhibit_manager_v1", 1)
[4004904.876] wl_registry@2.global(23, "wl_seat", 6)
[4004904.902] wl_registry@2.global(24, "wl_output", 3)
[4004904.929]  -> wl_registry@2.bind(24, "wl_output", 3, new id [unknown]@6)
[4004904.964] wl_registry@2.global(25, "wl_output", 3)
[4004904.991]  -> wl_registry@2.bind(25, "wl_output", 3, new id [unknown]@7)
[4004905.027]  -> wl_display@1.sync(new id wl_callback@8)
[4004905.142] wl_display@1.delete_id(8)
[4004905.157] wl_output@6.geometry(0, 0, 433, 271, 0, "Acer Technologies", "AL2016W", 0)
[4004905.215] wl_output@6.mode(0, 720, 400, 70082)
[4004905.248] wl_output@6.mode(0, 640, 480, 59940)
[4004905.280] wl_output@6.mode(0, 640, 480, 66667)
[4004905.312] wl_output@6.mode(0, 640, 480, 72809)
[4004905.344] wl_output@6.mode(0, 640, 480, 75000)
[4004905.376] wl_output@6.mode(0, 800, 600, 56250)
[4004905.420] wl_output@6.mode(0, 800, 600, 60317)
[4004905.452] wl_output@6.mode(0, 800, 600, 72188)
[4004905.484] wl_output@6.mode(0, 800, 600, 75000)
[4004905.516] wl_output@6.mode(0, 832, 624, 74551)
[4004905.548] wl_output@6.mode(0, 1024, 768, 60004)
[4004905.580] wl_output@6.mode(0, 1024, 768, 70069)
[4004905.611] wl_output@6.mode(0, 1024, 768, 75029)
[4004905.643] wl_output@6.mode(0, 1152, 864, 75000)
[4004905.675] wl_output@6.mode(0, 1366, 768, 59949)
[4004905.706] wl_output@6.mode(0, 1280, 960, 60000)
[4004905.738] wl_output@6.mode(0, 1440, 900, 59901)
[4004905.770] wl_output@6.mode(0, 1440, 900, 74984)
[4004905.801] wl_output@6.mode(0, 1280, 1024, 75025)
[4004905.833] wl_output@6.mode(0, 1400, 1050, 59948)
[4004905.865] wl_output@6.mode(0, 1600, 1200, 60000)
[4004905.896] wl_output@6.mode(1, 1680, 1050, 59954)
[4004905.928] wl_output@6.scale(1)
[4004905.941] wl_output@6.done()
[4004905.951] wl_output@7.geometry(1680, 0, 433, 271, 0, "Acer Technologies", "AL2016W", 0)
[4004906.008] wl_output@7.mode(0, 720, 400, 70082)
[4004906.039] wl_output@7.mode(0, 640, 480, 59940)
[4004906.071] wl_output@7.mode(0, 640, 480, 66667)
[4004906.103] wl_output@7.mode(0, 640, 480, 72809)
[4004906.135] wl_output@7.mode(0, 640, 480, 75000)
[4004906.166] wl_output@7.mode(0, 800, 600, 56250)
[4004906.198] wl_output@7.mode(0, 800, 600, 60317)
[4004906.230] wl_output@7.mode(0, 800, 600, 72188)
[4004906.261] wl_output@7.mode(0, 800, 600, 75000)
[4004906.293] wl_output@7.mode(0, 832, 624, 74551)
[4004906.333] wl_output@7.mode(0, 1024, 768, 60004)
[4004906.365] wl_output@7.mode(0, 1024, 768, 70069)
[4004906.403] wl_output@7.mode(0, 1024, 768, 75029)
[4004906.435] wl_output@7.mode(0, 1152, 864, 75000)
[4004906.467] wl_output@7.mode(0, 1366, 768, 59949)
[4004906.499] wl_output@7.mode(0, 1280, 960, 60000)
[4004906.531] wl_output@7.mode(0, 1440, 900, 59901)
[4004906.563] wl_output@7.mode(0, 1440, 900, 74984)
[4004906.595] wl_output@7.mode(0, 1280, 1024, 75025)
[4004906.627] wl_output@7.mode(0, 1400, 1050, 59948)
[4004906.659] wl_output@7.mode(0, 1600, 1200, 60000)
[4004906.691] wl_output@7.mode(1, 1680, 1050, 59954)
[4004906.723] wl_output@7.scale(1)
[4004906.736] wl_output@7.done()
[4004906.745] wl_callback@8.done(58483)
[4004906.760]  -> zxdg_output_manager_v1@4.get_xdg_output(new id zxdg_output_v1@8, wl_output@7)
[4004906.784]  -> zxdg_output_manager_v1@4.get_xdg_output(new id zxdg_output_v1@9, wl_output@6)
[4004906.861] zxdg_output_v1@8.logical_position(1680, 0)
[4004906.882] zxdg_output_v1@8.logical_size(1680, 1050)
[4004906.902] zxdg_output_v1@8.name("DP-1")
[4004906.915] zxdg_output_v1@8.description("Acer Technologies AL2016W L640C0184054 (DP-1)")
[4004906.928] zxdg_output_v1@8.done()
[4004906.938] zxdg_output_v1@9.logical_position(0, 0)
[4004906.957] zxdg_output_v1@9.logical_size(1680, 1050)
[4004906.976] zxdg_output_v1@9.name("DVI-I-1")
[4004906.990] zxdg_output_v1@9.description("Acer Technologies AL2016W L640C0184054 (DVI-I-1)")
[4004907.003] zxdg_output_v1@9.done()
[4004907.013]  -> wl_display@1.sync(new id wl_callback@10)
[4004907.068] wl_display@1.delete_id(10)
[4004907.082] wl_callback@10.done(58483)
[4004907.096]  -> zwlr_screencopy_manager_v1@5.capture_output(new id zwlr_screencopy_frame_v1@10, 0, wl_output@7)
[4004907.127]  -> zwlr_screencopy_manager_v1@5.capture_output(new id zwlr_screencopy_frame_v1@11, 0, wl_output@6)
[4004907.232] zwlr_screencopy_frame_v1@10.buffer(0, 1680, 1050, 6720)
[4004907.300]  -> wl_shm@3.create_pool(new id wl_shm_pool@12, fd 5, 7056000)
[4004907.331]  -> wl_shm_pool@12.create_buffer(new id wl_buffer@13, 0, 1680, 1050, 6720, 0)
[4004907.412]  -> wl_shm_pool@12.destroy()
[4004907.426]  -> zwlr_screencopy_frame_v1@10.copy(wl_buffer@13)
[4004907.440] zwlr_screencopy_frame_v1@11.buffer(0, 1680, 1050, 6720)
[4004907.486]  -> wl_shm@3.create_pool(new id wl_shm_pool@14, fd 6, 7056000)
[4004907.517]  -> wl_shm_pool@14.create_buffer(new id wl_buffer@15, 0, 1680, 1050, 6720, 0)
[4004907.565]  -> wl_shm_pool@14.destroy()
[4004907.576]  -> zwlr_screencopy_frame_v1@11.copy(wl_buffer@15)
[4004924.092] wl_display@1.delete_id(12)
[4004924.120] wl_display@1.delete_id(14)
[4004924.134] zwlr_screencopy_frame_v1@11.flags(1)
[4004924.147] zwlr_screencopy_frame_v1@11.ready(0, 76849, 203865328)
[4004939.759] zwlr_screencopy_frame_v1@10.flags(1)
[4004939.803] zwlr_screencopy_frame_v1@10.ready(0, 76849, 219719497)
[4005262.629]  -> zwlr_screencopy_frame_v1@10.destroy()
[4005263.012]  -> wl_buffer@13.destroy()
[4005263.023]  -> zxdg_output_v1@8.destroy()
[4005263.033]  -> wl_output@7.release()
[4005263.044]  -> zwlr_screencopy_frame_v1@11.destroy()
[4005263.406]  -> wl_buffer@15.destroy()
[4005263.419]  -> zxdg_output_v1@9.destroy()
[4005263.429]  -> wl_output@6.release()
[4005263.439]  -> zwlr_screencopy_manager_v1@5.destroy()
[4005263.449]  -> zxdg_output_manager_v1@4.destroy()

@emersion
Copy link
Owner

Hmm. Not sure what happens here, my setup uses the same format. If you change this line to return CAIRO_FORMAT_RGB24, does it work?

@bbigras
Copy link

bbigras commented Dec 17, 2018

If you change this line to return CAIRO_FORMAT_RGB24, does it work?

Yes it does work!! Thanks!

@emersion
Copy link
Owner

That's not a good fix though. Could you open a wlroots issue about this, including a full sway debug log?

@bbigras
Copy link

bbigras commented Dec 17, 2018

Could you open a wlroots issue about this, including a full sway debug log?

Done

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants