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

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

@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