mirror of
https://github.com/davatorium/rofi.git
synced 2025-07-31 21:59:25 -04:00
Fix window matching.
This commit is contained in:
parent
f88cfacfde
commit
b3bc620211
2 changed files with 23 additions and 16 deletions
|
@ -4,6 +4,7 @@
|
||||||
- Fix ellipsiziing in entry box.
|
- Fix ellipsiziing in entry box.
|
||||||
- Fix crash on empty list with custom input (#175).
|
- Fix crash on empty list with custom input (#175).
|
||||||
- SSH: Ignore comments in Host line (#178).
|
- SSH: Ignore comments in Host line (#178).
|
||||||
|
- Fix issues with BSD (#180)
|
||||||
New feature:
|
New feature:
|
||||||
- Markup support error message.
|
- Markup support error message.
|
||||||
- Implement -no-custom as alternative to -only-select (#176).
|
- Implement -no-custom as alternative to -only-select (#176).
|
||||||
|
|
|
@ -308,26 +308,32 @@ static int window_match ( char **tokens, __attribute__( ( unused ) ) const char
|
||||||
client *c = window_client ( display, ids->array[index] );
|
client *c = window_client ( display, ids->array[index] );
|
||||||
|
|
||||||
if ( tokens ) {
|
if ( tokens ) {
|
||||||
int test = 0;
|
for ( int j = 0; match && tokens != NULL && tokens[j] != NULL; j++ ) {
|
||||||
|
int test = 0;
|
||||||
|
// Dirty hack. Normally token_match does _all_ the matching,
|
||||||
|
// Now we want it to match only one item at the time.
|
||||||
|
// If hack not in place it would not match queries spanning multiple fields.
|
||||||
|
// e.g. when searching 'title element' and 'class element'
|
||||||
|
char *ftokens[2] = { tokens[j], NULL };
|
||||||
|
if ( !test && c->title[0] != '\0' ) {
|
||||||
|
test = token_match ( ftokens, c->title, case_sensitive, 0, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
if ( !test && c->title[0] != '\0' ) {
|
if ( !test && c->class[0] != '\0' ) {
|
||||||
test = token_match ( tokens, c->title, case_sensitive, 0, NULL );
|
test = token_match ( ftokens, c->class, case_sensitive, 0, NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !test && c->class[0] != '\0' ) {
|
if ( !test && c->role[0] != '\0' ) {
|
||||||
test = token_match ( tokens, c->class, case_sensitive, 0, NULL );
|
test = token_match ( ftokens, c->role, case_sensitive, 0, NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !test && c->role[0] != '\0' ) {
|
if ( !test && c->name[0] != '\0' ) {
|
||||||
test = token_match ( tokens, c->role, case_sensitive, 0, NULL );
|
test = token_match ( ftokens, c->name, case_sensitive, 0, NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !test && c->name[0] != '\0' ) {
|
if ( test == 0 ) {
|
||||||
test = token_match ( tokens, c->name, case_sensitive, 0, NULL );
|
match = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( test == 0 ) {
|
|
||||||
match = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue