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

Port to wlroots 0.18.x #2452

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

Port to wlroots 0.18.x #2452

wants to merge 21 commits into from

Conversation

soreau
Copy link
Member

@soreau soreau commented Aug 26, 2024

Gotchas:

wl_drm was dropped, so clients must update. A notable one is libva, which stopped working with wlroots 0.18 until upgrading libva.

wlr_input_inhibit was dropped and as of now, there is no replacement.

Possibilities:

linux-drm-syncobj-v1

@mark-herbert42
Copy link

Compiled 0.9 with this PR - works ok so far. Seems like the new wlroots is better in terms of battery life at least for firefox-youtube.

@soreau
Copy link
Member Author

soreau commented Aug 27, 2024

Compiled 0.9 with this PR - works ok so far. Seems like the new wlroots is better in terms of battery life at least for firefox-youtube.

Thanks for testing!

@soreau soreau force-pushed the track-wlroots branch 28 times, most recently from 0e5e05e to c9c1798 Compare September 1, 2024 10:35
@killown
Copy link
Contributor

killown commented Sep 3, 2024

fuzz tests crash related to your branch

EE 03-09-24 14:41:52.567 - [src/api/wayfire/dassert.hpp:26] Adding a child node twice!
AddressSanitizer:DEADLYSIGNAL
=================================================================
==39316==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x58bbd4d01b7a bp 0x7ffde566ecd0 sp 0x7ffde566ddd0 T0)
==39316==The signal is caused by a WRITE memory access.
==39316==Hint: address points to the zero page.
    #0 0x58bbd4d01b7a in wf::print_trace(bool) ../src/debug.cpp:231
    #1 0x58bbd4da9c68 in wf::dassert(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) ../src/api/wayfire/dassert.hpp:27
    #2 0x58bbd4da9c68 in wf::scene::node_t::set_children_unchecked(std::vector<std::shared_ptr<wf::scene::node_t>, std::allocator<std::shared_ptr<wf::scene::node_t> > >) ../src/core/scene.cpp:136
    #3 0x58bbd4daa05e in wf::scene::floating_inner_node_t::set_children_list(std::vector<std::shared_ptr<wf::scene::node_t>, std::allocator<std::shared_ptr<wf::scene::node_t> > >) ../src/core/scene.cpp:120
    #4 0x58bbd4dc35dc in wf::scene::add_front(std::shared_ptr<wf::scene::floating_inner_node_t>, std::shared_ptr<wf::scene::node_t>) ../src/api/wayfire/scene-operations.hpp:38
    #5 0x58bbd4dc42b8 in wf::start_move_view_to_wset(nonstd::observer_ptr<wf::toplevel_view_interface_t>, std::shared_ptr<wf::workspace_set_t>) ../src/core/core.cpp:494
    #6 0x58bbd4dc4971 in wf::move_view_to_output(nonstd::observer_ptr<wf::toplevel_view_interface_t>, wf::output_t*, bool) ../src/core/core.cpp:532
    #7 0x58bbd4d0e8f0 in wf::window_manager_t::fullscreen_request(nonstd::observer_ptr<wf::toplevel_view_interface_t>, wf::output_t*, bool, std::optional<wf::point_t>) ../src/core/window-manager.cpp:256
    #8 0x722e237436d1 in wayfire_wm_actions_t::ipc_set_fullscreen::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&)#1}::operator()(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&) const::{lambda(nonstd::observer_ptr<wf::toplevel_view_interface_t>, bool)#1}::operator()(nonstd::observer_ptr<wf::toplevel_view_interface_t>, bool) const ../plugins/wm-actions/wm-actions.cpp:474
    #9 0x722e237436d1 in void std::__invoke_impl<void, wayfire_wm_actions_t::ipc_set_fullscreen::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&)#1}::operator()(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&) const::{lambda(nonstd::observer_ptr<wf::toplevel_view_interface_t>, bool)#1}&, nonstd::observer_ptr<wf::toplevel_view_interface_t>, bool>(std::__invoke_other, wayfire_wm_actions_t::ipc_set_fullscreen::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&)#1}::operator()(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&) const::{lambda(nonstd::observer_ptr<wf::toplevel_view_interface_t>, bool)#1}&, nonstd::observer_ptr<wf::toplevel_view_interface_t>&&, bool&&) /usr/include/c++/14.2.1/bits/invoke.h:61
    #10 0x722e237436d1 in std::enable_if<is_invocable_r_v<void, wayfire_wm_actions_t::ipc_set_fullscreen::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&)#1}::operator()(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&) const::{lambda(nonstd::observer_ptr<wf::toplevel_view_interface_t>, bool)#1}&, nonstd::observer_ptr<wf::toplevel_view_interface_t>, bool>, void>::type std::__invoke_r<void, wayfire_wm_actions_t::ipc_set_fullscreen::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&)#1}::operator()(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&) const::{lambda(nonstd::observer_ptr<wf::toplevel_view_interface_t>, bool)#1}&, nonstd::observer_ptr<wf::toplevel_view_interface_t>, bool>(wayfire_wm_actions_t::ipc_set_fullscreen::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&)#1}::operator()(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&) const::{lambda(nonstd::observer_ptr<wf::toplevel_view_interface_t>, bool)#1}&, nonstd::observer_ptr<wf::toplevel_view_interface_t>&&, bool&&) /usr/include/c++/14.2.1/bits/invoke.h:111
    #11 0x722e237436d1 in std::_Function_handler<void (nonstd::observer_ptr<wf::toplevel_view_interface_t>, bool), wayfire_wm_actions_t::ipc_set_fullscreen::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&)#1}::operator()(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&) const::{lambda(nonstd::observer_ptr<wf::toplevel_view_interface_t>, bool)#1}>::_M_invoke(std::_Any_data const&, nonstd::observer_ptr<wf::toplevel_view_interface_t>&&, bool&&) /usr/include/c++/14.2.1/bits/std_function.h:290
    #12 0x722e23783f31 in std::function<void (nonstd::observer_ptr<wf::toplevel_view_interface_t>, bool)>::operator()(nonstd::observer_ptr<wf::toplevel_view_interface_t>, bool) const /usr/include/c++/14.2.1/bits/std_function.h:591
    #13 0x722e23783f31 in wayfire_wm_actions_t::execute_for_view(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&, std::function<void (nonstd::observer_ptr<wf::toplevel_view_interface_t>, bool)>) [clone .isra.0] ../plugins/wm-actions/wm-actions.cpp:436
    #14 0x722e23748ae9 in wayfire_wm_actions_t::ipc_set_fullscreen::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&)#1}::operator()(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&) const ../plugins/wm-actions/wm-actions.cpp:475
    #15 0x722e23748ae9 in nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> std::__invoke_impl<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>, wayfire_wm_actions_t::ipc_set_fullscreen::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&)#1}&, nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> >(std::__invoke_other, wayfire_wm_actions_t::ipc_set_fullscreen::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&)#1}&, nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>&&) /usr/include/c++/14.2.1/bits/invoke.h:61
    #16 0x722e23748ae9 in std::enable_if<is_invocable_r_v<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>, wayfire_wm_actions_t::ipc_set_fullscreen::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&)#1}&, nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> >, nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> >::type std::__invoke_r<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>, wayfire_wm_actions_t::ipc_set_fullscreen::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&)#1}&, nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> >(wayfire_wm_actions_t::ipc_set_fullscreen::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&)#1}&, nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>&&) /usr/include/c++/14.2.1/bits/invoke.h:116
    #17 0x722e23748ae9 in std::_Function_handler<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> (nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>), wayfire_wm_actions_t::ipc_set_fullscreen::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&)#1}>::_M_invoke(std::_Any_data const&, nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>&&) /usr/include/c++/14.2.1/bits/std_function.h:291
    #18 0x722e27dd81ad in std::function<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> (nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>)>::operator()(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>) const /usr/include/c++/14.2.1/bits/std_function.h:591
    #19 0x722e27dd81ad in wf::ipc::method_repository_t::register_method(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::function<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> (nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>)>)::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&, wf::ipc::client_interface_t*)#1}::operator()(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&, wf::ipc::client_interface_t*) const ../plugins/ipc/ipc-method-repository.hpp:68
    #20 0x722e27dd81ad in nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> std::__invoke_impl<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>, wf::ipc::method_repository_t::register_method(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::function<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> (nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>)>)::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&, wf::ipc::client_interface_t*)#1}&, nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>, wf::ipc::client_interface_t*>(std::__invoke_other, wf::ipc::method_repository_t::register_method(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::function<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> (nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>)>)::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&, wf::ipc::client_interface_t*)#1}&, nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>&&, wf::ipc::client_interface_t*&&) /usr/include/c++/14.2.1/bits/invoke.h:61
    #21 0x722e27dd81ad in std::enable_if<is_invocable_r_v<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>, wf::ipc::method_repository_t::register_method(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::function<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> (nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>)>)::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&, wf::ipc::client_interface_t*)#1}&, nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>, wf::ipc::client_interface_t*>, nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> >::type std::__invoke_r<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>, wf::ipc::method_repository_t::register_method(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::function<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> (nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>)>)::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&, wf::ipc::client_interface_t*)#1}&, nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>, wf::ipc::client_interface_t*>(wf::ipc::method_repository_t::register_method(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::function<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> (nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>)>)::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&, wf::ipc::client_interface_t*)#1}&, nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>&&, wf::ipc::client_interface_t*&&) /usr/include/c++/14.2.1/bits/invoke.h:116
    #22 0x722e27dd81ad in std::_Function_handler<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> (nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>, wf::ipc::client_interface_t*), wf::ipc::method_repository_t::register_method(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::function<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> (nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>)>)::{lambda(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&, wf::ipc::client_interface_t*)#1}>::_M_invoke(std::_Any_data const&, nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>&&, wf::ipc::client_interface_t*&&) /usr/include/c++/14.2.1/bits/std_function.h:291
    #23 0x722e27393f8f in std::function<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> (nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>, wf::ipc::client_interface_t*)>::operator()(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>, wf::ipc::client_interface_t*) const /usr/include/c++/14.2.1/bits/std_function.h:591
    #24 0x722e27393f8f in wf::ipc::method_repository_t::call_method(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>, wf::ipc::client_interface_t*) ../plugins/ipc/ipc-method-repository.hpp:89
    #25 0x722e27393f8f in wf::ipc::server_t::handle_incoming_message(wf::ipc::client_t*, nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>) ../plugins/ipc/ipc.cpp:136
    #26 0x722e27396387 in wf::ipc::client_t::handle_fd_incoming(unsigned int) ../plugins/ipc/ipc.cpp:268
    #27 0x722e27374c39 in std::function<void (unsigned int)>::operator()(unsigned int) const /usr/include/c++/14.2.1/bits/std_function.h:591
    #28 0x722e27374c39 in wl_loop_handle_ipc_client_fd_event(int, unsigned int, void*) ../plugins/ipc/ipc.cpp:143
    #29 0x722e3c0e30a1 in wl_event_loop_dispatch (/usr/lib/libwayland-server.so.0+0xa0a1) (BuildId: 915b81a9d6d73724356b2d67e54f4fd5da5249d5)
    #30 0x722e3c0e510e in wl_display_run (/usr/lib/libwayland-server.so.0+0xc10e) (BuildId: 915b81a9d6d73724356b2d67e54f4fd5da5249d5)
    #31 0x58bbd4ce72d5 in main ../src/main.cpp:448
    #32 0x722e3ae34e07  (/usr/lib/libc.so.6+0x25e07) (BuildId: 98b3d8e0b8c534c769cb871c438b4f8f3a8e4bf3)
    #33 0x722e3ae34ecb in __libc_start_main (/usr/lib/libc.so.6+0x25ecb) (BuildId: 98b3d8e0b8c534c769cb871c438b4f8f3a8e4bf3)
    #34 0x58bbd4cebee4 in _start (/usr/bin/wayfire+0x101ee4) (BuildId: c9692065ec772cec8b9e46f48a4bffbbbc9cf902)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV ../src/debug.cpp:231 in wf::print_trace(bool)
