commit c261063634ddcba7cdd84d5c11766945e4517056
parent bf9ee7c8e70917cc7d1a0b05ae0d333abeb49812
Author: Michael Forney <mforney@mforney.org>
Date: Sat, 6 Dec 2014 12:33:37 -0800
Various minor fixes/style changes
Diffstat:
13 files changed, 15 insertions(+), 19 deletions(-)
diff --git a/libswc/compositor.c b/libswc/compositor.c
@@ -521,13 +521,12 @@ void compositor_view_show(struct compositor_view * view)
if (view->visible)
return;
- /* Assume worst-case no clipping until we draw the next frame (in case the
- * surface gets moved before that. */
- pixman_region32_clear(&view->clip);
-
view->visible = true;
view_update_screens(&view->base);
+ /* Assume worst-case no clipping until we draw the next frame (in case the
+ * surface gets moved before that. */
+ pixman_region32_clear(&view->clip);
damage_view(view);
update(&view->base);
@@ -831,16 +830,15 @@ static struct wl_compositor_interface compositor_implementation = {
static void bind_compositor(struct wl_client * client, void * data,
uint32_t version, uint32_t id)
{
- struct swc_compositor * compositor = data;
struct wl_resource * resource;
- if (version >= 3)
+ if (version > 3)
version = 3;
resource = wl_resource_create(client, &wl_compositor_interface,
version, id);
wl_resource_set_implementation(resource, &compositor_implementation,
- compositor, NULL);
+ NULL, NULL);
}
bool swc_compositor_initialize()
diff --git a/libswc/data_device_manager.c b/libswc/data_device_manager.c
@@ -63,7 +63,7 @@ static void bind_data_device_manager(struct wl_client * client, void * data,
{
struct wl_resource * resource;
- if (version >= 1)
+ if (version > 1)
version = 1;
resource = wl_resource_create(client, &wl_data_device_manager_interface,
diff --git a/libswc/drm.c b/libswc/drm.c
@@ -266,7 +266,7 @@ static void bind_drm(struct wl_client * client, void * data, uint32_t version,
{
struct wl_resource * resource;
- if (version >= 2)
+ if (version > 2)
version = 2;
resource = wl_resource_create(client, &wl_drm_interface, version, id);
diff --git a/libswc/keyboard.c b/libswc/keyboard.c
@@ -29,6 +29,7 @@
#include "compositor.h"
#include "internal.h"
#include "keyboard.h"
+#include "surface.h"
#include "util.h"
#include <assert.h>
diff --git a/libswc/keyboard.h b/libswc/keyboard.h
@@ -25,7 +25,6 @@
#define SWC_KEYBOARD_H
#include "input.h"
-#include "surface.h"
#include "xkb.h"
#include <wayland-util.h>
diff --git a/libswc/output.c b/libswc/output.c
@@ -20,7 +20,7 @@ static void bind_output(struct wl_client * client, void * data,
struct wl_resource * resource;
uint32_t flags;
- if (version >= 2)
+ if (version > 2)
version = 2;
resource = wl_resource_create(client, &wl_output_interface, version, id);
diff --git a/libswc/panel_manager.c b/libswc/panel_manager.c
@@ -52,7 +52,7 @@ static void bind_panel_manager(struct wl_client * client, void * data,
{
struct wl_resource * resource;
- if (version >= 1)
+ if (version > 1)
version = 1;
resource = wl_resource_create(client, &swc_panel_manager_interface,
diff --git a/libswc/screen.c b/libswc/screen.c
@@ -84,7 +84,7 @@ static void bind_screen(struct wl_client * client, void * data,
struct screen * screen = data;
struct wl_resource * resource;
- if (version >= 1)
+ if (version > 1)
version = 1;
resource = wl_resource_create(client, &swc_screen_interface, version, id);
diff --git a/libswc/seat.c b/libswc/seat.c
@@ -206,7 +206,7 @@ static void bind_seat(struct wl_client * client, void * data, uint32_t version,
{
struct wl_resource * resource;
- if (version >= 4)
+ if (version > 4)
version = 4;
resource = wl_resource_create(client, &wl_seat_interface, version, id);
diff --git a/libswc/shell.c b/libswc/shell.c
@@ -55,7 +55,7 @@ static void bind_shell(struct wl_client * client, void * data,
{
struct wl_resource * resource;
- if (version >= 1)
+ if (version > 1)
version = 1;
resource = wl_resource_create(client, &wl_shell_interface, version, id);
diff --git a/libswc/shm.c b/libswc/shm.c
@@ -227,7 +227,7 @@ static void bind_shm(struct wl_client * client, void * data, uint32_t version,
{
struct wl_resource * resource;
- if (version >= 1)
+ if (version > 1)
version = 1;
resource = wl_resource_create(client, &wl_shm_interface, version, id);
diff --git a/libswc/surface.c b/libswc/surface.c
@@ -80,8 +80,6 @@ static void state_finalize(struct swc_surface_state * state)
/**
* In order to set the buffer of a surface state (current or pending), we need
* to manage the destroy listeners we have for the new and old buffer.
- *
- * @return: Whether or not the buffer was changed.
*/
static void state_set_buffer(struct swc_surface_state * state,
struct wl_resource * resource)
diff --git a/libswc/xdg_shell.c b/libswc/xdg_shell.c
@@ -121,7 +121,7 @@ static void bind_shell(struct wl_client * client, void * data,
{
struct wl_resource * resource;
- if (version >= 1)
+ if (version > 1)
version = 1;
resource = wl_resource_create(client, &xdg_shell_interface, version, id);