.RS 4
.\}
.nf
-MONITOR_SEL := [MONITOR_SEL#](DIR|CYCLE_DIR|last|older|newer|focused|primary|^<n>|<monitor_id>|<monitor_name>)[\&.[!]occupied][\&.[!]focused]
+MONITOR_SEL := [MONITOR_SEL#](DIR|CYCLE_DIR|last|older|newer|focused|pointed|primary|^<n>|<monitor_id>|<monitor_name>)[\&.[!]occupied][\&.[!]focused]
.fi
.if n \{\
.RE
Selects the currently focused monitor\&.
.RE
.PP
+pointed
+.RS 4
+Selects the monitor under the pointer\&.
+.RE
+.PP
primary
.RS 4
Selects the primary monitor\&.
Select a monitor.
----
-MONITOR_SEL := [MONITOR_SEL#](DIR|CYCLE_DIR|last|older|newer|focused|primary|^<n>|<monitor_id>|<monitor_name>)[.[!]occupied][.[!]focused]
+MONITOR_SEL := [MONITOR_SEL#](DIR|CYCLE_DIR|last|older|newer|focused|pointed|primary|^<n>|<monitor_id>|<monitor_name>)[.[!]occupied][.[!]focused]
----
Descriptors
focused::
Selects the currently focused monitor.
+pointed::
+ Selects the monitor under the pointer.
+
primary::
Selects the primary monitor.
#include "window.h"
#include "tree.h"
#include "query.h"
+#include "geometry.h"
void query_tree(FILE *rsp)
{
if (monitor_matches(&loc, ref, sel)) {
dst->monitor = mon;
}
+ } else if (streq("pointed", desc)) {
+ xcb_point_t pointer;
+ query_pointer(NULL, &pointer);
+ for (monitor_t *m = mon_head; m != NULL; m = m->next) {
+ if (is_inside(pointer, m->rectangle)) {
+ dst->monitor = m;
+ break;
+ }
+ }
} else if (parse_index(desc, &idx) && monitor_from_index(idx, dst)) {
free(desc_copy);
if (monitor_matches(dst, ref, sel)) {