bogue icon indicating copy to clipboard operation
bogue copied to clipboard

macOS Ventura 13.3 GUI Maximize Window

Open vinnyh125 opened this issue 2 years ago • 12 comments

Issue: When I run dune exec bin/main.exe, I see my GUI and it's fully functional, but when I click on the green button on the GUI window to maximize it, the GUI crashes, and I receive a warning about how "main.exe crashed suddenly". I also see this message in the terminal: zsh: bus error dune exec bin/main.exe. Let me know if anyone is able to reproduce this issue :^) image

vinnyh125 avatar Oct 19 '23 15:10 vinnyh125

Hi, sorry for this. Could you try with one of the shipped boguex examples, with debugging and logging turned on? for instance

BOGUE_DEBUG=true BOGUE_LOG_TO_FILE=true boguex 1h

and attach the log file?

sanette avatar Oct 20 '23 13:10 sanette

I've entered that command into my terminal and here is the file: bogue9953e6.log Let me know if I did it right

vinnyh125 avatar Oct 20 '23 21:10 vinnyh125

did you trigger the maximize bug with this example too?

sanette avatar Oct 21 '23 08:10 sanette

Yep. It's strange because if I hover over the green button and select "maximize window" from the dropdown, it's okay, but if I just click on it, the GUI crashes.

vinnyh125 avatar Oct 21 '23 13:10 vinnyh125

that's weird, I see no trace of the bug (and of the maximize event) in the log

sanette avatar Oct 21 '23 14:10 sanette

Oh wow, that's very strange. This issue has been reproduced with my friends who also have the M2 MBA running Ventura, so it might be on Apple's end.

vinnyh125 avatar Oct 21 '23 15:10 vinnyh125

let's check if the problem lies in SDL/tsdl. Could you try the following in an ocaml toplevel?

#require "tsdl";;
open Tsdl;;
Sdl.create_window ~w:600 ~h:400 "test" Sdl.Window.(windowed + resizable + opengl + allow_highdpi);;

This should open a window (without any meaningful content). Then try to maximize it.

you may then quit with

Sdl.quit ();;

sanette avatar Oct 22 '23 07:10 sanette

When I type this into utop, I don't see a window, and when I try to access it in the application bar at the bottom of the Mac, it freezes and then says "Application Not Responding".

vinnyh125 avatar Oct 22 '23 18:10 vinnyh125

oh yeah I forgot that mac os treats SDL windows in a weird way.

sanette avatar Oct 22 '23 20:10 sanette

Could you try this sample code from the Tsdl doc? https://erratique.ch/software/tsdl/doc/Tsdl/index.html#opengl_2

open Tsdl

let main () = match Sdl.init Sdl.Init.(video + events) with
| Error (`Msg e) -> Sdl.log "Init error: %s" e; exit 1
| Ok () ->
    match Sdl.create_window ~w:640 ~h:480 "SDL OpenGL" Sdl.Window.opengl with
    | Error (`Msg e) -> Sdl.log "Create window error: %s" e; exit 1
    | Ok w ->
        Sdl.pump_events ();
        Sdl.delay 3000l;
        Sdl.destroy_window w;
        Sdl.quit ();
        exit 0

let () = main ()

sanette avatar Oct 28 '23 11:10 sanette

Tried the following code, and the window is created, but when I click on it, it quits and disappears without printing anything in the terminal or anything

vinnyh125 avatar Oct 29 '23 00:10 vinnyh125

it quits after 3 sec, you may change to a longer time, for instance 10sec Sdl.delay 10000l; if you need it to test maximizing the window

sanette avatar Oct 29 '23 10:10 sanette