| 149 | } |
| 150 | |
| 151 | void SDLPlatform::PostHandleEvents() |
| 152 | { |
| 153 | SDL_RemoveEventWatch(EventFilterCallback, &WinImpl::DraggedWindow); |
| 154 | |
| 155 | // Handle window dragging release here |
| 156 | if (WinImpl::DraggedWindow != nullptr) |
| 157 | { |
| 158 | Float2 mousePosition; |
| 159 | auto buttons = SDL_GetGlobalMouseState(&mousePosition.X, &mousePosition.Y); |
| 160 | |
| 161 | // Send simulated mouse up event |
| 162 | SDL_Event buttonUpEvent { 0 }; |
| 163 | buttonUpEvent.motion.type = SDL_EVENT_MOUSE_BUTTON_UP; |
| 164 | buttonUpEvent.button.down = false; |
| 165 | buttonUpEvent.motion.windowID = SDL_GetWindowID(WinImpl::DraggedWindow->GetSDLWindow()); |
| 166 | buttonUpEvent.motion.timestamp = SDL_GetTicksNS(); |
| 167 | buttonUpEvent.motion.state = SDL_BUTTON_LEFT; |
| 168 | buttonUpEvent.button.clicks = 1; |
| 169 | buttonUpEvent.motion.x = mousePosition.X; |
| 170 | buttonUpEvent.motion.y = mousePosition.Y; |
| 171 | WinImpl::DraggedWindow->HandleEvent(buttonUpEvent); |
| 172 | WinImpl::DraggedWindow = nullptr; |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | bool SDLWindow::HandleEventInternal(SDL_Event& event) |
| 177 | { |
nothing calls this directly
no test coverage detected