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

SDL backend does not work with SDL_VIDEODRIVER=wayland #2800

Closed
NeroBurner opened this issue Sep 23, 2019 · 4 comments
Closed

SDL backend does not work with SDL_VIDEODRIVER=wayland #2800

NeroBurner opened this issue Sep 23, 2019 · 4 comments

Comments

@NeroBurner
Copy link
Contributor

Version/Branch of Dear ImGui:

Version: 1.73 WIP
Branch: example_add_glad_files (master + glad OpenGL 3.3 Core)

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_sdl.cpp + imgui_impl_opengl3.cpp (as well as opengl2, and vulkan)
OpenGL backends tested with gl3w and glad loaders
Compiler: g++ (GCC) 9.1.0 as well as clang version 8.0.1
Operating System: Arch Linux

My Issue:
when starting an example_sdl_XXX with the SDL_VIDEODRIVER=wayland environment variable on wayland the window loads fine, but the elements can't be interacted with

Screenshots/Video

first run with ./example_sdl_vulkan shows the xwayland symbol in the title-bar (top left corner). And it it fully functionable
Screenshot_20190923_233025

second run with SDL_VIDEODRIVER=wayland ./example_sdl_vulkan shows wayland symbol, but is not actionable
Screenshot_20190923_232937

Standalone, minimal, complete and verifiable example:

  • On wayland compile example_sdl_(opengl3, opengl2 or vulkan)
  • let example run with SDL_VIDEODRIVER=wayland environment variable SDL_VIDEODRIVER=wayland ./example_sdl_opengl3
  • see that the UI cannot be interacted with
@ocornut
Copy link
Owner

ocornut commented Sep 24, 2019

Hello,
Thanks for the headup,
Could you look into it to try to understand the issue? I am probably never going to look into it myself.

@NeroBurner
Copy link
Contributor Author

found the issue: SDL_GetGlobalMouseState does not work with the wayland backend. Most probably a security measure for programs to not grab everything the user does
https://wiki.libsdl.org/SDL_GetGlobalMouseState

using SDL_GetMouseState https://wiki.libsdl.org/SDL_GetMouseState works

I'll send a PR

@ocornut ocornut added the inputs label Sep 24, 2019
@ocornut
Copy link
Owner

ocornut commented Sep 24, 2019

Thanks! Will also aim to rework some of that logic (perhaps for #2696) so may change later.
You may just add an additional defined(xxx) test in that block in the meanwhile!

@ocornut
Copy link
Owner

ocornut commented Dec 17, 2019

Merged #2802, thank you @NeroBurner !

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

Successfully merging a pull request may close this issue.

2 participants