mirror of
https://github.com/swaywm/sway.git
synced 2024-11-16 05:03:17 +00:00
35a82a8693
This fixes a few issues with swaybar's cursor scaling: 1. The cursor scale is now changed when the output scale changes 2. The cursor scale is no longer bound by the max output scale when swaybar is launched 3. Related to the previous item, the cursor is no longer tiny on low scale outputs after the max output scale has changed This also bumps up `wl_compositor` to version 4 to allow usage of `wl_surface_damage_buffer`.
55 lines
1,019 B
C
55 lines
1,019 B
C
#ifndef _SWAYBAR_INPUT_H
|
|
#define _SWAYBAR_INPUT_H
|
|
|
|
#include <wayland-client.h>
|
|
#include "list.h"
|
|
|
|
struct swaybar;
|
|
struct swaybar_output;
|
|
|
|
struct swaybar_pointer {
|
|
struct wl_pointer *pointer;
|
|
struct wl_cursor_theme *cursor_theme;
|
|
struct wl_cursor_image *cursor_image;
|
|
struct wl_surface *cursor_surface;
|
|
struct swaybar_output *current;
|
|
int x, y;
|
|
uint32_t serial;
|
|
};
|
|
|
|
enum x11_button {
|
|
NONE,
|
|
LEFT,
|
|
MIDDLE,
|
|
RIGHT,
|
|
SCROLL_UP,
|
|
SCROLL_DOWN,
|
|
SCROLL_LEFT,
|
|
SCROLL_RIGHT,
|
|
BACK,
|
|
FORWARD,
|
|
};
|
|
|
|
enum hotspot_event_handling {
|
|
HOTSPOT_IGNORE,
|
|
HOTSPOT_PROCESS,
|
|
};
|
|
|
|
struct swaybar_hotspot {
|
|
struct wl_list link; // swaybar_output::hotspots
|
|
int x, y, width, height;
|
|
enum hotspot_event_handling (*callback)(struct swaybar_output *output,
|
|
struct swaybar_hotspot *hotspot, int x, int y,
|
|
enum x11_button button, void *data);
|
|
void (*destroy)(void *data);
|
|
void *data;
|
|
};
|
|
|
|
extern const struct wl_seat_listener seat_listener;
|
|
|
|
void update_cursor(struct swaybar *bar);
|
|
|
|
void free_hotspots(struct wl_list *list);
|
|
|
|
#endif
|