Skip to content

Commit a6e5635

Browse files
ocornutbojosos
authored andcommitted
Backends: Win32, SDL, GLFW: only honor io.WantSetMousePos when focused + fix GLFW uninstalling handler + tweaks to reduce branch drift with docking. (ocornut#787, ocornut#2445, ocornut#2696, ocornut#3751, ocornut#4377)
# Conflicts: # backends/imgui_impl_glfw.cpp # backends/imgui_impl_sdl.cpp # backends/imgui_impl_win32.cpp
1 parent 134bf8a commit a6e5635

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

backends/imgui_impl_vulkan.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ IMGUI_IMPL_API void ImGui_ImplVulkan_TransitionLayouts(Crowny::VulkanCmdB
9090
#endif
9191
IMGUI_IMPL_API ImTextureID ImGui_ImplVulkan_AddTexture(VkSampler sampler, VkImageView imageView, VkImageLayout imageLayout, Crowny::VulkanImage* image = nullptr);
9292

93+
#ifdef CW
94+
IMGUI_IMPL_API ImTextureID ImGui_ImplVulkan_AddTexture(const Crowny::Ref<Crowny::Texture>& texture);
95+
IMGUI_IMPL_API void ImGui_ImplVulkan_ClearTextures();
96+
#include "Platform/Vulkan/VulkanCommandBuffer.h"
97+
IMGUI_IMPL_API void ImGui_ImplVulkan_TransitionLayouts(Crowny::VulkanCmdBuffer* cmdBuffer);
98+
#endif
99+
IMGUI_IMPL_API ImTextureID ImGui_ImplVulkan_AddTexture(VkSampler sampler, VkImageView imageView, VkImageLayout imageLayout, Crowny::VulkanImage* image = nullptr);
100+
93101
// Optional: load Vulkan functions with a custom function loader
94102
// This is only useful with IMGUI_IMPL_VULKAN_NO_PROTOTYPES / VK_NO_PROTOTYPES
95103
IMGUI_IMPL_API bool ImGui_ImplVulkan_LoadFunctions(PFN_vkVoidFunction(*loader_func)(const char* function_name, void* user_data), void* user_data = NULL);

imgui_widgets.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4213,6 +4213,37 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
42134213
state->OnKeyPressed(STB_TEXTEDIT_K_WORDLEFT);
42144214
state->OnKeyPressed(STB_TEXTEDIT_K_WORDRIGHT | STB_TEXTEDIT_K_SHIFT);
42154215
}
4216+
else if (hovered && io.MouseClickedCount[0] >= 2 && !io.KeyShift)
4217+
{
4218+
stb_textedit_click(state, &state->Stb, mouse_x, mouse_y);
4219+
const int multiclick_count = (io.MouseClickedCount[0] - 2);
4220+
if ((multiclick_count % 2) == 0)
4221+
{
4222+
int ext_len = 0;
4223+
for (int i = state->CurLenW - 1; i >= 0; i--)
4224+
{
4225+
ext_len++;
4226+
if (state->TextW[i] == '.')
4227+
break;
4228+
}
4229+
if (ext_len == state->CurLenW) // no . char in string.
4230+
ext_len = 0;
4231+
state->Select(0, ext_len);
4232+
state->SelectedAllMouseLock = true;
4233+
}
4234+
else
4235+
{
4236+
state->SelectAll();
4237+
state->SelectedAllMouseLock = true;
4238+
}
4239+
}
4240+
else if (hovered && is_osx && io.MouseDoubleClicked[0])
4241+
{
4242+
// Double-click select a word only, OS X style (by simulating keystrokes)
4243+
// Maybe worth doing this on all platforms? Shouldn't this be default behaviour?
4244+
state->OnKeyPressed(STB_TEXTEDIT_K_WORDLEFT);
4245+
state->OnKeyPressed(STB_TEXTEDIT_K_WORDRIGHT | STB_TEXTEDIT_K_SHIFT);
4246+
}
42164247
else if (io.MouseClicked[0] && !state->SelectedAllMouseLock)
42174248
{
42184249
if (hovered)

0 commit comments

Comments
 (0)