mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-26 06:59:52 -05:00
rootston: cleanup for multiseat
This commit is contained in:
parent
a00b7f1e9b
commit
992f931ae9
5 changed files with 26 additions and 53 deletions
|
|
@ -7,6 +7,7 @@
|
|||
#include <dev/evdev/input-event-codes.h>
|
||||
#endif
|
||||
#include <wlr/util/log.h>
|
||||
#include "rootston/xcursor.h"
|
||||
#include "rootston/cursor.h"
|
||||
|
||||
struct roots_cursor *roots_cursor_create(struct roots_seat *seat) {
|
||||
|
|
@ -141,13 +142,11 @@ static void roots_cursor_press_button(struct roots_cursor *cursor,
|
|||
cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy);
|
||||
|
||||
if (state == WLR_BUTTON_PRESSED && view && roots_seat_has_meta_pressed(seat)) {
|
||||
// TODO
|
||||
roots_seat_focus_view(seat, view);
|
||||
|
||||
uint32_t edges;
|
||||
switch (button) {
|
||||
case BTN_LEFT:
|
||||
// TODO
|
||||
roots_seat_begin_move(seat, view);
|
||||
break;
|
||||
case BTN_RIGHT:
|
||||
|
|
@ -171,7 +170,6 @@ static void roots_cursor_press_button(struct roots_cursor *cursor,
|
|||
return;
|
||||
}
|
||||
|
||||
// TODO
|
||||
uint32_t serial =
|
||||
wlr_seat_pointer_notify_button(seat->seat, time, button, state);
|
||||
|
||||
|
|
@ -182,7 +180,6 @@ static void roots_cursor_press_button(struct roots_cursor *cursor,
|
|||
roots_cursor_update_position(cursor, time);
|
||||
break;
|
||||
case WLR_BUTTON_PRESSED:
|
||||
// TODO
|
||||
i = cursor->input_events_idx;
|
||||
cursor->input_events[i].serial = serial;
|
||||
cursor->input_events[i].cursor = cursor->cursor;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include <wlr/util/log.h>
|
||||
|
||||
#include "rootston/xcursor.h"
|
||||
#include "rootston/input.h"
|
||||
#include "rootston/seat.h"
|
||||
#include "rootston/keyboard.h"
|
||||
|
|
|
|||
|
|
@ -1,14 +1,6 @@
|
|||
#include <wlr/types/wlr_cursor.h>
|
||||
#include "rootston/input.h"
|
||||
|
||||
struct wlr_xcursor *get_default_xcursor(struct wlr_xcursor_theme *theme) {
|
||||
return wlr_xcursor_theme_get_cursor(theme, "left_ptr");
|
||||
}
|
||||
|
||||
struct wlr_xcursor *get_move_xcursor(struct wlr_xcursor_theme *theme) {
|
||||
return wlr_xcursor_theme_get_cursor(theme, "grabbing");
|
||||
}
|
||||
|
||||
static const char *get_resize_xcursor_name(uint32_t edges) {
|
||||
if (edges & ROOTS_CURSOR_RESIZE_EDGE_TOP) {
|
||||
if (edges & ROOTS_CURSOR_RESIZE_EDGE_RIGHT) {
|
||||
|
|
@ -32,6 +24,14 @@ static const char *get_resize_xcursor_name(uint32_t edges) {
|
|||
return "se-resize"; // fallback
|
||||
}
|
||||
|
||||
struct wlr_xcursor *get_default_xcursor(struct wlr_xcursor_theme *theme) {
|
||||
return wlr_xcursor_theme_get_cursor(theme, "left_ptr");
|
||||
}
|
||||
|
||||
struct wlr_xcursor *get_move_xcursor(struct wlr_xcursor_theme *theme) {
|
||||
return wlr_xcursor_theme_get_cursor(theme, "grabbing");
|
||||
}
|
||||
|
||||
struct wlr_xcursor *get_resize_xcursor(struct wlr_xcursor_theme *theme,
|
||||
uint32_t edges) {
|
||||
return wlr_xcursor_theme_get_cursor(theme, get_resize_xcursor_name(edges));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue