ocornut / imgui

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

ImGUI isn't focusing on window/processing mouse clicks #1999

Closed moofMonkey closed 6 years ago

moofMonkey commented 6 years ago

Version/Branch of Dear ImGui: tested both 1.62 and 1.63 WIP

Back-ends: imgui_impl_win32.cpp + imgui_impl_dx9.cpp OS: Windows 10 Pro 17134 Compiler: MSVS + VS Community 2017

My Issue/Question: ImGUI isn't focusing on window/processing mouse clicks

After updating ImGUI from 1.61 to 1.62 I've changed this code:

- extern IMGUI_API LRESULT   ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
+ extern LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
...
    ImGui_ImplWin32_WndProcHandler(window, message_type, wParam, l_param);
    if(ImGuiWantsControl(message_type))
        return 0;
...
    ImGui_ImplDX9_NewFrame(); 
+   ImGui_ImplWin32_NewFrame(); 
+   ImGui::NewFrame(); 
+ 
    DrawGUI(); 
+
+   ImGui::EndFrame(); 
    ImGui::Render(); 
    ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData()); 
...
-   ImGui_ImplDX9_Init(game_hwnd, thisptr); 
+   ImGui_ImplWin32_Init(game_hwnd); 
+   ImGui_ImplDX9_Init(thisptr); 

And... it's not working.

UPD: after showing GUI window is active, but after 1 click (no matter where) is unfocuses

ocornut commented 6 years ago

Sorry but #1586