Closed xbjfk closed 8 months ago
Either something like
--- i/src/view/view.cpp
+++ w/src/view/view.cpp
@@ -339,7 +339,7 @@ wf::pointf_t wf::view_interface_t::global_to_local_point(const wf::pointf_t& arg
result.y -= og.y;
/* Go up from the surface, finding offsets */
- while (surface && surface != this)
+ while (surface && surface != this && surface->is_mapped())
{
auto offset = surface->get_offset();
result.x -= offset.x;
or just
--- i/src/view/subsurface.cpp
+++ w/src/view/subsurface.cpp
@@ -41,7 +41,8 @@ wf::subsurface_implementation_t::subsurface_implementation_t(wlr_subsurface *_su
wf::point_t wf::subsurface_implementation_t::get_offset()
{
- assert(is_mapped());
+ if (!is_mapped())
+ return {0, 0};
return {
sub->current.x,
??? @ammen99
I cannot reproduce in a nested Wayfire session. Is there something special I need to configure?
i have the same problem, when closing foot terminal wayfire crash. please check this although is from a previous version of wayfire still happen in version 0.7.3
wayfire: ../wayfire-0.7.2/src/view/subsurface.cpp:44: virtual wf::point_t wf::subsurface_implementation_t::get_offset(): Assertion `is_mapped()' failed.
Thread 1 "wayfire" received signal SIGABRT, Aborted.
0x00007ffff770eef5 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0 0x00007ffff770eef5 in raise () at /usr/lib/libc.so.6
#1 0x00007ffff76f8862 in abort () at /usr/lib/libc.so.6
#2 0x00007ffff76f8747 in _nl_load_domain.cold () at /usr/lib/libc.so.6
#3 0x00007ffff7707646 in () at /usr/lib/libc.so.6
#4 0x00005555555e05b6 in wf::subsurface_implementation_t::get_offset() (this=<optimized out>) at ../wayfire-0.7.2/src/view/subsurface.cpp:42
#5 wf::subsurface_implementation_t::get_offset() (this=0x555556034660) at ../wayfire-0.7.2/src/view/subsurface.cpp:42
#6 0x00005555555e0f1e in wf::view_interface_t::global_to_local_point(wf::pointf_t const&, wf::surface_interface_t*)
(this=0x555556044618, arg=<optimized out>, surface=0x555556034660) at ../wayfire-0.7.2/src/view/view.cpp:345
#7 0x00005555555d9ab4 in get_surface_relative_coords(wf::surface_interface_t*, wf::pointf_t const&) (surface=0x55555604e600, point=...)
at ../wayfire-0.7.2/src/core/seat/seat.cpp:431
#8 0x00005555555d28a2 in wf::pointer_t::update_cursor_position(unsigned int, bool) (this=0x555555ce8110, time_msec=31275672, real_update=<optimized out>)
at ../wayfire-0.7.2/src/core/seat/pointer.cpp:85
#9 0x00005555555c4ea6 in std::function<void (void*)>::operator()(void*) const (__args#0=<optimized out>, this=<optimized out>)
at /usr/include/c++/11.1.0/bits/std_function.h:560
#10 operator() (__closure=<optimized out>, __closure=<optimized out>, data=<optimized out>) at ../wayfire-0.7.2/src/core/seat/input-manager.cpp:321
#11 std::__invoke_impl<void, wf::SurfaceMapStateListener::SurfaceMapStateListener()::<lambda(void*)>&, wf::signal_data_t*> (__f=<optimized out>)
at /usr/include/c++/11.1.0/bits/invoke.h:61
#12 std::__invoke_r<void, wf::SurfaceMapStateListener::SurfaceMapStateListener()::<lambda(void*)>&, wf::signal_data_t*> (__fn=<optimized out>)
at /usr/include/c++/11.1.0/bits/invoke.h:111
#13 std::_Function_handler<void(wf::signal_data_t*), wf::SurfaceMapStateListener::SurfaceMapStateListener()::<lambda(void*)> >::_M_invoke(const std::_Any_data &, wf::signal_data_t *&&) (__functor=<optimized out>, __args#0=<optimized out>) at /usr/include/c++/11.1.0/bits/std_function.h:291
#14 0x00005555555adacc in std::function<void (void*)>::operator()(void*) const (__args#0=<optimized out>, this=<optimized out>)
at /usr/include/c++/11.1.0/bits/std_function.h:560
#15 operator()<std::function<void(wf::signal_data_t*)>*> (call=<optimized out>, __closure=<optimized out>) at ../wayfire-0.7.2/src/core/object.cpp:136
#16 std::__invoke_impl<void, wf::signal_provider_t::emit_signal(std::string, wf::signal_data_t*)::<lambda(auto:3)>&, std::function<void(wf::signal_data_t*)>*&>
(__f=<optimized out>) at /usr/include/c++/11.1.0/bits/invoke.h:61
#17 std::__invoke_r<void, wf::signal_provider_t::emit_signal(std::string, wf::signal_data_t*)::<lambda(auto:3)>&, std::function<void(wf::signal_data_t*)>*&>
(__fn=<optimized out>) at /usr/include/c++/11.1.0/bits/invoke.h:111
#18 std::_Function_handler<void(std::function<void(wf::signal_data_t*)>*&), wf::signal_provider_t::emit_signal(std::string, wf::signal_data_t*)::<lambda(auto:3)> >::_M_invoke(const std::_Any_data &, std::function<void(wf::signal_data_t*)> *&) (__functor=<optimized out>, __args#0=<optimized out>)
at /usr/include/c++/11.1.0/bits/std_function.h:291
#19 0x00005555555b1ea8 in std::function<void (wf::signal_connection_t*&)>::operator()(wf::signal_connection_t*&) const
(__args#0=<optimized out>, this=0x7fffffffd620) at /usr/include/c++/11.1.0/bits/std_function.h:560
#20 wf::safe_list_t<std::function<void (wf::signal_data_t*)>*>::for_each(std::function<void (std::function<void (wf::signal_data_t*)>*&)>) const
(func=..., this=<optimized out>) at ../wayfire-0.7.2/src/api/wayfire/nonstd/safe-list.hpp:203
#21 wf::signal_provider_t::emit_signal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, wf::signal_data_t*)
(this=0x5555556535a0 <wf::compositor_core_impl_t::get()::instance>, name="surface-unmapped", data=0x7fffffffd690)
at ../wayfire-0.7.2/src/core/object.cpp:134
#22 0x00005555555e3fb9 in wf::emit_map_state_change(wf::surface_interface_t*) (surface=0x7fffffffd6d0) at ../wayfire-0.7.2/src/view/surface.cpp:307
#23 0x00005555555e413c in wf::wlr_surface_base_t::unmap() (this=0x555556034680) at ../wayfire-0.7.2/src/view/surface.cpp:348
#24 0x00005555555a1c3a in std::function<void (void*)>::operator()(void*) const (__args#0=<optimized out>, this=<optimized out>)
at /usr/include/c++/11.1.0/bits/std_function.h:560
#25 wf::wl_listener_wrapper::emit(void*) (data=<optimized out>, this=<optimized out>) at ../wayfire-0.7.2/src/util.cpp:526
#26 handle_wrapped_listener(wl_listener*, void*) (listener=<optimized out>, data=<optimized out>) at ../wayfire-0.7.2/src/util.cpp:463
#27 0x00007ffff7f22a6e in wlr_signal_emit_safe () at /usr/lib/libwlroots.so.9
#28 0x00007ffff7f22c9d in () at /usr/lib/libwlroots.so.9
#29 0x00007ffff7f1af19 in () at /usr/lib/libwlroots.so.9
#30 0x00007ffff76cd0e6 in () at /usr/lib/libffi.so.8
#31 0x00007ffff76cc497 in () at /usr/lib/libffi.so.8
#32 0x00007ffff7f76303 in () at /usr/lib/libwayland-server.so.0
#33 0x00007ffff7f7159c in () at /usr/lib/libwayland-server.so.0
#34 0x00007ffff7f7415a in wl_event_loop_dispatch () at /usr/lib/libwayland-server.so.0
#35 0x00007ffff7f71c37 in wl_display_run () at /usr/lib/libwayland-server.so.0
#36 0x00005555555a07e5 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at ../wayfire-0.7.2/src/main.cpp:312
+1
@ammen99 I can reproduce this with latest wayfire and latest foot terminal. This is the backtrace I get:
II 22-08-22 19:55:04.210 - [src/view/xdg-shell.cpp:201] new xdg_shell_stable surface: (null) app-id: foot
wayfire: ../src/view/subsurface.cpp:44: virtual wf::point_t wf::subsurface_implementation_t::get_offset(): Assertion `is_mapped()' failed.
EE 22-08-22 19:55:06.313 - [src/main.cpp:132] Fatal error: Fatal error(SIGABRT)
EE 22-08-22 19:55:06.363 - #1 signal_handler(int) ../src/main.cpp:134
EE 22-08-22 19:55:06.541 - #2 __restore_rt sigaction.c:?
EE 22-08-22 19:55:06.676 - #3 __GI_raise ../sysdeps/unix/sysv/linux/raise.c:51 (discriminator 3)
EE 22-08-22 19:55:06.810 - #4 __GI_abort /build/glibc-sMfBJT/glibc-2.31/stdlib/abort.c:81 (discriminator 34)
EE 22-08-22 19:55:06.944 - #5 get_sysdep_segment_value /build/glibc-sMfBJT/glibc-2.31/intl/loadmsgcat.c:509
EE 22-08-22 19:55:07.120 - #6 __GI___assert_fail :?
EE 22-08-22 19:55:07.168 - #7 wf::subsurface_implementation_t::get_offset() ../src/view/subsurface.cpp:47
EE 22-08-22 19:55:07.225 - #8 wf::view_interface_t::global_to_local_point(wf::pointf_t const&, wf::surface_interface_t*) ../src/view/view.cpp:344
EE 22-08-22 19:55:07.280 - #9 get_surface_relative_coords(wf::surface_interface_t*, wf::pointf_t const&) ../src/core/seat/seat.cpp:431 (discriminator 5)
EE 22-08-22 19:55:07.329 - #10 wf::pointer_t::update_cursor_position(unsigned int, bool) ../src/core/seat/pointer.cpp:85
EE 22-08-22 19:55:07.385 - #11 auto wf::pointer_t::pointer_t(nonstd::observer_ptr<wf::input_manager_t>, nonstd::observer_ptr<wf::seat_t>)::{lambda(auto:1)#1}::operator()<wf::surface_interface_t*>(wf::surface_interface_t*) const ../src/core/seat/pointer.cpp:26
EE 22-08-22 19:55:07.437 - #12 std::_Function_handler<void (wf::surface_interface_t*), wf::pointer_t::pointer_t(nonstd::observer_ptr<wf::input_manager_t>, nonstd::observer_ptr<wf::seat_t>)::{lambda(auto:1)#1}>::_M_invoke(std::_Any_data const&, wf::surface_interface_t*&&) /usr/include/c++/9/bits/std_function.h:302
EE 22-08-22 19:55:07.494 - #13 std::function<void (wf::surface_interface_t*)>::operator()(wf::surface_interface_t*) const /usr/include/c++/9/bits/std_function.h:688
EE 22-08-22 19:55:07.553 - #14 wf::SurfaceMapStateListener::SurfaceMapStateListener()::{lambda(void*)#1}::operator()(void*) const ../src/core/seat/input-manager.cpp:330
EE 22-08-22 19:55:07.608 - #15 std::_Function_handler<void (wf::signal_data_t*), wf::SurfaceMapStateListener::SurfaceMapStateListener()::{lambda(void*)#1}>::_M_invoke(std::_Any_data const&, wf::signal_data_t*&&) /usr/include/c++/9/bits/std_function.h:302
EE 22-08-22 19:55:07.658 - #16 std::function<void (wf::signal_data_t*)>::operator()(wf::signal_data_t*) const /usr/include/c++/9/bits/std_function.h:688
EE 22-08-22 19:55:07.706 - #17 wf::signal_connection_t::emit(wf::signal_data_t*) ../src/core/object.cpp:49
EE 22-08-22 19:55:07.754 - #18 auto wf::signal_provider_t::emit_signal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, wf::signal_data_t*)::{lambda(auto:1)#1}::operator()<wf::signal_connection_t*>(wf::signal_connection_t*) const ../src/core/object.cpp:114
EE 22-08-22 19:55:07.802 - #19 std::_Function_handler<void (wf::signal_connection_t*&), wf::signal_provider_t::emit_signal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, wf::signal_data_t*)::{lambda(auto:1)#1}>::_M_invoke(std::_Any_data const&, wf::signal_connection_t*&) /usr/include/c++/9/bits/std_function.h:302
EE 22-08-22 19:55:07.848 - #20 std::function<void (wf::signal_connection_t*&)>::operator()(wf::signal_connection_t*&) const /usr/include/c++/9/bits/std_function.h:688
EE 22-08-22 19:55:07.899 - #21 wf::safe_list_t<wf::signal_connection_t*>::for_each(std::function<void (wf::signal_connection_t*&)>) const ../src/api/wayfire/nonstd/safe-list.hpp:177 (discriminator 2)
EE 22-08-22 19:55:07.949 - #22 wf::signal_provider_t::emit_signal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, wf::signal_data_t*) ../src/core/object.cpp:111 (discriminator 2)
EE 22-08-22 19:55:08.002 - #23 wf::emit_map_state_change(wf::surface_interface_t*) ../src/view/surface.cpp:319 (discriminator 4)
EE 22-08-22 19:55:08.051 - #24 wf::wlr_surface_base_t::unmap() ../src/view/surface.cpp:362
EE 22-08-22 19:55:08.102 - #25 wf::subsurface_implementation_t::subsurface_implementation_t(wlr_subsurface*)::{lambda(void*)#2}::operator()(void*) const ../src/view/subsurface.cpp:14
EE 22-08-22 19:55:08.150 - #26 std::_Function_handler<void (void*), wf::subsurface_implementation_t::subsurface_implementation_t(wlr_subsurface*)::{lambda(void*)#2}>::_M_invoke(std::_Any_data const&, void*&&) /usr/include/c++/9/bits/std_function.h:302
EE 22-08-22 19:55:08.190 - #27 std::function<void (void*)>::operator()(void*) const /usr/include/c++/9/bits/std_function.h:688
EE 22-08-22 19:55:08.228 - #28 wf::wl_listener_wrapper::emit(void*) ../src/wl-listener-wrapper.tpp:59
EE 22-08-22 19:55:08.273 - #29 wf::handle_wrapped_listener(wl_listener*, void*) ../src/wl-listener-wrapper.tpp:11
EE 22-08-22 19:55:08.290 - #30 wlr_signal_emit_safe ../util/signal.c:22
EE 22-08-22 19:55:08.308 - #31 subsurface_unmap ../types/wlr_surface.c:1055
EE 22-08-22 19:55:08.325 - #32 subsurface_role_precommit ../types/wlr_surface.c:1089
EE 22-08-22 19:55:08.345 - #33 surface_handle_commit ../types/wlr_surface.c:559
EE 22-08-22 19:55:08.356 - #34 ffi_prep_go_closure ??:?
EE 22-08-22 19:55:08.367 - #35 ffi_closure_free ??:?
EE 22-08-22 19:55:08.379 - #36 wl_closure_invoke ../src/connection.c:1027
EE 22-08-22 19:55:08.393 - #37 wl_client_connection_data ../src/wayland-server.c:437
EE 22-08-22 19:55:08.406 - #38 wl_event_loop_dispatch ../src/event-loop.c:1024 (discriminator 2)
EE 22-08-22 19:55:08.417 - #39 wl_display_run ../src/wayland-server.c:1406
EE 22-08-22 19:55:08.458 - #40 main ../src/main.cpp:364
EE 22-08-22 19:55:08.591 - #41 __libc_start_main ../csu/libc-start.c:342
EE 22-08-22 19:55:08.644 - #42 _start ??:?
I tried @unrelentingtech second patch and it fixes the problem.
I believe this is no longer an issue with wayfire-git.
I'll check that, thanks!El 26 feb 2024 06:49, Ilia Bozhinov @.***> escribió: I believe this is no longer an issue with wayfire-git.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>
Describe the bug When foot uses CSD, and the close button is clicked, wayfire crashes.
To Reproduce Steps to reproduce the behavior:
Expected behavior Foot closes and wayfire does not crash
Screenshots or stacktrace Backtrace with address sanitizer enabled (if possible): see https://codeberg.org/dnkl/foot/issues/766#issuecomment-274572
Wayfire version git latest