mirror of
https://github.com/swaywm/sway.git
synced 2025-11-03 09:01:43 -05:00
Enable windows to register to get notified of pointer button events
This commit is contained in:
parent
9889b14511
commit
c8a64305fd
2 changed files with 20 additions and 0 deletions
|
|
@ -9,6 +9,8 @@
|
|||
#include "list.h"
|
||||
#include "client/registry.h"
|
||||
|
||||
struct window;
|
||||
|
||||
struct buffer {
|
||||
struct wl_buffer *buffer;
|
||||
cairo_surface_t *surface;
|
||||
|
|
@ -25,6 +27,13 @@ struct cursor {
|
|||
struct wl_poitner *pointer;
|
||||
};
|
||||
|
||||
struct pointer_input {
|
||||
wl_fixed_t last_x;
|
||||
wl_fixed_t last_y;
|
||||
|
||||
void (*notify)(struct window *window, wl_fixed_t x, wl_fixed_t y, uint32_t button);
|
||||
};
|
||||
|
||||
struct window {
|
||||
struct registry *registry;
|
||||
struct buffer buffers[2];
|
||||
|
|
@ -36,6 +45,7 @@ struct window {
|
|||
uint32_t width, height;
|
||||
char *font;
|
||||
cairo_t *cairo;
|
||||
struct pointer_input pointer_input;
|
||||
};
|
||||
|
||||
struct window *window_setup(struct registry *registry, uint32_t width, uint32_t height, bool shell_surface);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue