Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/modules/active-notify/activenotifymanagerinterfacev1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@

#include "activenotifymanagerinterfacev1.h"

#include "qwayland-server-treeland-active-notify-unstable-v1.h"

Check warning on line 6 in src/modules/active-notify/activenotifymanagerinterfacev1.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "qwayland-server-treeland-active-notify-unstable-v1.h" not found.

#include <cstring>

static QList<ActiveNotifyV1 *> s_notifies;

struct TreelandActiveNotifyManagerInterfaceV1Private
Expand Down Expand Up @@ -46,11 +44,6 @@
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!");
Expand Down
16 changes: 0 additions & 16 deletions src/modules/decoration/decorationmanagerinterfacev1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
#include <wayland-server-core.h>
#include <wlr/types/wlr_compositor.h>

#include <wtoplevelsurface.h>

Check warning on line 14 in src/modules/decoration/decorationmanagerinterfacev1.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <wtoplevelsurface.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <cstring>

// ---------------------------------------------------------------------------
// Helpers
// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -309,13 +307,6 @@
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,
Expand All @@ -324,13 +315,6 @@
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.
Expand Down
14 changes: 0 additions & 14 deletions src/modules/region-watch/regionwatchmanagerinterfacev1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@

#include <woutput.h>

#include <QTimer>

Check warning on line 10 in src/modules/region-watch/regionwatchmanagerinterfacev1.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QTimer> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <string.h>

#include <wayland-server.h>

Check warning on line 12 in src/modules/region-watch/regionwatchmanagerinterfacev1.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <wayland-server.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <wlr/types/wlr_output.h>

Check warning on line 13 in src/modules/region-watch/regionwatchmanagerinterfacev1.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <wlr/types/wlr_output.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

// Errors of treeland_region_watch_v1, mirroring the protocol XML.
enum RegionWatchError {
Expand Down Expand Up @@ -120,18 +118,6 @@
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) {
Expand Down
7 changes: 2 additions & 5 deletions src/modules/xwindow-control/xwindowcontrolinterfacev1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
#include <wserver.h>
#include <wsurface.h>

#include <wayland-server-core.h>

Check warning on line 12 in src/modules/xwindow-control/xwindowcontrolinterfacev1.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <wayland-server-core.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <cstring>

class XWindowControlInterfaceV1Private : public QtWaylandServer::treeland_xwindow_control_v1
{
public:
Expand Down Expand Up @@ -50,9 +48,8 @@
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) {
Expand Down
Loading