| 196 | static bool gWindowSizeInitialized = false; |
| 197 | |
| 198 | static void glfw_framebuffer_size( GLFWwindow* /*window*/, int width, int height ) |
| 199 | { |
| 200 | auto viewer = &MR::getViewerInstance(); |
| 201 | #if defined( __linux__ ) && !defined( __EMSCRIPTEN__ ) |
| 202 | if ( gWindowSizeInitialized ) |
| 203 | { |
| 204 | // on Linux some (or all?) window managers send resize events in batch, processing all of them hits performance |
| 205 | viewer->emplaceEvent( "Window resize", [width, height, viewer] |
| 206 | { |
| 207 | viewer->postResize( width, height ); |
| 208 | }, true ); |
| 209 | } |
| 210 | else |
| 211 | #endif |
| 212 | { |
| 213 | viewer->postResize( width, height ); |
| 214 | viewer->postEmptyEvent(); |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | static void glfw_window_pos( GLFWwindow* /*window*/, int xPos, int yPos ) |
| 219 | { |
no test coverage detected