Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which windowing backend is recommended for docking branch? #4323

Closed
BreyerW opened this issue Jul 14, 2021 · 4 comments
Closed

Which windowing backend is recommended for docking branch? #4323

BreyerW opened this issue Jul 14, 2021 · 4 comments

Comments

@BreyerW
Copy link

BreyerW commented Jul 14, 2021

Tried looking for reasons why docking branch is not yet merged as i recall there was post from author(?) that explained bugs in windowing backend i think it was sdl2? Historically sdl2 never really cared for multi-windowing (and thus - real multi-viewporting since theres also virtual multi-viewporting) but that was few years ago and now i cant find it. Also im curious about CURRENT state of affair.

@PathogenDavid
Copy link
Contributor

If such a comment exists, it's probably buried in #2109. I'm not sure if there's any one thing keeping the docking branch from being merged though.

Each backend has a list of features it does/doesn't support, including multi-viewport features:

// Implemented features:
// [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
// [X] Platform: Clipboard support.
// [X] Platform: Keyboard arrays indexed using SDL_SCANCODE_* codes, e.g. ImGui::IsKeyPressed(SDL_SCANCODE_SPACE).
// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
// [X] Platform: Multi-viewport support (multiple windows). Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'.
// Missing features:
// [ ] Platform: SDL2 handling of IME under Windows appears to be broken and it explicitly disable the regular Windows IME. You can restore Windows IME by compiling SDL with SDL_DISABLE_WINDOWS_IME.
// [ ] Platform: Multi-viewport + Minimized windows seems to break mouse wheel events (at least under Windows).

It may be you're thinking of the last item on that list.

In my experience the docking branch has been very stable for quite some time, but I also don't generally use it with SDL. You can always disable multi-viewport by skipping ImGuiConfigFlags_ViewportsEnable and use docking alone if it becomes a problem.

@ocornut
Copy link
Owner

ocornut commented Jul 14, 2021

The Win32 backend implements most details better but both GLFW and SDL are good enough (the missing details may be things you won't notice but that won't be issues to you).

However for both GLFW and SDL some details are only implemented correctly for Win32 (not for Linux/OSX), as you can see at the bottom of the code. I don't think they are difficult changes to make but in two years and #2117 no single Linux/OSX user came up with fixes so assume it's not that bad.

SDL 2.0.5+ is generally recommended.

@BreyerW
Copy link
Author

BreyerW commented Jul 14, 2021

Oh i see thanks to both of you this mostly cleared my doubts. I was mainly worried about details like correct recognition of top-most window when they are stacked (some frameworks i had no-pleasure working with hidden this info from programmers making custom drag&drop a pain since that required using plat specific api) in addition to more broad support like multi-windowing/viewporting but we will see how it goes

@ocornut
Copy link
Owner

ocornut commented Jan 4, 2022

about details like correct recognition of top-most window when they are stacked (some frameworks i had no-pleasure working with hidden this info from programmers making custom drag&drop a pain since that required using plat specific api) in addition to more broad support like multi-windowing/viewporting but we will see how it goes

We still do have quite some problems with that indeed.

The Input part of it fixed/handled by the ImGuiBackendFlags_HasMouseHoveredViewport flag, which is only handled by Win32 and GLFW 3.3+ because providing the Hovered viewport needs to take account for pass-thru/transparent one for docking. Maybe we can find a way to handle it differently.

But not actually knowing depth properly causes other issues with merging of viewports and popup ordering, so this is not yet perfect and a still open issue in general.

(Closing as answered, the other stuff already have variety of open issues)

@ocornut ocornut closed this as completed Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants