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

Wayland support for tasklist panel #1148

Merged
merged 13 commits into from
Oct 21, 2020
Merged

Conversation

wmww
Copy link
Contributor

@wmww wmww commented Oct 1, 2020

This uses the wlr-foreign-toplevel-management-unstable-v1.xml protocol which is supported by Sway >1.5 and Mir >2.1. The task list is a lot more basic than the one provided by wncklet (no right-click menu, no grouping, etc) but forking wncklet and porting it to Wayland would be more work. I also fixed the other wncklet applets so they wouldn't crash on Wayland, but since they don't have a useful implementation I didn't enable them. This is an update to a previous iteration of the same idea, which has been what the mate-wayland snap has been using.

@lukefromdc
Copy link
Member

Running under x11 I got a segfault with this backtrace on running mate-panel --replace:

Thread 1 "mate-panel" received signal SIGSEGV, Segmentation fault.
0x00007ffff7029c16 in g_type_check_instance_cast ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
(gdb) thread apply all bt full

Thread 7 (Thread 0x7fffde582700 (LWP 45193)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff6f64d12 in g_cond_wait_until () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff6eec511 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff6f42d2a in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff6f4239d in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff7d5eea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140736923707136, 3187003581449449030, 140737488345838, 140737488345839, 140736923704448, 8396800, -3187072514736968122, -3187020812306928058}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#6  0x00007ffff6962eaf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 6 (Thread 0x7fffdffff700 (LWP 45179)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff6f64bff in g_cond_wait () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff4305c9b in  () at /usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
#3  0x00007ffff42fd951 in  () at /usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
#4  0x00007fffdd9fbf49 in  () at /usr/lib/x86_64-linux-gnu/libgnutls.so.30
#5  0x00007fffdd9f42f1 in  () at /usr/lib/x86_64-linux-gnu/libgnutls.so.30
#6  0x00007fffdd9ff7bc in gnutls_handshake () at /usr/lib/x86_64-linux-gnu/libgnutls.so.30
#7  0x00007ffff42fef67 in  () at /usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
#8  0x00007ffff4304407 in  () at /usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
#9  0x00007ffff43046be in  () at /usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
#10 0x00007ffff70faade in  () at /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#11 0x00007ffff6f42bd4 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007ffff6f4239d in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#13 0x00007ffff7d5eea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140736951482112, 3187003581449449030, 140737488346894, 140737488346895, 140736951479424, 8396800, -3187073949792915898, -3187020812306928058}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#14 0x00007ffff6962eaf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 5 (Thread 0x7fffee9f6700 (LWP 45163)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff6f64bff in g_cond_wait () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff4305c9b in  () at /usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
#3  0x00007ffff42fd951 in  () at /usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
#4  0x00007fffdd9fbf49 in  () at /usr/lib/x86_64-linux-gnu/libgnutls.so.30
#5  0x00007fffdd9f42f1 in  () at /usr/lib/x86_64-linux-gnu/libgnutls.so.30
#6  0x00007fffdd9ff7bc in gnutls_handshake () at /usr/lib/x86_64-linux-gnu/libgnutls.so.30
#7  0x00007ffff42fef67 in  () at /usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
#8  0x00007ffff4304407 in  () at /usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
#9  0x00007ffff43046be in  () at /usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
#10 0x00007ffff70faade in  () at /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#11 0x00007ffff6f42bd4 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007ffff6f4239d in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#13 0x00007ffff7d5eea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737196812032, 3187003581449449030, 140737488346782, 140737488346783, 140737196809344, 8396800, -3187035739079496122, -3187020812306928058}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#14 0x00007ffff6962eaf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 4 (Thread 0x7fffef7fe700 (LWP 45147)):
#0  0x00007ffff69584bf in __GI___poll (fds=0x5555557417e0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
        resultvar = 18446744073709551100
        sc_cancel_oldtype = 0
#1  0x00007ffff6f1a46e in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff6f1a58f in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff45b4d8d in  () at /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
#4  0x00007ffff6f4239d in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff7d5eea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737211524864, 3187003581449449030, 140737488347214, 140737488347215, 140737211522176, 8396800, -3187039866543067578, -3187020812306928058}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#6  0x00007ffff6962eaf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 3 (Thread 0x7fffeffff700 (LWP 45146)):
#0  0x00007ffff69584bf in __GI___poll (fds=0x7fffe8016930, nfds=3, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
        resultvar = 18446744073709551100
        sc_cancel_oldtype = 0
#1  0x00007ffff6f1a46e in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff6f1a7d3 in g_main_loop_run () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff715f276 in  () at /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x00007ffff6f4239d in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff7d5eea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737219917568, 3187003581449449030, 140737488344254, 140737488344255, 140737219914880, 8396800, -3187038765420827066, -3187020812306928058}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#6  0x00007ffff6962eaf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7ffff4e1a700 (LWP 45145)):
#0  0x00007ffff69584bf in __GI___poll (fds=0x55555567f580, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
        resultvar = 18446744073709551100
        sc_cancel_oldtype = 0
#1  0x00007ffff6f1a46e in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff6f1a58f in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff6f1a5e1 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff6f4239d in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff7d5eea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737301817088, 3187003581449449030, 140737488343854, 140737488343855, 140737301814400, 8396800, -3187023393196003770, -3187020812306928058}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#6  0x00007ffff6962eaf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7ffff540af00 (LWP 45141)):
#0  0x00007ffff7029c16 in g_type_check_instance_cast () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#1  0x00007ffff42c7f28 in update_button_state () at /usr/lib/x86_64-linux-gnu/mate-panel/libwnck-applet.so
#2  0x00007ffff42c8d1a in show_desktop_changed_callback () at /usr/lib/x86_64-linux-gnu/mate-panel/libwnck-applet.so
#3  0x00007ffff7003126 in  () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#4  0x00007ffff702123e in g_signal_emit_valist () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#5  0x00007ffff7021812 in g_signal_emit () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#6  0x00007ffff41ef331 in  () at /usr/lib/x86_64-linux-gnu/libwnck-3.so.0
#7  0x00007ffff41eecca in  () at /usr/lib/x86_64-linux-gnu/libwnck-3.so.0
#8  0x00007ffff41eeeaf in  () at /usr/lib/x86_64-linux-gnu/libwnck-3.so.0
#9  0x00007ffff41eeef9 in  () at /usr/lib/x86_64-linux-gnu/libwnck-3.so.0
#10 0x00007ffff6f1a17e in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007ffff6f1a500 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007ffff6f1a7d3 in g_main_loop_run () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#13 0x00007ffff7706105 in gtk_main () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#14 0x00005555555791a8 in main ()


@lukefromdc
Copy link
Member

Since the first backtrace appeared to point to the show desktop button, I tried again (under x11 again)with that applet removed from the panel. Got another segfault, this time inpager_update()with:

Reading symbols from mate-panel...
(No debugging symbols found in mate-panel)
(gdb) run
Starting program: /usr/bin/mate-panel 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff4e1a700 (LWP 53163)]
[New Thread 0x7fffeffff700 (LWP 53164)]
[New Thread 0x7fffef7fe700 (LWP 53165)]
[New Thread 0x7fffee9f6700 (LWP 53166)]
[New Thread 0x7fffde4e6700 (LWP 53194)]
[New Thread 0x7fffddce5700 (LWP 53195)]

Thread 1 "mate-panel" received signal SIGSEGV, Segmentation fault.
0x00007ffff42c4ac9 in pager_update ()
   from /usr/lib/x86_64-linux-gnu/mate-panel/libwnck-applet.so
(gdb) thread apply bt full
Invalid thread ID: bt full
(gdb) thread apply all bt full

Thread 7 (Thread 0x7fffddce5700 (LWP 53195)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff6f64d12 in g_cond_wait_until () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff6eec511 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff6f42d2a in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff6f4239d in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff7d5eea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140736914675456, -7206737669677682687, 140737488345198, 140737488345199, 140736914672768, 8396800, 7206671831727566849, 7206720301356642305}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#6  0x00007ffff6962eaf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 6 (Thread 0x7fffde4e6700 (LWP 53194)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff6f64d12 in g_cond_wait_until () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff6eec511 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff6f42d2a in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
--Type <RET> for more, q to quit, c to continue without paging--c
#4  0x00007ffff6f4239d in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff7d5eea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140736923068160, -7206737669677682687, 140737488347406, 140737488347407, 140736923065472, 8396800, 7206668532655812609, 7206720301356642305}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#6  0x00007ffff6962eaf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 5 (Thread 0x7fffee9f6700 (LWP 53166)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff6f64d12 in g_cond_wait_until () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff6eec511 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff6f42d2a in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff6f4239d in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff7d5eea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737196812032, -7206737669677682687, 140737488346782, 140737488346783, 140737196809344, 8396800, 7206704412812603393, 7206720301356642305}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#6  0x00007ffff6962eaf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 4 (Thread 0x7fffef7fe700 (LWP 53165)):
#0  0x00007ffff69584bf in __GI___poll (fds=0x5555557329e0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
        resultvar = 18446744073709551100
        sc_cancel_oldtype = 0
#1  0x00007ffff6f1a46e in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff6f1a58f in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff45b4d8d in  () at /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
#4  0x00007ffff6f4239d in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff7d5eea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737211524864, -7206737669677682687, 140737488347214, 140737488347215, 140737211522176, 8396800, 7206701384860659713, 7206720301356642305}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#6  0x00007ffff6962eaf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 3 (Thread 0x7fffeffff700 (LWP 53164)):
#0  0x00007ffff69584bf in __GI___poll (fds=0x555555695810, nfds=3, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
        resultvar = 18446744073709551100
        sc_cancel_oldtype = 0
#1  0x00007ffff6f1a46e in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff6f1a7d3 in g_main_loop_run () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff715f276 in  () at /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x00007ffff6f4239d in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff7d5eea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737219917568, -7206737669677682687, 140737488344254, 140737488344255, 140737219914880, 8396800, 7206702485982900225, 7206720301356642305}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#6  0x00007ffff6962eaf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7ffff4e1a700 (LWP 53163)):
#0  0x00007ffff69584bf in __GI___poll (fds=0x555555682910, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
        resultvar = 18446744073709551100
        sc_cancel_oldtype = 0
#1  0x00007ffff6f1a46e in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff6f1a58f in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff6f1a5e1 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff6f4239d in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff7d5eea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737301817088, -7206737669677682687, 140737488343854, 140737488343855, 140737301814400, 8396800, 7206726452437282817, 7206720301356642305}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#6  0x00007ffff6962eaf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7ffff540af00 (LWP 53159)):
#0  0x00007ffff42c4ac9 in pager_update () at /usr/lib/x86_64-linux-gnu/mate-panel/libwnck-applet.so
#1  0x00007ffff42c4ff6 in window_manager_changed () at /usr/lib/x86_64-linux-gnu/mate-panel/libwnck-applet.so
#2  0x00007ffff7003126 in  () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#3  0x00007ffff702123e in g_signal_emit_valist () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#4  0x00007ffff7021812 in g_signal_emit () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#5  0x00007ffff41ef3b1 in  () at /usr/lib/x86_64-linux-gnu/libwnck-3.so.0
#6  0x00007ffff41eedc3 in  () at /usr/lib/x86_64-linux-gnu/libwnck-3.so.0
#7  0x00007ffff41eeebb in  () at /usr/lib/x86_64-linux-gnu/libwnck-3.so.0
#8  0x00007ffff41eeef9 in  () at /usr/lib/x86_64-linux-gnu/libwnck-3.so.0
#9  0x00007ffff6f1a17e in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007ffff6f1a500 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007ffff6f1a7d3 in g_main_loop_run () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007ffff7706105 in gtk_main () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#13 0x00005555555791a8 in main ()
(gdb) 

@lukefromdc
Copy link
Member

Retested on my very old Wayfire install-and it worked quite well, with an entirely functional taskbar on a wayfire install that dates all the way back to July 2019.

Now we just need to make it work on x11 as well: the segfaults are x11-only it seems.

Note that if both X11 and wayfire sessions are running at the same time on different tty's as usual since the dbus work you must launch the panel from the existing mate/x11 session and it will show up in (and only in) the wayfire session

