zserge / fenster

The most minimal cross-platform GUI library
MIT License
811 stars 42 forks source link

Opening multiple windows in series not working (OSX) #14

Open coolbutuseless opened 1 year ago

coolbutuseless commented 1 year ago

Under OSX (12.6.3), I'm trying to open a second window after the first has closed.

In examples/minimal-c/main.c I've edited the main to be:

int main() { 
    printf("Starting first instance\n");
    run();
    printf("Starting second instance\n");
    return run(); 
}

After the first window opens and I click "close", the executable exits and the second instance never starts.

The console output I see is:

$ ./main
Starting first instance
$

What I've found so far:

CardealRusso commented 1 month ago

This seems to be an expected behavior, since there is nothing to handle the attempt to close the window on either platform. On linux, the program is terminated when it receives an error from Xorg, when trying to close the window (yes, it returns non-zero error code when closing on close window button).