ocornut / imgui

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
MIT License
59.7k stars 10.17k forks source link

TabItem requires two clicks to select #6318

Closed ZhouMin216 closed 1 year ago

ZhouMin216 commented 1 year ago

Version/Branch of Dear ImGui:

Version: 1.89.3 WIP Branch: master

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_android.h imgui_impl_opengl3.h Operating System: Android

My Issue/Question:

Hi all, When I use BeginTabItem on the Windows system, it is selected by clicking once. When using it on the Android system, I must click twice, or first click on another location, and then click TabItem to be selected. It seems that there are no different behaviors set for different systems in the source code. What do I need to do to select TabItem with just one click on the Android platform? Thanks for any help.

Video: https://user-images.githubusercontent.com/47287700/231030790-1a42001f-ef08-4f2c-9f69-2d92f749844e.mp4

          if (ImGui::BeginTabBar("MyTabBar", tab_bar_flags))
          {
              for (int n = 0; n < IM_ARRAYSIZE(opened); n++)
                  if (opened[n] && ImGui::BeginTabItem(names[n], &opened[n], ImGuiTabItemFlags_None))
                  {
                      ImGui::Text("This is the %s tab!", names[n]);
                      if (n & 1)
                          ImGui::Text("I am an odd tab.");
                      ImGui::EndTabItem();
                  }
              ImGui::EndTabBar();
          }
ocornut commented 1 year ago

Hello, Coincidentally, even thought this has been a problem with touch device for years this was JUST fixed with c9fe7ebc + for Android db4c4e33. If you update to latest master it should work.

ZhouMin216 commented 1 year ago

Hello, Coincidentally, even thought this has been a problem with touch device for years this was JUST fixed with c9fe7eb + for Android db4c4e3. If you update to latest master it should work. Thank you for your reply! I'll give it a try

ZhouMin216 commented 1 year ago

@ocornut I have updated to the latest master and this issue has been well resolved. Thank you very much.