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
33
src/view.c
33
src/view.c
|
|
@ -215,20 +215,25 @@ view_matches_query(struct view *view, struct view_query *query)
|
|||
|
||||
if (query->monitor) {
|
||||
struct output *current = output_nearest_to_cursor(view->server);
|
||||
|
||||
if (!strcasecmp(query->monitor, "current") && current != view->output) {
|
||||
return false;
|
||||
}
|
||||
if (!strcasecmp(query->monitor, "left") &&
|
||||
output_get_adjacent(current, LAB_EDGE_LEFT, false) != view->output) {
|
||||
return false;
|
||||
}
|
||||
if (!strcasecmp(query->monitor, "right") &&
|
||||
output_get_adjacent(current, LAB_EDGE_RIGHT, false) != view->output) {
|
||||
return false;
|
||||
}
|
||||
if (output_from_name(view->server, query->monitor) != view->output) {
|
||||
return false;
|
||||
if (!strcasecmp(query->monitor, "current")) {
|
||||
if (current != view->output) {
|
||||
return false;
|
||||
}
|
||||
} else if (!strcasecmp(query->monitor, "left")) {
|
||||
if (output_get_adjacent(current, LAB_EDGE_LEFT, false)
|
||||
!= view->output) {
|
||||
return false;
|
||||
}
|
||||
} else if (!strcasecmp(query->monitor, "right")) {
|
||||
if (output_get_adjacent(current, LAB_EDGE_RIGHT, false)
|
||||
!= view->output) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (output_from_name(view->server, query->monitor)
|
||||
!= view->output) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue