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

SDL3 backend: Undeclared identifier 'focused_window' on Android/iOS/Emscripten #6391

Closed
jo-codegirl opened this issue May 2, 2023 · 1 comment
Labels

Comments

@jo-codegirl
Copy link

jo-codegirl commented May 2, 2023

Version/Branch of Dear ImGui:

Version: 1.89.6 WIP
Branch: master (7c291ba)

Back-end

Back-ends: imgui_impl_sdl3.cpp
Compiler: Android Studio Dolphin, SDK 32
Operating System: Ventura 13.3.1

My Issue/Question:

When building in Android, SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE is set to 0. Later, in ImGui_ImplSDL3_UpdateMouseData, code is defined by this flag. A variable is not initialized in the #else so there is a build error when it is used:

/imgui/backends/imgui_impl_sdl3.cpp:460:35: error: use of undeclared identifier 'focused_window'

Also, see #6386 (comment)

Screenshots/Video

Screenshot 2023-05-02 at 6 11 51 AM

Standalone, minimal, complete and verifiable example:

// I got it to compile in my local repo by setting focused_window to bd->window, is this desired initialization in this case?
SDL_Window* focused_window = bd->Window;
@ocornut
Copy link
Owner

ocornut commented May 4, 2023

Apologies, this was an overlook in this specific SDL3 backend condition. Pushed your fix as 5dc6013. Thank you!

@ocornut ocornut closed this as completed May 4, 2023
@ocornut ocornut changed the title Undeclared identifier 'focused_window' SDL3 backend: Undeclared identifier 'focused_window' on Android/iOS/Emscripten May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants