Make Wayland request listeners static const when possible
This commit is contained in:
parent
cb3c727632
commit
8f2cd3236f
|
@ -90,7 +90,7 @@ static void layer_surface_closed(void *_output,
|
||||||
swaybar_output_free(output);
|
swaybar_output_free(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct zwlr_layer_surface_v1_listener layer_surface_listener = {
|
static const struct zwlr_layer_surface_v1_listener layer_surface_listener = {
|
||||||
.configure = layer_surface_configure,
|
.configure = layer_surface_configure,
|
||||||
.closed = layer_surface_closed,
|
.closed = layer_surface_closed,
|
||||||
};
|
};
|
||||||
|
@ -230,7 +230,7 @@ static void output_scale(void *data, struct wl_output *wl_output,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wl_output_listener output_listener = {
|
static const struct wl_output_listener output_listener = {
|
||||||
.geometry = output_geometry,
|
.geometry = output_geometry,
|
||||||
.mode = output_mode,
|
.mode = output_mode,
|
||||||
.done = output_done,
|
.done = output_done,
|
||||||
|
@ -307,7 +307,7 @@ static void xdg_output_handle_description(void *data,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct zxdg_output_v1_listener xdg_output_listener = {
|
static const struct zxdg_output_v1_listener xdg_output_listener = {
|
||||||
.logical_position = xdg_output_handle_logical_position,
|
.logical_position = xdg_output_handle_logical_position,
|
||||||
.logical_size = xdg_output_handle_logical_size,
|
.logical_size = xdg_output_handle_logical_size,
|
||||||
.done = xdg_output_handle_done,
|
.done = xdg_output_handle_done,
|
||||||
|
|
|
@ -339,7 +339,7 @@ static void wl_pointer_axis_discrete(void *data, struct wl_pointer *wl_pointer,
|
||||||
seat->axis[axis].discrete_steps += abs(discrete);
|
seat->axis[axis].discrete_steps += abs(discrete);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct wl_pointer_listener pointer_listener = {
|
static const struct wl_pointer_listener pointer_listener = {
|
||||||
.enter = wl_pointer_enter,
|
.enter = wl_pointer_enter,
|
||||||
.leave = wl_pointer_leave,
|
.leave = wl_pointer_leave,
|
||||||
.motion = wl_pointer_motion,
|
.motion = wl_pointer_motion,
|
||||||
|
|
|
@ -103,7 +103,7 @@ static void layer_surface_closed(void *data,
|
||||||
swaynag_destroy(swaynag);
|
swaynag_destroy(swaynag);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct zwlr_layer_surface_v1_listener layer_surface_listener = {
|
static const struct zwlr_layer_surface_v1_listener layer_surface_listener = {
|
||||||
.configure = layer_surface_configure,
|
.configure = layer_surface_configure,
|
||||||
.closed = layer_surface_closed,
|
.closed = layer_surface_closed,
|
||||||
};
|
};
|
||||||
|
@ -124,7 +124,7 @@ static void surface_enter(void *data, struct wl_surface *surface,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct wl_surface_listener surface_listener = {
|
static const struct wl_surface_listener surface_listener = {
|
||||||
.enter = surface_enter,
|
.enter = surface_enter,
|
||||||
.leave = nop,
|
.leave = nop,
|
||||||
};
|
};
|
||||||
|
@ -263,7 +263,7 @@ static void wl_pointer_axis(void *data, struct wl_pointer *wl_pointer,
|
||||||
render_frame(swaynag);
|
render_frame(swaynag);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct wl_pointer_listener pointer_listener = {
|
static const struct wl_pointer_listener pointer_listener = {
|
||||||
.enter = wl_pointer_enter,
|
.enter = wl_pointer_enter,
|
||||||
.leave = nop,
|
.leave = nop,
|
||||||
.motion = wl_pointer_motion,
|
.motion = wl_pointer_motion,
|
||||||
|
@ -289,7 +289,7 @@ static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct wl_seat_listener seat_listener = {
|
static const struct wl_seat_listener seat_listener = {
|
||||||
.capabilities = seat_handle_capabilities,
|
.capabilities = seat_handle_capabilities,
|
||||||
.name = nop,
|
.name = nop,
|
||||||
};
|
};
|
||||||
|
@ -305,7 +305,7 @@ static void output_scale(void *data, struct wl_output *output,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct wl_output_listener output_listener = {
|
static const struct wl_output_listener output_listener = {
|
||||||
.geometry = nop,
|
.geometry = nop,
|
||||||
.mode = nop,
|
.mode = nop,
|
||||||
.done = nop,
|
.done = nop,
|
||||||
|
@ -327,7 +327,7 @@ static void xdg_output_handle_name(void *data,
|
||||||
swaynag_output->swaynag->querying_outputs--;
|
swaynag_output->swaynag->querying_outputs--;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct zxdg_output_v1_listener xdg_output_listener = {
|
static const struct zxdg_output_v1_listener xdg_output_listener = {
|
||||||
.logical_position = nop,
|
.logical_position = nop,
|
||||||
.logical_size = nop,
|
.logical_size = nop,
|
||||||
.done = nop,
|
.done = nop,
|
||||||
|
|
Loading…
Reference in a new issue