Immediate-Mode-UI / Nuklear

A single-header ANSI C immediate mode cross-platform GUI library
https://immediate-mode-ui.github.io/Nuklear/doc/index.html
Other
9.08k stars 542 forks source link

Overlapped windows or controls are processed. #250

Open MadBit010 opened 3 years ago

MadBit010 commented 3 years ago

First of all, thank you for this great library.

Now to the issue. ~~When two controls overlap, e.g. an expanded combobox overlaps other controls with its panel. Now I select an element from the ComboBox. By clicking, the underlying control automatically receives the focus and is processed accordingly. A button is clicked unintentionally. A checkbox is activated/deactivated.~~ The same happens when two windows overlap and the Close button of both windows are on top of each other. If I press the Close button there, both windows may be closed. Depending on which window is processed first.

Is there a solution for this?

MadBit010 commented 3 years ago

Sorry, the ComboBox is not quite right. The control underneath was my own. So I must have done something wrong.

But the issue with the overlapping windows remains!

veyh commented 2 years ago

Hey, I also ran into a similar problem. You should be able to fix by making buttons trigger on mouse up instead of mouse down.

#define NK_BUTTON_TRIGGER_ON_RELEASE