Skip to content

createWindow with visible=false does not create a hidden window #1081

@Ragnar-H

Description

@Ragnar-H
  • Operating System: macos v11.4
  • Revery Version: Reproduced in revery repo examples at 79c2572
  • OCaml version: 4.12.0
  • Native, Bytecode, or JS build: Development build
  • Minimal repro

I'm happy to create a dedicated repo for this if that's needed. This can be reproduced in the Examples in this repo which seemed easiest :)

diff --git a/examples/Examples.re b/examples/Examples.re
index f0d567a2..b942e896 100644
--- a/examples/Examples.re
+++ b/examples/Examples.re
@@ -347,6 +347,7 @@ let init = app => {
     App.createWindow(
       ~createOptions=
         WindowCreateOptions.create(
+          ~visible=false,
           ~width=windowWidth,
           ~height=windowHeight,
           ~maximized,
  • Steps to reproduce:
  1. Pass in visible=false into the Examples in this repo - see git diff in above section
  2. esy @examples run
  • Actual Result:

App window is shown and focused

  • Expected Result:

App window is hidden

  • Additional Information:

In Window.create we've got a guard for calling .show() on Sdl2 window however we probably want to pass in SDL_WINDOW_HIDDEN to the Sdl2.Window.create. I suspect Sdl2 has the sane default of windows being visible.

  • Search terms used:

visible, createWindow

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