Another try at pointer frame support on Wayland

This time I think I got the wheel handling correct. At least works with
my wheel mouse.
This commit is contained in:
Kovid Goyal
2024-04-08 18:45:38 +05:30
parent b48b53fce9
commit ac4eef7eb3
2 changed files with 125 additions and 78 deletions

27
glfw/wl_platform.h vendored
View File

@@ -146,6 +146,13 @@ enum WaylandWindowPendingState {
PENDING_STATE_DECORATION = 2
};
enum _GLFWWaylandAxisEvent {
AXIS_EVENT_UNKNOWN = 0,
AXIS_EVENT_CONTINUOUS = 1,
AXIS_EVENT_DISCRETE = 2,
AXIS_EVENT_VALUE120 = 3
};
// Wayland-specific per-window data
//
typedef struct _GLFWwindowWayland
@@ -178,6 +185,20 @@ typedef struct _GLFWwindowWayland
struct zwlr_layer_surface_v1* zwlr_layer_surface_v1;
} layer_shell;
/* information about axis events on current frame */
struct
{
struct {
enum _GLFWWaylandAxisEvent x_axis_type;
float x;
enum _GLFWWaylandAxisEvent y_axis_type;
float y;
} discrete, continuous;
/* Event timestamp in nanoseconds */
monotonic_t timestamp_ns;
} pointer_curr_axis_info;
_GLFWcursor* currentCursor;
double cursorPosX, cursorPosY, allCursorPosX, allCursorPosY;
@@ -255,12 +276,6 @@ typedef struct _GLFWwindowWayland
bool maximize_on_first_show;
// counters for ignoring axis events following axis_discrete events in the
// same frame along the same axis
struct {
unsigned int x, y;
} axis_discrete_count;
uint32_t pending_state;
struct {
int width, height;