struct wlr_seat_client *focused_client =
seat->seat->pointer_state.focused_client;
- /* This can be sent by any client, so we check to make sure this one is
- * actually has pointer focus first. */
+ /*
+ * This can be sent by any client, so we check to make sure this one is
+ * actually has pointer focus first.
+ */
if (focused_client == event->seat_client) {
- /* Once we've vetted the client, we can tell the cursor to use
+ /*
+ * Once we've vetted the client, we can tell the cursor to use
* the provided surface as the cursor image. It will set the
* hardware cursor on the output that it's currently on and
- * continue to do so as the cursor moves between outputs. */
+ * continue to do so as the cursor moves between outputs.
+ */
wlr_cursor_set_surface(seat->cursor, event->surface,
event->hotspot_x, event->hotspot_y);
}
struct wlr_surface *surface = NULL;
int view_area = LAB_SSD_NONE;
struct view *view =
- desktop_view_at(server, server->seat.cursor->x, server->seat.cursor->y,
- &surface, &sx, &sy, &view_area);
+ desktop_view_at(server, server->seat.cursor->x,
+ server->seat.cursor->y, &surface, &sx, &sy, &view_area);
if (!view) {
set_cursor(server, XCURSOR_DEFAULT);
} else {
uint32_t resize_edges = ssd_resize_edges(view_area);
if (resize_edges) {
cursor_name_set_by_server = true;
- set_cursor(server, wlr_xcursor_get_resize_name(resize_edges));
+ set_cursor(server,
+ wlr_xcursor_get_resize_name(resize_edges));
} else if (view_area != LAB_SSD_NONE) {
/* title and buttons */
set_cursor(server, XCURSOR_DEFAULT);
wlr_seat_pointer_notify_motion(wlr_seat, time, sx, sy);
}
} else {
- /* Clear pointer focus so future button events and such are not
- * sent to the last client to have the cursor over it. */
+ /*
+ * Clear pointer focus so future button events and such are not
+ * sent to the last client to have the cursor over it.
+ */
wlr_seat_pointer_clear_focus(wlr_seat);
}
}
for (size_t i = 0; i < sizeof(edges) / sizeof(edges[0]); ++i) {
if ((anchor & edges[i].anchors) == edges[i].anchors) {
if (edges[i].positive_axis) {
- *edges[i].positive_axis += exclusive + edges[i].margin;
+ *edges[i].positive_axis +=
+ exclusive + edges[i].margin;
}
if (edges[i].negative_axis) {
- *edges[i].negative_axis -= exclusive + edges[i].margin;
+ *edges[i].negative_axis -=
+ exclusive + edges[i].margin;
}
}
}
wl_list_for_each(layer_surface, layer_surfaces, link) {
struct wlr_layer_surface_v1 *wlr_layer_surface_v1 =
layer_surface->layer_surface;
- output_surface_for_each_surface(output, wlr_layer_surface_v1->surface,
- layer_surface->geo.x, layer_surface->geo.y, iterator,
- user_data);
+ output_surface_for_each_surface(output,
+ wlr_layer_surface_v1->surface, layer_surface->geo.x,
+ layer_surface->geo.y, iterator, user_data);
/* TODO: handle popups */
}
}
}
#if HAVE_XWAYLAND
- output_unmanaged_for_each_surface(output, &output->server->unmanaged_surfaces,
- iterator, user_data);
+ output_unmanaged_for_each_surface(output,
+ &output->server->unmanaged_surfaces, iterator, user_data);
#endif
output_layer_for_each_surface(output,
struct render_data data = {
.damage = damage,
};
- output_view_for_each_popup_surface(output, view, render_surface_iterator, &data);
+ output_view_for_each_popup_surface(output, view,
+ render_surface_iterator, &data);
}
void
int32_t width = head->state.custom_mode.width;
int32_t height = head->state.custom_mode.height;
int32_t refresh = head->state.custom_mode.refresh;
- wlr_output_set_custom_mode(o, width, height, refresh);
+ wlr_output_set_custom_mode(o, width,
+ height, refresh);
}
wlr_output_layout_move(server->output_layout, o,
head->state.x, head->state.y);
static void
handle_output_manager_apply(struct wl_listener *listener, void *data)
{
- struct server *server = wl_container_of(listener, server, output_manager_apply);
+ struct server *server =
+ wl_container_of(listener, server, output_manager_apply);
struct wlr_output_configuration_v1 *config = data;
bool config_is_good = verify_output_config_v1(config);
static struct
wlr_output_configuration_v1 *create_output_config(struct server *server)
{
- struct wlr_output_configuration_v1 *config = wlr_output_configuration_v1_create();
+ struct wlr_output_configuration_v1 *config =
+ wlr_output_configuration_v1_create();
if (!config) {
wlr_log(WLR_ERROR, "wlr_output_configuration_v1_create()");
return NULL;
wlr_output_configuration_head_v1_create(config,
output->wlr_output);
if (!head) {
- wlr_log(WLR_ERROR, "wlr_output_configuration_head_v1_create()");
+ wlr_log(WLR_ERROR,
+ "wlr_output_configuration_head_v1_create()");
wlr_output_configuration_v1_destroy(config);
return NULL;
}
- struct wlr_box *box = wlr_output_layout_get_box(server->output_layout,
- output->wlr_output);
+ struct wlr_box *box =
+ wlr_output_layout_get_box(server->output_layout,
+ output->wlr_output);
if (box) {
head->state.x = box->x;
head->state.y = box->y;
static void
handle_output_layout_change(struct wl_listener *listener, void *data)
{
- struct server *server = wl_container_of(listener, server, output_layout_change);
+ struct server *server =
+ wl_container_of(listener, server, output_layout_change);
bool done_changing = server->pending_output_config == NULL;
if (done_changing) {
- struct wlr_output_configuration_v1 *config = create_output_config(server);
+ struct wlr_output_configuration_v1 *config =
+ create_output_config(server);
if (config) {
- wlr_output_manager_v1_set_configuration(server->output_manager, config);
+ wlr_output_manager_v1_set_configuration(
+ server->output_manager, config);
} else {
- wlr_log(WLR_ERROR, "wlr_output_manager_v1_set_configuration()");
+ wlr_log(WLR_ERROR,
+ "wlr_output_manager_v1_set_configuration()");
}
}
}
void
subsurface_create(struct view *view, struct wlr_subsurface *wlr_subsurface)
{
- struct view_subsurface *subsurface = calloc(1, sizeof(struct view_subsurface));
+ struct view_subsurface *subsurface =
+ calloc(1, sizeof(struct view_subsurface));
if (!subsurface) {
return;
}
parse_hexstr("#dddad6", theme->window_active_title_bg_color);
parse_hexstr("#f6f5f4", theme->window_inactive_title_bg_color);
- parse_hexstr("#000000", theme->window_active_button_iconify_unpressed_image_color);
- parse_hexstr("#000000", theme->window_active_button_max_unpressed_image_color);
- parse_hexstr("#000000", theme->window_active_button_close_unpressed_image_color);
- parse_hexstr("#000000", theme->window_inactive_button_iconify_unpressed_image_color);
- parse_hexstr("#000000", theme->window_inactive_button_max_unpressed_image_color);
- parse_hexstr("#000000", theme->window_inactive_button_close_unpressed_image_color);
+ parse_hexstr("#000000",
+ theme->window_active_button_iconify_unpressed_image_color);
+ parse_hexstr("#000000",
+ theme->window_active_button_max_unpressed_image_color);
+ parse_hexstr("#000000",
+ theme->window_active_button_close_unpressed_image_color);
+ parse_hexstr("#000000",
+ theme->window_inactive_button_iconify_unpressed_image_color);
+ parse_hexstr("#000000",
+ theme->window_inactive_button_max_unpressed_image_color);
+ parse_hexstr("#000000",
+ theme->window_inactive_button_close_unpressed_image_color);
parse_hexstr("#fcfbfa", theme->menu_items_bg_color);
parse_hexstr("#000000", theme->menu_items_text_color);
/* universal button */
if (match(key, "window.active.button.unpressed.image.color")) {
- parse_hexstr(value, theme->window_active_button_iconify_unpressed_image_color);
- parse_hexstr(value, theme->window_active_button_max_unpressed_image_color);
- parse_hexstr(value, theme->window_active_button_close_unpressed_image_color);
+ parse_hexstr(value,
+ theme->window_active_button_iconify_unpressed_image_color);
+ parse_hexstr(value,
+ theme->window_active_button_max_unpressed_image_color);
+ parse_hexstr(value,
+ theme->window_active_button_close_unpressed_image_color);
}
if (match(key, "window.inactive.button.unpressed.image.color")) {
- parse_hexstr(value, theme->window_inactive_button_iconify_unpressed_image_color);
- parse_hexstr(value, theme->window_inactive_button_max_unpressed_image_color);
- parse_hexstr(value, theme->window_inactive_button_close_unpressed_image_color);
+ parse_hexstr(value,
+ theme->window_inactive_button_iconify_unpressed_image_color);
+ parse_hexstr(value,
+ theme->window_inactive_button_max_unpressed_image_color);
+ parse_hexstr(value,
+ theme->window_inactive_button_close_unpressed_image_color);
}
/* individual buttons */
if (match(key, "window.active.button.iconify.unpressed.image.color")) {
- parse_hexstr(value, theme->window_active_button_iconify_unpressed_image_color);
+ parse_hexstr(value,
+ theme->window_active_button_iconify_unpressed_image_color);
}
if (match(key, "window.active.button.max.unpressed.image.color")) {
- parse_hexstr(value, theme->window_active_button_max_unpressed_image_color);
+ parse_hexstr(value,
+ theme->window_active_button_max_unpressed_image_color);
}
if (match(key, "window.active.button.close.unpressed.image.color")) {
- parse_hexstr(value, theme->window_active_button_close_unpressed_image_color);
+ parse_hexstr(value,
+ theme->window_active_button_close_unpressed_image_color);
}
if (match(key, "window.inactive.button.iconify.unpressed.image.color")) {
- parse_hexstr(value, theme->window_inactive_button_iconify_unpressed_image_color);
+ parse_hexstr(value,
+ theme->window_inactive_button_iconify_unpressed_image_color);
}
if (match(key, "window.inactive.button.max.unpressed.image.color")) {
- parse_hexstr(value, theme->window_inactive_button_max_unpressed_image_color);
+ parse_hexstr(value,
+ theme->window_inactive_button_max_unpressed_image_color);
}
if (match(key, "window.inactive.button.close.unpressed.image.color")) {
- parse_hexstr(value, theme->window_inactive_button_close_unpressed_image_color);
+ parse_hexstr(value,
+ theme->window_inactive_button_close_unpressed_image_color);
}
if (match(key, "menu.items.bg.color")) {
static void
handle_request_move(struct wl_listener *listener, void *data)
{
- /* This event is raised when a client would like to begin an interactive
+ /*
+ * This event is raised when a client would like to begin an interactive
* move, typically because the user clicked on their client-side
* decorations. Note that a more sophisticated compositor should check
* the provied serial against a list of button press serials sent to
* this
* client, to prevent the client from requesting this whenever they
- * want. */
+ * want.
+ */
struct view *view = wl_container_of(listener, view, request_move);
interactive_begin(view, LAB_INPUT_STATE_MOVE, 0);
}
static void
handle_request_resize(struct wl_listener *listener, void *data)
{
- /* This event is raised when a client would like to begin an interactive
+ /*
+ * This event is raised when a client would like to begin an interactive
* resize, typically because the user clicked on their client-side
* decorations. Note that a more sophisticated compositor should check
* the provied serial against a list of button press serials sent to
* this
* client, to prevent the client from requesting this whenever they
- * want. */
+ * want.
+ */
struct wlr_xdg_toplevel_resize_event *event = data;
struct view *view = wl_container_of(listener, view, request_resize);
interactive_begin(view, LAB_INPUT_STATE_RESIZE, event->edges);
static void
xdg_toplevel_view_for_each_popup_surface(struct view *view,
- wlr_surface_iterator_func_t iterator, void *data)
+ wlr_surface_iterator_func_t iterator, void *data)
{
wlr_xdg_surface_for_each_popup_surface(view->xdg_surface, iterator, data);
}
position_xdg_toplevel_view(struct view *view)
{
if (istopmost(view)) {
- struct wlr_box box = output_usable_area_from_cursor_coords(view->server);
+ struct wlr_box box =
+ output_usable_area_from_cursor_coords(view->server);
view->x = box.x;
view->y = box.y;
view->w = view->xdg_surface->geometry.width;
foreign_toplevel_handle_create(view);
- struct wlr_box box = output_usable_area_from_cursor_coords(view->server);
+ struct wlr_box box =
+ output_usable_area_from_cursor_coords(view->server);
view->x = box.x;
view->y = box.y;
view_center(view);