Update imgui to 1.92.6

This commit is contained in:
Guillaume Meunier committed 2026-08-17 20:43:56 +02:00
1 parent da950e0857
commit f5fd1ecb9e
5 files changed
+31 -28

No files matched your search

+2 -2
View File
@@ -251,8 +251,8 @@ FetchContent_Declare(libktx EXCLUDE_FROM_ALL SYSTEM URL https://github.co
FetchContent_Declare(implot EXCLUDE_FROM_ALL SYSTEM URL https://github.com/epezent/implot/archive/3da8bd34299965d3b0ab124df743fe3e076fa222.zip
URL_HASH SHA256=e9b439a94aa6f09fcf12ed9c2cd784efe5e99e96242122aa683e690b29f7a59f)
file(GLOB IMGUI_PATCHES CONFIGURE_DEPENDS patches/imgui/*)
FetchContent_Declare(imgui EXCLUDE_FROM_ALL SYSTEM URL https://github.com/ocornut/imgui/archive/refs/tags/v1.92.5.tar.gz
URL_HASH SHA256=0eb50fe9aeba1a51f96b5843c7f630a32ed2e9362d693c61b87e4fa870cf826d
FetchContent_Declare(imgui EXCLUDE_FROM_ALL SYSTEM URL https://github.com/ocornut/imgui/archive/refs/tags/v1.92.6.tar.gz
URL_HASH SHA256=5b17c01f69545bde732b14936d89ce0f508adb83e8b56fa82448371845172bc3
PATCH_COMMAND ${CMAKE_CURRENT_LIST_DIR}/patches/apply.sh ${IMGUI_PATCHES}
)
FetchContent_Declare(uni-algo EXCLUDE_FROM_ALL SYSTEM URL https://github.com/uni-algo/uni-algo/archive/v1.2.0.tar.gz
+2 -2
View File
@@ -536,8 +536,8 @@ void imgui_context::initialize_fonts()
}
}
utils::mapped_file font_awesome_regular("assets://Font Awesome 6 Free-Regular-400.otf");
utils::mapped_file font_awesome_solid("assets://Font Awesome 6 Free-Solid-900.otf");
font_awesome_regular = utils::mapped_file("assets://Font Awesome 6 Free-Regular-400.otf");
font_awesome_solid = utils::mapped_file("assets://Font Awesome 6 Free-Solid-900.otf");
ImFontConfig config;
config.FontDataOwnedByAtlas = false;
+3
View File
@@ -21,6 +21,7 @@
#include "image_loader.h"
#include "render/growable_descriptor_pool.h"
#include "utils/cache.h"
#include "utils/mapped_file.h"
#include "utils/thread_safe.h"
#include "wivrn_config.h"
#include "xr/hand_tracker.h"
@@ -203,6 +204,8 @@ private:
bool show_demo_window = true;
#endif
utils::mapped_file font_awesome_regular;
utils::mapped_file font_awesome_solid;
void initialize_fonts();
std::vector<controller_state> read_controllers_state(XrTime display_time);
@@ -1,4 +1,4 @@
From bf64125b461a33d9e67e9b6f3da2f0e0726cfb03 Mon Sep 17 00:00:00 2001
From 818da9ceb2ec8e59f7ff600de4255bd237165146 Mon Sep 17 00:00:00 2001
From: Guillaume Meunier <[email protected]>
Date: Wed, 16 Oct 2024 20:51:52 +0200
Subject: [PATCH 1/2] Change ImGui::ButtonBehavior default flags when using
@@ -12,23 +12,23 @@ Subject: [PATCH 1/2] Change ImGui::ButtonBehavior default flags when using
4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/imgui.cpp b/imgui.cpp
index 99819ffe..c1a16c42 100644
index 93cff908c..6a914bc3c 100644
--- a/imgui.cpp
+++ b/imgui.cpp
@@ -10140,7 +10140,7 @@ static const char* GetInputSourceName(ImGuiInputSource source)
@@ -10351,7 +10351,7 @@ static const char* GetInputSourceName(ImGuiInputSource source)
}
static const char* GetMouseSourceName(ImGuiMouseSource source)
{
- const char* mouse_source_names[] = { "Mouse", "TouchScreen", "Pen" };
+ const char* mouse_source_names[] = { "Mouse", "TouchScreen", "Pen", "VRHandTracking", "VRController" };
IM_ASSERT(IM_ARRAYSIZE(mouse_source_names) == ImGuiMouseSource_COUNT && source >= 0 && source < ImGuiMouseSource_COUNT);
return mouse_source_names[source];
}
IM_ASSERT(IM_COUNTOF(mouse_source_names) == ImGuiMouseSource_COUNT);
if (source < 0 || source >= ImGuiMouseSource_COUNT)
return "Unknown";
diff --git a/imgui.h b/imgui.h
index a2b2a1fa..64d5f758 100644
index e3edac89c..af1cb686d 100644
--- a/imgui.h
+++ b/imgui.h
@@ -1935,6 +1935,8 @@ enum ImGuiMouseSource : int
@@ -1979,6 +1979,8 @@ enum ImGuiMouseSource : int
ImGuiMouseSource_Mouse = 0, // Input is coming from an actual mouse.
ImGuiMouseSource_TouchScreen, // Input is coming from a touch screen (no hovering prior to initial press, less precise initial press aiming, dual-axis wheeling possible).
ImGuiMouseSource_Pen, // Input is coming from a pressure/magnetic pen (often used in conjunction with high-sampling rates).
@@ -38,12 +38,12 @@ index a2b2a1fa..64d5f758 100644
};
diff --git a/imgui_demo.cpp b/imgui_demo.cpp
index 991676f7..b360e69e 100644
index c0c4de946..d570f1f74 100644
--- a/imgui_demo.cpp
+++ b/imgui_demo.cpp
@@ -7768,6 +7768,11 @@ static void DemoWindowInputs()
@@ -7838,6 +7838,11 @@ static void DemoWindowInputs()
ImGui::Text("Mouse clicked count:");
for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (io.MouseClickedCount[i] > 0) { ImGui::SameLine(); ImGui::Text("b%d: %d", i, io.MouseClickedCount[i]); }
for (int i = 0; i < IM_COUNTOF(io.MouseDown); i++) if (io.MouseClickedCount[i] > 0) { ImGui::SameLine(); ImGui::Text("b%d: %d", i, io.MouseClickedCount[i]); }
+ const char* mouse_source_names[] = { "Mouse", "TouchScreen", "Pen", "VRHandTracking", "VRController" };
+ IM_ASSERT(IM_ARRAYSIZE(mouse_source_names) == ImGuiMouseSource_COUNT && io.MouseSource >= 0 && io.MouseSource < ImGuiMouseSource_COUNT);
@@ -54,7 +54,7 @@ index 991676f7..b360e69e 100644
// displaying the data for old/new backends.
// User code should never have to go through such hoops!
diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp
index a0c4f14f..11709bd1 100644
index 23a75aa8c..f5a0e52d5 100644
--- a/imgui_widgets.cpp
+++ b/imgui_widgets.cpp
@@ -557,7 +557,12 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
@@ -72,5 +72,5 @@ index a0c4f14f..11709bd1 100644
ImGuiWindow* backup_hovered_window = g.HoveredWindow;
const bool flatten_hovered_children = (flags & ImGuiButtonFlags_FlattenChildren) && g.HoveredWindow && g.HoveredWindow->RootWindow == window->RootWindow;
--
2.50.0
2.55.0
@@ -1,4 +1,4 @@
From cdb8a40a9363019e33ecf9428cc2e1c6319aea1f Mon Sep 17 00:00:00 2001
From a5e267b54a8724f69bcebe23e669edfee63121e3 Mon Sep 17 00:00:00 2001
From: Guillaume Meunier <[email protected]>
Date: Tue, 22 Oct 2024 15:09:14 +0200
Subject: [PATCH 2/2] Add ImGuiWindowFlags_NoFocusOnClick flag
@@ -9,31 +9,31 @@ Subject: [PATCH 2/2] Add ImGuiWindowFlags_NoFocusOnClick flag
2 files changed, 4 insertions(+)
diff --git a/imgui.cpp b/imgui.cpp
index c1a16c42..115371b2 100644
index 6a914bc3c..a5d45bc63 100644
--- a/imgui.cpp
+++ b/imgui.cpp
@@ -5134,6 +5134,9 @@ void ImGui::UpdateMouseMovingWindowEndFrame()
@@ -5285,6 +5285,9 @@ void ImGui::UpdateMouseMovingWindowEndFrame()
// Handle the edge case of a popup being closed while clicking in its empty space.
// If we try to focus it, FocusWindow() > ClosePopupsOverWindow() will accidentally close any parent popups because they are not linked together any more.
ImGuiWindow* root_window = g.HoveredWindow ? g.HoveredWindow->RootWindow : NULL;
+ if (root_window && (root_window->Flags & ImGuiWindowFlags_NoFocusOnClick))
ImGuiWindow* hovered_root = hovered_window ? hovered_window->RootWindow : NULL;
+ if (hovered_root && (hovered_root->Flags & ImGuiWindowFlags_NoFocusOnClick))
+ return;
+
const bool is_closed_popup = root_window && (root_window->Flags & ImGuiWindowFlags_Popup) && !IsPopupOpen(root_window->PopupId, ImGuiPopupFlags_AnyPopupLevel);
const bool is_closed_popup = hovered_root && (hovered_root->Flags & ImGuiWindowFlags_Popup) && !IsPopupOpen(hovered_root->PopupId, ImGuiPopupFlags_AnyPopupLevel);
if (root_window != NULL && !is_closed_popup)
if (hovered_window != NULL && !is_closed_popup)
diff --git a/imgui.h b/imgui.h
index 64d5f758..cff44a55 100644
index af1cb686d..cfaaec47b 100644
--- a/imgui.h
+++ b/imgui.h
@@ -1161,6 +1161,7 @@ enum ImGuiWindowFlags_
@@ -1182,6 +1182,7 @@ enum ImGuiWindowFlags_
ImGuiWindowFlags_NoNavInputs = 1 << 16, // No keyboard/gamepad navigation within the window
ImGuiWindowFlags_NoNavFocus = 1 << 17, // No focusing toward this window with keyboard/gamepad navigation (e.g. skipped by CTRL+TAB)
ImGuiWindowFlags_NoNavFocus = 1 << 17, // No focusing toward this window with keyboard/gamepad navigation (e.g. skipped by Ctrl+Tab)
ImGuiWindowFlags_UnsavedDocument = 1 << 18, // Display a dot next to the title. When used in a tab/docking context, tab is selected when clicking the X + closure is not assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar.
+ ImGuiWindowFlags_NoFocusOnClick = 1 << 19, // Disable taking focus when clicked
ImGuiWindowFlags_NoNav = ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus,
ImGuiWindowFlags_NoDecoration = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapse,
ImGuiWindowFlags_NoInputs = ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus,
--
2.50.0
2.55.0