MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / PostHandleEvents

Method PostHandleEvents

Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp:1088–1112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1086}
1087
1088void 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
1114bool SDLWindow::HandleEventInternal(SDL_Event& event)
1115{

Callers

nothing calls this directly

Calls 2

GetSDLWindowMethod · 0.80
HandleEventMethod · 0.45

Tested by

no test coverage detected