focus_follows_mouse
Wether to focus the window under the mouse pointer.
+ adaptative_raise
+ Prevent floating windows from being raised when they might cover other floating windows.
+
## Mouse Bindings
button_modifier + left mouse button
.TP
.I focus_follows_mouse
Wether to focus the window under the mouse pointer.
+.TP
+.I adaptative_raise
+Prevent floating windows from being raised when they might cover other floating windows.
.SH MOUSE BINDINGS
.TP
.I button_modifier + left mouse button
bool b;
if (parse_bool(value, &b))
focus_follows_mouse = b;
+ } else if (strcmp(name, "adaptative_raise") == 0) {
+ bool b;
+ if (parse_bool(value, &b))
+ adaptative_raise = b;
} else if (strcmp(name, "wm_name") == 0) {
strncpy(wm_name, value, sizeof(wm_name));
ewmh_update_wm_name();
snprintf(rsp, BUFSIZ, "%s", BOOLSTR(gapless_monocle));
else if (strcmp(name, "focus_follows_mouse") == 0)
snprintf(rsp, BUFSIZ, "%s", BOOLSTR(focus_follows_mouse));
+ else if (strcmp(name, "adaptative_raise") == 0)
+ snprintf(rsp, BUFSIZ, "%s", BOOLSTR(adaptative_raise));
else if (strcmp(name, "wm_name") == 0)
snprintf(rsp, BUFSIZ, "%s", wm_name);
else if (strcmp(name, "button_modifier") == 0)
borderless_monocle = BORDERLESS_MONOCLE;
gapless_monocle = GAPLESS_MONOCLE;
focus_follows_mouse = FOCUS_FOLLOWS_MOUSE;
+ adaptative_raise = ADAPTATIVE_RAISE;
}
#define BORDERLESS_MONOCLE false
#define GAPLESS_MONOCLE false
#define FOCUS_FOLLOWS_MOUSE false
+#define ADAPTATIVE_RAISE false
char focused_border_color[MAXLEN];
char active_border_color[MAXLEN];
bool borderless_monocle;
bool gapless_monocle;
bool focus_follows_mouse;
+bool adaptative_raise;
char wm_name[MAXLEN];
unsigned int button_modifier;
xcb_set_input_focus(dpy, XCB_INPUT_FOCUS_POINTER_ROOT, n->client->window, XCB_CURRENT_TIME);
}
- if (!is_tiled(n->client))
- window_raise(n->client->window);
- else
+ if (!is_tiled(n->client)) {
+ if (!adaptative_raise || !might_cover(d, n))
+ window_raise(n->client->window);
+ } else {
window_pseudo_raise(d, n->client->window);
+ }
if (d->focus != n) {
d->last_focus = d->focus;
#include "rules.h"
#include "window.h"
+bool contains(xcb_rectangle_t a, xcb_rectangle_t b)
+{
+ return (a.x <= b.x && (a.x + a.width) >= (b.x + b.width)
+ && a.y <= b.y && (a.y + a.height) >= (b.y + b.height));
+}
+
+bool might_cover(desktop_t *d, node_t *n)
+{
+ for (node_t *f = first_extrema(d->root); f != NULL; f = next_leaf(f))
+ if (f != n && is_floating(f->client) && contains(n->client->floating_rectangle, f->client->floating_rectangle))
+ return true;
+ return false;
+}
+
bool locate_window(xcb_window_t win, window_location_t *loc)
{
for (monitor_t *m = mon_head; m != NULL; m = m->next)
#include <xcb/xcb_event.h>
#include "types.h"
+bool contains(xcb_rectangle_t, xcb_rectangle_t);
+bool might_cover(desktop_t *, node_t *);
bool locate_window(xcb_window_t, window_location_t *);
bool locate_desktop(char *, desktop_location_t *);
bool is_inside(monitor_t *, xcb_point_t);