Skip to content

[Bug]: Lime 8.3.2, setting fullscreen true on static scenes often results in a black screen until invalidated / re-drawn. #2083

Description

@twilson90

Preflight Checklist

  • I searched existing open and closed issues for duplicates.
  • I tested the latest stable Lime release or the current development branch where possible.
  • I reduced this to the smallest project or code sample that still reproduces the issue.
  • This issue describes one specific behavior, not several unrelated observations.

Problem Description

When I run an app with very little re-drawing and just static display, when I toggle fullscreen to true, there's a chance I see nothing but black, until I do something to prompt a re-draw.
Usually if I just start the app and immediately press alt+enter then I get a black screen first.

A quick and dirty fix is to simply call invalidate() on a DisplayObject on the stage after setting fullscreen=true, which prompts a re-draw.
This feels like a buffer swap/present isn't happening after the fullscreen is toggled.

It is somewhat predictable but not 100%
Usually, if it's presenting black in fullscreen, then I manually trigger a re-draw, then every subsequent fullscreen toggle presents correctly. It does seem to eventually go back to black if I keep toggling though and no further manual re-draws are issued by me.

  • fullscreen=true (black)
  • move a display object to trigger re-draw (displays correctly)
  • fullscreen=false
  • fullscreen=true (displays correctly)

Very easy to re-produce in latest Lime release, but much less predictable in dev branch.
I have managed to get it to happen in dev branch so it's still a problem, occurs much less frequently though.

I've attached a log from the sample that shows the sequence of events in a test I conducted but it's not very illustrative of the issue.

Version Information

Lime version: 8.3.2
OpenFL version, if applicable: 9.5.2
Haxe version: 4.3.7
Target/runtime: Hashlink, Windows

Environment

OS: Windows 11
Architecture: x64
GPU/driver, if relevant: Nvidia RTX 2060
Display refresh rate, if relevant: 60

Minimal Reproduction

https://github.com/twilson90/HelloWorld2

Logs and Output

INIT
platformName, Windows
platformVersion, 10.0.26200
Lime, 8.3.2
OpenFl, 9.5.2
-----@477ms-----
[Root invalidated]
-----@477ms-----
maximized, false
size, 800 x 600
position, 560 240
fullscreen, false
-----@2719ms-----
[fullscreen toggled]
-----@2722ms-----
size, 1920 x 1080
position, 0 0
fullscreen, true
[it's all gone black]
-----@4564ms-----
[Root invalidated]
[I can see again now]
-----@6809ms-----
[fullscreen toggled]
-----@6836ms-----
position, 560 240
fullscreen, false
-----@6836ms-----
size, 800 x 600
-----@9001ms-----
position, 2449 235
-----@24881ms-----
[Root invalidated]
-----@26309ms-----
[fullscreen toggled]
-----@26313ms-----
size, 1920 x 1080
position, 1920 0
fullscreen, true
[it's all gone black]
-----@28508ms-----
[fullscreen toggled]
-----@28517ms-----
position, 2449 235
fullscreen, false
-----@28517ms-----
size, 800 x 600
[I can see again now]
-----@29889ms-----
[fullscreen toggled]
-----@29893ms-----
size, 1920 x 1080
position, 1920 0
fullscreen, true
-----@31186ms-----
[Root invalidated]
-----@32237ms-----
[fullscreen toggled]
-----@32246ms-----
position, 2449 235
fullscreen, false
-----@32246ms-----
size, 800 x 600
-----@34317ms-----
position, 2374 239
-----@34930ms-----
size, 1920 x 1009
position, 1920 23
-----@34930ms-----
maximized, true
-----@35875ms-----
[fullscreen toggled]
-----@35880ms-----
size, 1920 x 1080
position, 1920 0
fullscreen, true
-----@35880ms-----
fullscreen, false
[it's all gone black]
-----@38743ms-----
[fullscreen toggled]
-----@38743ms-----
fullscreen, true
[I can see again now]
-----@40539ms-----
[fullscreen toggled]
-----@40548ms-----
position, 1920 23
fullscreen, false
-----@40548ms-----
size, 1920 x 1009
-----@41525ms-----
[fullscreen toggled]
-----@41529ms-----
size, 1920 x 1080
position, 1920 0
fullscreen, true
-----@41529ms-----
fullscreen, false
-----@42234ms-----
[fullscreen toggled]
-----@42243ms-----
fullscreen, true
[it's all gone black]
-----@44964ms-----
[fullscreen toggled]
-----@44971ms-----
size, 1920 x 1009
position, 1920 23
fullscreen, false
[I can see again now]
-----@47864ms-----
size, 800 x 600
position, 2374 239
-----@48748ms-----
[fullscreen toggled]
-----@48751ms-----
size, 1920 x 1080
position, 1920 0
fullscreen, true
[it's all gone black]
-----@50291ms-----
[fullscreen toggled]
-----@50300ms-----
size, 800 x 600
position, 2374 239
fullscreen, false
[I can see again now]
-----@51632ms-----
[fullscreen toggled]
-----@51636ms-----
size, 1920 x 1080
position, 1920 0
fullscreen, true
[it's all gone black]
-----@53668ms-----
[Root invalidated]
[I can see again now]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions