mirror of
https://github.com/labwc/labwc.git
synced 2026-02-26 01:40:22 -05: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,
|
void view_child_init(struct view_child *child, struct view *view,
|
||||||
struct wlr_surface *wlr_surface);
|
struct wlr_surface *wlr_surface);
|
||||||
void view_child_finish(struct view_child *child);
|
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_set_activated(struct view *view, bool activated);
|
||||||
void view_close(struct view *view);
|
void view_close(struct view *view);
|
||||||
|
|
@ -413,7 +414,8 @@ enum lab_cycle_dir {
|
||||||
* @current: reference point for finding next view to cycle to
|
* @current: reference point for finding next view to cycle to
|
||||||
* Note: If !current, the server->views second focusable view is returned
|
* 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);
|
struct view *desktop_focused_view(struct server *server);
|
||||||
void desktop_focus_topmost_mapped_view(struct server *server);
|
void desktop_focus_topmost_mapped_view(struct server *server);
|
||||||
bool isfocusable(struct view *view);
|
bool isfocusable(struct view *view);
|
||||||
|
|
@ -484,8 +486,8 @@ void server_init(struct server *server);
|
||||||
void server_start(struct server *server);
|
void server_start(struct server *server);
|
||||||
void server_finish(struct server *server);
|
void server_finish(struct server *server);
|
||||||
|
|
||||||
void action(struct view *activator, struct server *server, const char *action, const char *command,
|
void action(struct view *activator, struct server *server, const char *action,
|
||||||
uint32_t resize_edges);
|
const char *command, uint32_t resize_edges);
|
||||||
|
|
||||||
/* update onscreen display 'alt-tab' texture */
|
/* update onscreen display 'alt-tab' texture */
|
||||||
void osd_update(struct server *server);
|
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);
|
interactive_begin(view, LAB_INPUT_STATE_RESIZE, resize_edges);
|
||||||
}
|
}
|
||||||
} else {
|
} 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(
|
struct seat *seat = wl_container_of(
|
||||||
listener, seat, request_start_drag);
|
listener, seat, request_start_drag);
|
||||||
struct wlr_seat_request_start_drag_event *event = data;
|
struct wlr_seat_request_start_drag_event *event = data;
|
||||||
if (wlr_seat_validate_pointer_grab_serial(seat->seat, event->origin, event->serial)) {
|
if (wlr_seat_validate_pointer_grab_serial(seat->seat, event->origin,
|
||||||
wlr_seat_start_pointer_drag(seat->seat, event->drag, event->serial);
|
event->serial)) {
|
||||||
|
wlr_seat_start_pointer_drag(seat->seat, event->drag,
|
||||||
|
event->serial);
|
||||||
} else {
|
} else {
|
||||||
wlr_data_source_destroy(event->drag->source);
|
wlr_data_source_destroy(event->drag->source);
|
||||||
}
|
}
|
||||||
|
|
@ -374,10 +376,11 @@ cursor_motion(struct wl_listener *listener, void *data)
|
||||||
if (!seat->current_constraint) {
|
if (!seat->current_constraint) {
|
||||||
/*
|
/*
|
||||||
* The cursor doesn't move unless we tell it to. The cursor
|
* The cursor doesn't move unless we tell it to. The cursor
|
||||||
* automatically handles constraining the motion to the output layout,
|
* automatically handles constraining the motion to the output
|
||||||
* as well as any special configuration applied for the specific input
|
* layout, as well as any special configuration applied for the
|
||||||
* device which generated the event. You can pass NULL for the device
|
* specific input device which generated the event. You can pass
|
||||||
* if you want to move the cursor around without any input.
|
* 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,
|
wlr_cursor_move(seat->cursor, event->device, event->delta_x,
|
||||||
event->delta_y);
|
event->delta_y);
|
||||||
|
|
@ -428,19 +431,21 @@ cursor_motion_absolute(struct wl_listener *listener, void *data)
|
||||||
if (!seat->current_constraint) {
|
if (!seat->current_constraint) {
|
||||||
/*
|
/*
|
||||||
* The cursor doesn't move unless we tell it to. The cursor
|
* The cursor doesn't move unless we tell it to. The cursor
|
||||||
* automatically handles constraining the motion to the output layout,
|
* automatically handles constraining the motion to the output
|
||||||
* as well as any special configuration applied for the specific input
|
* layout, as well as any special configuration applied for the
|
||||||
* device which generated the event. You can pass NULL for the device
|
* specific input device which generated the event. You can pass
|
||||||
* if you want to move the cursor around without any input.
|
* 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);
|
process_cursor_motion(seat->server, event->time_msec);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
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;
|
struct mousebind *mousebind;
|
||||||
bool activated_any = false;
|
bool activated_any = false;
|
||||||
|
|
@ -487,7 +492,10 @@ is_double_click(long double_click_speed, uint32_t button)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (ms < double_click_speed && ms >= 0) {
|
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;
|
last_button = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -495,7 +503,9 @@ is_double_click(long double_click_speed, uint32_t button)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
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;
|
struct mousebind *mousebind;
|
||||||
bool double_click = is_double_click(rc.doubleclick_time, button);
|
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 */
|
/* Handle _release_ on root window */
|
||||||
if (!view) {
|
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;
|
goto mousebindings;
|
||||||
}
|
}
|
||||||
|
|
@ -600,7 +611,8 @@ cursor_button(struct wl_listener *listener, void *data)
|
||||||
|
|
||||||
/* Handle _press_ on root window */
|
/* Handle _press_ on root window */
|
||||||
if (!view) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -615,9 +627,13 @@ cursor_button(struct wl_listener *listener, void *data)
|
||||||
|
|
||||||
mousebindings:
|
mousebindings:
|
||||||
if (event->state == WLR_BUTTON_RELEASED) {
|
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) {
|
} 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) {
|
if (!triggered_frame_binding) {
|
||||||
/* Notify client with pointer focus of button press */
|
/* Notify client with pointer focus of button press */
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,8 @@ first_view(struct server *server)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct view *
|
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)) {
|
if (!has_focusable_view(&server->views)) {
|
||||||
return NULL;
|
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 _sx = ox - surface->geo.x;
|
||||||
double _sy = oy - surface->geo.y;
|
double _sy = oy - surface->geo.y;
|
||||||
struct wlr_surface *wlr_surface;
|
struct wlr_surface *wlr_surface;
|
||||||
wlr_surface = wlr_layer_surface_v1_surface_at(surface->layer_surface,
|
wlr_surface = wlr_layer_surface_v1_surface_at(
|
||||||
_sx, _sy, sx, sy);
|
surface->layer_surface, _sx, _sy, sx, sy);
|
||||||
if (wlr_surface) {
|
if (wlr_surface) {
|
||||||
return wlr_surface;
|
return wlr_surface;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,7 @@ map(struct view *view)
|
||||||
static void
|
static void
|
||||||
unmap(struct view *view)
|
unmap(struct view *view)
|
||||||
{
|
{
|
||||||
if(view->mapped) {
|
if (view->mapped) {
|
||||||
view->mapped = false;
|
view->mapped = false;
|
||||||
damage_all_outputs(view->server);
|
damage_all_outputs(view->server);
|
||||||
wl_list_remove(&view->commit.link);
|
wl_list_remove(&view->commit.link);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue