mirror of
https://github.com/swaywm/sway.git
synced 2024-11-26 18:01:29 +00:00
Implement clicking stacked title bars
This commit is contained in:
parent
f6c3682c05
commit
5354988317
|
@ -533,8 +533,23 @@ static struct sway_container *container_at_tabbed(struct sway_container *parent,
|
||||||
static struct sway_container *container_at_stacked(
|
static struct sway_container *container_at_stacked(
|
||||||
struct sway_container *parent, double ox, double oy,
|
struct sway_container *parent, double ox, double oy,
|
||||||
struct wlr_surface **surface, double *sx, double *sy) {
|
struct wlr_surface **surface, double *sx, double *sy) {
|
||||||
// TODO
|
if (oy < parent->y || oy > parent->y + parent->height) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
struct sway_seat *seat = input_manager_current_seat(input_manager);
|
||||||
|
|
||||||
|
// Title bars
|
||||||
|
int title_height = container_titlebar_height();
|
||||||
|
int child_index = (oy - parent->y) / title_height;
|
||||||
|
if (child_index < parent->children->length) {
|
||||||
|
struct sway_container *child = parent->children->items[child_index];
|
||||||
|
return seat_get_focus_inactive(seat, child);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Surfaces
|
||||||
|
struct sway_container *current = seat_get_active_child(seat, parent);
|
||||||
|
|
||||||
|
return container_at(current, ox, oy, surface, sx, sy);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue