Lil Cleanup

This commit is contained in:
2024-02-21 05:37:12 -05:00
parent bdc1427626
commit b1dfab70a1

View File

@@ -76,26 +76,13 @@ namespace ReWindow {
// TODO: Implement refresh time keeping
OnRefresh(0.f);
Window root_return;
Window child_return;
int root_x_ret;
int root_y_ret;
int win_x_ret;
int win_y_ret;
uint32_t mask_return;
unsigned m;
bool mouseAvailable = XQueryPointer(display, window, &root_return, &child_return, &root_x_ret, &root_y_ret, &win_x_ret, &win_y_ret, &mask_return);
if (mouseAvailable)
{
// TODO: Check if mouse coords have changed, only then fire OnMouseMove event
Vector2 mouse_coords = getCursorPos();
Vector2 mouse_coords_raw = {(float)win_x_ret, (float)win_y_ret};
auto window_pos = getPos();
Vector2 mouse_coords = mouse_coords_raw - window_pos;
auto eventData = MouseMoveEvent(mouse_coords);
OnMouseMove(eventData);
auto eventData = MouseMoveEvent(mouse_coords);
OnMouseMove(eventData);
}
std::this_thread::sleep_for(1ms);
}