LibGUI/WindowServer: Allow querying global cursor position

This commit is contained in:
2026-06-23 23:31:17 +03:00
parent 1287c8e335
commit 689494db63
6 changed files with 46 additions and 0 deletions

View File

@@ -274,6 +274,12 @@ namespace LibGUI
send_packet(packet, __FUNCTION__);
}
void Window::query_cursor_position()
{
const WindowPacket::QueryPointer packet {};
send_packet(packet, __FUNCTION__);
}
void Window::on_socket_error(BAN::StringView function)
{
if (m_handling_socket_error)
@@ -419,6 +425,10 @@ namespace LibGUI
if (m_mouse_scroll_event_callback)
m_mouse_scroll_event_callback(TRY_OR_BREAK(EventPacket::MouseScrollEvent::deserialize(packet_span)).event);
break;
case PacketType::QueryPointerEvent:
if (m_query_pointer_event_callback)
m_query_pointer_event_callback(TRY_OR_BREAK(EventPacket::QueryPointerEvent::deserialize(packet_span)).event);
break;
#undef TRY_OR_BREAK
default:
dprintln("unhandled packet type: {}", static_cast<uint32_t>(header.type));