]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Fix coding style
authorJohan Malm <jgm323@gmail.com>
Sun, 26 Dec 2021 23:29:01 +0000 (23:29 +0000)
committerJohan Malm <jgm323@gmail.com>
Sun, 26 Dec 2021 23:29:01 +0000 (23:29 +0000)
include/labwc.h
src/action.c
src/cursor.c
src/desktop.c
src/key-state.c
src/xwayland.c

index f71512e4c3245f88fcdfe9972ee9ea1ff50f42d9..8b960a5624bff6750937996081078bc070ef3214 100644 (file)
@@ -351,7 +351,8 @@ void xwayland_unmanaged_create(struct server *server,
 void view_child_init(struct view_child *child, struct view *view,
        struct wlr_surface *wlr_surface);
 void view_child_finish(struct view_child *child);
-void view_subsurface_create(struct view *view, struct wlr_subsurface *wlr_subsurface);
+void view_subsurface_create(struct view *view,
+       struct wlr_subsurface *wlr_subsurface);
 
 void view_set_activated(struct view *view, bool activated);
 void view_close(struct view *view);
@@ -413,7 +414,8 @@ enum lab_cycle_dir {
  * @current: reference point for finding next view to cycle to
  * Note: If !current, the server->views second focusable view is returned
  */
-struct view *desktop_cycle_view(struct server *server, struct view *current, enum lab_cycle_dir dir);
+struct view *desktop_cycle_view(struct server *server, struct view *current,
+       enum lab_cycle_dir dir);
 struct view *desktop_focused_view(struct server *server);
 void desktop_focus_topmost_mapped_view(struct server *server);
 bool isfocusable(struct view *view);
@@ -484,8 +486,8 @@ void server_init(struct server *server);
 void server_start(struct server *server);
 void server_finish(struct server *server);
 
-void action(struct view *activator, struct server *server, const char *action, const char *command,
-       uint32_t resize_edges);
+void action(struct view *activator, struct server *server, const char *action,
+       const char *command, uint32_t resize_edges);
 
 /* update onscreen display 'alt-tab' texture */
 void osd_update(struct server *server);
index c29cc83dcbc7ef09f324b3a0da2ce26d622fb81c..926db0639ac035dc3056953f52c6f8fe9e878347 100644 (file)
@@ -105,6 +105,6 @@ action(struct view *activator, struct server *server, const char *action, const
                        interactive_begin(view, LAB_INPUT_STATE_RESIZE, resize_edges);
                }
        } else {
-               wlr_log(WLR_ERROR, "action (%s) not supported", action);
+               wlr_log(WLR_ERROR, "(%s) not supported", action);
        }
 }
index c2b3a19ff3c64bb36f4c5cb4fb25c5ef9472eade..e7a4a5d7a34f39a42bf97e00346126b0c802c102 100644 (file)
@@ -84,8 +84,10 @@ request_start_drag_notify(struct wl_listener *listener, void *data)
        struct seat *seat = wl_container_of(
                listener, seat, request_start_drag);
        struct wlr_seat_request_start_drag_event *event = data;
-       if (wlr_seat_validate_pointer_grab_serial(seat->seat, event->origin, event->serial)) {
-               wlr_seat_start_pointer_drag(seat->seat, event->drag, event->serial);
+       if (wlr_seat_validate_pointer_grab_serial(seat->seat, event->origin,
+                       event->serial)) {
+               wlr_seat_start_pointer_drag(seat->seat, event->drag,
+                       event->serial);
        } else {
                wlr_data_source_destroy(event->drag->source);
        }
@@ -374,10 +376,11 @@ cursor_motion(struct wl_listener *listener, void *data)
        if (!seat->current_constraint) {
                /*
                 * The cursor doesn't move unless we tell it to. The cursor
-                * automatically handles constraining the motion to the output layout,
-                * as well as any special configuration applied for the specific input
-                * device which generated the event. You can pass NULL for the device
-                * if you want to move the cursor around without any input.
+                * automatically handles constraining the motion to the output
+                * layout, as well as any special configuration applied for the
+                * specific input device which generated the event. You can pass
+                * NULL for the device if you want to move the cursor around
+                * without any input.
                 */
                wlr_cursor_move(seat->cursor, event->device, event->delta_x,
                        event->delta_y);
@@ -428,19 +431,21 @@ cursor_motion_absolute(struct wl_listener *listener, void *data)
        if (!seat->current_constraint) {
                /*
                 * The cursor doesn't move unless we tell it to. The cursor
-                * automatically handles constraining the motion to the output layout,
-                * as well as any special configuration applied for the specific input
-                * device which generated the event. You can pass NULL for the device
-                * if you want to move the cursor around without any input.
+                * automatically handles constraining the motion to the output
+                * layout, as well as any special configuration applied for the
+                * specific input device which generated the event. You can pass
+                * NULL for the device if you want to move the cursor around
+                * without any input.
                 */
-               wlr_cursor_move(seat->cursor, event->device, dx, dy);
-       }
+               wlr_cursor_move(seat->cursor, event->device, dx, dy); }
 
        process_cursor_motion(seat->server, event->time_msec);
 }
 
 static bool
