maim icon indicating copy to clipboard operation
maim copied to clipboard

black image on gnome wayland

Open lesmana opened this issue 9 years ago • 11 comments
trafficstars

maim used to work fine on my system. I use arch linux. I updated my system and now have gnome 3.22. gnome 3.22 uses wayland by default. Since that update maim produces black images. the images have the same resolution as my screen. 1280x800.

Please confirm whether this is a problem with wayland or just a problem on my system.

$ maim --version
maim v3.4.47

Copyright (C) 2014 Dalton Nell, Maim Contributors
(https://github.com/naelstrof/maim/graphs/contributors)
$ uname -a
Linux lestop 4.8.4-1-ARCH #1 SMP PREEMPT Sat Oct 22 18:26:57 CEST 2016 x86_64 GNU/Linux
$ gnome-shell --version
GNOME Shell 3.22.1

Please tell me what more information do you need.

lesmana avatar Oct 28 '16 21:10 lesmana

this "bug" is shared with other screenshot tools like scrot and import from imagemagick.

please follow my (mis)adventures with the screenshot tools in this arch linux forum thread: https://bbs.archlinux.org/viewtopic.php?pid=1662309

lesmana avatar Nov 04 '16 16:11 lesmana

Maim simply doesn't support wayland.

It's due for a re-write, but until I have time for it you'll be better off submitting bug reports to the wayland team since imlib2's X11 calls aren't being translated properly.

naelstrof avatar Nov 04 '16 21:11 naelstrof

Also wayland is a protocol. The compositors, GNOME in this case implement calls like screenshotting themselves. "supporting wayland" means means independently supporting GNOME, KDE, sway, enlightenment, etc.

CamilleScholtz avatar Nov 04 '16 23:11 CamilleScholtz

I reported the bug to the wayland developers

https://bugs.freedesktop.org/show_bug.cgi?id=98672

lesmana avatar Nov 10 '16 12:11 lesmana

Yeah wayland is unusable for modular deskop usage by design in the name of """"security"""" sadly, now you just need to exploit the compositor.

CamilleScholtz avatar Nov 10 '16 18:11 CamilleScholtz

On sway it's has trouble too. Black image always and broken with -i argument laptop% maim -i $(xdotool getactivewindow) Your windowmanager claims not to support _NET_ACTIVE_WINDOW, so the attempt to query the active window aborted. xdo_get_active_window reported an error maim: option requires an argument -- 'i'

MrSorcus avatar Nov 24 '16 14:11 MrSorcus

I mean that's actually xdotool not working. X tools probably won't work on Wayland, but I don't think maim will either. Neither xdotool or maim are made with wayland in mind. I plan to add support for wayland soon, but it'd require a re-write and I simply don't have enough time.

naelstrof avatar Nov 25 '16 08:11 naelstrof

Any update on this? @naelstrof

hmnd avatar Mar 10 '18 00:03 hmnd

Wayland doesn't support 3rd party screenshot apps and currently doesn't plan to. It's too secure and would require Wayland to be re thought a bit. Probably isn't going to happen anytime soon. Sorry.

naelstrof avatar Mar 10 '18 00:03 naelstrof

Wayland doesn't support 3rd party screenshot apps and currently doesn't plan to. It's too secure and would require Wayland to be re thought a bit. Probably isn't going to happen anytime soon. Sorry.

I use grim in combination with slurp in order to get screenshots on Wayland (I use sway as my WM).

My script that I trigger:

#!/bin/bash

SCREENSHOTS_DIR=$(xdg-user-dir PICTURES)/screenshots
[[ ! -d "$SCREENSHOTS_DIR" ]] && mkdir -p "$SCREENSHOTS_DIR"

slurp | grim -g - "$SCREENSHOTS_DIR"/$(date +%F_%T).png

victorz avatar Nov 20 '21 09:11 victorz

A note. For grim to work on sway, you need to be using wlroots > 0.16.0, since WLR_RENDERER=vulkan on older versions did not allow dpms output to capture display.

asklow avatar Nov 23 '22 19:11 asklow