==39316==ABORTING
(EE) failed to write to Xwayland fd: Broken pipe

@soreau
Copy link
Member Author

soreau commented Sep 3, 2024

@killown How do you know this crash is related to this branch? It would also be helpful if you can explain how to reproduce the crash without the fuzz test.

@killown
Copy link
Contributor

killown commented Sep 3, 2024

@killown How do you know this crash is related to this branch? It would also be helpful if you can explain how to reproduce the crash without the fuzz test.

because i am using your branch in the pkgbuild... not reproducible, this is how me and ammen99 did in the past, he just had the crash reports with no clue, it's up to you to fix it or not, but ammen99 could consider this a really issue before merging.

Copy link
Member

@ammen99 ammen99 left a comment

Choose a reason for hiding this comment

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

Looking at https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4345, I believe we need to change all places which use xdg_surface.destroy events to xdg_popup/xdg_toplevel.destroy.

Otherwise LGTM, thanks for the patience!

LOGD("Changed adaptive sync on output: ", handle->name, " to ", current_state.vrr);
} else
{
LOGE("Failed to change adaptive sync on output: ", handle->name);
wlr_output_rollback(handle);
// wlr_output_rollback(handle);
Copy link
Member

Choose a reason for hiding this comment

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

We should here revert &state to the previous vrr state I think, otherwise, &state gets permanently 'broken' afaict

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, see this later commit.

Copy link
Member Author

Choose a reason for hiding this comment

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

I looked at this and what I think is best, is to call wlr_output_state_finish() and wlr_output_state_init() after each wlr_output_state_commit(), so I pushed a commit to do that. This way, we should never have to worry about rolling back states or potentially stale state data.

{
wlr_output_commit(handle);
wlr_output_commit_state(handle, &state);
Copy link
Member

Choose a reason for hiding this comment

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

Same as above, we ought to reset in the other case .. In all honestly previously we probably had to do a rollback as well, but we didn't (which might have been a compositor bug that nobody happened to complain about ...)

Copy link
Member Author

Choose a reason for hiding this comment

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

Noted, will fix.

d["type"] = wlr_input_device_type_to_string(device->get_wlr_handle()->type);
d["id"] = (intptr_t)device->get_wlr_handle();
d["name"] = nonull(device->get_wlr_handle()->name);
d["type"] = wlr_input_device_type_to_string(device->get_wlr_handle()->type);
Copy link
Member

Choose a reason for hiding this comment

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

Is there no way to get vendor/product? Maybe by asking libinput directly for libinput devices, and just setting 'unknown' or 'nil' or whatever is appropriate for others. I would like to avoid any breaking changes to the IPC if possible.

Copy link
Member Author

Choose a reason for hiding this comment

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

From the 0.18 release notes:

"..drop wlr_input_device.{vendor,product}, these aren't super useful without the bus type. Compositors can still obtain this information from the libinput device if they want to."

Copy link
Member Author

Choose a reason for hiding this comment

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

I could use some help finding the call(s) to get the vendor/product id from libinput.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried libinput_device_get_id_{vendor|product}(wlr_libinput_get_device_handle(device->get_wlr_handle())); but it always crashes.

Copy link
Member

Choose a reason for hiding this comment

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

Devices are not necessarily libinput devices (especially in the wayland backend, you won't find a libinput device). So this needs to be in a check, and in the other cases we can set 'unknown' or -1 as a value.

src/view/xdg-shell.cpp Outdated Show resolved Hide resolved
src/view/xwayland.cpp Show resolved Hide resolved
@soreau
Copy link
Member Author

soreau commented Sep 28, 2024

Looking at https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4345, I believe we need to change all places which use xdg_surface.destroy events to xdg_popup/xdg_toplevel.destroy.

I thought I caught them all but apparently xdg-toplevel is still using destroy events from the base xdg_surface (see last link). xdg_popups from master vs. track-wlroots branch. Similarly for xdg_toplevel, master and track-wlroots

EDIT: Pushed a fix for this.

This leads to a crash on wlroots 0.18, as wlroots handles this already.
xdg wayland surfaces were not committing because compositors are expected
to send a configure when wlr_xdg_surface.initial_commit is set.
There is nothing needed to do here when using wlr_output_state.
Without edge, latest only has 1.22 until possibly Nov '24, when alpine image
3.21 is released.
If a subsurface is created and then becomes smaller without repositioning,
the old larger size was never damaged, leaving artifacts on the output.
This fixes the build.
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