-handle_release_mousebinding(struct view *view, struct server *server, uint32_t button, uint32_t modifiers, enum ssd_part_type view_area, uint32_t resize_edges)
+handle_release_mousebinding(struct view *view, struct server *server,
+               uint32_t button, uint32_t modifiers,
+               enum ssd_part_type view_area, uint32_t resize_edges)
 {
        struct mousebind *mousebind;
        bool activated_any = false;
@@ -487,7 +492,10 @@ is_double_click(long double_click_speed, uint32_t button)
                return false;
        }
        if (ms < double_click_speed && ms >= 0) {
-               /* end sequence so that third click is not considered a double-click */
+               /*
+                * End sequence so that third click is not considered a
+                * double-click
+                */
                last_button = 0;
                return true;
        }
@@ -495,7 +503,9 @@ is_double_click(long double_click_speed, uint32_t button)
 }
 
 static bool
-handle_press_mousebinding(struct view *view, struct server *server, uint32_t button, uint32_t modifiers, enum ssd_part_type view_area, uint32_t resize_edges)
+handle_press_mousebinding(struct view *view, struct server *server,
+               uint32_t button, uint32_t modifiers,
+               enum ssd_part_type view_area, uint32_t resize_edges)
 {
        struct mousebind *mousebind;
        bool double_click = is_double_click(rc.doubleclick_time, button);
@@ -571,7 +581,8 @@ cursor_button(struct wl_listener *listener, void *data)
 
                /* Handle _release_ on root window */
                if (!view) {
-                       handle_release_mousebinding(NULL, server, event->button, modifiers, LAB_SSD_ROOT, 0);
+                       handle_release_mousebinding(NULL, server, event->button,
+                               modifiers, LAB_SSD_ROOT, 0);
                }
                goto mousebindings;
        }
@@ -600,7 +611,8 @@ cursor_button(struct wl_listener *listener, void *data)
 
        /* Handle _press_ on root window */
        if (!view) {
-               handle_press_mousebinding(NULL, server, event->button, modifiers, LAB_SSD_ROOT, 0);
+               handle_press_mousebinding(NULL, server,
+                       event->button, modifiers, LAB_SSD_ROOT, 0);
                return;
        }
 
@@ -615,9 +627,13 @@ cursor_button(struct wl_listener *listener, void *data)
 
 mousebindings:
        if (event->state == WLR_BUTTON_RELEASED) {
-               triggered_frame_binding |= handle_release_mousebinding(view, server, event->button, modifiers, view_area, resize_edges);
+               triggered_frame_binding |= handle_release_mousebinding(view,
+                       server, event->button, modifiers,
+                       view_area, resize_edges);
        } else if (event->state == WLR_BUTTON_PRESSED) {
-               triggered_frame_binding |= handle_press_mousebinding(view, server, event->button, modifiers, view_area, resize_edges);
+               triggered_frame_binding |= handle_press_mousebinding(view,
+                       server, event->button, modifiers,
+                       view_area, resize_edges);
        }
        if (!triggered_frame_binding) {
                /* Notify client with pointer focus of button press */
index 9c09598c95832f828d32a84c7e94d4899a932b1c..0e68387934067e1e4cfbf2c6c43cf1ed6e2e1f26 100644 (file)
@@ -169,7 +169,8 @@ first_view(struct server *server)
 }
 
 struct view *
-desktop_cycle_view(struct server *server, struct view *current, enum lab_cycle_dir dir)
+desktop_cycle_view(struct server *server, struct view *current,
+               enum lab_cycle_dir dir)
 {
        if (!has_focusable_view(&server->views)) {
                return NULL;
@@ -292,8 +293,8 @@ wlr_surface *layer_surface_at(struct wl_list *layer, double ox, double oy,
                double _sx = ox - surface->geo.x;
                double _sy = oy - surface->geo.y;
                struct wlr_surface *wlr_surface;
-               wlr_surface = wlr_layer_surface_v1_surface_at(surface->layer_surface,
-                                                             _sx, _sy, sx, sy);
+               wlr_surface = wlr_layer_surface_v1_surface_at(
+                       surface->layer_surface, _sx, _sy, sx, sy);
                if (wlr_surface) {
                        return wlr_surface;
                }
index 9b50f33ed9ac0354ddf770ecc19b410930dff62e..bc4844f6dcb6836fb9f83dde9ba5595b01832e8e 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-only
 #include <stdbool.h>
 #include <stdint.h>
 #include <string.h>
index 44205a1f53b8545b8888162d6125f92ab0aebb7b..4b0cd184e9891bd1d7745940507f547dd5c58311 100644 (file)
@@ -279,7 +279,7 @@ map(struct view *view)
 static void
 unmap(struct view *view)
 {
-       if(view->mapped) {
+       if (view->mapped) {
                view->mapped = false;
                damage_all_outputs(view->server);
                wl_list_remove(&view->commit.link);