mirror of
https://github.com/swaywm/sway.git
synced 2025-11-15 06:59:50 -05:00
Added meson option "enable_xwayland" (default: true) to enable/disable xwayland support
This commit is contained in:
parent
817d37c950
commit
24ad1c3983
18 changed files with 92 additions and 20 deletions
|
|
@ -19,7 +19,9 @@ bool criteria_is_empty(struct criteria *criteria) {
|
|||
&& !criteria->instance
|
||||
&& !criteria->con_mark
|
||||
&& !criteria->con_id
|
||||
#ifdef HAVE_XWAYLAND
|
||||
&& !criteria->id
|
||||
#endif
|
||||
&& !criteria->window_role
|
||||
&& !criteria->window_type
|
||||
&& !criteria->floating
|
||||
|
|
@ -127,12 +129,14 @@ static bool criteria_matches_view(struct criteria *criteria,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_XWAYLAND
|
||||
if (criteria->id) { // X11 window ID
|
||||
uint32_t x11_window_id = view_get_x11_window_id(view);
|
||||
if (!x11_window_id || x11_window_id != criteria->id) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (criteria->window_role) {
|
||||
// TODO
|
||||
|
|
@ -265,7 +269,9 @@ enum criteria_token {
|
|||
T_CON_ID,
|
||||
T_CON_MARK,
|
||||
T_FLOATING,
|
||||
#ifdef HAVE_XWAYLAND
|
||||
T_ID,
|
||||
#endif
|
||||
T_INSTANCE,
|
||||
T_SHELL,
|
||||
T_TILING,
|
||||
|
|
@ -287,8 +293,10 @@ static enum criteria_token token_from_name(char *name) {
|
|||
return T_CON_ID;
|
||||
} else if (strcmp(name, "con_mark") == 0) {
|
||||
return T_CON_MARK;
|
||||
#ifdef HAVE_XWAYLAND
|
||||
} else if (strcmp(name, "id") == 0) {
|
||||
return T_ID;
|
||||
#endif
|
||||
} else if (strcmp(name, "instance") == 0) {
|
||||
return T_INSTANCE;
|
||||
} else if (strcmp(name, "shell") == 0) {
|
||||
|
|
@ -355,7 +363,9 @@ static char *get_focused_prop(enum criteria_token token) {
|
|||
case T_CON_ID: // These do not support __focused__
|
||||
case T_CON_MARK:
|
||||
case T_FLOATING:
|
||||
#ifdef HAVE_XWAYLAND
|
||||
case T_ID:
|
||||
#endif
|
||||
case T_TILING:
|
||||
case T_URGENT:
|
||||
case T_WINDOW_TYPE:
|
||||
|
|
@ -426,12 +436,14 @@ static bool parse_token(struct criteria *criteria, char *name, char *value) {
|
|||
case T_WINDOW_TYPE:
|
||||
// TODO: This is a string but will be stored as an enum or integer
|
||||
break;
|
||||
#ifdef HAVE_XWAYLAND
|
||||
case T_ID:
|
||||
criteria->id = strtoul(effective_value, &endptr, 10);
|
||||
if (*endptr != 0) {
|
||||
error = strdup("The value for 'id' should be numeric");
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case T_FLOATING:
|
||||
criteria->floating = true;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue