summaryrefslogtreecommitdiff
path: root/sway/container.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2017-06-14 18:53:40 -0400
committerGitHub <[email protected]>2017-06-14 18:53:40 -0400
commit298f56353ef155f6a2ccc977c96b2ff5d971e65e (patch)
treedcb3b74f1dde93bce8657b7509662ffd7db667d0 /sway/container.c
parenta5c07dde6aba87584ddb6c6a2769472a6003623a (diff)
parenteb6e38c86d2deb37cc6f378f8644c4a530fd7448 (diff)
Merge branch 'master' into server-decoration
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/sway/container.c b/sway/container.c
index 08aa77a8..358ba767 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -699,12 +699,12 @@ static bool pointer_test(swayc_t *view, void *_origin) {
swayc_t *container_under_pointer(void) {
// root.output->workspace
- if (!root_container.focused || !root_container.focused->focused) {
+ if (!root_container.focused) {
return NULL;
}
- swayc_t *lookup = root_container.focused->focused;
+ swayc_t *lookup = root_container.focused;
// Case of empty workspace
- if (lookup->children == 0) {
+ if (lookup->children && !lookup->unmanaged) {
return NULL;
}
struct wlc_point origin;
@@ -712,6 +712,17 @@ swayc_t *container_under_pointer(void) {
while (lookup && lookup->type != C_VIEW) {
int i;
int len;
+ for (int _i = 0; lookup->unmanaged && _i < lookup->unmanaged->length; ++_i) {
+ wlc_handle *handle = lookup->unmanaged->items[_i];
+ const struct wlc_geometry *geo = wlc_view_get_geometry(*handle);
+ if (origin.x >= geo->origin.x && origin.y >= geo->origin.y
+ && origin.x < geo->origin.x + (int)geo->size.w
+ && origin.y < geo->origin.y + (int)geo->size.h) {
+ // Hack: we force focus upon unmanaged views here
+ wlc_view_focus(*handle);
+ return NULL;
+ }
+ }
// if tabbed/stacked go directly to focused container, otherwise search
// children
if (lookup->layout == L_TABBED || lookup->layout == L_STACKED) {