Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selection button inactive (was: Shutter does not work in Wayland) #187

Open
Photon89 opened this issue Jun 11, 2020 · 93 comments
Open

Selection button inactive (was: Shutter does not work in Wayland) #187

Photon89 opened this issue Jun 11, 2020 · 93 comments
Labels

Comments

@Photon89
Copy link
Member

Running Gnome 3.18 and Gnome Shell as the new Wayland Compositor, shutter doesn't work. I.e. it's only creating a screenshot of the shutter logo in a distorted way.

I don't if that's something that can be fixed easily, but it seems Wayland (security) related.

Otherwise thanks for this outstanding screenshot tool!

Wolf


Main upstream discussion & fixes example to deal with wayland:
https://bugzilla.gnome.org/show_bug.cgi?id=776437


Workaround

Log out. Click your name on the login screen, then click the gear button and select 'Ubuntu on Xorg'. Enter your password and log in.

Launchpad Details: #LP1502263 Wolf Vollprecht - 2015-10-02 17:53:46 +0000

@Photon89
Copy link
Member Author

Confirmed, though I'm not sure whether it's the Shutter logo I'm seeing.

This is related to the security in Wayland, which prevents applications from seeing other application's viewports.

Gnome-screenshot manages, so it must be possible in some way. I'm just not sure what API is being used.

https://bugzilla.redhat.com/show_bug.cgi?id=1299293
https://lists.fedoraproject.org/pipermail/users/2016-February/468633.html

Launchpad Details: #LPC Roel Brook - 2016-04-11 16:16:24 +0000

@Photon89
Copy link
Member Author

Same problem here with ubuntu GNOME 16.10. It's possible to take screenshots, but they just show some strange pixel-pictures...
Shutter works fine when not logging in with wayland.

Launchpad Details: #LPC Jakob Schäuble - 2016-10-21 14:44:44 +0000

@Photon89
Copy link
Member Author

Another +1 from me. I see this on Arch with xf86-video-nouveau driver running Gnome 3.22.

Launchpad Details: #LPC pd5rm - 2016-10-21 18:05:43 +0000

@Photon89
Copy link
Member Author

+1. I'm seeing this issue on fedora 25, with Wayland

Launchpad Details: #LPC tristan su - 2016-10-26 12:01:09 +0000

@Photon89
Copy link
Member Author

Same here, Gnome on Arch.

Launchpad Details: #LPC Richard - 2016-10-31 15:58:12 +0000

@Photon89
Copy link
Member Author

..on wayland, by the way...

Launchpad Details: #LPC Richard - 2016-10-31 16:50:52 +0000

@Photon89
Copy link
Member Author

wayland...Gnome 3.22 Fedora 25 ...

shutter doesn't work

Launchpad Details: #LPC solideo - 2016-11-23 15:13:49 +0000

@Photon89
Copy link
Member Author

Same here

Launchpad Details: #LPC jack_spratt - 2016-11-28 18:41:45 +0000

@Photon89
Copy link
Member Author

+1. Fedora 24 and Fedora 25 with Wayland and Shutter. Only re-login with Xorg makes it work again.

Launchpad Details: #LPC Jorge - 2016-11-30 10:28:58 +0000

@Photon89
Copy link
Member Author

See https://bugzilla.gnome.org/761737

Launchpad Details: #LPC Jeremy Bicha - 2016-12-17 18:22:02 +0000

@Photon89
Copy link
Member Author

Status changed to 'Confirmed' because the bug affects multiple users.

Launchpad Details: #LPC Launchpad Janitor - 2016-12-17 21:05:37 +0000

@Photon89
Copy link
Member Author

mario-kemper, do you plan to port Shutter to support the native DBUS/Wayland APIs in the future?

Launchpad Details: #LPC Robert Buchholz - 2017-01-25 12:50:43 +0000

@Photon89
Copy link
Member Author

Given the recent news of Unity, made the switch to GNOME/Wayland. I use Shutter all the time, but it only shows a black screen when I try to take a screenshot under Wayland. Is support planned?

Launchpad Details: #LPC Matthew Gregg - 2017-04-06 14:51:31 +0000

@Photon89
Copy link
Member Author

Development looks dead, I don't think, anything will happen unless somebody jumps in and resumes the development...

Launchpad Details: #LPC Michael Kogan - 2017-04-07 07:13:48 +0000

@Photon89
Copy link
Member Author

Ok, now in Ubuntu 17.10 using Wayland. Shutter tries to take a screenshot but only got the Shutter icon distorted.

I found some shortcuts useful in gnome-screenshot, not a workaround but still useful.
Actually I am seeing for the first time the gnome shortcuts as well:

PrtSc = Capture screen
Alt+PrtSc = Capture Active App/Window
Shift+PrtSc = Capture Area

Launchpad Details: #LPC Julian Alarcon - 2017-07-17 13:57:14 +0000

@Photon89
Copy link
Member Author

I hope that someone fix this bug. BTW KDE guys fixed (partially) this problem in Spectacle
https://blog.martin-graesslin.com/blog/2016/11/from-window-killing-to-screenshot/

Launchpad Details: #LPC Julian Alarcon - 2017-07-17 14:41:49 +0000

@Photon89
Copy link
Member Author

same in Ubuntu 17.10 Wayland:
corrado@corrado-HP-aa-p5:/Documents$ env | grep -i wayland
DESKTOP_SESSION=ubuntu-wayland
WAYLAND_DISPLAY=wayland-0
XDG_SESSION_TYPE=wayland
XDG_SESSION_DESKTOP=ubuntu-wayland
GDMSESSION=ubuntu-wayland
corrado@corrado-HP-aa-p5:
/Documents$

corrado@corrado-HP-aa-p5:/Documents$ ./inxi -Fxx
System: Host: corrado-HP-aa-p5 Kernel: 4.11.0-10-generic x86_64 (64 bit gcc: 6.3.0)
Desktop: Gnome 3.24.2 (Gtk 3.22.15-0ubuntu2) dm: gdm3
Distro: Ubuntu Artful Aardvark (development branch)
Machine: Device: laptop System: Hewlett-Packard product: HP 250 G3 Notebook PC v: 0991100000000000000600087
Mobo: Hewlett-Packard model: 2211 v: 86.49 UEFI: Insyde v: F.36 date: 12/18/2014
Chassis: type: 10
Battery BAT1: charge: 3.2 Wh 14.8% condition: 21.5/21.8 Wh (99%) volts: 10.6/11.1
model: 13-42 OA03031 serial: 02550 01/07/2015 status: Discharging
CPU: Dual core Intel Core i5-4210U (-HT-MCP-) cache: 3072 KB
flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 9577
clock speeds: min/max: 800/2700 MHz 1: 799 MHz 2: 799 MHz 3: 799 MHz 4: 1017 MHz
Graphics: Card: Intel Haswell-ULT Integrated Graphics Controller bus-ID: 00:02.0 chip-ID: 8086:0a16
Display Server: wayland (X.Org 1.19.3) driver: N/A Resolution: [email protected]
OpenGL: renderer: Mesa DRI Intel Haswell Mobile
version: 4.5 Mesa 17.1.2 (compat-v: 3.0) Direct Render: Yes
Audio: Card-1 Intel 8 Series HD Audio Controller driver: snd_hda_intel bus-ID: 00:1b.0 chip-ID: 8086:9c20
Card-2 Intel Haswell-ULT HD Audio Controller driver: snd_hda_intel bus-ID: 00:03.0 chip-ID: 8086:0a0c
Sound: Advanced Linux Sound Architecture v: k4.11.0-10-generic
Network: Card-1: Realtek RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller
driver: r8169 v: 2.3LK-NAPI port: 3000 bus-ID: 08:00.0 chip-ID: 10ec:8136
IF: enp8s0 state: down mac: 5c:b9:01:06:ba:ce
Card-2: Ralink RT3290 Wireless 802.11n 1T/1R PCIe
driver: rt2800pci v: 2.3.0 bus-ID: 09:00.0 chip-ID: 1814:3290
IF: wlo1 state: up mac: ac:d1:b8:82:03:5d
Drives: HDD Total Size: 500.1GB (2.0% used)
ID-1: /dev/sda model: ST500LT012 size: 500.1GB serial: W3PEAWM4
Partition: ID-1: / size: 32G used: 5.5G (19%) fs: ext4 dev: /dev/sda5
ID-2: swap-1 size: 4.29GB used: 0.00GB (0%) fs: swap dev: /dev/sda2
RAID: System: supported: N/A
No RAID devices: /proc/mdstat, md_mod kernel module present
Unused Devices: none
Sensors: System Temperatures: cpu: 42.0C mobo: 42.0C
Fan Speeds (in rpm): cpu: N/A
Info: Processes: 229 Uptime: 7 min Memory: 1118.1/3881.2MB Init: systemd v: 233 runlevel: 5 Gcc sys: 6.3.0
Client: Shell (bash 4.4.121 running in gnome-terminal-) inxi: 2.3.23
corrado@corrado-HP-aa-p5:
/Documents$

for a (may be) similar problem see also:
https://bugs.launchpad.net/ubuntu/+source/gimp/+bug/1705188
https://bugs.launchpad.net/ubuntu/+source/gpick/+bug/1704808

Launchpad Details: #LPC corrado venturini - 2017-07-22 10:55:17 +0000

@Photon89
Copy link
Member Author

How does mir take a screenshot then?

Launchpad Details: #LPC Khurshid Alam - 2017-08-14 15:59:09 +0000

@Photon89
Copy link
Member Author

May be related: MaartenBaert/ssr#431

Launchpad Details: #LPC Michael Kogan - 2017-08-17 18:20:53 +0000

@Photon89
Copy link
Member Author

In Ubuntu 17.10, shutter is unusable. Until this is fixed, is there an alternative that does work in wayland?

Launchpad Details: #LPC Lonnie Lee Best - 2017-10-13 10:57:04 +0000

@Photon89
Copy link
Member Author

gnome-screenshot works

Launchpad Details: #LPC André - 2017-10-13 11:28:06 +0000

@Photon89
Copy link
Member Author

Can it edit and upload screenshots?

On Fri, Oct 13, 2017 at 1:39 PM André wrote:

gnome-screenshot works

--
You received this bug notification because you are a member of Shutter
Team, which is subscribed to shutter in Ubuntu.
https://bugs.launchpad.net/bugs/1502263

Title:
Shutter does not work in Wayland

To manage notifications about this bug go to:
https://bugs.launchpad.net/shutter/+bug/1502263/+subscriptions

Launchpad Details: #LPC Vadim Peretokin - 2017-10-13 11:52:36 +0000

@Photon89
Copy link
Member Author

Not fully featured as shutter. It can just take screenshots, it's an alternative to the most basic feature of shutter, screenshot and saving to file (desktop, window, area,...)

ps. Sorry for my simplistic ressponse

Launchpad Details: #LPC André - 2017-10-13 12:08:53 +0000

@Photon89
Copy link
Member Author

Maybe you need to run first the 'xhost' script:

https://bugs.launchpad.net/ubuntu/+source/synaptic/+bug/1712089/comments/8

Launchpad Details: #LPC 9d9'suspended user' - 2017-10-13 12:12:33 +0000

@Photon89
Copy link
Member Author

The easiest way in gnome-shell is pressing the print screen button for a full screen shot, or SHIFT+Print Screen button to select a region.

Launchpad Details: #LPC Wolf Vollprecht - 2017-10-13 13:20:29 +0000

@Photon89
Copy link
Member Author

Shutter is a lot more than a simple screenshot-application.

It allows you to immediately ftp your screenshot to a websever and then it copies the url of that screenshot into your clipboard (automatically) so you can can quickly share screenshots with other people via chat/email/etc with simple ctrl-v paste.

Additionally, it allow you to edit a screenshot; you can draw arrow to potions of the image you want to emphasize before collaboration.

I use it so frequently, and it is such a time saver to alternative methods of accomplishing these needs, that must downgrade to Ubuntu 16.04.3 until it works in Ubuntu 17.10, or until there is an alternative that truly compares.

Ubuntu 17.10 is looking great, but I have to have sophisticated applications like shutter, autokey-gtk, or I simply can't upgrade. Ubuntu is not a toy for me. I use it for work and productivity.

Launchpad Details: #LPC Lonnie Lee Best - 2017-10-13 20:40:45 +0000

@Photon89
Copy link
Member Author

I take the screenshot with the gnome utility, copy the image then paste it
in shutter. Painful but only workaround I've found.

On Oct 13, 2017 16:54, "Lonnie Lee Best" wrote:

Shutter is a lot more than a simple screenshot-application.

It allows you to immediately ftp your screenshot to a websever and then
it copies the url of that screenshot into your clipboard (automatically)
so you can can quickly share screenshots with other people via
chat/email/etc with simple ctrl-v paste.

Additionally, it allow you to edit a screenshot; you can draw arrow to
potions of the image you want to emphasize before collaboration.

I use it so frequently, and it is such a time saver to alternative
methods of accomplishing these needs, that must downgrade to Ubuntu
16.04.3 until it works in Ubuntu 17.10, or until there is an alternative
that truly compares.

Ubuntu 17.10 is looking great, but I have to have sophisticated
applications like shutter, autokey-gtk, or I simply can't upgrade.
Ubuntu is not a toy for me. I use it for work and productivity.

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1502263

Title:
Shutter does not work in Wayland

Status in Shutter:
Confirmed
Status in Ubuntu GNOME:
Triaged
Status in shutter package in Ubuntu:
Confirmed
Status in shutter package in Fedora:
Unknown

Bug description:
Running Gnome 3.18 and Gnome Shell as the new Wayland Compositor,
shutter doesn't work. I.e. it's only creating a screenshot of the
shutter logo in a distorted way.

I don't if that's something that can be fixed easily, but it seems
Wayland (security) related.

Otherwise thanks for this outstanding screenshot tool!

Wolf

To manage notifications about this bug go to:
https://bugs.launchpad.net/shutter/+bug/1502263/+subscriptions

Launchpad Details: #LPC Jerther - 2017-10-13 20:57:55 +0000

@Photon89
Copy link
Member Author

Lonnie, you can still use Ubuntu 17.10. On the login screen, after selecting your name, click the gear button to log in to 'Ubuntu on Xorg'. That will also work in Ubuntu 18.04 LTS.

Launchpad Details: #LPC Jeremy Bicha - 2017-10-13 21:08:37 +0000

@Photon89
Copy link
Member Author

I don't see a clear solution that's not a workaround in that bug topic

On Sat, Oct 28, 2017 at 8:12 AM dino99 wrote:

** Description changed:

Running Gnome 3.18 and Gnome Shell as the new Wayland Compositor,
shutter doesn't work. I.e. it's only creating a screenshot of the
shutter logo in a distorted way.

I don't if that's something that can be fixed easily, but it seems
Wayland (security) related.

Otherwise thanks for this outstanding screenshot tool!

Wolf

--
You received this bug notification because you are a member of Shutter
Team, which is subscribed to shutter in Ubuntu.
https://bugs.launchpad.net/bugs/1502263

Title:
Shutter does not work in Wayland

To manage notifications about this bug go to:
https://bugs.launchpad.net/shutter/+bug/1502263/+subscriptions

Launchpad Details: #LPC Vadim Peretokin - 2017-10-28 06:45:42 +0000

@Photon89
Copy link
Member Author

Photon89 commented Aug 17, 2023

@DarthGandalf I get a segmentation fault on launch when trying to use Shutter in a Manjaro KDE Wayland session. It just says

libwnck is designed to work in X11 only, no valid display found

and then immediately segfaults. Is this a known issue?

I launched with -d:Trace in X11 and Wayland and the debug output is absolutely identical up to this line...

edit: Here is the relevant gdb output:

[...]
INFO: gathering system information...

[Detaching after fork from child process 1425]
Linux photon-virtualbox 6.1.44-1-MANJARO #1 SMP PREEMPT_DYNAMIC Wed Aug  9 09:02:26 UTC 2023 x86_64 GNU/Linux

[Detaching after fork from child process 1426]
Manjaro Linux \r  (\n) (\l)



Glib 1.3293 
Gtk3 0.038 

Glib built for 2.76.4, running with 2.76.4


(shutter:1417): Wnck-WARNING **: 08:49:31.696: libwnck is designed to work in X11 only, no valid display found

Thread 1 "perl" received signal SIGSEGV, Segmentation fault.
0x00007ffff5b2c785 in XQueryExtension () from /usr/lib/libX11.so.6
(gdb) bt full
#0  0x00007ffff5b2c785 in XQueryExtension () at /usr/lib/libX11.so.6
#1  0x00007ffff5b20587 in XInitExtension () at /usr/lib/libX11.so.6
#2  0x00007ffff4fc32a1 in XextAddDisplay () at /usr/lib/libXext.so.6
#3  0x00007ffff59ea285 in XResQueryExtension () at /usr/lib/libXRes.so.1
#4  0x00007ffff5d9b4a5 in  () at /usr/lib/libwnck-3.so.0
#5  0x00007ffff7de6e63 in  () at /usr/lib/libgobject-2.0.so.0
#6  0x00007ffff7de8f0b in g_object_new_valist () at /usr/lib/libgobject-2.0.so.0
#7  0x00007ffff7de929e in g_object_new () at /usr/lib/libgobject-2.0.so.0
#8  0x00007ffff5d8ac93 in wnck_screen_get_default () at /usr/lib/libwnck-3.so.0
#9  0x00007ffff78b14f6 in  () at /usr/lib/libffi.so.8
#10 0x00007ffff78adf5e in  () at /usr/lib/libffi.so.8
#11 0x00007ffff78b0b73 in ffi_call () at /usr/lib/libffi.so.8
#12 0x00007ffff7fb9ec0 in invoke_c_code
    (info=info@entry=0x5555596f8590, func_pointer=<optimized out>, sp=sp@entry=0x55555555ed00, ax=ax@entry=1, items=items@entry=4, internal_stack_offset=internal_stack_offset@entry=4, package=<optimized out>, namespace=<optimized out>, function=<optimized out>, mark=<optimized out>)
    at /build/perl-glib-object-introspection/src/Glib-Object-Introspection-0.050/gperl-i11n-invoke-c.c:202
        cif = {abi = FFI_UNIX64, nargs = 0, arg_types = 0x4800000027, rtype = 0x7ffff78b22a0 <ffi_type_pointer>, bytes = 0, flags = 7}
        instance = 0x0
        i = <optimized out>
        iinfo = {base = {interface = 0x5555596f8590, is_function = 1, is_vfunc = 0, is_callback = 0, is_signal = 0, n_args = 0, current_pos = 32767, arg_infos = 0x0, arg_types = 0x0, aux_args = 0x0, has_return_value = 1, return_type_ffi = 0x7ffff78b22a0 <ffi_type_pointer>, return_type_info = {dummy1 = 18, dummy2 = 2147483647, dummy3 = 0x5555558df690, dummy4 = 0x5555596f8590, dummy5 = 0x555555ade5e0, dummy6 = 5176, dummy7 = 0, padding = {0x0, 0x0, 0x0, 0x0}}, return_type_transfer = GI_TRANSFER_NOTHING, callback_infos = 0x0, array_infos = 0x0, free_after_call = 0x0}, target_package = 0x5555559601c0 "Wnck", target_namespace = 0x5555596fbba0 "Screen", targ--Type <RET> for more, q to quit, c to continue without paging--
et_function = 0x5555559d2e60 "get_default", is_constructor = 0, is_method = 0, throws = 0, n_invoke_args = 0, n_nullable_args = 0, n_expected_args = 0, n_given_args = 0, args = 0x200e5fd3d49fe400, arg_types_ffi = 0x4800000027, in_args = 0x5555557a6eb0, out_args = 0x7ffff7e79d38, is_automatic_arg = 0x555555f87810, constructor_offset = 0, method_offset = 0, stack_offset = 4, dynamic_stack_offset = 0}
        n_return_values = <optimized out>
        ffi_return_value = {v_boolean = 0, v_int8 = 0 '\000', v_uint8 = 0 '\000', v_int16 = 0, v_uint16 = 0, v_int32 = 0, v_uint32 = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double = 0, v_short = 0, v_ushort = 0, v_int = 0, v_uint = 0, v_long = 0, v_ulong = 0, v_ssize = 0, v_size = 0, v_string = 0x0, v_pointer = 0x0}
        return_value_p = 0x7fffffffc860
        return_value = {v_boolean = 0, v_int8 = 0 '\000', v_uint8 = 0 '\000', v_int16 = 0, v_uint16 = 0, v_int32 = 0, v_uint32 = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double = 0, v_short = 0, v_ushort = 0, v_int = 0, v_uint = 0, v_long = 0, v_ulong = 0, v_ssize = 0, v_size = 0, v_string = 0x0, v_pointer = 0x0}
        local_error = 0x0
        local_error_address = 0x7fffffffc870
#13 0x00007ffff7fbae27 in XS_Glib__Object__Introspection_invoke (my_perl=<optimized out>, cv=<optimized out>)
    at /build/perl-glib-object-introspection/src/Glib-Object-Introspection-0.050/GObjectIntrospection.xs:1020
        basename = 0x555555f87810 "Wnck"
        namespace = 0x5555596fbba0 "Screen"
        function = 0x5555559d2e60 "get_default"
        repository = <optimized out>
        info = 0x5555596f8590
        func_pointer = 0x7ffff5d8ac50 <wnck_screen_get_default>
        symbol = 0x7ffff7f9d88c "wnck_screen_get_default"
        internal_stack_offset = 4
        sp = 0x55555555ed00
        ax = 1
        mark = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--
        items = 4
#14 0x00007ffff7b31a91 in Perl_pp_entersub (my_perl=0x5555555592a0)
    at /build/perl/src/perl-5.38.0/pp_hot.c:5555
        markix = 0
        is_scalar = true
        sp = <optimized out>
        sv = 0x55555572d920
        gv = 0x0
        cv = 0x55555572d920
        cx = <optimized out>
        old_savestack_ix = <optimized out>
#15 0x00007ffff7b22516 in Perl_runops_standard (my_perl=0x5555555592a0)
    at /build/perl/src/perl-5.38.0/run.c:41
        op = <optimized out>
#16 0x00007ffff7a6ae81 in Perl_call_sv (my_perl=0x5555555592a0, sv=<optimized out>, flags=<optimized out>)
    at /build/perl/src/perl-5.38.0/perl.c:3133
        myop = {op_next = 0x0, op_sibparent = 0x0, op_ppaddr = 0x7ffff7b31870 <Perl_pp_entersub>, op_targ = 0, op_type = 187, op_opt = 0, op_slabbed = 0, op_savefree = 0, op_static = 0, op_folded = 0, op_moresib = 0, op_spare = 0, op_flags = 65 'A', op_private = 0 '\000', op_first = 0x0, op_other = 0x0}
        method_op = {op_next = 0x7fffffffcbc0, op_sibparent = 0x0, op_ppaddr = 0x7ffff7b328e0 <Perl_pp_method>, op_targ = 0, op_type = 215, op_opt = 0, op_slabbed = 0, op_savefree = 0, op_static = 0, op_folded = 0, op_moresib = 0, op_spare = 0, op_flags = 0 '\000', op_private = 0 '\000', op_u = {op_first = 0x0, op_meth_sv = 0x0}, op_rclass_targ = 0}
        oldmark = 0
        retval = 0
        oldcatch = false
        ret = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--
        oldop = 0x5555556ab2f0
        cur_env = {je_prev = 0x7fffefb13130, je_buf = {{__jmpbuf = {140737349003289, 140733193388032, 2309889022297629696, 140737349097584, -128, 0, 2, 16}, __mask_was_saved = -135816000, __saved_mask = {__val = {0, 140737348885404, 16, 93825060916928, 93825036359072, 140737349074303, 93824992252576, 7, 93825060916928, 140737349115437, 93825060917336, 93825060916928, 93824992252576, 524288, 93825036359072, 140737349153871}}}}, je_ret = 5, je_mustcatch = false, je_old_delaymagic = 0, je_old_stack_hwm = 93824992252576}
#17 0x00007ffff7a6b5e0 in Perl_call_method
    (my_perl=<optimized out>, methname=methname@entry=0x555557f695a0 "STARTUP", flags=flags@entry=5)
    at /build/perl/src/perl-5.38.0/perl.c:3036
        len = <optimized out>
        sv = <optimized out>
#18 0x00007ffff7fb7cbd in invoke_perl_code
    (cif=<optimized out>, resp=0x7fffffffd010, args=0x7fffffffce80, userdata=<optimized out>)
    at /build/perl-glib-object-introspection/src/Glib-Object-Introspection-0.050/gperl-i11n-invoke-perl.c:169
        cb_interface = 0x5555583ecbc0
        iinfo = {base = {interface = 0x5555583ecbc0, is_function = 0, is_vfunc = 0, is_callback = 1, is_signal = 0, n_args = 1, current_pos = 0, arg_infos = 0x7fffdc002e10, arg_types = 0x5555596a2a30, aux_args = 0x5555596c56e0, has_return_value = 0, return_type_ffi = 0x7ffff78b21a0 <ffi_type_void>, return_type_info = {dummy1 = 18, dummy2 = 2147483647, dummy3 = 0x5555558df690, dummy4 = 0x5555583ecbc0, dummy5 = 0x5555558f6ab0, dummy6 = 31944, dummy7 = 0, padding = {0x0, 0x0, 0x0, 0x0}}, return_type_transfer = GI_TRANSFER_NOTHING, callback_infos = 0x0, array_infos = 0x0, free_after_call = 0x0}}
        args_offset = <optimized out>
        i = <optimized out>
        in_inout = <optimized out>
        n_return_values = 0
        n_returned = <optimized out>
        context = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--
        first_sv = <optimized out>
        last_sv = <optimized out>
        sp = <optimized out>
#19 0x00007ffff78b10d2 in  () at /usr/lib/libffi.so.8
#20 0x00007ffff78b1718 in  () at /usr/lib/libffi.so.8
#21 0x00007ffff7df5bc9 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#22 0x00007ffff7df5d34 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#23 0x00007ffff7107575 in g_application_register () at /usr/lib/libgio-2.0.so.0
#24 0x00007ffff7107b30 in  () at /usr/lib/libgio-2.0.so.0
#25 0x00007ffff7107e6c in g_application_run () at /usr/lib/libgio-2.0.so.0
#26 0x00007ffff78b14f6 in  () at /usr/lib/libffi.so.8
#27 0x00007ffff78adf5e in  () at /usr/lib/libffi.so.8
#28 0x00007ffff78b0b73 in ffi_call () at /usr/lib/libffi.so.8
#29 0x00007ffff7fb9ec0 in invoke_c_code
    (info=info@entry=0x55555852b700, func_pointer=<optimized out>, sp=sp@entry=0x55555555ed00, ax=ax@entry=1, items=items@entry=5, internal_stack_offset=internal_stack_offset@entry=4, package=<optimized out>, namespace=<optimized out>, function=<optimized out>, mark=<optimized out>)
    at /build/perl-glib-object-introspection/src/Glib-Object-Introspection-0.050/gperl-i11n-invoke-c.c:202
        cif = {abi = FFI_UNIX64, nargs = 3, arg_types = 0x5555596c8960, rtype = 0x7ffff78b2330 <ffi_type_sint32>, bytes = 0, flags = 6}
        instance = 0x5555596c90c0
        i = <optimized out>
        iinfo = {base = {interface = 0x55555852b700, is_function = 1, is_vfunc = 0, is_callback = 0, is_signal = 0, n_args = 2, current_pos = 1, arg_infos = 0x5555593bea70, arg_types = 0x5555589ab240, aux_args = 0x5555596c8910, has_return_value = 1, return_type_ffi = 0x7ffff78b2330 <ffi_type_sint32>, return_type_info = {dummy1 = 18, dummy2 = 2147483647, dummy3 = 0x5555558df690, dummy4 = 0x55555852b700, dummy5 = 0x5555558f6ab0, dummy6 = 29364, dummy7 = 0, padding = {0x0, 0x0, 0x0, 0x0}}, return_type_transfer = GI_TRANSFER_NOTHING, callback_infos--Type <RET> for more, q to quit, c to continue without paging--
 = 0x0, array_infos = 0x5555596c2300 = {0x5555596ba920}, free_after_call = 0x0}, target_package = 0x555555a8a370 "Glib::IO", target_namespace = 0x5555596cf400 "Application", target_function = 0x5555557872c0 "run", is_constructor = 0, is_method = 1, throws = 0, n_invoke_args = 3, n_nullable_args = 1, n_expected_args = 2, n_given_args = 1, args = 0x5555596ba8d0, arg_types_ffi = 0x5555596c8960, in_args = 0x5555596c8f00, out_args = 0x5555596c8930, is_automatic_arg = 0x5555596ba900, constructor_offset = 0, method_offset = 1, stack_offset = 4, dynamic_stack_offset = -1}
        n_return_values = <optimized out>
        ffi_return_value = {v_boolean = 0, v_int8 = 0 '\000', v_uint8 = 0 '\000', v_int16 = 0, v_uint16 = 0, v_int32 = 0, v_uint32 = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double = 0, v_short = 0, v_ushort = 0, v_int = 0, v_uint = 0, v_long = 0, v_ulong = 0, v_ssize = 0, v_size = 0, v_string = 0x0, v_pointer = 0x0}
        return_value_p = 0x7fffffffd5b0
        return_value = {v_boolean = 0, v_int8 = 0 '\000', v_uint8 = 0 '\000', v_int16 = 0, v_uint16 = 0, v_int32 = 0, v_uint32 = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double = 0, v_short = 0, v_ushort = 0, v_int = 0, v_uint = 0, v_long = 0, v_ulong = 0, v_ssize = 0, v_size = 0, v_string = 0x0, v_pointer = 0x0}
        local_error = 0x0
        local_error_address = 0x7fffffffd5c0
#30 0x00007ffff7fbae27 in XS_Glib__Object__Introspection_invoke (my_perl=<optimized out>, cv=<optimized out>)
    at /build/perl-glib-object-introspection/src/Glib-Object-Introspection-0.050/GObjectIntrospection.xs:1020
        basename = 0x5555556f85b0 "Gio"
        namespace = 0x5555596cf400 "Application"
        function = 0x5555557872c0 "run"
        repository = <optimized out>
        info = 0x55555852b700
        func_pointer = 0x7ffff7107d60 <g_application_run>
        symbol = 0x7ffff6f4a2e0 "g_application_run"
        internal_stack_offset = 4
        sp = 0x55555555ed00
--Type <RET> for more, q to quit, c to continue without paging--
        ax = 1
        mark = <optimized out>
        items = 5
#31 0x00007ffff7b31a91 in Perl_pp_entersub (my_perl=0x5555555592a0)
    at /build/perl/src/perl-5.38.0/pp_hot.c:5555
        markix = 0
        is_scalar = false
        sp = <optimized out>
        sv = 0x55555572d920
        gv = 0x0
        cv = 0x55555572d920
        cx = <optimized out>
        old_savestack_ix = <optimized out>
#32 0x00007ffff7b22516 in Perl_runops_standard (my_perl=0x5555555592a0)
    at /build/perl/src/perl-5.38.0/run.c:41
        op = <optimized out>
#33 0x00007ffff7a6ef33 in S_run_body (oldscope=<optimized out>, my_perl=<optimized out>)
    at /build/perl/src/perl-5.38.0/perl.c:2807
        oldscope = 1
        ret = <optimized out>
        cur_env = {je_prev = 0x5555555595b0, je_buf = {{__jmpbuf = {140737488345832, 1407061934346053410, 0, 140737488345856, 140737354125312, 93824992247112, -1407061933366991070, -1407080136982288606}, __mask_was_saved = 0, __saved_mask = {__val = {0, 7, 6, 140737352539328, 0, 140737348885404, 140737352539328, 93824992265504, 51539607553, 140737348273384, 0, 93824992255664, 4129754963, 2309889022297629696, 140737351785888, 140737488345832}}}}, je_ret = 3, je_mustcatch = true, je_old_delaymagic = 0, je_old_stack_hwm = 0}
#34 perl_run (my_perl=0x5555555592a0) at /build/perl/src/perl-5.38.0/perl.c:2727
        oldscope = 1
--Type <RET> for more, q to quit, c to continue without paging--
        ret = <optimized out>
        cur_env = {je_prev = 0x5555555595b0, je_buf = {{__jmpbuf = {140737488345832, 1407061934346053410, 0, 140737488345856, 140737354125312, 93824992247112, -1407061933366991070, -1407080136982288606}, __mask_was_saved = 0, __saved_mask = {__val = {0, 7, 6, 140737352539328, 0, 140737348885404, 140737352539328, 93824992265504, 51539607553, 140737348273384, 0, 93824992255664, 4129754963, 2309889022297629696, 140737351785888, 140737488345832}}}}, je_ret = 3, je_mustcatch = true, je_old_delaymagic = 0, je_old_stack_hwm = 0}
#35 0x000055555555517f in main ()
(gdb) INFO: gathering system information...

[Detaching after fork from child process 1484]
Linux photon-virtualbox 6.1.44-1-MANJARO #1 SMP PREEMPT_DYNAMIC Wed Aug  9 09:02:26 UTC 2023 x86_64 GNU/Linux

[Detaching after fork from child process 1485]
Manjaro Linux \r  (\n) (\l)



Glib 1.3293 
Gtk3 0.038 

Glib built for 2.76.4, running with 2.76.4


(shutter:1476): Wnck-WARNING **: 22:21:19.623: libwnck is designed to work in X11 only, no valid display found

Thread 1 "perl" received signal SIGSEGV, Segmentation fault.
0x00007ffff5b2c785 in XQueryExtension () from /usr/lib/libX11.so.6
(gdb) 

edit 2: Should be fixed by #611.

@Photon89
Copy link
Member Author

Photon89 commented Aug 19, 2023

We might use Slurp on Wayland once this issue is fixed: emersion/slurp#136 I don't know which magic they use, but it looks like they managed to grab the cursor position and make selections on Wayland screens, even multiple monitors seem to be supported. We could then use Shutter::Screenshot::Wayland which is already implemented and then crop the full screen screenshot according to the dimensions and position of Slurp's selection.

The selection is also configurable regarding color and frame thickness, so we might be even able to make it look like our own selection tool for X11.

@DarthGandalf
Copy link
Member

We can't combine Slurp with the current implementation of Shutter::Screenshot::Wayland which uses XDG portal. Portal doesn't "just" give us the image, it may or may not provide its own UI to select a window/region/timeout/whatever. In that case user would need to select the rectangle twice?

@DarthGandalf
Copy link
Member

@Photon89 from your posts I can assume you only test wayland on DE where the DE-specific implementation of the XDG portal doesn't provide its own UI, but just takes screenshot of the whole screen. Is it gnome's one? Can you try kde? or vice versa. https://packages.ubuntu.com/search?keywords=xdg-desktop-portal currently shows the following:

  • xdg-desktop-portal-gnome
  • xdg-desktop-portal-gtk
  • xdg-desktop-portal-kde
  • xdg-desktop-portal-lxqt
  • xdg-desktop-portal-wlr

@Photon89
Copy link
Member Author

I tried Manjaro KDE. There the full screen mode worked the same way as in X11, just the filename was "unknown_NNN.png".

@DarthGandalf
Copy link
Member

Then try the gnome one :) I don't remember which of them had its own UI

@Photon89
Copy link
Member Author

If I had to guess, most probably Gnome. ;) Sure, will set up a VM and try! But even if there is some Gnome specific dialog, isn't it possible to use it the same way as in fullscreen mode after Slurp has been used to select a screen region? Or do you mean that Slurp won't work in Gnome as expected?

@DarthGandalf
Copy link
Member

isn't it possible to use it the same way as in fullscreen mode after Slurp has been used to select a screen region?

With XDG portal API it's not possible to pass the "region" obtained from Slurp. There's just no such parameter in the method: https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Screenshot

We can't even specify whether we want the full screen, or only 1 window, everything is up to the implementation of the portal to decide, probably by asking the user using some kind of GUI which we cannot control. I just put it in the "fullscreen" button randomly, because there's no better place for it now. Maybe it should be a separate button.

@Photon89
Copy link
Member Author

I'm installing Manjaro Gnome in a VM right now and will test!

@Photon89
Copy link
Member Author

@DarthGandalf So, I can report now: In Manjaro Gnome, when making a fullscreen shot, I get a dialog asking for permission where I can click "Allow" or "Deny". If I click "Allow", the screenshot is taken as expected. Also, on the second try there is no more such dialog. Even after closing Shutter and relaunching it.

@Photon89
Copy link
Member Author

Slurp doesn't work on Gnome and fails with

compositor doesn't support zwlr_layer_shell_v1

though. But maybe if apps like Shutter support all DEs besides of Gnome it motivates Gnome devs to work on better compatibility?

@Photon89
Copy link
Member Author

Photon89 commented Aug 21, 2023

@DarthGandalf I made a quick and dirty proof of concept implementation of a Shutter::Screenshot::WaylandSelector which is heavily based on Shutter::Screenshot::Wayland and uses Slurp to get the selection size and position. It works on a KDE Wayland session but I kicked out stuff like delay and include/exclude cursor for the moment. The bigger problem is that by restoring the Selection mode for Wayland in the main Shutter file I broke something and now Shutter crashes on startup on X11... I spent a lot of time trying to figure out what is going on but couldn't figure it out... Shall I make a draft PR for it?

@DarthGandalf
Copy link
Member

I made a quick and dirty proof of concept implementation of a Shutter::Screenshot::WaylandSelector which is heavily based on Shutter::Screenshot::Wayland and uses Slurp to get the selection size and position

You're assuming that all implementations of portal have this behavior of NOT showing any additional GUI to user. Using Slurp may work fine as long as this stays true. However, we have no way of checking that while calling portal API.

Here's what I see on Ubuntu 22.04 VM:
Выделение_466

How will this interact with Slurp?

Shall I make a draft PR for it?

Well, I can't possibly help you debug it otherwise, can I?

@Photon89
Copy link
Member Author

Photon89 commented Aug 22, 2023

Well, I can't possibly help you debug it otherwise, can I?

Thanks! 😃 Please see #612.

Here's what I see on Ubuntu 22.04 VM:

I assume, this is Gnome (made to look like Unity)? Slurp doesn't work in Gnome anyway... So Gnome is so far not supported. I guess...

@DarthGandalf
Copy link
Member

But what stops KDE devs from adding a similar dialog to KDE portal implementation in future?

@Photon89
Copy link
Member Author

I don't know, looks like Wayland related stuff is in very much flow recently, so implementations differ in various DEs and distros, and also might change frequently. But if we can support at least some DE for some time, it's already a start, we can see where we get from there, if things change!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants