mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 12:06:00 +01:00
wl_seat: send frame event after pointer leave (#6074)
This commit is contained in:
parent
94c20a1863
commit
31890026ea
2 changed files with 17 additions and 1 deletions
|
@ -186,10 +186,13 @@ void CSeatManager::setPointerFocus(wlr_surface* surf, const Vector2D& local) {
|
|||
}
|
||||
}
|
||||
|
||||
auto lastPointerFocusResource = state.pointerFocusResource;
|
||||
|
||||
state.pointerFocusResource.reset();
|
||||
state.pointerFocus = surf;
|
||||
|
||||
if (!surf) {
|
||||
sendPointerFrame(lastPointerFocusResource);
|
||||
events.pointerFocusChange.emit();
|
||||
return;
|
||||
}
|
||||
|
@ -209,6 +212,11 @@ void CSeatManager::setPointerFocus(wlr_surface* surf, const Vector2D& local) {
|
|||
}
|
||||
}
|
||||
|
||||
if (state.pointerFocusResource != lastPointerFocusResource)
|
||||
sendPointerFrame(lastPointerFocusResource);
|
||||
|
||||
sendPointerFrame();
|
||||
|
||||
hyprListener_pointerSurfaceDestroy.initCallback(
|
||||
&surf->events.destroy, [this](void* owner, void* data) { setPointerFocus(nullptr, {}); }, nullptr, "CSeatManager");
|
||||
|
||||
|
@ -245,7 +253,14 @@ void CSeatManager::sendPointerFrame() {
|
|||
if (!state.pointerFocusResource)
|
||||
return;
|
||||
|
||||
for (auto& p : state.pointerFocusResource->pointers) {
|
||||
sendPointerFrame(state.pointerFocusResource);
|
||||
}
|
||||
|
||||
void CSeatManager::sendPointerFrame(WP<CWLSeatResource> pResource) {
|
||||
if (!pResource)
|
||||
return;
|
||||
|
||||
for (auto& p : pResource->pointers) {
|
||||
if (!p)
|
||||
continue;
|
||||
|
||||
|
|
|
@ -63,6 +63,7 @@ class CSeatManager {
|
|||
void sendPointerMotion(uint32_t timeMs, const Vector2D& local);
|
||||
void sendPointerButton(uint32_t timeMs, uint32_t key, wl_pointer_button_state state);
|
||||
void sendPointerFrame();
|
||||
void sendPointerFrame(WP<CWLSeatResource> pResource);
|
||||
void sendPointerAxis(uint32_t timeMs, wl_pointer_axis axis, double value, int32_t discrete, wl_pointer_axis_source source, wl_pointer_axis_relative_direction relative);
|
||||
|
||||
void sendTouchDown(wlr_surface* surf, uint32_t timeMs, int32_t id, const Vector2D& local);
|
||||
|
|
Loading…
Reference in a new issue