x11-toolkits/wlroots: update to 0.12.0
Changes: https://github.com/swaywm/wlroots/releases/tag/0.12.0 Reported by: GitHub (watch releases)
This commit is contained in:
parent
a19de432e5
commit
d81a61abe4
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=554475
@ -1,12 +1,11 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PORTNAME= wlroots
|
||||
DISTVERSION= 0.11.0
|
||||
PORTREVISION= 2
|
||||
DISTVERSION= 0.12.0
|
||||
CATEGORIES= x11-toolkits
|
||||
|
||||
PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
|
||||
PATCHFILES+= 0fe36eb89754.patch:-p1 # https://github.com/swaywm/wlroots/pull/2064
|
||||
PATCHFILES+= 8bdf0df41719.patch:-p1 # https://github.com/swaywm/wlroots/pull/2064
|
||||
PATCHFILES+= 90cb6d26877b.patch:-p1 # https://github.com/swaywm/wlroots/pull/2064
|
||||
|
||||
MAINTAINER= jbeich@FreeBSD.org
|
||||
@ -40,26 +39,17 @@ OPTIONS_SUB= yes
|
||||
|
||||
CONSOLEKIT_DESC= DRM sessions without root using ConsoleKit2
|
||||
CONSOLEKIT_PATCH_SITES= https://github.com/myfreeweb/${GH_PROJECT}/commit/:ck2
|
||||
CONSOLEKIT_PATCHFILES= b59460944208.patch:-p1:ck2 # https://github.com/swaywm/wlroots/pull/1467
|
||||
CONSOLEKIT_PATCHFILES= fcee578b13eb.patch:-p1:ck2 # https://github.com/swaywm/wlroots/pull/1467
|
||||
CONSOLEKIT_LIB_DEPENDS= libdbus-1.so:devel/dbus \
|
||||
libconsolekit.so:sysutils/consolekit2
|
||||
CONSOLEKIT_MESON_ENABLED= consolekit2
|
||||
CONSOLEKIT_PREVENTS= LIBSEAT
|
||||
CONSOLEKIT_PREVENTS_MSG=CONSOLEKIT and LIBSEAT patches cannot be applied together
|
||||
.if make(makesum)
|
||||
.MAKEFLAGS: WITH+=CONSOLEKIT
|
||||
.endif
|
||||
|
||||
LIBSEAT_DESC= DRM sessions with/without root via libseat (experimental)
|
||||
LIBSEAT_PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/:libseat
|
||||
LIBSEAT_PATCHFILES= bad1e9afa8ea.patch:-p1:libseat # https://github.com/swaywm/wlroots/pull/2364
|
||||
LIBSEAT_PATCHFILES+= 330c50b48dfe.patch:-p1:libseat # https://github.com/swaywm/wlroots/pull/2379
|
||||
LIBSEAT_PATCHFILES+= 4a85ae24c7df.patch:-p1:libseat # https://github.com/swaywm/wlroots/pull/2383
|
||||
LIBSEAT_LIB_DEPENDS= libseat.so:sysutils/seatd
|
||||
LIBSEAT_MESON_ENABLED= libseat
|
||||
.if make(makesum)
|
||||
.MAKEFLAGS: WITH+=LIBSEAT
|
||||
.endif
|
||||
|
||||
X11_LIB_DEPENDS= libxcb-errors.so:x11/xcb-util-errors \
|
||||
libxcb-icccm.so:x11/xcb-util-wm
|
||||
|
@ -1,15 +1,9 @@
|
||||
TIMESTAMP = 1594852043
|
||||
SHA256 (swaywm-wlroots-0.11.0_GH0.tar.gz) = a7645e77229aab4942748c621be8bdb8b073d94f35f3e032b867246862bf2d01
|
||||
SIZE (swaywm-wlroots-0.11.0_GH0.tar.gz) = 481126
|
||||
SHA256 (0fe36eb89754.patch) = a416f736df9afb7f3035488bdfd94983b6208d1fa7d36ca13fea315aceae153d
|
||||
SIZE (0fe36eb89754.patch) = 5257
|
||||
TIMESTAMP = 1604844104
|
||||
SHA256 (swaywm-wlroots-0.12.0_GH0.tar.gz) = c9e9f4f6d2f526d0b2886daf3ec37e64831773059aa669fb98a88522a1626bdb
|
||||
SIZE (swaywm-wlroots-0.12.0_GH0.tar.gz) = 476936
|
||||
SHA256 (8bdf0df41719.patch) = 0be1441fd6c3bad0918a09714e1605c1a76362d57ee42aa09f55dfbcba1d8218
|
||||
SIZE (8bdf0df41719.patch) = 5792
|
||||
SHA256 (90cb6d26877b.patch) = 4c3a87dca481a637457d7409d38ce2bcd8d52ba4a0b02cf16e09429a6d3d360d
|
||||
SIZE (90cb6d26877b.patch) = 3965
|
||||
SHA256 (b59460944208.patch) = 8b15ed54dcec76adf231db454ece78427eeabd5466ffd180b57ec785eeb4c507
|
||||
SIZE (b59460944208.patch) = 27381
|
||||
SHA256 (bad1e9afa8ea.patch) = 6022aba43fb2ed867e6eedca7319e6304a6312d28441c75a930cec5334961f06
|
||||
SIZE (bad1e9afa8ea.patch) = 14832
|
||||
SHA256 (330c50b48dfe.patch) = cf0f93636aa163c120d256849f28d4da6446a20f64616c451acbf3d705484013
|
||||
SIZE (330c50b48dfe.patch) = 1473
|
||||
SHA256 (4a85ae24c7df.patch) = 00f04b80ae39205aaffb3abfe4ffa9ef5d76d206280312c9fcce6b15e3f85c25
|
||||
SIZE (4a85ae24c7df.patch) = 2306
|
||||
SHA256 (fcee578b13eb.patch) = d6d9874e4b060979b608e36dd784f4355a4856c45d98e0ab2bf75936a8f1d460
|
||||
SIZE (fcee578b13eb.patch) = 27676
|
||||
|
@ -78,7 +78,6 @@ include/wlr/types/wlr_xcursor_manager.h
|
||||
include/wlr/types/wlr_xdg_decoration_v1.h
|
||||
include/wlr/types/wlr_xdg_output_v1.h
|
||||
include/wlr/types/wlr_xdg_shell.h
|
||||
include/wlr/types/wlr_xdg_shell_v6.h
|
||||
include/wlr/util/edges.h
|
||||
include/wlr/util/log.h
|
||||
include/wlr/util/region.h
|
||||
@ -86,5 +85,5 @@ include/wlr/version.h
|
||||
include/wlr/xcursor.h
|
||||
%%X11%%include/wlr/xwayland.h
|
||||
lib/libwlroots.so
|
||||
lib/libwlroots.so.6
|
||||
lib/libwlroots.so.7
|
||||
libdata/pkgconfig/wlroots.pc
|
||||
|
@ -3,7 +3,7 @@
|
||||
PORTNAME= cage
|
||||
DISTVERSIONPREFIX= v
|
||||
DISTVERSION= 0.1.2.1
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= x11-wm
|
||||
|
||||
PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
PORTNAME= hikari
|
||||
DISTVERSION= 2.2.2
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= x11-wm
|
||||
MASTER_SITES= https://hikari.acmelabs.space/releases/
|
||||
|
||||
@ -13,7 +14,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
|
||||
|
||||
BUILD_DEPENDS= evdev-proto>0:devel/evdev-proto \
|
||||
wayland-protocols>=1.14:graphics/wayland-protocols \
|
||||
wlroots>=0.9.0<0.12.0:x11-toolkits/wlroots
|
||||
wlroots>=0.9.0<0.13.0:x11-toolkits/wlroots
|
||||
LIB_DEPENDS= libepoll-shim.so:devel/libepoll-shim \
|
||||
libinput.so:x11/libinput \
|
||||
libucl.so:textproc/libucl \
|
||||
|
@ -3,6 +3,7 @@
|
||||
PORTNAME= phoc
|
||||
DISTVERSIONPREFIX= v
|
||||
DISTVERSION= 0.4.4
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= x11-wm
|
||||
|
||||
MAINTAINER= jbeich@FreeBSD.org
|
||||
|
@ -2,12 +2,13 @@
|
||||
|
||||
PORTNAME= sway
|
||||
DISTVERSION= 1.5
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= x11-wm
|
||||
|
||||
PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
|
||||
PATCHFILES+= cd9d1038a822.patch:-p1 # https://github.com/swaywm/sway/pull/5090
|
||||
PATCHFILES+= f98ca3ab7ca1.patch:-p1 # https://github.com/swaywm/sway/pull/5090
|
||||
PATCHFILES+= 5ae4f65045c0.patch:-p1 # wlroots 0.12.0
|
||||
|
||||
MAINTAINER= jbeich@FreeBSD.org
|
||||
COMMENT= i3-compatible Wayland compositor
|
||||
@ -17,7 +18,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
|
||||
|
||||
BUILD_DEPENDS= evdev-proto>0:devel/evdev-proto \
|
||||
wayland-protocols>=1.14:graphics/wayland-protocols \
|
||||
wlroots>=0.11.0<0.12.0:x11-toolkits/wlroots
|
||||
wlroots>=0.12.0<0.13.0:x11-toolkits/wlroots
|
||||
LIB_DEPENDS= libjson-c.so:devel/json-c \
|
||||
libevdev.so:devel/libevdev \
|
||||
libpcre.so:devel/pcre \
|
||||
|
@ -5,3 +5,5 @@ SHA256 (cd9d1038a822.patch) = 4183dffdf4e3dbe70302d7e6e665cc83243a7166cf9bc2b8aa
|
||||
SIZE (cd9d1038a822.patch) = 8946
|
||||
SHA256 (f98ca3ab7ca1.patch) = 319a9658ea12403e6c73ed0c2c6f0deffd23ebe25b6ba81d7573f9984be95760
|
||||
SIZE (f98ca3ab7ca1.patch) = 2669
|
||||
SHA256 (5ae4f65045c0.patch) = b29852188bd900f444882a8500452ccb018fd2025cb3e9c618dbff1bc9abe525
|
||||
SIZE (5ae4f65045c0.patch) = 724
|
||||
|
@ -3,6 +3,7 @@
|
||||
PORTNAME= wayfire-plugins-extra
|
||||
DISTVERSIONPREFIX= v
|
||||
DISTVERSION= 0.5.0
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= x11-wm
|
||||
|
||||
MAINTAINER= jbeich@FreeBSD.org
|
||||
|
@ -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 \
|
||||
|
592
x11-wm/wayfire/files/patch-wlroots-0.12
Normal file
592
x11-wm/wayfire/files/patch-wlroots-0.12
Normal file
@ -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;
|
Loading…
Reference in New Issue
Block a user