mirror of
https://github.com/swaywm/sway.git
synced 2025-11-06 13:29:50 -05:00
Fix floating click events
* Set focus to a floating container when clicking its title bar. * Raise floating when user clicks title bar or decorations (in the seat_begin functions). * In container_at, it only returned a floating container if the user had clicked the surface. This makes it use floating_container_at instead.
This commit is contained in:
parent
2bd561d2b7
commit
416bb7a214
3 changed files with 17 additions and 9 deletions
|
|
@ -358,7 +358,6 @@ struct sway_container *container_at(struct sway_workspace *workspace,
|
|||
struct wlr_surface **surface, double *sx, double *sy) {
|
||||
struct sway_container *c;
|
||||
|
||||
// Focused view's popups
|
||||
struct sway_seat *seat = input_manager_current_seat(input_manager);
|
||||
struct sway_container *focus = seat_get_focused_container(seat);
|
||||
bool is_floating = focus && container_is_floating_or_child(focus);
|
||||
|
|
@ -370,14 +369,11 @@ struct sway_container *container_at(struct sway_workspace *workspace,
|
|||
}
|
||||
*surface = NULL;
|
||||
}
|
||||
// Cast a ray to handle floating windows
|
||||
for (int i = workspace->floating->length - 1; i >= 0; --i) {
|
||||
struct sway_container *cn = workspace->floating->items[i];
|
||||
if (cn->view && (c = surface_at_view(cn, lx, ly, surface, sx, sy))) {
|
||||
return c;
|
||||
}
|
||||
// Floating
|
||||
if ((c = floating_container_at(lx, ly, surface ,sx ,sy))) {
|
||||
return c;
|
||||
}
|
||||
// If focused is tiling, focused view's non-popups
|
||||
// Tiling (focused)
|
||||
if (focus && focus->view && !is_floating) {
|
||||
if ((c = surface_at_view(focus, lx, ly, surface, sx, sy))) {
|
||||
return c;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue