@@ -112,10 +112,6 @@ static void drop_callback(GLFWwindow* window, int count, const char** paths) {
112
112
s_this->magicOpen (paths[0 ]);
113
113
}
114
114
115
- static void resize_callback (GLFWwindow* window, int width, int height) {
116
- s_this->m_setupScreenSize = true ;
117
- }
118
-
119
115
static void ShowHelpMarker (const char * desc) {
120
116
ImGui::SameLine ();
121
117
ImGui::TextDisabled (" (?)" );
@@ -275,7 +271,7 @@ end)(jit.status()))
275
271
276
272
s_this = this ;
277
273
glfwSetDropCallback (m_window, drop_callback);
278
- glfwSetWindowSizeCallback (m_window, resize_callback );
274
+ glfwSetWindowSizeCallback (m_window, [](GLFWwindow*, int , int ) { s_this-> m_setupScreenSize = true ; } );
279
275
280
276
Resources::loadIcon ([this ](const uint8_t * data, uint32_t size) {
281
277
int x, y, comp;
@@ -561,6 +557,9 @@ void PCSX::GUI::startFrame() {
561
557
int w, h;
562
558
563
559
glfwGetFramebufferSize (m_window, &w, &h);
560
+ // Make width/height be 1 at minimum
561
+ w = std::max<int >(w, 1 );
562
+ h = std::max<int >(h, 1 );
564
563
m_framebufferSize = ImVec2 (w, h);
565
564
m_renderSize = ImVec2 (w, h);
566
565
normalizeDimensions (m_renderSize, renderRatio);
0 commit comments