| 1086 | } |
| 1087 | |
| 1088 | void SDLPlatform::PostHandleEvents() |
| 1089 | { |
| 1090 | // Handle window dragging release here |
| 1091 | if (X11Impl::DraggedWindow != nullptr) |
| 1092 | { |
| 1093 | Float2 mousePosition; |
| 1094 | auto buttons = SDL_GetGlobalMouseState(&mousePosition.X, &mousePosition.Y); |
| 1095 | bool buttonReleased = (buttons & SDL_BUTTON_MASK(SDL_BUTTON_LEFT)) == 0; |
| 1096 | if (buttonReleased) |
| 1097 | { |
| 1098 | // Send simulated mouse up event |
| 1099 | SDL_Event buttonUpEvent { 0 }; |
| 1100 | buttonUpEvent.motion.type = SDL_EVENT_MOUSE_BUTTON_UP; |
| 1101 | buttonUpEvent.button.down = false; |
| 1102 | buttonUpEvent.motion.windowID = SDL_GetWindowID(X11Impl::DraggedWindow->GetSDLWindow()); |
| 1103 | buttonUpEvent.motion.timestamp = SDL_GetTicksNS(); |
| 1104 | buttonUpEvent.motion.state = SDL_BUTTON_LEFT; |
| 1105 | buttonUpEvent.button.clicks = 1; |
| 1106 | buttonUpEvent.motion.x = mousePosition.X; |
| 1107 | buttonUpEvent.motion.y = mousePosition.Y; |
| 1108 | X11Impl::DraggedWindow->HandleEvent(buttonUpEvent); |
| 1109 | X11Impl::DraggedWindow = nullptr; |
| 1110 | } |
| 1111 | } |
| 1112 | } |
| 1113 | |
| 1114 | bool SDLWindow::HandleEventInternal(SDL_Event& event) |
| 1115 | { |
nothing calls this directly
no test coverage detected