mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
Fix more coding style violations
This commit is contained in:
parent
a9042e3cde
commit
ea3ea49783
5 changed files with 39 additions and 33 deletions
36
src/output.c
36
src/output.c
|
|
@ -18,7 +18,7 @@
|
|||
#include "ssd.h"
|
||||
#include "theme.h"
|
||||
|
||||
//#define DEBUG 1
|
||||
#define DEBUG (0)
|
||||
|
||||
typedef void (*surface_iterator_func_t)(struct output *output,
|
||||
struct wlr_surface *surface, struct wlr_box *box,
|
||||
|
|
@ -848,8 +848,8 @@ new_output_notify(struct wl_listener *listener, void *data)
|
|||
* a black screen. See sway@4cdc4ac6
|
||||
*/
|
||||
if (!wlr_output_test(wlr_output)) {
|
||||
wlr_log(WLR_DEBUG, "preferred mode rejected, falling back to "
|
||||
"another mode");
|
||||
wlr_log(WLR_DEBUG,
|
||||
"preferred mode rejected, falling back to another mode");
|
||||
struct wlr_output_mode *mode;
|
||||
wl_list_for_each(mode, &wlr_output->modes, link) {
|
||||
if (mode == preferred_mode) {
|
||||
|
|
@ -922,7 +922,8 @@ output_init(struct server *server)
|
|||
output_manager_init(server);
|
||||
}
|
||||
|
||||
static void output_config_apply(struct server *server,
|
||||
static void
|
||||
output_config_apply(struct server *server,
|
||||
struct wlr_output_configuration_v1 *config)
|
||||
{
|
||||
server->pending_output_config = config;
|
||||
|
|
@ -961,13 +962,15 @@ static void output_config_apply(struct server *server,
|
|||
server->pending_output_config = NULL;
|
||||
}
|
||||
|
||||
static bool verify_output_config_v1(const struct wlr_output_configuration_v1 *config)
|
||||
static bool
|
||||
verify_output_config_v1(const struct wlr_output_configuration_v1 *config)
|
||||
{
|
||||
//TODO implement
|
||||
/* TODO implement */
|
||||
return true;
|
||||
}
|
||||
|
||||
static void handle_output_manager_apply(struct wl_listener *listener, void* data)
|
||||
static void
|
||||
handle_output_manager_apply(struct wl_listener *listener, void *data)
|
||||
{
|
||||
struct server *server = wl_container_of(listener, server, output_manager_apply);
|
||||
struct wlr_output_configuration_v1 *config = data;
|
||||
|
|
@ -988,10 +991,11 @@ static void handle_output_manager_apply(struct wl_listener *listener, void* data
|
|||
* a struct that we send to clients via the wlr_output_configuration v1
|
||||
* interface
|
||||
*/
|
||||
static struct wlr_output_configuration_v1 *create_output_config(struct server *server)
|
||||
static struct
|
||||
wlr_output_configuration_v1 *create_output_config(struct server *server)
|
||||
{
|
||||
struct wlr_output_configuration_v1 *config = wlr_output_configuration_v1_create();
|
||||
if(config == NULL) {
|
||||
if (!config) {
|
||||
wlr_log(WLR_ERROR, "wlr_output_configuration_v1_create()");
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -1001,31 +1005,32 @@ static struct wlr_output_configuration_v1 *create_output_config(struct server *s
|
|||
struct wlr_output_configuration_head_v1 *head =
|
||||
wlr_output_configuration_head_v1_create(config,
|
||||
output->wlr_output);
|
||||
if (head == NULL) {
|
||||
if (!head) {
|
||||
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);
|
||||
if (box != NULL) {
|
||||
if (box) {
|
||||
head->state.x = box->x;
|
||||
head->state.y = box->y;
|
||||
} else {
|
||||
wlr_log(WLR_ERROR, "failed to get output layout box");
|
||||
}
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
static void handle_output_layout_change(struct wl_listener *listener, void *data) {
|
||||
static void
|
||||
handle_output_layout_change(struct wl_listener *listener, void *data)
|
||||
{
|
||||
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);
|
||||
if(config != NULL) {
|
||||
if (config) {
|
||||
wlr_output_manager_v1_set_configuration(server->output_manager, config);
|
||||
} else {
|
||||
wlr_log(WLR_ERROR, "wlr_output_manager_v1_set_configuration()");
|
||||
|
|
@ -1033,7 +1038,8 @@ static void handle_output_layout_change(struct wl_listener *listener, void *data
|
|||
}
|
||||
}
|
||||
|
||||
void output_manager_init(struct server *server)
|
||||
void
|
||||
output_manager_init(struct server *server)
|
||||
{
|
||||
server->output_manager = wlr_output_manager_v1_create(server->wl_display);
|
||||
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ ssd_box(struct view *view, enum ssd_part_type type)
|
|||
box.x = view->x - theme->border_width;
|
||||
box.y = view->y + view->h;
|
||||
box.width = view->w + 2 * theme->border_width;
|
||||
box.height = +theme->border_width + INVISIBLE_MARGIN;
|
||||
box.height = theme->border_width + INVISIBLE_MARGIN;
|
||||
break;
|
||||
case LAB_SSD_PART_LEFT:
|
||||
box.x = view->x - theme->border_width - INVISIBLE_MARGIN;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue