]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Use proper enum argument type for desktop_surface_and_view_at
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Sat, 29 Jan 2022 16:52:16 +0000 (17:52 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 30 Jan 2022 21:23:15 +0000 (21:23 +0000)
include/labwc.h
include/ssd.h
src/cursor.c
src/desktop.c

index 3b46d9419cb5fb1ef6f42a4c579f3cc6e17c90a6..5efa6392f64392895dd4112235158c536fbec5db 100644 (file)
@@ -43,6 +43,7 @@
 #include <xkbcommon/xkbcommon.h>
 #include "config/keybind.h"
 #include "config/rcxml.h"
+#include "ssd.h"
 
 #define XCURSOR_DEFAULT "left_ptr"
 #define XCURSOR_SIZE 24
@@ -448,7 +449,7 @@ bool isfocusable(struct view *view);
  */
 struct view *desktop_surface_and_view_at(struct server *server, double lx,
        double ly, struct wlr_surface **surface, double *sx, double *sy,
-       int *view_area);
+       enum ssd_part_type *view_area);
 
 struct view *desktop_view_at_cursor(struct server *server);
 
index bffa65647be6bc40b2e0e9c7662b81a8bc6df26c..aeeedf0d1a229edc2a5afadc40c3d53878a1557c 100644 (file)
@@ -2,8 +2,6 @@
 #ifndef __LABWC_SSD_H
 #define __LABWC_SSD_H
 
-#include "labwc.h"
-
 /*
  * Sequence these according to the order they should be processed for
  * press and hover events. Bear in mind that some of their respective
@@ -31,6 +29,13 @@ enum ssd_part_type {
        LAB_SSD_END_MARKER
 };
 
+/*
+ * Defer including labwc.h because it is using enum ssd_part_type.
+ * This is an issue for headers like mousebind.h which only includes
+ * ssd.h but does not include labwc.h.
+ */
+#include "labwc.h"
+
 struct ssd_part {
        struct wlr_box box;
        enum ssd_part_type type;
index a7b72810bd5c5bc2ea2ef5600899e4970b102083..f0498d6700a98b9a53e3b09f69094efdbc6e0f75 100644 (file)
@@ -17,7 +17,7 @@ cursor_rebase(struct seat *seat, uint32_t time_msec)
 {
        double sx, sy;
        struct wlr_surface *surface;
-       int view_area = LAB_SSD_NONE;
+       enum ssd_part_type view_area = LAB_SSD_NONE;
 
        desktop_surface_and_view_at(seat->server, seat->cursor->x,
                seat->cursor->y, &surface, &sx, &sy, &view_area);
@@ -201,7 +201,7 @@ process_cursor_motion(struct server *server, uint32_t time)
        double sx, sy;
        struct wlr_seat *wlr_seat = server->seat.seat;
        struct wlr_surface *surface = NULL;
-       int view_area = LAB_SSD_NONE;
+       enum ssd_part_type view_area = LAB_SSD_NONE;
        struct view *view = desktop_surface_and_view_at(server,
                server->seat.cursor->x, server->seat.cursor->y, &surface,
                &sx, &sy, &view_area);
@@ -583,7 +583,7 @@ cursor_button(struct wl_listener *listener, void *data)
 
        double sx, sy;
        struct wlr_surface *surface;
-       int view_area = LAB_SSD_NONE;
+       enum ssd_part_type view_area = LAB_SSD_NONE;
        uint32_t resize_edges;
 
        /* bindings to the Frame context swallow mouse events if activated */
index d24ddd35038cc9cc6b7e705278686a1a146a1afc..9d80da0f1e00654271dbc92a170277c287a47467 100644 (file)
@@ -343,7 +343,7 @@ layer_surface_popup_at(struct output *output, struct wl_list *layer,
 struct view *
 desktop_surface_and_view_at(struct server *server, double lx, double ly,
                struct wlr_surface **surface, double *sx, double *sy,
-               int *view_area)
+               enum ssd_part_type *view_area)
 {
        struct wlr_output *wlr_output = wlr_output_layout_output_at(
                        server->output_layout, lx, ly);
@@ -435,7 +435,7 @@ desktop_view_at_cursor(struct server *server)
 {
        double sx, sy;
        struct wlr_surface *surface;
-       int view_area = LAB_SSD_NONE;
+       enum ssd_part_type view_area = LAB_SSD_NONE;
 
        return desktop_surface_and_view_at(server,
                        server->seat.cursor->x, server->seat.cursor->y,