diff options
author | Jan Beich <jbeich@FreeBSD.org> | 2020-11-08 16:48:02 +0000 |
---|---|---|
committer | Jan Beich <jbeich@FreeBSD.org> | 2020-11-08 16:48:02 +0000 |
commit | d81a61abe4657d72f087c1086dba92ab77db4594 (patch) | |
tree | 4fac44dcd650256913b380323c466323bfdb7b0f /x11-wm/wayfire | |
parent | a19de432e5be2753770b0e0f7f910713de93fba4 (diff) | |
download | ports-d81a61abe4657d72f087c1086dba92ab77db4594.tar.gz ports-d81a61abe4657d72f087c1086dba92ab77db4594.zip |
x11-toolkits/wlroots: update to 0.12.0
Changes: https://github.com/swaywm/wlroots/releases/tag/0.12.0
Reported by: GitHub (watch releases)
Notes
Notes:
svn path=/head/; revision=554475
Diffstat (limited to 'x11-wm/wayfire')
-rw-r--r-- | x11-wm/wayfire/Makefile | 4 | ||||
-rw-r--r-- | x11-wm/wayfire/files/patch-wlroots-0.12 | 592 |
2 files changed, 594 insertions, 2 deletions
diff --git a/x11-wm/wayfire/Makefile b/x11-wm/wayfire/Makefile index 45ec684c6d44..bc1923ce3eeb 100644 --- a/x11-wm/wayfire/Makefile +++ b/x11-wm/wayfire/Makefile @@ -2,7 +2,7 @@ PORTNAME= wayfire DISTVERSION= 0.5.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= x11-wm MAINTAINER= jbeich@FreeBSD.org @@ -16,7 +16,7 @@ BUILD_DEPENDS= evdev-proto>0:devel/evdev-proto \ ${LOCALBASE}/include/xf86drmMode.h:graphics/libdrm \ wayland-protocols>=1.12:graphics/wayland-protocols \ glm>=0.9.8:math/glm \ - wlroots>=0.11.0<0.12.0:x11-toolkits/wlroots + wlroots>=0.11.0<0.13.0:x11-toolkits/wlroots LIB_DEPENDS= libinotify.so:devel/libinotify \ libwf-config.so:devel/wf-config \ libpng.so:graphics/png \ diff --git a/x11-wm/wayfire/files/patch-wlroots-0.12 b/x11-wm/wayfire/files/patch-wlroots-0.12 new file mode 100644 index 000000000000..a74a250355a4 --- /dev/null +++ b/x11-wm/wayfire/files/patch-wlroots-0.12 @@ -0,0 +1,592 @@ +https://github.com/WayfireWM/wayfire/commit/a8857ba0d3b7 + +meson.build:31:1: ERROR: Invalid version of dependency, need 'wlroots' ['<0.12.0'] found '0.12.0'. + +In file included from ../src/view/view.cpp:11: +../src/view/xdg-shell.hpp:8:10: fatal error: 'wlr/types/wlr_xdg_shell_v6.h' file not found +#include <wlr/types/wlr_xdg_shell_v6.h> + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +--- meson.build.orig 2020-08-04 18:56:17 UTC ++++ meson.build +@@ -28,7 +28,7 @@ libinput = dependency('libinput', version: '>=1. + pixman = dependency('pixman-1') + threads = dependency('threads') + xkbcommon = dependency('xkbcommon') +-wlroots = dependency('wlroots', version: ['>=0.11.0', '<0.12.0'], required: get_option('use_system_wlroots')) ++wlroots = dependency('wlroots', version: ['>=0.11.0', '<0.13.0'], required: get_option('use_system_wlroots')) + wfconfig = dependency('wf-config', version: ['>=0.5.0', '<0.6.0'], required: get_option('use_system_wfconfig')) + + use_system_wlroots = not get_option('use_system_wlroots').disabled() and wlroots.found() +--- src/output/output.cpp.orig 2020-08-04 18:56:17 UTC ++++ src/output/output.cpp +@@ -188,33 +188,26 @@ bool wf::output_t::ensure_visible(wayfire_view v) + return true; + } + +-template<class popup_type> +-void try_close_popup(wayfire_view to_check, wayfire_view active_view) +-{ +- auto popup = dynamic_cast<wayfire_xdg_popup<popup_type>*>(to_check.get()); +- if (!popup || (popup->popup_parent == active_view.get())) +- { +- return; +- } +- +- /* Ignore popups which have a popup as their parent. In those cases, we'll +- * close the topmost popup and this will recursively destroy the others. +- * +- * Otherwise we get a race condition with wlroots. */ +- if (dynamic_cast<wayfire_xdg_popup<popup_type>*>(popup->popup_parent)) +- { +- return; +- } +- +- popup->close(); +-} +- + void wf::output_impl_t::close_popups() + { + for (auto& v : workspace->get_views_in_layer(wf::ALL_LAYERS)) + { +- try_close_popup<wlr_xdg_popup>(v, active_view); +- try_close_popup<wlr_xdg_popup_v6>(v, active_view); ++ auto popup = dynamic_cast<wayfire_xdg_popup*>(v.get()); ++ if (!popup || (popup->popup_parent == active_view.get())) ++ { ++ continue; ++ } ++ ++ /* Ignore popups which have a popup as their parent. In those cases, we'll ++ * close the topmost popup and this will recursively destroy the others. ++ * ++ * Otherwise we get a race condition with wlroots. */ ++ if (dynamic_cast<wayfire_xdg_popup*>(popup->popup_parent)) ++ { ++ continue; ++ } ++ ++ popup->close(); + } + } + +--- src/view/view-impl.cpp.orig 2020-08-04 18:56:17 UTC ++++ src/view/view-impl.cpp +@@ -571,7 +571,6 @@ extern "C" + { + #include <wlr/config.h> + +-#include <wlr/types/wlr_xdg_shell_v6.h> + #define namespace namespace_t + #include <wlr/types/wlr_layer_shell_v1.h> + #undef namespace +@@ -613,12 +612,6 @@ wayfire_view wf::wl_surface_to_wayfire_view(wl_resourc + auto surface = (wlr_surface*)wl_resource_get_user_data(resource); + + void *handle = NULL; +- +- if (wlr_surface_is_xdg_surface_v6(surface)) +- { +- handle = wlr_xdg_surface_v6_from_wlr_surface(surface)->data; +- } +- + if (wlr_surface_is_xdg_surface(surface)) + { + handle = wlr_xdg_surface_from_wlr_surface(surface)->data; +--- src/view/xdg-shell.cpp.orig 2020-08-04 18:56:17 UTC ++++ src/view/xdg-shell.cpp +@@ -8,8 +8,7 @@ + #include "wayfire/output-layout.hpp" + #include <wayfire/workspace-manager.hpp> + +-template<class XdgPopupVersion> +-wayfire_xdg_popup<XdgPopupVersion>::wayfire_xdg_popup(XdgPopupVersion *popup) : ++wayfire_xdg_popup::wayfire_xdg_popup(wlr_xdg_popup *popup) : + wf::wlr_view_t() + { + this->popup_parent = +@@ -20,8 +19,7 @@ wayfire_xdg_popup<XdgPopupVersion>::wayfire_xdg_popup( + this->set_output(popup_parent->get_output()); + } + +-template<class XdgPopupVersion> +-void wayfire_xdg_popup<XdgPopupVersion>::initialize() ++void wayfire_xdg_popup::initialize() + { + LOGI("New xdg popup"); + on_map.set_callback([&] (void*) { map(this->popup->base->surface); }); +@@ -33,7 +31,7 @@ void wayfire_xdg_popup<XdgPopupVersion>::initialize() + on_destroy.set_callback([&] (void*) { destroy(); }); + on_new_popup.set_callback([&] (void *data) + { +- create_xdg_popup((XdgPopupVersion*)data); ++ create_xdg_popup((wlr_xdg_popup*)data); + }); + + on_map.connect(&popup->base->events.map); +@@ -63,8 +61,7 @@ void wayfire_xdg_popup<XdgPopupVersion>::initialize() + &this->parent_title_changed); + } + +-template<class XdgPopupVersion> +-void wayfire_xdg_popup<XdgPopupVersion>::map(wlr_surface *surface) ++void wayfire_xdg_popup::map(wlr_surface *surface) + { + uint32_t parent_layer = + get_output()->workspace->get_view_layer(popup_parent->self()); +@@ -82,15 +79,13 @@ void wayfire_xdg_popup<XdgPopupVersion>::map(wlr_surfa + unconstrain(); + } + +-template<class XdgPopupVersion> +-void wayfire_xdg_popup<XdgPopupVersion>::commit() ++void wayfire_xdg_popup::commit() + { + wlr_view_t::commit(); + update_position(); + } + +-template<class XdgPopupVersion> +-void wayfire_xdg_popup<XdgPopupVersion>::update_position() ++void wayfire_xdg_popup::update_position() + { + if (!popup_parent->is_mapped() || !is_mapped()) + { +@@ -110,14 +105,12 @@ void wayfire_xdg_popup<XdgPopupVersion>::update_positi + this->move(popup_offset.x, popup_offset.y); + } + +-template<class XdgPopupVersion> +-void wayfire_xdg_popup<XdgPopupVersion>::unconstrain() ++void wayfire_xdg_popup::unconstrain() + { + wf::view_interface_t *toplevel_parent = this; +- using popup_type = wayfire_xdg_popup<XdgPopupVersion>*; + while (true) + { +- popup_type as_popup = dynamic_cast<popup_type>(toplevel_parent); ++ auto as_popup = dynamic_cast<wayfire_xdg_popup*>(toplevel_parent); + if (as_popup) + { + toplevel_parent = as_popup->popup_parent; +@@ -137,24 +130,11 @@ void wayfire_xdg_popup<XdgPopupVersion>::unconstrain() + box.x -= wm.x; + box.y -= wm.y; + +- _do_unconstrain(box); +-} +- +-template<> +-void wayfire_xdg_popup<wlr_xdg_popup>::_do_unconstrain(wlr_box box) +-{ + wlr_xdg_popup_unconstrain_from_box(popup, &box); + } + +-template<> +-void wayfire_xdg_popup<wlr_xdg_popup_v6>::_do_unconstrain(wlr_box box) ++void wayfire_xdg_popup::destroy() + { +- wlr_xdg_popup_v6_unconstrain_from_box(popup, &box); +-} +- +-template<class XdgPopupVersion> +-void wayfire_xdg_popup<XdgPopupVersion>::destroy() +-{ + on_map.disconnect(); + on_unmap.disconnect(); + on_destroy.disconnect(); +@@ -163,8 +143,7 @@ void wayfire_xdg_popup<XdgPopupVersion>::destroy() + wlr_view_t::destroy(); + } + +-template<class XdgPopupVersion> +-wf::point_t wayfire_xdg_popup<XdgPopupVersion>::get_window_offset() ++wf::point_t wayfire_xdg_popup::get_window_offset() + { + return { + popup->base->geometry.x, +@@ -172,32 +151,18 @@ wf::point_t wayfire_xdg_popup<XdgPopupVersion>::get_wi + }; + } + +-template<> +-void wayfire_xdg_popup<wlr_xdg_popup_v6>::close() ++void wayfire_xdg_popup::close() + { + pending_close.run_once([=] () + { + if (is_mapped()) + { +- wlr_xdg_surface_v6_send_close(popup->base); +- } +- }); +-} +- +-template<> +-void wayfire_xdg_popup<wlr_xdg_popup>::close() +-{ +- pending_close.run_once([=] () +- { +- if (is_mapped()) +- { + wlr_xdg_popup_destroy(popup->base); + } + }); + } + +-template<class XdgPopupVersion> +-void create_xdg_popup_templ(XdgPopupVersion *popup) ++void create_xdg_popup(wlr_xdg_popup *popup) + { + auto parent = wf::wf_surface_from_void(popup->parent->data); + if (!parent) +@@ -207,30 +172,14 @@ void create_xdg_popup_templ(XdgPopupVersion *popup) + return; + } + +- wf::get_core().add_view( +- std::make_unique<wayfire_xdg_popup<XdgPopupVersion>>(popup)); ++ wf::get_core().add_view(std::make_unique<wayfire_xdg_popup>(popup)); + } + +-template<class XdgPopupVersion> +-void create_xdg_popup(XdgPopupVersion *popup) +-{ +- create_xdg_popup_templ(popup); +-} +- +-// specialized in header +-template<> +-void create_xdg_popup<wlr_xdg_popup>(wlr_xdg_popup *popup) +-{ +- create_xdg_popup_templ(popup); +-} +- +-template<class XdgToplevelVersion> +-wayfire_xdg_view<XdgToplevelVersion>::wayfire_xdg_view(XdgToplevelVersion *top) : ++wayfire_xdg_view::wayfire_xdg_view(wlr_xdg_toplevel *top) : + wf::wlr_view_t(), xdg_toplevel(top) + {} + +-template<class XdgToplevelVersion> +-void wayfire_xdg_view<XdgToplevelVersion>::initialize() ++void wayfire_xdg_view::initialize() + { + wlr_view_t::initialize(); + LOGI("new xdg_shell_stable surface: ", xdg_toplevel->title, +@@ -306,15 +255,10 @@ void wayfire_xdg_view<XdgToplevelVersion>::initialize( + } + } + +-template<class XdgToplevelVersion> +-wayfire_xdg_view<XdgToplevelVersion>::~wayfire_xdg_view() ++wayfire_xdg_view::~wayfire_xdg_view() + {} + +-template<class XdgToplevelVersion> +-wf::geometry_t get_xdg_geometry(XdgToplevelVersion *toplevel); +- +-template<> +-wf::geometry_t get_xdg_geometry<wlr_xdg_toplevel>(wlr_xdg_toplevel *toplevel) ++wf::geometry_t get_xdg_geometry(wlr_xdg_toplevel *toplevel) + { + wlr_box xdg_geometry; + wlr_xdg_surface_get_geometry(toplevel->base, &xdg_geometry); +@@ -322,24 +266,13 @@ wf::geometry_t get_xdg_geometry<wlr_xdg_toplevel>(wlr_ + return xdg_geometry; + } + +-template<> +-wf::geometry_t get_xdg_geometry<wlr_xdg_toplevel_v6>(wlr_xdg_toplevel_v6 *toplevel) ++void wayfire_xdg_view::map(wlr_surface *surface) + { +- wlr_box xdg_geometry; +- wlr_xdg_surface_v6_get_geometry(toplevel->base, &xdg_geometry); +- +- return xdg_geometry; +-} +- +-template<class XdgToplevelVersion> +-void wayfire_xdg_view<XdgToplevelVersion>::map(wlr_surface *surface) +-{ + wlr_view_t::map(surface); + create_toplevel(); + } + +-template<class XdgToplevelVersion> +-void wayfire_xdg_view<XdgToplevelVersion>::commit() ++void wayfire_xdg_view::commit() + { + wlr_view_t::commit(); + +@@ -359,14 +292,12 @@ void wayfire_xdg_view<XdgToplevelVersion>::commit() + } + } + +-template<class XdgToplevelVersion> +-wf::point_t wayfire_xdg_view<XdgToplevelVersion>::get_window_offset() ++wf::point_t wayfire_xdg_view::get_window_offset() + { + return xdg_surface_offset; + } + +-template<class XdgToplevelVersion> +-wf::geometry_t wayfire_xdg_view<XdgToplevelVersion>::get_wm_geometry() ++wf::geometry_t wayfire_xdg_view::get_wm_geometry() + { + if (!is_mapped()) + { +@@ -391,8 +322,7 @@ wf::geometry_t wayfire_xdg_view<XdgToplevelVersion>::g + return wm; + } + +-template<class XdgToplevelVersion> +-void wayfire_xdg_view<XdgToplevelVersion>::set_activated(bool act) ++void wayfire_xdg_view::set_activated(bool act) + { + /* we don't send activated or deactivated for shell views, + * they should always be active */ +@@ -401,55 +331,26 @@ void wayfire_xdg_view<XdgToplevelVersion>::set_activat + act = true; + } + +- _set_activated(act); ++ wlr_xdg_toplevel_set_activated(xdg_toplevel->base, act); + wf::wlr_view_t::set_activated(act); + } + +-template<> +-void wayfire_xdg_view<wlr_xdg_toplevel>::_set_activated(bool act) ++void wayfire_xdg_view::set_tiled(uint32_t edges) + { +- wlr_xdg_toplevel_set_activated(xdg_toplevel->base, act); +-} +- +-template<> +-void wayfire_xdg_view<wlr_xdg_toplevel_v6>::_set_activated(bool act) +-{ +- wlr_xdg_toplevel_v6_set_activated(xdg_toplevel->base, act); +-} +- +-template<> +-void wayfire_xdg_view<wlr_xdg_toplevel>::set_tiled(uint32_t edges) +-{ + wlr_xdg_toplevel_set_tiled(xdg_toplevel->base, edges); + wlr_xdg_toplevel_set_maximized(xdg_toplevel->base, + (edges == wf::TILED_EDGES_ALL)); + wlr_view_t::set_tiled(edges); + } + +-template<> +-void wayfire_xdg_view<wlr_xdg_toplevel_v6>::set_tiled(uint32_t edges) ++void wayfire_xdg_view::set_fullscreen(bool full) + { +- wlr_xdg_toplevel_v6_set_maximized(xdg_toplevel->base, !!edges); +- wlr_view_t::set_tiled(edges); +-} +- +-template<> +-void wayfire_xdg_view<wlr_xdg_toplevel>::set_fullscreen(bool full) +-{ + wf::wlr_view_t::set_fullscreen(full); + wlr_xdg_toplevel_set_fullscreen(xdg_toplevel->base, full); + } + +-template<> +-void wayfire_xdg_view<wlr_xdg_toplevel_v6>::set_fullscreen(bool full) ++void wayfire_xdg_view::resize(int w, int h) + { +- wf::wlr_view_t::set_fullscreen(full); +- wlr_xdg_toplevel_v6_set_fullscreen(xdg_toplevel->base, full); +-} +- +-template<class XdgToplevelVersion> +-void wayfire_xdg_view<XdgToplevelVersion>::resize(int w, int h) +-{ + if (view_impl->frame) + { + view_impl->frame->calculate_resize_size(w, h); +@@ -460,51 +361,23 @@ void wayfire_xdg_view<XdgToplevelVersion>::resize(int + if (should_resize_client({w, h}, current_size)) + { + this->last_size_request = {w, h}; +- _resize(w, h); ++ wlr_xdg_toplevel_set_size(xdg_toplevel->base, w, h); + } + } + +-template<> +-void wayfire_xdg_view<wlr_xdg_toplevel>::_resize(int w, int h) ++void wayfire_xdg_view::request_native_size() + { +- wlr_xdg_toplevel_set_size(xdg_toplevel->base, w, h); +-} +- +-template<> +-void wayfire_xdg_view<wlr_xdg_toplevel_v6>::_resize(int w, int h) +-{ +- wlr_xdg_toplevel_v6_set_size(xdg_toplevel->base, w, h); +-} +- +-template<> +-void wayfire_xdg_view<wlr_xdg_toplevel>::request_native_size() +-{ + wlr_xdg_toplevel_set_size(xdg_toplevel->base, 0, 0); + } + +-template<> +-void wayfire_xdg_view<wlr_xdg_toplevel_v6>::request_native_size() ++void wayfire_xdg_view::close() + { +- wlr_xdg_toplevel_v6_set_size(xdg_toplevel->base, 0, 0); +-} +- +-template<> +-void wayfire_xdg_view<wlr_xdg_toplevel>::close() +-{ + wlr_xdg_toplevel_send_close(xdg_toplevel->base); + wf::wlr_view_t::close(); + } + +-template<> +-void wayfire_xdg_view<wlr_xdg_toplevel_v6>::close() ++void wayfire_xdg_view::destroy() + { +- wlr_xdg_surface_v6_send_close(xdg_toplevel->base); +- wf::wlr_view_t::close(); +-} +- +-template<class XdgToplevelVersion> +-void wayfire_xdg_view<XdgToplevelVersion>::destroy() +-{ + on_map.disconnect(); + on_unmap.disconnect(); + on_destroy.disconnect(); +@@ -522,13 +395,11 @@ void wayfire_xdg_view<XdgToplevelVersion>::destroy() + wf::wlr_view_t::destroy(); + } + +-static wlr_xdg_shell *xdg_handle; +-static wlr_xdg_shell_v6 *xdg_handle_v6; ++static wlr_xdg_shell *xdg_handle = nullptr; + +- + void wf::init_xdg_shell() + { +- static wf::wl_listener_wrapper on_xdg_created, on_xdg6_created; ++ static wf::wl_listener_wrapper on_xdg_created; + xdg_handle = wlr_xdg_shell_create(wf::get_core().display); + + if (xdg_handle) +@@ -539,34 +410,9 @@ void wf::init_xdg_shell() + if (surf->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) + { + wf::get_core().add_view( +- std::make_unique<wayfire_xdg_view<wlr_xdg_toplevel>>( +- surf->toplevel)); ++ std::make_unique<wayfire_xdg_view>(surf->toplevel)); + } + }); + on_xdg_created.connect(&xdg_handle->events.new_surface); + } +- +- xdg_handle_v6 = wlr_xdg_shell_v6_create(wf::get_core().display); +- if (xdg_handle_v6) +- { +- on_xdg6_created.set_callback([&] (void *data) +- { +- auto surf = static_cast<wlr_xdg_surface_v6*>(data); +- if (surf->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL) +- { +- wf::get_core().add_view( +- std::make_unique<wayfire_xdg_view<wlr_xdg_toplevel_v6>>( +- surf->toplevel)); +- } +- }); +- on_xdg6_created.connect(&xdg_handle_v6->events.new_surface); +- } + } +- +-template class wayfire_xdg_popup<wlr_xdg_popup_v6>; +- +-template class wayfire_xdg_popup<wlr_xdg_popup>; +- +-template class wayfire_xdg_view<wlr_xdg_toplevel_v6>; +- +-template class wayfire_xdg_view<wlr_xdg_toplevel>; +--- src/view/xdg-shell.hpp.orig 2020-08-04 18:56:17 UTC ++++ src/view/xdg-shell.hpp +@@ -5,14 +5,11 @@ + extern "C" + { + #include <wlr/types/wlr_xdg_shell.h> +-#include <wlr/types/wlr_xdg_shell_v6.h> + } + + /** +- * A class for xdg-shell(and -v6) popups. XdgPopupVersion can be either a +- * `wlr_xdg_popup` or `wlr_xdg_popup_v6`. ++ * A class for xdg-shell popups + */ +-template<class XdgPopupVersion> + class wayfire_xdg_popup : public wf::wlr_view_t + { + protected: +@@ -21,13 +18,12 @@ class wayfire_xdg_popup : public wf::wlr_view_t + parent_title_changed, parent_app_id_changed; + + wf::wl_idle_call pending_close; +- XdgPopupVersion *popup; ++ wlr_xdg_popup *popup; + void unconstrain(); +- void _do_unconstrain(wlr_box box); + void update_position(); + + public: +- wayfire_xdg_popup(XdgPopupVersion *popup); ++ wayfire_xdg_popup(wlr_xdg_popup *popup); + void initialize() override; + + wlr_view_t *popup_parent; +@@ -39,12 +35,8 @@ class wayfire_xdg_popup : public wf::wlr_view_t + virtual void close() override; + }; + +-template<class XdgPopupVersion> +-void create_xdg_popup(XdgPopupVersion *popup); +-template<> +-void create_xdg_popup<wlr_xdg_popup>(wlr_xdg_popup *popup); ++void create_xdg_popup(wlr_xdg_popup *popup); + +-template<class XdgToplevelVersion> + class wayfire_xdg_view : public wf::wlr_view_t + { + private: +@@ -55,13 +47,13 @@ class wayfire_xdg_view : public wf::wlr_view_t + on_set_title, on_set_app_id; + + wf::point_t xdg_surface_offset = {0, 0}; +- XdgToplevelVersion *xdg_toplevel; ++ wlr_xdg_toplevel *xdg_toplevel; + + protected: + void initialize() override final; + + public: +- wayfire_xdg_view(XdgToplevelVersion *toplevel); ++ wayfire_xdg_view(wlr_xdg_toplevel *toplevel); + virtual ~wayfire_xdg_view(); + + void map(wlr_surface *surface) final; +@@ -72,11 +64,9 @@ class wayfire_xdg_view : public wf::wlr_view_t + + void set_tiled(uint32_t edges) final; + void set_activated(bool act) final; +- void _set_activated(bool act); + void set_fullscreen(bool full) final; + + void resize(int w, int h) final; +- void _resize(int w, int h); + void request_native_size() override final; + + void destroy() final; |