mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-14 19:04:44 +00:00
Windows examples always set ARROW cursor when not drawn by ImGui #585
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#585
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In the example code windows backends, e.g. ImGui_ImplDX11_NewFrame(), always setting the cursor to IDC_ARROW if not ImGui-drawn prevents display of non-ARROW cursors (such as when resizing the ImGui window).
Thanks. Do you know what a solution would be?
have a way of deciding which cursor to draw (like the resize arrow in the 4 orientations)
Though that information is only available after
Render()Here's my current workaround, I just use GetCursor() instead of LoadCursor() so when OS changes the cursor we then set it to the same one:
I'm not sure it's the best fix, but this seems to mostly work fine. It's not perfect when switching back-and-forth between ImGui-drawn and OS-drawn cursor, but that case is a bit flaky anyway with the cursor not being redrawn until it's moved.
Wouldn't SetCursor(GetCursor()) be equivalent to not doing anything?
Yeah, probably :)
if (io.MouseDrawCursor) SetCursor(NULL); seems to work just as well.
It's a bit tricky to find a satisfying generic solution, it should really be an application-side thing.
For know I have switched to just using
As both you and the PR in #909 suggested. It works because some mouse-related Windows message appears to set the mouse cursor on every movement, but it is a little dodgy. It would be a little less dodgy to move that block to the main.cpp file but I don't think it is harmful in the current spot (and certainly less than it was previously).