cinder / Cinder

Cinder is a community-developed, free and open source library for professional-quality creative coding in C++.
http://libcinder.org
Other
5.3k stars 940 forks source link

Resizing window to smallest vertical size on OSX crashes application #1206

Open sansumbrella opened 8 years ago

sansumbrella commented 8 years ago

Adjusting the window size with the mouse in OSX (e.g. dragging from the corner) causes the application to crash when the window height is dragged to its minimum.

resizing

sansumbrella commented 8 years ago

Resizing using the setWindowSize method does not crash, even when setting the size to zero.

richardeakin commented 8 years ago

I'm not able to repro with the BasicApp sample here - size.y stops at 1 and that's as small as it gets. Are you able to?

If it is indeed a problem we could look into setting the NSWindow's minSize property, but I doubt we want to set that to anything lower than {1,1}.

sansumbrella commented 8 years ago

Reproducible with the latest BasicApp sample (just pulled and rebuilt cinder this morning).

OSX 10.10.5 AMD D300 GPU

resizing-basicapp

sansumbrella commented 8 years ago

Borderless windows are not affected by this bug.

richardeakin commented 8 years ago

Huh, strange because I still can't, although I'm on OS X 10.11.1. I'm also noticing that you're window seems to get smaller than mine:

screenshot 2015-12-03 10 48 04

That's as small as I can make it, vertically.

sansumbrella commented 8 years ago

Adding a quick [winImpl->mWin setMinSize:NSMakeSize(1, 1)]; to the window instantiation function doesn't seem to have any salubrious effect.

sansumbrella commented 8 years ago

Not a burning issue, but definitely a weird one. Apple's SceneKit template application does not have this issue.

pizthewiz commented 8 years ago

I can't seem to reproduce with the BasicApp on OS X 10.11.2 El Capitan either.

axjxwright commented 8 years ago

Can confirm on 10.10.1 with BasicApp. Can also reproduce with this mini glfw application.

// clang++ -std=c++1y -stdlib=libc++ -Ofast -I/usr/local/include -L/usr/local/lib -lglfw3 -framework OpenGL -framework IOKit -framework Cocoa -framework CoreVideo -o crash crash.cxx

#include <glfw/glfw3.h>

int main ( )
{
    glfwInit();
    auto window = glfwCreateWindow ( 640, 480, "Window", nullptr, nullptr );

    while ( !glfwWindowShouldClose ( window ) )
    {
        glClear(GL_COLOR_BUFFER_BIT);
        glfwPollEvents();
        glfwSwapBuffers(window);
    }

    glfwTerminate();
    return 0;
}