diff --git a/src/modules/active-notify/activenotifymanagerinterfacev1.cpp b/src/modules/active-notify/activenotifymanagerinterfacev1.cpp index 2fb3b5cd7..6bcae59b8 100644 --- a/src/modules/active-notify/activenotifymanagerinterfacev1.cpp +++ b/src/modules/active-notify/activenotifymanagerinterfacev1.cpp @@ -5,8 +5,6 @@ #include "qwayland-server-treeland-active-notify-unstable-v1.h" -#include - static QList s_notifies; struct TreelandActiveNotifyManagerInterfaceV1Private @@ -46,11 +44,6 @@ void TreelandActiveNotifyManagerInterfaceV1Private::get_active_notify(Resource * uint32_t id, struct ::wl_resource *seat) { - if (!seat || strcmp(wl_resource_get_class(seat), "wl_seat") != 0) { - wl_resource_post_error(resource->handle, 0, "seat resource is NULL or not a wl_seat!"); - return; - } - struct wlr_seat_client *seat_client = wlr_seat_client_from_resource(seat); if (!seat_client) { wl_resource_post_error(resource->handle, 0, "seat resource is inert!"); diff --git a/src/modules/decoration/decorationmanagerinterfacev1.cpp b/src/modules/decoration/decorationmanagerinterfacev1.cpp index 063a490f3..a1a4f025e 100644 --- a/src/modules/decoration/decorationmanagerinterfacev1.cpp +++ b/src/modules/decoration/decorationmanagerinterfacev1.cpp @@ -13,8 +13,6 @@ #include -#include - // --------------------------------------------------------------------------- // Helpers // --------------------------------------------------------------------------- @@ -309,13 +307,6 @@ void DecorationManagerInterfaceV1Private::get_decoration_context(Resource *resou uint32_t id, struct ::wl_resource *surface) { - if (!surface) { - wl_resource_post_error(resource->handle, - TREELAND_DECORATION_MANAGER_V1_ERROR_INVALID_SURFACE, - "surface resource is NULL!"); - return; - } - // The surface must be owned by the requesting client. if (wl_resource_get_client(surface) != resource->client()) { wl_resource_post_error(resource->handle, @@ -324,13 +315,6 @@ void DecorationManagerInterfaceV1Private::get_decoration_context(Resource *resou return; } - if (strcmp(wl_resource_get_class(surface), "wl_surface") != 0) { - wl_resource_post_error(resource->handle, - TREELAND_DECORATION_MANAGER_V1_ERROR_INVALID_SURFACE, - "invalid surface!"); - return; - } - auto *wlrSurface = wlr_surface_from_resource(surface); // At most one active decoration context per surface. diff --git a/src/modules/region-watch/regionwatchmanagerinterfacev1.cpp b/src/modules/region-watch/regionwatchmanagerinterfacev1.cpp index 758cf3be0..b9ca75133 100644 --- a/src/modules/region-watch/regionwatchmanagerinterfacev1.cpp +++ b/src/modules/region-watch/regionwatchmanagerinterfacev1.cpp @@ -9,8 +9,6 @@ #include -#include - #include #include @@ -120,18 +118,6 @@ void RegionWatchV1Private::set_region(Resource *resource, return; } - // wlr_output_from_resource() asserts that the resource is a genuine - // wl_output; a client may pass any live object id (or an inert one), - // which would abort the compositor before the checks below. Validate - // the object class first and route invalid references to the error path. - if (!outputResource - || strcmp(wl_resource_get_class(outputResource), wl_output_interface.name) != 0) { - wl_resource_post_error(resource->handle, - InvalidAnchor, - "set_region requires a valid wl_output resource"); - return; - } - struct wlr_output *output = wlr_output_from_resource(outputResource); auto *wOutput = output ? WOutput::fromHandle(output) : nullptr; if (!wOutput) { diff --git a/src/modules/xwindow-control/xwindowcontrolinterfacev1.cpp b/src/modules/xwindow-control/xwindowcontrolinterfacev1.cpp index 14227636b..1e2dc69ab 100644 --- a/src/modules/xwindow-control/xwindowcontrolinterfacev1.cpp +++ b/src/modules/xwindow-control/xwindowcontrolinterfacev1.cpp @@ -11,8 +11,6 @@ #include -#include - class XWindowControlInterfaceV1Private : public QtWaylandServer::treeland_xwindow_control_v1 { public: @@ -50,9 +48,8 @@ void XWindowControlInterfaceV1Private::set_xwindow_position_relative(Resource *r wl_fixed_t dx, wl_fixed_t dy) { - WSurface *wsurface = nullptr; - if (anchor && strcmp(wl_resource_get_class(anchor), "wl_surface") == 0) - wsurface = WSurface::fromHandle(wlr_surface_from_resource(anchor)); + // libwayland dispatch already guarantees a genuine wl_surface. + auto *wsurface = WSurface::fromHandle(wlr_surface_from_resource(anchor)); uint32_t ok = (wsurface && Helper::instance()->setXWindowPositionRelative(wid, wsurface, dx, dy)) ? 0 : 1; wl_resource *cb = wl_resource_create(resource->client(), &wl_callback_interface, 1, callback); if (!cb) {