mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
Fix coding style
This commit is contained in:
parent
60149e4fa5
commit
34a12b3515
6 changed files with 48 additions and 28 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
54
src/cursor.c
54
src/cursor.c
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue