mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
view: fix <query monitor="current|left|right" />
Before this commit, <else> branch was always executed with
monitor="current", monitor="left" or monitor="right" queries.
For example:
<action name="If">
<query monitor="current" />
<then>
<action />
</then>
<else>
<action />
</else>
</action>
This commit is contained in:
parent
d54051d9c1
commit
f09ace51bf
1 changed files with 19 additions and 14 deletions
19
src/view.c
19
src/view.c
|
|
@ -215,22 +215,27 @@ view_matches_query(struct view *view, struct view_query *query)
|
||||||
|
|
||||||
if (query->monitor) {
|
if (query->monitor) {
|
||||||
struct output *current = output_nearest_to_cursor(view->server);
|
struct output *current = output_nearest_to_cursor(view->server);
|
||||||
|
if (!strcasecmp(query->monitor, "current")) {
|
||||||
if (!strcasecmp(query->monitor, "current") && current != view->output) {
|
if (current != view->output) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!strcasecmp(query->monitor, "left") &&
|
} else if (!strcasecmp(query->monitor, "left")) {
|
||||||
output_get_adjacent(current, LAB_EDGE_LEFT, false) != view->output) {
|
if (output_get_adjacent(current, LAB_EDGE_LEFT, false)
|
||||||
|
!= view->output) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!strcasecmp(query->monitor, "right") &&
|
} else if (!strcasecmp(query->monitor, "right")) {
|
||||||
output_get_adjacent(current, LAB_EDGE_RIGHT, false) != view->output) {
|
if (output_get_adjacent(current, LAB_EDGE_RIGHT, false)
|
||||||
|
!= view->output) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (output_from_name(view->server, query->monitor) != view->output) {
|
} else {
|
||||||
|
if (output_from_name(view->server, query->monitor)
|
||||||
|
!= view->output) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue