Jetpack 4.3 eglInitialize occasionally hangs thread in a new Weston Wayland window

I just got back to work on this issue. At this point I have recreated the issue with weston where hotplugging the monitor shifts the window off-screen.

Steps to re-create:

  1. Launch weston (steps can be found in the development guide)

  2. Launch the gearscube sample application
    cd /usr/src/nvidia/graphics_demos/prebuilts/bin/wayland
    ./gearscube -windowsize 1920 1080

  3. Turn off the display

  4. Turn on the display ( this triggers the hot plug event )

Sometimes this crashes the gearscube sample application. This may be related to weston itself crashing. We have weston running as a systemd service so it always comes back up. You can repeat turning the monitor off then on until the application does not crash, then you will see the shifted window.

Window before turning display off then on:

Window after turning display off then on:

Note that we have customized the weston desktop to be all black. If we had a background image you would see it in the second picture. I will now try to re-create the issue where eglInitialize() appears to hang the thread.