mirror of
https://cagebreak.project-repo.co/cagebreak.git
synced 2026-08-09 15:19:11 +02:00
Apply clang-format
This commit is contained in:
parent
bc1748cdd3
commit
70d8041c5f
7 changed files with 33 additions and 24 deletions
|
|
@ -368,7 +368,7 @@ main(int argc, char *argv[]) {
|
|||
wl_event_loop_add_signal(event_loop, SIGPIPE, handle_signal, &server);
|
||||
server.event_loop = event_loop;
|
||||
|
||||
backend = wlr_backend_autocreate(server.wl_display,&server.session);
|
||||
backend = wlr_backend_autocreate(server.wl_display, &server.session);
|
||||
if(!backend) {
|
||||
wlr_log(WLR_ERROR, "Unable to create the wlroots backend");
|
||||
ret = 1;
|
||||
|
|
@ -428,9 +428,10 @@ main(int argc, char *argv[]) {
|
|||
ret = 1;
|
||||
goto end;
|
||||
}
|
||||
server.scene_output_layout=wlr_scene_attach_output_layout(server.scene, server.output_layout);
|
||||
server.scene_output_layout =
|
||||
wlr_scene_attach_output_layout(server.scene, server.output_layout);
|
||||
|
||||
compositor = wlr_compositor_create(server.wl_display,6,server.renderer);
|
||||
compositor = wlr_compositor_create(server.wl_display, 6, server.renderer);
|
||||
if(!compositor) {
|
||||
wlr_log(WLR_ERROR, "Unable to create the wlroots compositor");
|
||||
ret = 1;
|
||||
|
|
|
|||
|
|
@ -270,9 +270,10 @@ LLVMFuzzerInitialize(int *argc, char ***argv) {
|
|||
ret = 1;
|
||||
goto end;
|
||||
}
|
||||
server.scene_output_layout=wlr_scene_attach_output_layout(server.scene, server.output_layout);
|
||||
server.scene_output_layout =
|
||||
wlr_scene_attach_output_layout(server.scene, server.output_layout);
|
||||
|
||||
compositor = wlr_compositor_create(server.wl_display, 5,server.renderer);
|
||||
compositor = wlr_compositor_create(server.wl_display, 5, server.renderer);
|
||||
if(!compositor) {
|
||||
wlr_log(WLR_ERROR, "Unable to create the wlroots compositor");
|
||||
ret = 1;
|
||||
|
|
|
|||
|
|
@ -1625,7 +1625,8 @@ void
|
|||
set_cursor(bool enabled, struct cg_seat *seat) {
|
||||
if(enabled == true) {
|
||||
seat->enable_cursor = true;
|
||||
wlr_cursor_set_xcursor(seat->cursor,seat->xcursor_manager, DEFAULT_XCURSOR);
|
||||
wlr_cursor_set_xcursor(seat->cursor, seat->xcursor_manager,
|
||||
DEFAULT_XCURSOR);
|
||||
} else {
|
||||
seat->enable_cursor = false;
|
||||
wlr_cursor_unset_image(seat->cursor);
|
||||
|
|
@ -1685,7 +1686,9 @@ run_action(enum keybinding_action action, struct cg_server *server,
|
|||
if(data.u != server->seat->default_mode) {
|
||||
wlr_seat_pointer_notify_clear_focus(server->seat->seat);
|
||||
if(server->seat->enable_cursor == true) {
|
||||
wlr_cursor_set_xcursor(server->seat->cursor,server->seat->xcursor_manager, "dot_box_mask");
|
||||
wlr_cursor_set_xcursor(server->seat->cursor,
|
||||
server->seat->xcursor_manager,
|
||||
"dot_box_mask");
|
||||
}
|
||||
}
|
||||
server->seat->mode = data.u;
|
||||
|
|
|
|||
11
output.c
11
output.c
|
|
@ -15,6 +15,7 @@
|
|||
#include <wlr/backend/x11.h>
|
||||
#endif
|
||||
#include <wlr/types/wlr_compositor.h>
|
||||
#include <wlr/types/wlr_cursor.h>
|
||||
#include <wlr/types/wlr_data_device.h>
|
||||
#include <wlr/types/wlr_output.h>
|
||||
#include <wlr/types/wlr_output_layout.h>
|
||||
|
|
@ -22,7 +23,6 @@
|
|||
#include <wlr/types/wlr_xcursor_manager.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include <wlr/util/region.h>
|
||||
#include <wlr/types/wlr_cursor.h>
|
||||
#if CG_HAS_XWAYLAND
|
||||
#include <wlr/xwayland.h>
|
||||
#endif
|
||||
|
|
@ -165,7 +165,7 @@ handle_output_frame(struct wl_listener *listener, void *data) {
|
|||
if(scene_output == NULL) {
|
||||
return;
|
||||
}
|
||||
wlr_scene_output_commit(scene_output,NULL);
|
||||
wlr_scene_output_commit(scene_output, NULL);
|
||||
|
||||
struct timespec now = {0};
|
||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||
|
|
@ -439,7 +439,8 @@ handle_output_commit(struct wl_listener *listener, void *data) {
|
|||
}
|
||||
|
||||
if(event->state->committed &
|
||||
(WLR_OUTPUT_STATE_TRANSFORM | WLR_OUTPUT_STATE_SCALE | WLR_OUTPUT_STATE_MODE)) {
|
||||
(WLR_OUTPUT_STATE_TRANSFORM | WLR_OUTPUT_STATE_SCALE |
|
||||
WLR_OUTPUT_STATE_MODE)) {
|
||||
struct cg_view *view;
|
||||
wl_list_for_each(
|
||||
view, &output->workspaces[output->curr_workspace]->views, link) {
|
||||
|
|
@ -499,7 +500,7 @@ handle_new_output(struct wl_listener *listener, void *data) {
|
|||
}
|
||||
|
||||
struct cg_output *output = calloc(1, sizeof(struct cg_output));
|
||||
output->scene_output=wlr_scene_output_create(server->scene,wlr_output);
|
||||
output->scene_output = wlr_scene_output_create(server->scene, wlr_output);
|
||||
if(!output) {
|
||||
wlr_log(WLR_ERROR, "Failed to allocate output");
|
||||
return;
|
||||
|
|
@ -552,7 +553,7 @@ handle_new_output(struct wl_listener *listener, void *data) {
|
|||
server->curr_output = output;
|
||||
}
|
||||
wlr_cursor_set_xcursor(server->seat->cursor, server->seat->xcursor_manager,
|
||||
DEFAULT_XCURSOR);
|
||||
DEFAULT_XCURSOR);
|
||||
wlr_cursor_warp(server->seat->cursor, NULL, 0, 0);
|
||||
|
||||
output->destroy.notify = handle_output_destroy;
|
||||
|
|
|
|||
9
seat.c
9
seat.c
|
|
@ -14,13 +14,13 @@
|
|||
#include <wlr/types/wlr_compositor.h>
|
||||
#include <wlr/types/wlr_cursor.h>
|
||||
#include <wlr/types/wlr_data_device.h>
|
||||
#include <wlr/types/wlr_idle_notify_v1.h>
|
||||
#include <wlr/types/wlr_keyboard_group.h>
|
||||
#include <wlr/types/wlr_primary_selection.h>
|
||||
#include <wlr/types/wlr_scene.h>
|
||||
#include <wlr/types/wlr_seat.h>
|
||||
#include <wlr/types/wlr_touch.h>
|
||||
#include <wlr/types/wlr_xcursor_manager.h>
|
||||
#include <wlr/types/wlr_idle_notify_v1.h>
|
||||
#include <wlr/util/log.h>
|
||||
#if CG_HAS_XWAYLAND
|
||||
#include <wlr/xwayland.h>
|
||||
|
|
@ -61,7 +61,8 @@ update_capabilities(const struct cg_seat *seat) {
|
|||
seat->enable_cursor == false) {
|
||||
wlr_cursor_unset_image(seat->cursor);
|
||||
} else {
|
||||
wlr_cursor_set_xcursor(seat->cursor, seat->xcursor_manager, DEFAULT_XCURSOR);
|
||||
wlr_cursor_set_xcursor(seat->cursor, seat->xcursor_manager,
|
||||
DEFAULT_XCURSOR);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -204,8 +205,8 @@ handle_command_key_bindings(struct cg_server *server, xkb_keysym_t sym,
|
|||
&server->scene->tree.node, server->seat->cursor->x,
|
||||
server->seat->cursor->y, &sx, &sy);
|
||||
if(server->seat->enable_cursor) {
|
||||
wlr_cursor_set_xcursor(server->seat->cursor, server->seat->xcursor_manager,
|
||||
"left_ptr");
|
||||
wlr_cursor_set_xcursor(server->seat->cursor,
|
||||
server->seat->xcursor_manager, "left_ptr");
|
||||
if(node && node->type == WLR_SCENE_NODE_BUFFER) {
|
||||
struct wlr_scene_surface *scene_surface =
|
||||
wlr_scene_surface_try_from_buffer(
|
||||
|
|
|
|||
|
|
@ -248,7 +248,8 @@ handle_xdg_shell_surface_new(struct wl_listener *listener, void *data) {
|
|||
xdg_shell_view->map.notify = handle_xdg_shell_surface_map;
|
||||
wl_signal_add(&xdg_surface->surface->events.map, &xdg_shell_view->map);
|
||||
xdg_shell_view->unmap.notify = handle_xdg_shell_surface_unmap;
|
||||
wl_signal_add(&xdg_surface->surface->events.unmap, &xdg_shell_view->unmap);
|
||||
wl_signal_add(&xdg_surface->surface->events.unmap,
|
||||
&xdg_shell_view->unmap);
|
||||
xdg_shell_view->destroy.notify = handle_xdg_shell_surface_destroy;
|
||||
wl_signal_add(&xdg_surface->events.destroy, &xdg_shell_view->destroy);
|
||||
xdg_shell_view->request_fullscreen.notify =
|
||||
|
|
|
|||
15
xwayland.c
15
xwayland.c
|
|
@ -42,7 +42,7 @@ static pid_t
|
|||
get_pid(const struct cg_view *view) {
|
||||
struct wlr_xwayland_surface *surf =
|
||||
wlr_xwayland_surface_try_from_wlr_surface(view->wlr_surface);
|
||||
if(surf==NULL) {
|
||||
if(surf == NULL) {
|
||||
return -1;
|
||||
} else {
|
||||
return surf->pid;
|
||||
|
|
@ -177,9 +177,8 @@ static const struct cg_view_impl xwayland_view_impl = {
|
|||
static void
|
||||
handle_xwayland_surface_associate(struct wl_listener *listener, void *data) {
|
||||
struct cg_xwayland_view *xwayland_view =
|
||||
wl_container_of(listener, xwayland_view, associate);
|
||||
struct wlr_xwayland_surface *xsurface =
|
||||
xwayland_view->xwayland_surface;
|
||||
wl_container_of(listener, xwayland_view, associate);
|
||||
struct wlr_xwayland_surface *xsurface = xwayland_view->xwayland_surface;
|
||||
wl_signal_add(&xsurface->surface->events.unmap, &xwayland_view->unmap);
|
||||
xwayland_view->unmap.notify = handle_xwayland_surface_unmap;
|
||||
wl_signal_add(&xsurface->surface->events.map, &xwayland_view->map);
|
||||
|
|
@ -189,7 +188,7 @@ handle_xwayland_surface_associate(struct wl_listener *listener, void *data) {
|
|||
static void
|
||||
handle_xwayland_surface_dissociate(struct wl_listener *listener, void *data) {
|
||||
struct cg_xwayland_view *xwayland_view =
|
||||
wl_container_of(listener, xwayland_view, dissociate);
|
||||
wl_container_of(listener, xwayland_view, dissociate);
|
||||
wl_list_remove(&xwayland_view->map.link);
|
||||
wl_list_remove(&xwayland_view->unmap.link);
|
||||
}
|
||||
|
|
@ -212,9 +211,11 @@ handle_xwayland_surface_new(struct wl_listener *listener, void *data) {
|
|||
xwayland_view->xwayland_surface = xwayland_surface;
|
||||
|
||||
xwayland_view->associate.notify = handle_xwayland_surface_associate;
|
||||
wl_signal_add(&xwayland_surface->events.associate, &xwayland_view->associate);
|
||||
wl_signal_add(&xwayland_surface->events.associate,
|
||||
&xwayland_view->associate);
|
||||
xwayland_view->dissociate.notify = handle_xwayland_surface_dissociate;
|
||||
wl_signal_add(&xwayland_surface->events.dissociate, &xwayland_view->dissociate);
|
||||
wl_signal_add(&xwayland_surface->events.dissociate,
|
||||
&xwayland_view->dissociate);
|
||||
xwayland_view->destroy.notify = handle_xwayland_surface_destroy;
|
||||
wl_signal_add(&xwayland_surface->events.destroy, &xwayland_view->destroy);
|
||||
xwayland_view->request_fullscreen.notify =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue