mirror of
https://github.com/labwc/labwc.git
synced 2025-10-31 22:25:34 -04:00
CodeStyle: prevent space in code indents
This commit is contained in:
parent
a3fff9f87b
commit
1995a33df9
12 changed files with 76 additions and 67 deletions
|
|
@ -401,8 +401,7 @@ void seat_set_pressed(struct seat *seat, struct view *view,
|
||||||
struct wlr_surface *toplevel, uint32_t resize_edges);
|
struct wlr_surface *toplevel, uint32_t resize_edges);
|
||||||
void seat_reset_pressed(struct seat *seat);
|
void seat_reset_pressed(struct seat *seat);
|
||||||
|
|
||||||
void interactive_begin(struct view *view, enum input_mode mode,
|
void interactive_begin(struct view *view, enum input_mode mode, uint32_t edges);
|
||||||
uint32_t edges);
|
|
||||||
void interactive_finish(struct view *view);
|
void interactive_finish(struct view *view);
|
||||||
void interactive_cancel(struct view *view);
|
void interactive_cancel(struct view *view);
|
||||||
|
|
||||||
|
|
|
||||||
8
scripts/checkpatch.pl
vendored
8
scripts/checkpatch.pl
vendored
|
|
@ -3738,6 +3738,14 @@ sub process {
|
||||||
# check we are in a valid source file C or perl if not then ignore this hunk
|
# check we are in a valid source file C or perl if not then ignore this hunk
|
||||||
next if ($realfile !~ /\.(h|c|pl|dtsi|dts)$/);
|
next if ($realfile !~ /\.(h|c|pl|dtsi|dts)$/);
|
||||||
|
|
||||||
|
# at the beginning of a line in a .c file there should be no
|
||||||
|
# spaces unless it is a single space in front of a multiline comment
|
||||||
|
if ($realfile =~ /\.c$/ && $rawline =~ /^\+\t* [^*]/) {
|
||||||
|
my $herevet = "$here\n" . cat_vet($rawline) . "\n";
|
||||||
|
WARN("CODE_INDENT",
|
||||||
|
"code indent should never contain spaces\n" . $herevet);
|
||||||
|
}
|
||||||
|
|
||||||
# at the beginning of a line any tabs must come first and anything
|
# at the beginning of a line any tabs must come first and anything
|
||||||
# more than $tabsize must use tabs.
|
# more than $tabsize must use tabs.
|
||||||
if ($rawline =~ /^\+\s* \t\s*\S/ ||
|
if ($rawline =~ /^\+\s* \t\s*\S/ ||
|
||||||
|
|
|
||||||
|
|
@ -66,10 +66,10 @@ build_theme_path(struct ctx *ctx, char *prefix, const char *path)
|
||||||
{
|
{
|
||||||
if (!prefix) {
|
if (!prefix) {
|
||||||
snprintf(ctx->buf, ctx->len, "%s/%s/openbox-3", path,
|
snprintf(ctx->buf, ctx->len, "%s/%s/openbox-3", path,
|
||||||
ctx->theme_name);
|
ctx->theme_name);
|
||||||
} else {
|
} else {
|
||||||
snprintf(ctx->buf, ctx->len, "%s/%s/%s/openbox-3", prefix, path,
|
snprintf(ctx->buf, ctx->len, "%s/%s/%s/openbox-3", prefix, path,
|
||||||
ctx->theme_name);
|
ctx->theme_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -122,10 +122,12 @@ config_dir(void)
|
||||||
if (buf[0] != '\0') {
|
if (buf[0] != '\0') {
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
struct ctx ctx = { .build_path_fn = build_config_path,
|
struct ctx ctx = {
|
||||||
.buf = buf,
|
.build_path_fn = build_config_path,
|
||||||
.len = sizeof(buf),
|
.buf = buf,
|
||||||
.dirs = config_dirs };
|
.len = sizeof(buf),
|
||||||
|
.dirs = config_dirs
|
||||||
|
};
|
||||||
return find_dir(&ctx);
|
return find_dir(&ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -133,10 +135,12 @@ char *
|
||||||
theme_dir(const char *theme_name)
|
theme_dir(const char *theme_name)
|
||||||
{
|
{
|
||||||
static char buf[4096] = { 0 };
|
static char buf[4096] = { 0 };
|
||||||
struct ctx ctx = { .build_path_fn = build_theme_path,
|
struct ctx ctx = {
|
||||||
.buf = buf,
|
.build_path_fn = build_theme_path,
|
||||||
.len = sizeof(buf),
|
.buf = buf,
|
||||||
.dirs = theme_dirs,
|
.len = sizeof(buf),
|
||||||
.theme_name = theme_name };
|
.dirs = theme_dirs,
|
||||||
|
.theme_name = theme_name
|
||||||
|
};
|
||||||
return find_dir(&ctx);
|
return find_dir(&ctx);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1105,7 +1105,7 @@ cursor_init(struct seat *seat)
|
||||||
wl_signal_add(&seat->cursor->events.motion, &seat->cursor_motion);
|
wl_signal_add(&seat->cursor->events.motion, &seat->cursor_motion);
|
||||||
seat->cursor_motion_absolute.notify = cursor_motion_absolute;
|
seat->cursor_motion_absolute.notify = cursor_motion_absolute;
|
||||||
wl_signal_add(&seat->cursor->events.motion_absolute,
|
wl_signal_add(&seat->cursor->events.motion_absolute,
|
||||||
&seat->cursor_motion_absolute);
|
&seat->cursor_motion_absolute);
|
||||||
seat->cursor_button.notify = cursor_button;
|
seat->cursor_button.notify = cursor_button;
|
||||||
wl_signal_add(&seat->cursor->events.button, &seat->cursor_button);
|
wl_signal_add(&seat->cursor->events.button, &seat->cursor_button);
|
||||||
seat->cursor_axis.notify = cursor_axis;
|
seat->cursor_axis.notify = cursor_axis;
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,8 @@ keyboard_any_modifiers_pressed(struct wlr_keyboard *keyboard)
|
||||||
{
|
{
|
||||||
xkb_mod_index_t i;
|
xkb_mod_index_t i;
|
||||||
for (i = 0; i < xkb_keymap_num_mods(keyboard->keymap); i++) {
|
for (i = 0; i < xkb_keymap_num_mods(keyboard->keymap); i++) {
|
||||||
if (xkb_state_mod_index_is_active
|
if (xkb_state_mod_index_is_active(keyboard->xkb_state,
|
||||||
(keyboard->xkb_state, i,
|
i, XKB_STATE_MODS_DEPRESSED)) {
|
||||||
XKB_STATE_MODS_DEPRESSED)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -99,14 +98,14 @@ handle_keybinding(struct server *server, uint32_t modifiers, xkb_keysym_t sym)
|
||||||
|
|
||||||
static bool is_modifier_key(xkb_keysym_t sym)
|
static bool is_modifier_key(xkb_keysym_t sym)
|
||||||
{
|
{
|
||||||
return sym == XKB_KEY_Shift_L ||
|
return sym == XKB_KEY_Shift_L
|
||||||
sym == XKB_KEY_Shift_R ||
|
|| sym == XKB_KEY_Shift_R
|
||||||
sym == XKB_KEY_Alt_L ||
|
|| sym == XKB_KEY_Alt_L
|
||||||
sym == XKB_KEY_Alt_R ||
|
|| sym == XKB_KEY_Alt_R
|
||||||
sym == XKB_KEY_Control_L ||
|
|| sym == XKB_KEY_Control_L
|
||||||
sym == XKB_KEY_Control_R ||
|
|| sym == XKB_KEY_Control_R
|
||||||
sym == XKB_KEY_Super_L ||
|
|| sym == XKB_KEY_Super_L
|
||||||
sym == XKB_KEY_Super_R;
|
|| sym == XKB_KEY_Super_R;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
|
|
||||||
19
src/server.c
19
src/server.c
|
|
@ -76,15 +76,14 @@ seat_inhibit_input(struct seat *seat, struct wl_client *active_client)
|
||||||
{
|
{
|
||||||
seat->active_client_while_inhibited = active_client;
|
seat->active_client_while_inhibited = active_client;
|
||||||
|
|
||||||
if (seat->focused_layer &&
|
if (seat->focused_layer && active_client !=
|
||||||
(wl_resource_get_client(seat->focused_layer->resource) !=
|
wl_resource_get_client(seat->focused_layer->resource)) {
|
||||||
active_client)) {
|
|
||||||
seat_set_focus_layer(seat, NULL);
|
seat_set_focus_layer(seat, NULL);
|
||||||
}
|
}
|
||||||
struct wlr_surface *previous_kb_surface =
|
struct wlr_surface *previous_kb_surface =
|
||||||
seat->seat->keyboard_state.focused_surface;
|
seat->seat->keyboard_state.focused_surface;
|
||||||
if (previous_kb_surface &&
|
if (previous_kb_surface && active_client !=
|
||||||
wl_resource_get_client(previous_kb_surface->resource) != active_client) {
|
wl_resource_get_client(previous_kb_surface->resource)) {
|
||||||
seat_focus_surface(seat, NULL); /* keyboard focus */
|
seat_focus_surface(seat, NULL); /* keyboard focus */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -307,7 +306,7 @@ server_init(struct server *server)
|
||||||
}
|
}
|
||||||
server->new_xdg_surface.notify = xdg_surface_new;
|
server->new_xdg_surface.notify = xdg_surface_new;
|
||||||
wl_signal_add(&server->xdg_shell->events.new_surface,
|
wl_signal_add(&server->xdg_shell->events.new_surface,
|
||||||
&server->new_xdg_surface);
|
&server->new_xdg_surface);
|
||||||
|
|
||||||
/* Disable CSD */
|
/* Disable CSD */
|
||||||
struct wlr_xdg_decoration_manager_v1 *xdg_deco_mgr = NULL;
|
struct wlr_xdg_decoration_manager_v1 *xdg_deco_mgr = NULL;
|
||||||
|
|
@ -317,7 +316,7 @@ server_init(struct server *server)
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
wl_signal_add(&xdg_deco_mgr->events.new_toplevel_decoration,
|
wl_signal_add(&xdg_deco_mgr->events.new_toplevel_decoration,
|
||||||
&server->xdg_toplevel_decoration);
|
&server->xdg_toplevel_decoration);
|
||||||
server->xdg_toplevel_decoration.notify = xdg_toplevel_decoration;
|
server->xdg_toplevel_decoration.notify = xdg_toplevel_decoration;
|
||||||
|
|
||||||
struct wlr_server_decoration_manager *deco_mgr = NULL;
|
struct wlr_server_decoration_manager *deco_mgr = NULL;
|
||||||
|
|
@ -327,9 +326,9 @@ server_init(struct server *server)
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
wlr_server_decoration_manager_set_default_mode(
|
wlr_server_decoration_manager_set_default_mode(
|
||||||
deco_mgr, rc.xdg_shell_server_side_deco ?
|
deco_mgr, rc.xdg_shell_server_side_deco
|
||||||
WLR_SERVER_DECORATION_MANAGER_MODE_SERVER :
|
? WLR_SERVER_DECORATION_MANAGER_MODE_SERVER
|
||||||
WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT);
|
: WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT);
|
||||||
|
|
||||||
struct wlr_presentation *presentation =
|
struct wlr_presentation *presentation =
|
||||||
wlr_presentation_create(server->wl_display, server->backend);
|
wlr_presentation_create(server->wl_display, server->backend);
|
||||||
|
|
|
||||||
|
|
@ -351,7 +351,7 @@ theme_read(struct theme *theme, const char *theme_name)
|
||||||
|
|
||||||
if (strlen(theme_dir(theme_name))) {
|
if (strlen(theme_dir(theme_name))) {
|
||||||
snprintf(themerc, sizeof(themerc), "%s/themerc",
|
snprintf(themerc, sizeof(themerc), "%s/themerc",
|
||||||
theme_dir(theme_name));
|
theme_dir(theme_name));
|
||||||
stream = fopen(themerc, "r");
|
stream = fopen(themerc, "r");
|
||||||
}
|
}
|
||||||
if (!stream) {
|
if (!stream) {
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ u32(float *rgba)
|
||||||
r[i] = rgba[i] * 255;
|
r[i] = rgba[i] * 255;
|
||||||
}
|
}
|
||||||
return ((r[3] & 0xff) << 24) | ((r[0] & 0xff) << 16) |
|
return ((r[3] & 0xff) << 24) | ((r[0] & 0xff) << 16) |
|
||||||
((r[1] & 0xff) << 8) | (r[2] & 0xff);
|
((r[1] & 0xff) << 8) | (r[2] & 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,8 @@ static char *
|
||||||
xbm_path(const char *button)
|
xbm_path(const char *button)
|
||||||
{
|
{
|
||||||
static char buffer[4096] = { 0 };
|
static char buffer[4096] = { 0 };
|
||||||
snprintf(buffer, sizeof(buffer), "%s/%s", theme_dir(rc.theme_name),
|
snprintf(buffer, sizeof(buffer), "%s/%s",
|
||||||
button);
|
theme_dir(rc.theme_name), button);
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -65,28 +65,28 @@ void
|
||||||
xbm_load(struct theme *theme)
|
xbm_load(struct theme *theme)
|
||||||
{
|
{
|
||||||
parse_set_color(theme->window_active_button_menu_unpressed_image_color);
|
parse_set_color(theme->window_active_button_menu_unpressed_image_color);
|
||||||
load_button("menu.xbm", &theme->xbm_menu_active_unpressed,
|
load_button("menu.xbm",
|
||||||
menu_button_normal);
|
&theme->xbm_menu_active_unpressed, menu_button_normal);
|
||||||
parse_set_color(theme->window_active_button_iconify_unpressed_image_color);
|
parse_set_color(theme->window_active_button_iconify_unpressed_image_color);
|
||||||
load_button("iconify.xbm", &theme->xbm_iconify_active_unpressed,
|
load_button("iconify.xbm",
|
||||||
iconify_button_normal);
|
&theme->xbm_iconify_active_unpressed, iconify_button_normal);
|
||||||
parse_set_color(theme->window_active_button_max_unpressed_image_color);
|
parse_set_color(theme->window_active_button_max_unpressed_image_color);
|
||||||
load_button("max.xbm", &theme->xbm_maximize_active_unpressed,
|
load_button("max.xbm",
|
||||||
max_button_normal);
|
&theme->xbm_maximize_active_unpressed, max_button_normal);
|
||||||
parse_set_color(theme->window_active_button_close_unpressed_image_color);
|
parse_set_color(theme->window_active_button_close_unpressed_image_color);
|
||||||
load_button("close.xbm", &theme->xbm_close_active_unpressed,
|
load_button("close.xbm",
|
||||||
close_button_normal);
|
&theme->xbm_close_active_unpressed, close_button_normal);
|
||||||
|
|
||||||
parse_set_color(theme->window_inactive_button_menu_unpressed_image_color);
|
parse_set_color(theme->window_inactive_button_menu_unpressed_image_color);
|
||||||
load_button("menu.xbm", &theme->xbm_menu_inactive_unpressed,
|
load_button("menu.xbm",
|
||||||
menu_button_normal);
|
&theme->xbm_menu_inactive_unpressed, menu_button_normal);
|
||||||
parse_set_color(theme->window_inactive_button_iconify_unpressed_image_color);
|
parse_set_color(theme->window_inactive_button_iconify_unpressed_image_color);
|
||||||
load_button("iconify.xbm", &theme->xbm_iconify_inactive_unpressed,
|
load_button("iconify.xbm",
|
||||||
iconify_button_normal);
|
&theme->xbm_iconify_inactive_unpressed, iconify_button_normal);
|
||||||
parse_set_color(theme->window_inactive_button_max_unpressed_image_color);
|
parse_set_color(theme->window_inactive_button_max_unpressed_image_color);
|
||||||
load_button("max.xbm", &theme->xbm_maximize_inactive_unpressed,
|
load_button("max.xbm",
|
||||||
max_button_normal);
|
&theme->xbm_maximize_inactive_unpressed, max_button_normal);
|
||||||
parse_set_color(theme->window_inactive_button_close_unpressed_image_color);
|
parse_set_color(theme->window_inactive_button_close_unpressed_image_color);
|
||||||
load_button("close.xbm", &theme->xbm_close_inactive_unpressed,
|
load_button("close.xbm",
|
||||||
close_button_normal);
|
&theme->xbm_close_inactive_unpressed, close_button_normal);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ xdg_toplevel_decoration(struct wl_listener *listener, void *data)
|
||||||
wl_signal_add(&wlr_decoration->events.destroy, &xdg_deco->destroy);
|
wl_signal_add(&wlr_decoration->events.destroy, &xdg_deco->destroy);
|
||||||
xdg_deco->request_mode.notify = xdg_deco_request_mode;
|
xdg_deco->request_mode.notify = xdg_deco_request_mode;
|
||||||
wl_signal_add(&wlr_decoration->events.request_mode,
|
wl_signal_add(&wlr_decoration->events.request_mode,
|
||||||
&xdg_deco->request_mode);
|
&xdg_deco->request_mode);
|
||||||
|
|
||||||
xdg_deco_request_mode(&xdg_deco->request_mode, wlr_decoration);
|
xdg_deco_request_mode(&xdg_deco->request_mode, wlr_decoration);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ xwayland_unmanaged_create(struct server *server,
|
||||||
unmanaged->xwayland_surface = xsurface;
|
unmanaged->xwayland_surface = xsurface;
|
||||||
|
|
||||||
wl_signal_add(&xsurface->events.request_configure,
|
wl_signal_add(&xsurface->events.request_configure,
|
||||||
&unmanaged->request_configure);
|
&unmanaged->request_configure);
|
||||||
unmanaged->request_configure.notify =
|
unmanaged->request_configure.notify =
|
||||||
unmanaged_handle_request_configure;
|
unmanaged_handle_request_configure;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -379,7 +379,7 @@ static bool
|
||||||
want_deco(struct wlr_xwayland_surface *xwayland_surface)
|
want_deco(struct wlr_xwayland_surface *xwayland_surface)
|
||||||
{
|
{
|
||||||
return xwayland_surface->decorations ==
|
return xwayland_surface->decorations ==
|
||||||
WLR_XWAYLAND_SURFACE_DECORATIONS_ALL;
|
WLR_XWAYLAND_SURFACE_DECORATIONS_ALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -418,9 +418,9 @@ set_initial_position(struct view *view,
|
||||||
{
|
{
|
||||||
/* Don't center views with position explicitly specified */
|
/* Don't center views with position explicitly specified */
|
||||||
bool has_position = xwayland_surface->size_hints &&
|
bool has_position = xwayland_surface->size_hints &&
|
||||||
(xwayland_surface->size_hints->flags &
|
(xwayland_surface->size_hints->flags & (
|
||||||
(XCB_ICCCM_SIZE_HINT_US_POSITION |
|
XCB_ICCCM_SIZE_HINT_US_POSITION |
|
||||||
XCB_ICCCM_SIZE_HINT_P_POSITION));
|
XCB_ICCCM_SIZE_HINT_P_POSITION));
|
||||||
|
|
||||||
if (has_position) {
|
if (has_position) {
|
||||||
/* Just make sure the view is on-screen */
|
/* Just make sure the view is on-screen */
|
||||||
|
|
@ -679,7 +679,7 @@ xwayland_server_init(struct server *server, struct wlr_compositor *compositor)
|
||||||
}
|
}
|
||||||
server->xwayland_new_surface.notify = handle_new_surface;
|
server->xwayland_new_surface.notify = handle_new_surface;
|
||||||
wl_signal_add(&server->xwayland->events.new_surface,
|
wl_signal_add(&server->xwayland->events.new_surface,
|
||||||
&server->xwayland_new_surface);
|
&server->xwayland_new_surface);
|
||||||
|
|
||||||
server->xwayland_ready.notify = handle_ready;
|
server->xwayland_ready.notify = handle_ready;
|
||||||
wl_signal_add(&server->xwayland->events.ready,
|
wl_signal_add(&server->xwayland->events.ready,
|
||||||
|
|
@ -693,14 +693,14 @@ xwayland_server_init(struct server *server, struct wlr_compositor *compositor)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_xcursor *xcursor;
|
struct wlr_xcursor *xcursor;
|
||||||
xcursor = wlr_xcursor_manager_get_xcursor(server->seat.xcursor_manager,
|
xcursor = wlr_xcursor_manager_get_xcursor(
|
||||||
XCURSOR_DEFAULT, 1);
|
server->seat.xcursor_manager, XCURSOR_DEFAULT, 1);
|
||||||
if (xcursor) {
|
if (xcursor) {
|
||||||
struct wlr_xcursor_image *image = xcursor->images[0];
|
struct wlr_xcursor_image *image = xcursor->images[0];
|
||||||
wlr_xwayland_set_cursor(server->xwayland, image->buffer,
|
wlr_xwayland_set_cursor(server->xwayland, image->buffer,
|
||||||
image->width * 4, image->width,
|
image->width * 4, image->width,
|
||||||
image->height, image->hotspot_x,
|
image->height, image->hotspot_x,
|
||||||
image->hotspot_y);
|
image->hotspot_y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue