mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
query: extend "monitor" query & add missing docs
This commit is contained in:
parent
01032ef3bd
commit
f4c270c92f
2 changed files with 19 additions and 2 deletions
|
|
@ -425,6 +425,11 @@ Actions that execute other actions. Used in keyboard/mouse bindings.
|
|||
Whether the client has full server-side decorations,
|
||||
borders only, or no server-side decorations.
|
||||
|
||||
*monitor* [current|left|right|<monitor_name>]
|
||||
Whether the client is on a monitor relative to the to
|
||||
the currently focused monitor (current, left, or right)
|
||||
or on a monitor with the supplied <monitor_name>.
|
||||
|
||||
This argument is optional.
|
||||
|
||||
*then*
|
||||
|
|
|
|||
16
src/view.c
16
src/view.c
|
|
@ -199,8 +199,20 @@ view_matches_query(struct view *view, struct view_query *query)
|
|||
}
|
||||
|
||||
if (query->monitor) {
|
||||
struct output *target = output_from_name(view->server, query->monitor);
|
||||
if (target != view->output) {
|
||||
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, VIEW_EDGE_LEFT, false) != view->output) {
|
||||
return false;
|
||||
}
|
||||
if (!strcasecmp(query->monitor, "right") &&
|
||||
output_get_adjacent(current, VIEW_EDGE_RIGHT, false) != view->output) {
|
||||
return false;
|
||||
}
|
||||
if (output_from_name(view->server, query->monitor) != view->output) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue