more style fixes, included "sway/config.h" where needed
This commit is contained in:
parent
2bf893248a
commit
79a45d4a40
|
@ -12,6 +12,7 @@
|
||||||
#include <wlr/render/wlr_renderer.h>
|
#include <wlr/render/wlr_renderer.h>
|
||||||
// TODO WLR: make Xwayland optional
|
// TODO WLR: make Xwayland optional
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
|
#include "config.h"
|
||||||
#ifdef HAVE_XWAYLAND
|
#ifdef HAVE_XWAYLAND
|
||||||
#include "sway/xwayland.h"
|
#include "sway/xwayland.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#ifdef HAVE_XWAYLAND
|
|
||||||
#ifndef SWAY_XWAYLAND_H
|
#ifndef SWAY_XWAYLAND_H
|
||||||
#define SWAY_XWAYLAND_H
|
#define SWAY_XWAYLAND_H
|
||||||
|
|
||||||
|
@ -24,4 +23,3 @@ struct sway_xwayland {
|
||||||
void handle_xwayland_ready(struct wl_listener *listener, void *data);
|
void handle_xwayland_ready(struct wl_listener *listener, void *data);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#include <wlr/util/log.h>
|
#include <wlr/util/log.h>
|
||||||
|
#include "sway/config.h"
|
||||||
#include "sway/commands.h"
|
#include "sway/commands.h"
|
||||||
#include "sway/tree/arrange.h"
|
#include "sway/tree/arrange.h"
|
||||||
#include "sway/tree/layout.h"
|
#include "sway/tree/layout.h"
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "stringop.h"
|
#include "stringop.h"
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
bool criteria_is_empty(struct criteria *criteria) {
|
bool criteria_is_empty(struct criteria *criteria) {
|
||||||
return !criteria->title
|
return !criteria->title
|
||||||
|
@ -19,9 +20,9 @@ bool criteria_is_empty(struct criteria *criteria) {
|
||||||
&& !criteria->instance
|
&& !criteria->instance
|
||||||
&& !criteria->con_mark
|
&& !criteria->con_mark
|
||||||
&& !criteria->con_id
|
&& !criteria->con_id
|
||||||
#ifdef HAVE_XWAYLAND
|
#ifdef HAVE_XWAYLAND
|
||||||
&& !criteria->id
|
&& !criteria->id
|
||||||
#endif
|
#endif
|
||||||
&& !criteria->window_role
|
&& !criteria->window_role
|
||||||
&& !criteria->window_type
|
&& !criteria->window_type
|
||||||
&& !criteria->floating
|
&& !criteria->floating
|
||||||
|
@ -129,14 +130,14 @@ static bool criteria_matches_view(struct criteria *criteria,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_XWAYLAND
|
#ifdef HAVE_XWAYLAND
|
||||||
if (criteria->id) { // X11 window ID
|
if (criteria->id) { // X11 window ID
|
||||||
uint32_t x11_window_id = view_get_x11_window_id(view);
|
uint32_t x11_window_id = view_get_x11_window_id(view);
|
||||||
if (!x11_window_id || x11_window_id != criteria->id) {
|
if (!x11_window_id || x11_window_id != criteria->id) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (criteria->window_role) {
|
if (criteria->window_role) {
|
||||||
// TODO
|
// TODO
|
||||||
|
@ -293,10 +294,10 @@ static enum criteria_token token_from_name(char *name) {
|
||||||
return T_CON_ID;
|
return T_CON_ID;
|
||||||
} else if (strcmp(name, "con_mark") == 0) {
|
} else if (strcmp(name, "con_mark") == 0) {
|
||||||
return T_CON_MARK;
|
return T_CON_MARK;
|
||||||
#ifdef HAVE_XWAYLAND
|
#ifdef HAVE_XWAYLAND
|
||||||
} else if (strcmp(name, "id") == 0) {
|
} else if (strcmp(name, "id") == 0) {
|
||||||
return T_ID;
|
return T_ID;
|
||||||
#endif
|
#endif
|
||||||
} else if (strcmp(name, "instance") == 0) {
|
} else if (strcmp(name, "instance") == 0) {
|
||||||
return T_INSTANCE;
|
return T_INSTANCE;
|
||||||
} else if (strcmp(name, "shell") == 0) {
|
} else if (strcmp(name, "shell") == 0) {
|
||||||
|
@ -363,9 +364,9 @@ static char *get_focused_prop(enum criteria_token token) {
|
||||||
case T_CON_ID: // These do not support __focused__
|
case T_CON_ID: // These do not support __focused__
|
||||||
case T_CON_MARK:
|
case T_CON_MARK:
|
||||||
case T_FLOATING:
|
case T_FLOATING:
|
||||||
#ifdef HAVE_XWAYLAND
|
#ifdef HAVE_XWAYLAND
|
||||||
case T_ID:
|
case T_ID:
|
||||||
#endif
|
#endif
|
||||||
case T_TILING:
|
case T_TILING:
|
||||||
case T_URGENT:
|
case T_URGENT:
|
||||||
case T_WINDOW_TYPE:
|
case T_WINDOW_TYPE:
|
||||||
|
@ -436,14 +437,14 @@ static bool parse_token(struct criteria *criteria, char *name, char *value) {
|
||||||
case T_WINDOW_TYPE:
|
case T_WINDOW_TYPE:
|
||||||
// TODO: This is a string but will be stored as an enum or integer
|
// TODO: This is a string but will be stored as an enum or integer
|
||||||
break;
|
break;
|
||||||
#ifdef HAVE_XWAYLAND
|
#ifdef HAVE_XWAYLAND
|
||||||
case T_ID:
|
case T_ID:
|
||||||
criteria->id = strtoul(effective_value, &endptr, 10);
|
criteria->id = strtoul(effective_value, &endptr, 10);
|
||||||
if (*endptr != 0) {
|
if (*endptr != 0) {
|
||||||
error = strdup("The value for 'id' should be numeric");
|
error = strdup("The value for 'id' should be numeric");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case T_FLOATING:
|
case T_FLOATING:
|
||||||
criteria->floating = true;
|
criteria->floating = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include <wlr/types/wlr_idle.h>
|
#include <wlr/types/wlr_idle.h>
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
#include "sway/config.h"
|
||||||
#include "sway/desktop.h"
|
#include "sway/desktop.h"
|
||||||
#include "sway/desktop/transaction.h"
|
#include "sway/desktop/transaction.h"
|
||||||
#include "sway/input/cursor.h"
|
#include "sway/input/cursor.h"
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <wlr/types/wlr_output_layout.h>
|
#include <wlr/types/wlr_output_layout.h>
|
||||||
#include <wlr/types/wlr_xcursor_manager.h>
|
#include <wlr/types/wlr_xcursor_manager.h>
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
#include "sway/config.h"
|
||||||
#include "sway/debug.h"
|
#include "sway/debug.h"
|
||||||
#include "sway/desktop.h"
|
#include "sway/desktop.h"
|
||||||
#include "sway/input/cursor.h"
|
#include "sway/input/cursor.h"
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <wlr/types/wlr_output.h>
|
#include <wlr/types/wlr_output.h>
|
||||||
#include <wlr/types/wlr_output_layout.h>
|
#include <wlr/types/wlr_output_layout.h>
|
||||||
|
#include "sway/config.h"
|
||||||
#include "sway/debug.h"
|
#include "sway/debug.h"
|
||||||
#include "sway/tree/arrange.h"
|
#include "sway/tree/arrange.h"
|
||||||
#include "sway/tree/container.h"
|
#include "sway/tree/container.h"
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include <wayland-server.h>
|
#include <wayland-server.h>
|
||||||
#include <wlr/render/wlr_renderer.h>
|
#include <wlr/render/wlr_renderer.h>
|
||||||
#include <wlr/types/wlr_output_layout.h>
|
#include <wlr/types/wlr_output_layout.h>
|
||||||
|
#include "sway/config.h"
|
||||||
#ifdef HAVE_XWAYLAND
|
#ifdef HAVE_XWAYLAND
|
||||||
#include <wlr/xwayland.h>
|
#include <wlr/xwayland.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue