aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-03-01 11:23:41 -0500
committerGitHub <noreply@github.com>2018-03-01 11:23:41 -0500
commit0820557c8c13dabb3f598bbfe71a8a6b459f78b8 (patch)
treec0c25fcf81a2abb4a9d976469fe0645311953c19
parent7340cf19eaf7ff39de49b2af6ef48788f9ef6bd6 (diff)
parent90148e64abb944af0e893e4114339c097579c9ed (diff)
Merge pull request #693 from emersion/fix-output-bind-multiple
Fix clients binding multiple times to the same output
-rw-r--r--types/wlr_output.c7
-rw-r--r--types/wlr_surface.c2
2 files changed, 1 insertions, 8 deletions
diff --git a/types/wlr_output.c b/types/wlr_output.c
index 5a2886c7..96c9d324 100644
--- a/types/wlr_output.c
+++ b/types/wlr_output.c
@@ -16,9 +16,7 @@
#include "util/signal.h"
static void wl_output_send_to_resource(struct wl_resource *resource) {
- assert(resource);
struct wlr_output *output = wlr_output_from_resource(resource);
- assert(output);
const uint32_t version = wl_resource_get_version(resource);
if (version >= WL_OUTPUT_GEOMETRY_SINCE_VERSION) {
wl_output_send_geometry(resource, output->lx, output->ly,
@@ -52,9 +50,7 @@ static void wl_output_send_to_resource(struct wl_resource *resource) {
static void wlr_output_send_current_mode_to_resource(
struct wl_resource *resource) {
- assert(resource);
struct wlr_output *output = wlr_output_from_resource(resource);
- assert(output);
const uint32_t version = wl_resource_get_version(resource);
if (version < WL_OUTPUT_MODE_SINCE_VERSION) {
return;
@@ -76,7 +72,7 @@ static void wlr_output_send_current_mode_to_resource(
static void wl_output_destroy(struct wl_resource *resource) {
struct wlr_output *output = wlr_output_from_resource(resource);
- struct wl_resource *_resource = NULL;
+ struct wl_resource *_resource;
wl_resource_for_each(_resource, &output->wl_resources) {
if (_resource == resource) {
struct wl_list *link = wl_resource_get_link(_resource);
@@ -98,7 +94,6 @@ static struct wl_output_interface wl_output_impl = {
static void wl_output_bind(struct wl_client *wl_client, void *data,
uint32_t version, uint32_t id) {
struct wlr_output *wlr_output = data;
- assert(wl_client && wlr_output);
struct wl_resource *wl_resource = wl_resource_create(wl_client,
&wl_output_interface, version, id);
diff --git a/types/wlr_surface.c b/types/wlr_surface.c
index d63fc1f1..23966cd1 100644
--- a/types/wlr_surface.c
+++ b/types/wlr_surface.c
@@ -901,7 +901,6 @@ void wlr_surface_send_enter(struct wlr_surface *surface,
wl_resource_for_each(resource, &output->wl_resources) {
if (client == wl_resource_get_client(resource)) {
wl_surface_send_enter(surface->resource, resource);
- break;
}
}
}
@@ -913,7 +912,6 @@ void wlr_surface_send_leave(struct wlr_surface *surface,
wl_resource_for_each(resource, &output->wl_resources) {
if (client == wl_resource_get_client(resource)) {
wl_surface_send_leave(surface->resource, resource);
- break;
}
}
}