mirror of
https://github.com/swaywm/sway.git
synced 2025-11-26 06:59:59 -05:00
Store last button and use it when views request to move or resize
This commit is contained in:
parent
6767d8a593
commit
9df660ee31
5 changed files with 37 additions and 28 deletions
|
|
@ -1,9 +1,4 @@
|
|||
#define _POSIX_C_SOURCE 199309L
|
||||
#ifdef __linux__
|
||||
#include <linux/input-event-codes.h>
|
||||
#elif __FreeBSD__
|
||||
#include <dev/evdev/input-event-codes.h>
|
||||
#endif
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <wayland-server.h>
|
||||
|
|
@ -259,7 +254,9 @@ static void handle_request_move(struct wl_listener *listener, void *data) {
|
|||
struct sway_view *view = &xdg_shell_view->view;
|
||||
struct wlr_xdg_toplevel_move_event *e = data;
|
||||
struct sway_seat *seat = e->seat->seat->data;
|
||||
seat_begin_move(seat, view->swayc);
|
||||
if (e->serial == seat->last_button_serial) {
|
||||
seat_begin_move(seat, view->swayc, seat->last_button);
|
||||
}
|
||||
}
|
||||
|
||||
static void handle_request_resize(struct wl_listener *listener, void *data) {
|
||||
|
|
@ -268,7 +265,9 @@ static void handle_request_resize(struct wl_listener *listener, void *data) {
|
|||
struct sway_view *view = &xdg_shell_view->view;
|
||||
struct wlr_xdg_toplevel_resize_event *e = data;
|
||||
struct sway_seat *seat = e->seat->seat->data;
|
||||
seat_begin_resize(seat, view->swayc, BTN_LEFT, e->edges);
|
||||
if (e->serial == seat->last_button_serial) {
|
||||
seat_begin_resize(seat, view->swayc, seat->last_button, e->edges);
|
||||
}
|
||||
}
|
||||
|
||||
static void handle_unmap(struct wl_listener *listener, void *data) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue