@ -22,7 +22,7 @@ bool criteria_is_empty(struct criteria *criteria) {
& & ! criteria - > app_id
& & ! criteria - > app_id
& & ! criteria - > con_mark
& & ! criteria - > con_mark
& & ! criteria - > con_id
& & ! criteria - > con_id
# if HAVE _XWAYLAND
# if WLR_HAS _XWAYLAND
& & ! criteria - > class
& & ! criteria - > class
& & ! criteria - > id
& & ! criteria - > id
& & ! criteria - > instance
& & ! criteria - > instance
@ -90,7 +90,7 @@ void criteria_destroy(struct criteria *criteria) {
pattern_destroy ( criteria - > title ) ;
pattern_destroy ( criteria - > title ) ;
pattern_destroy ( criteria - > shell ) ;
pattern_destroy ( criteria - > shell ) ;
pattern_destroy ( criteria - > app_id ) ;
pattern_destroy ( criteria - > app_id ) ;
# if HAVE _XWAYLAND
# if WLR_HAS _XWAYLAND
pattern_destroy ( criteria - > class ) ;
pattern_destroy ( criteria - > class ) ;
pattern_destroy ( criteria - > instance ) ;
pattern_destroy ( criteria - > instance ) ;
pattern_destroy ( criteria - > window_role ) ;
pattern_destroy ( criteria - > window_role ) ;
@ -110,7 +110,7 @@ static int regex_cmp(const char *item, const pcre2_code *regex) {
return result ;
return result ;
}
}
# if HAVE _XWAYLAND
# if WLR_HAS _XWAYLAND
static bool view_has_window_type ( struct sway_view * view , enum atom_name name ) {
static bool view_has_window_type ( struct sway_view * view , enum atom_name name ) {
if ( view - > type ! = SWAY_VIEW_XWAYLAND ) {
if ( view - > type ! = SWAY_VIEW_XWAYLAND ) {
return false ;
return false ;
@ -251,7 +251,7 @@ static bool criteria_matches_view(struct criteria *criteria,
return false ;
return false ;
}
}
# if HAVE _XWAYLAND
# if WLR_HAS _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 ) {
@ -428,7 +428,7 @@ list_t *criteria_get_containers(struct criteria *criteria) {
return matches ;
return matches ;
}
}
# if HAVE _XWAYLAND
# if WLR_HAS _XWAYLAND
static enum atom_name parse_window_type ( const char * type ) {
static enum atom_name parse_window_type ( const char * type ) {
if ( strcasecmp ( type , " normal " ) = = 0 ) {
if ( strcasecmp ( type , " normal " ) = = 0 ) {
return NET_WM_WINDOW_TYPE_NORMAL ;
return NET_WM_WINDOW_TYPE_NORMAL ;
@ -461,7 +461,7 @@ enum criteria_token {
T_CON_ID ,
T_CON_ID ,
T_CON_MARK ,
T_CON_MARK ,
T_FLOATING ,
T_FLOATING ,
# if HAVE _XWAYLAND
# if WLR_HAS _XWAYLAND
T_CLASS ,
T_CLASS ,
T_ID ,
T_ID ,
T_INSTANCE ,
T_INSTANCE ,
@ -487,7 +487,7 @@ 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 ;
# if HAVE _XWAYLAND
# if WLR_HAS _XWAYLAND
} else if ( strcmp ( name , " class " ) = = 0 ) {
} else if ( strcmp ( name , " class " ) = = 0 ) {
return T_CLASS ;
return T_CLASS ;
} else if ( strcmp ( name , " id " ) = = 0 ) {
} else if ( strcmp ( name , " id " ) = = 0 ) {
@ -566,7 +566,7 @@ static bool parse_token(struct criteria *criteria, char *name, char *value) {
case T_CON_MARK :
case T_CON_MARK :
pattern_create ( & criteria - > con_mark , value ) ;
pattern_create ( & criteria - > con_mark , value ) ;
break ;
break ;
# if HAVE _XWAYLAND
# if WLR_HAS _XWAYLAND
case T_CLASS :
case T_CLASS :
pattern_create ( & criteria - > class , value ) ;
pattern_create ( & criteria - > class , value ) ;
break ;
break ;
@ -674,7 +674,7 @@ struct criteria *criteria_parse(char *raw, char **error_arg) {
+ + head ;
+ + head ;
struct criteria * criteria = calloc ( 1 , sizeof ( struct criteria ) ) ;
struct criteria * criteria = calloc ( 1 , sizeof ( struct criteria ) ) ;
# if HAVE _XWAYLAND
# if WLR_HAS _XWAYLAND
criteria - > window_type = ATOM_LAST ; // default value
criteria - > window_type = ATOM_LAST ; // default value
# endif
# endif
char * name = NULL , * value = NULL ;
char * name = NULL , * value = NULL ;