You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Merge pull request #105587 from deralmas/framing-this-moment
Wayland: Emulate frame event for old `wl_seat` versions
This commit is contained in:
@@ -1622,6 +1622,10 @@ void WaylandThread::_wl_pointer_on_enter(void *data, struct wl_pointer *wl_point
|
|||||||
seat_state_update_cursor(ss);
|
seat_state_update_cursor(ss);
|
||||||
|
|
||||||
DEBUG_LOG_WAYLAND_THREAD(vformat("Pointer entered window %d.", ws->id));
|
DEBUG_LOG_WAYLAND_THREAD(vformat("Pointer entered window %d.", ws->id));
|
||||||
|
|
||||||
|
if (wl_pointer_get_version(wl_pointer) < WL_POINTER_FRAME_SINCE_VERSION) {
|
||||||
|
_wl_pointer_on_frame(data, wl_pointer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaylandThread::_wl_pointer_on_leave(void *data, struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *surface) {
|
void WaylandThread::_wl_pointer_on_leave(void *data, struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *surface) {
|
||||||
@@ -1645,6 +1649,10 @@ void WaylandThread::_wl_pointer_on_leave(void *data, struct wl_pointer *wl_point
|
|||||||
pd.pressed_button_mask.clear();
|
pd.pressed_button_mask.clear();
|
||||||
|
|
||||||
DEBUG_LOG_WAYLAND_THREAD(vformat("Pointer left window %d.", id));
|
DEBUG_LOG_WAYLAND_THREAD(vformat("Pointer left window %d.", id));
|
||||||
|
|
||||||
|
if (wl_pointer_get_version(wl_pointer) < WL_POINTER_FRAME_SINCE_VERSION) {
|
||||||
|
_wl_pointer_on_frame(data, wl_pointer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaylandThread::_wl_pointer_on_motion(void *data, struct wl_pointer *wl_pointer, uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y) {
|
void WaylandThread::_wl_pointer_on_motion(void *data, struct wl_pointer *wl_pointer, uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y) {
|
||||||
@@ -1657,6 +1665,10 @@ void WaylandThread::_wl_pointer_on_motion(void *data, struct wl_pointer *wl_poin
|
|||||||
pd.position.y = wl_fixed_to_double(surface_y);
|
pd.position.y = wl_fixed_to_double(surface_y);
|
||||||
|
|
||||||
pd.motion_time = time;
|
pd.motion_time = time;
|
||||||
|
|
||||||
|
if (wl_pointer_get_version(wl_pointer) < WL_POINTER_FRAME_SINCE_VERSION) {
|
||||||
|
_wl_pointer_on_frame(data, wl_pointer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaylandThread::_wl_pointer_on_button(void *data, struct wl_pointer *wl_pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state) {
|
void WaylandThread::_wl_pointer_on_button(void *data, struct wl_pointer *wl_pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state) {
|
||||||
@@ -1704,6 +1716,10 @@ void WaylandThread::_wl_pointer_on_button(void *data, struct wl_pointer *wl_poin
|
|||||||
|
|
||||||
pd.button_time = time;
|
pd.button_time = time;
|
||||||
pd.button_serial = serial;
|
pd.button_serial = serial;
|
||||||
|
|
||||||
|
if (wl_pointer_get_version(wl_pointer) < WL_POINTER_FRAME_SINCE_VERSION) {
|
||||||
|
_wl_pointer_on_frame(data, wl_pointer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaylandThread::_wl_pointer_on_axis(void *data, struct wl_pointer *wl_pointer, uint32_t time, uint32_t axis, wl_fixed_t value) {
|
void WaylandThread::_wl_pointer_on_axis(void *data, struct wl_pointer *wl_pointer, uint32_t time, uint32_t axis, wl_fixed_t value) {
|
||||||
@@ -1723,6 +1739,10 @@ void WaylandThread::_wl_pointer_on_axis(void *data, struct wl_pointer *wl_pointe
|
|||||||
}
|
}
|
||||||
|
|
||||||
pd.button_time = time;
|
pd.button_time = time;
|
||||||
|
|
||||||
|
if (wl_pointer_get_version(wl_pointer) < WL_POINTER_FRAME_SINCE_VERSION) {
|
||||||
|
_wl_pointer_on_frame(data, wl_pointer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaylandThread::_wl_pointer_on_frame(void *data, struct wl_pointer *wl_pointer) {
|
void WaylandThread::_wl_pointer_on_frame(void *data, struct wl_pointer *wl_pointer) {
|
||||||
|
|||||||
Reference in New Issue
Block a user