@lukefromdc lukefromdc requested review from a team and removed request for a team October 2, 2020 23:45
@wmww
Copy link
Contributor Author

wmww commented Oct 3, 2020

Ah! I changed the signature of a function not noticing it was being used as a callback. Two instances of the same mistake in the desktop button an workspace switcher. Now should be good to go.

Copy link
Member

@lukefromdc lukefromdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now works, gives me a working tasklist both in x11 and in wayfire (even my old version). As far as function is concerned, this looks good to go.

This in fact is the biggest difference in making a Mate on Wayland environment functional. The others (now that what I thought was the toughest part has a solution) is to port the other panel applets (including the indicator applet) to in-process, port our remaining tray icons to indicators or applets, and ideally write a native wayland desktop icon window for Caja. Since Wayland is always a compositor, we would basically need to take the existing caja navigation window that can already run under wayland, strip it down, and force it to be always on the bottom (which the desktop on xwayland is NOT)

@@ -361,6 +361,7 @@ void
wayland_tasklist_set_orientation (GtkWidget* tasklist_widget, GtkOrientation orient)
{
TasklistManager *tasklist = tasklist_widget_get_tasklist (tasklist_widget);
g_return_if_fail(tasklist);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A space is missing before opening bracket.
I mean this is your code-style in this file :)

@@ -194,7 +194,7 @@ AC_ARG_ENABLE(wayland,
# Check if we have gtk-layer-shell installed, and thus should build with Wayland support
have_wayland=no
if test "x$enable_wayland" != "xno"; then
PKG_CHECK_MODULES(GTK_LAYER_SHELL, gtk-layer-shell-0, have_wayland=yes, [
PKG_CHECK_MODULES(WAYLAND, gtk-layer-shell-0 wayland-client, have_wayland=yes, [
if test "x$enable_wayland" = "xyes"; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, mate-panel depends on libwayland and gtk-layer-shell now?

Copy link
Member

@lukefromdc lukefromdc Oct 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only if Wayland support is to be enabled:
if test "x$enable_wayland" != "xno"; then

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question wasn't if wayland support is enabled or not. I always build with wayland and X11 support since wayland is supported.
But Ok, i have to add wayland-devel as build requires

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. Previously all of the Wayland interaction was done via GTK and GTK Layer Shell, but to support the foreign toplevel protocol the applet needs to use libwayland directly.

@raveit65
Copy link
Member

First commit is a bit misleading because
a) you did a lot more in this commit
b) the applet was never crashing with x11 ;)

applets/wncklet/showdesktop.c Outdated Show resolved Hide resolved
@raveit65
Copy link
Member

raveit65 commented Oct 10, 2020

The windows-list-applet does work under wayland with minimal function, other wncklet applets like show-desktop, workspace-switcher or windows-menu are disabled.
I found one issue.
The main right-click (context) menu should only be shown when clicking on the 3 points at left side of the applet.
Clicking on task-list-buttons should show the menu for minimize, maximize or full-screen menu-items of a window.
Same like with x11.
And i think we should disable the preferences menu item in context menu under wayland for the moment, if possible...
Because all configure options do nothing under wayland.

@raveit65
Copy link
Member

Interesting, the applet shows all windows of all workspaces under wayfire.

@wmww
Copy link
Contributor Author

wmww commented Oct 11, 2020

the applet was never crashing with x11 ;)

Only because it was disabled on X11 and so never created for it

@wmww
Copy link
Contributor Author

wmww commented Oct 11, 2020

Interesting, the applet shows all windows of all workspaces under wayfire.

The foreign toplevel management protocol is not workspace-aware, so there is no way to limit which windows are shown. That will need to be addressed in a new protocol version.

@wmww
Copy link
Contributor Author

wmww commented Oct 11, 2020

Clicking on task-list-buttons should show the menu for minimize, maximize or full-screen menu-items of a window.

That's implemented in Wncklet, and will need to be re-implemented. This PR is just a usable starting point, and does not claim feature parity with X11. Since the tasklist currently doesn't work at all on Wayland, I don't see why being feature-complete would be required.

I'll look into disabling the preferences options on Monday.

@raveit65
Copy link
Member

the applet was never crashing with x11 ;)

Only because it was disabled on X11 and so never created for it

Nope, this isn't true. All wnck applets were never disabled on X11.
It was disabled only for wayland.

I found one issue.
The main right-click (context) menu should only be shown when clicking on the 3 points at left side of the applet.
Clicking on task-list-buttons should show the menu for minimize, maximize or full-screen menu-items of a window.
Same like with x11.

That's implemented in Wncklet, and will need to be re-implemented. This PR is just a usable starting point, and does not claim feature parity with X11. Since the tasklist currently doesn't work at all on Wayland, I don't see why being feature-complete would be required.

Is my English really so bad?
I only said that the wrong context menu is shown on tasklist button.
The main context-menu should only be shown when clicking on the three points left from the applet.

@raveit65
Copy link
Member

raveit65 commented Oct 11, 2020

Main context-menu under X11 (clicking on the 3 points left from applet) = good
context-menu-main-x11

Task-list-button-context-menu under x11 = good
context-menu-task-list-button-x11

Main context-menu under wayland (clicking on the 3 points left from applet) = good
context-menu-main-wayland

Task-list-button-context-menu under wayland (clicking on button for firefox) = wrong
context-menu-task-list-button-wayland
As you can see clicking on tasklist button opens the wrong menu.

I agree with you that this PR is a starting point and far away from being perfect,
but showing the main-context-menu on task-list-button is wrong.

Edit:
I prefer not to show a context-menu when clicking on task-list button for the moment when features aren't implemented under wayland.

@lukefromdc
Copy link
Member

I agree that this is a starting point, and we need to get this fully working one piece at a time. No reason not to merge things that work, and in this case this PR makes what for me is the FIRST usable panel on Wayland, as you can minimize a window to the taskbar and restore it. That is the single most important part, and it works. If we cannot stop from getting the wrong menu on the taskbar buttons, it would be enough for now to simply disable showing any menu on them until the necessary code from wnck can be reimplemented later, in another PR. That's my judgement anyway

@wmww
Copy link
Contributor Author

wmww commented Oct 13, 2020

Nope, this isn't true. All wnck applets were never disabled on X11.
It was disabled only for wayland.

You would think by now I would know the difference between X11 and Wayland, but clearly I do not. I will fix that commit message when I clean up this PR. I'll also try to disable the context menu if it's easy, but might not bother if that's tricky for some reason. I said I would do things today, which I did not do. Maybe I'll do them tomorrow. We'll see.

@wmww wmww force-pushed the wncklet-wayland branch 2 times, most recently from 65d1240 to 230d2ce Compare October 16, 2020 17:53
@wmww
Copy link
Contributor Author

wmww commented Oct 16, 2020

Work has been busy for a few days, but I'm back now. The only thing I changed in the rebase was that first commit message. I switched to the old comment style and suppressed the context menu for window buttons. Anything else needed?

applets/wncklet/window-list.c Outdated Show resolved Hide resolved
@raveit65
Copy link
Member

raveit65 commented Oct 17, 2020

Any chance to disable the options in preferences Window for wayland? I think none of them can be used actually for wayland.

Edit: Or maybe it is possible to grey out the Preferences menu-entry for wayland? Might be easier.

But not a blocker for me if it is unneeded work or not possible, because only a few people will use this early stage of wayland support.

@raveit65
Copy link
Member

I can confirm that context-menu is disabled on tasklist buttons.
Thanks

Copy link
Member

@raveit65 raveit65 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Maybe the 2 fixes for the C comments can be squashed before merging?

@wmww
Copy link
Contributor Author

wmww commented Oct 20, 2020

Maybe the 2 fixes for the C comments can be squashed before merging?

Done

@raveit65
Copy link
Member

raveit65 commented Oct 21, 2020

Anyone else like to approve it after latest changes?

Copy link
Contributor

@rbuj rbuj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@raveit65
Copy link
Member

Thank you

@raveit65 raveit65 merged commit c100c45 into mate-desktop:master Oct 21, 2020
@lukefromdc
Copy link
Member

Just tested this on master as merged, works quite well in my old wayfire install, and on x11

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

Successfully merging this pull request may close these issues.

4 participants