aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/session/logind.c4
-rw-r--r--backend/session/session.c3
-rw-r--r--backend/wayland/backend.c24
-rw-r--r--examples/rotation.c8
-rw-r--r--examples/screenshot.c3
-rw-r--r--types/wlr_surface.c3
-rw-r--r--xwayland/xwm.c7
7 files changed, 37 insertions, 15 deletions
diff --git a/backend/session/logind.c b/backend/session/logind.c
index 0b5b2a63..1ece051f 100644
--- a/backend/session/logind.c
+++ b/backend/session/logind.c
@@ -330,7 +330,9 @@ static bool add_signal_matches(struct logind_session *session) {
static int dbus_event(int fd, uint32_t mask, void *data) {
sd_bus *bus = data;
- while (sd_bus_process(bus, NULL) > 0);
+ while (sd_bus_process(bus, NULL) > 0) {
+ // Do nothing.
+ }
return 1;
}
diff --git a/backend/session/session.c b/backend/session/session.c
index a5f17b8d..2bbbd4ef 100644
--- a/backend/session/session.c
+++ b/backend/session/session.c
@@ -307,8 +307,9 @@ size_t wlr_session_find_gpus(struct wlr_session *session,
}
const char *seat = udev_device_get_property_value(dev, "ID_SEAT");
- if (!seat)
+ if (!seat) {
seat = "seat0";
+ }
if (session->seat[0] && strcmp(session->seat, seat) != 0) {
udev_device_unref(dev);
continue;
diff --git a/backend/wayland/backend.c b/backend/wayland/backend.c
index 32fdc2b6..f85498eb 100644
--- a/backend/wayland/backend.c
+++ b/backend/wayland/backend.c
@@ -85,12 +85,24 @@ static void wlr_wl_backend_destroy(struct wlr_backend *_backend) {
wl_event_source_remove(backend->remote_display_src);
wlr_egl_finish(&backend->egl);
- if (backend->seat) wl_seat_destroy(backend->seat);
- if (backend->shm) wl_shm_destroy(backend->shm);
- if (backend->shell) zxdg_shell_v6_destroy(backend->shell);
- if (backend->compositor) wl_compositor_destroy(backend->compositor);
- if (backend->registry) wl_registry_destroy(backend->registry);
- if (backend->remote_display) wl_display_disconnect(backend->remote_display);
+ if (backend->seat) {
+ wl_seat_destroy(backend->seat);
+ }
+ if (backend->shm) {
+ wl_shm_destroy(backend->shm);
+ }
+ if (backend->shell) {
+ zxdg_shell_v6_destroy(backend->shell);
+ }
+ if (backend->compositor) {
+ wl_compositor_destroy(backend->compositor);
+ }
+ if (backend->registry) {
+ wl_registry_destroy(backend->registry);
+ }
+ if (backend->remote_display) {
+ wl_display_disconnect(backend->remote_display);
+ }
free(backend);
}
diff --git a/examples/rotation.c b/examples/rotation.c
index 1d974025..6ec6b439 100644
--- a/examples/rotation.c
+++ b/examples/rotation.c
@@ -64,8 +64,12 @@ static void handle_output_frame(struct output_state *output, struct timespec *ts
odata->x_offs += odata->x_vel * seconds;
odata->y_offs += odata->y_vel * seconds;
- if (odata->x_offs > 128) odata->x_offs = 0;
- if (odata->y_offs > 128) odata->y_offs = 0;
+ if (odata->x_offs > 128) {
+ odata->x_offs = 0;
+ }
+ if (odata->y_offs > 128) {
+ odata->y_offs = 0;
+ }
}
static void handle_output_add(struct output_state *output) {
diff --git a/examples/screenshot.c b/examples/screenshot.c
index 441d8684..529af38f 100644
--- a/examples/screenshot.c
+++ b/examples/screenshot.c
@@ -277,8 +277,9 @@ int main(int argc, char *argv[]) {
screenshooter, output->output, output->buffer);
orbital_screenshot_add_listener(screenshot, &screenshot_listener, screenshot);
buffer_copy_done = 0;
- while (!buffer_copy_done)
+ while (!buffer_copy_done) {
wl_display_roundtrip(display);
+ }
}
write_image("wayland-screenshot.png", width, height);
diff --git a/types/wlr_surface.c b/types/wlr_surface.c
index 8e024177..b9df8f7d 100644
--- a/types/wlr_surface.c
+++ b/types/wlr_surface.c
@@ -720,8 +720,9 @@ static struct wlr_subsurface *subsurface_find_sibling(
struct wlr_subsurface *sibling;
wl_list_for_each(sibling, &parent->subsurface_list, parent_link) {
- if (sibling->surface == surface && sibling != subsurface)
+ if (sibling->surface == surface && sibling != subsurface) {
return sibling;
+ }
}
return NULL;
diff --git a/xwayland/xwm.c b/xwayland/xwm.c
index dc349ab2..aada6501 100644
--- a/xwayland/xwm.c
+++ b/xwayland/xwm.c
@@ -480,12 +480,13 @@ static void read_surface_net_wm_state(struct wlr_xwm *xwm,
xsurface->fullscreen = 0;
xcb_atom_t *atom = xcb_get_property_value(reply);
for (uint32_t i = 0; i < reply->value_len; i++) {
- if (atom[i] == xwm->atoms[_NET_WM_STATE_FULLSCREEN])
+ if (atom[i] == xwm->atoms[_NET_WM_STATE_FULLSCREEN]) {
xsurface->fullscreen = true;
- if (atom[i] == xwm->atoms[_NET_WM_STATE_MAXIMIZED_VERT])
+ } else if (atom[i] == xwm->atoms[_NET_WM_STATE_MAXIMIZED_VERT]) {
xsurface->maximized_vert = true;
- if (atom[i] == xwm->atoms[_NET_WM_STATE_MAXIMIZED_HORZ])
+ } else if (atom[i] == xwm->atoms[_NET_WM_STATE_MAXIMIZED_HORZ]) {
xsurface->maximized_horz = true;
+ }
}
}