Skip to content

BUG: Mouse pos being updated when other widget has focus #52

@dimateos

Description

@dimateos

Describe the bug

Currently the imgui mouse pos is updated whenever the widget window/window is active. But in the case of widgets windows it also makes sense to check the focus. Otherwise a mouse over the area can trigger hovering effects in imgui when the user is interacting with other QT widgets.

viewer_WzmmTVZ1Y9

//... ImGuiRenderer.cpp
if (m_window->isActive()) // + also check focus in case of widget
{
    const QPoint pos = m_window->mapFromGlobal(QCursor::pos());
    io.MousePos = ImVec2(pos.x(), pos.y());
}
else
{
    io.MousePos = ImVec2(-1,-1);
}

To Reproduce
Have any widget like a combo box that expands over the widgets area when interacted.

Expected behavior
Imgui mouse pos should not be updated when the widget has no focus other widget has focus to avoid hovering triggers.

viewer_mlYkJNG894

Desktop (please complete the following information):

  • OS: Win10. Note that I am using imgui 1.89.2.WIP with docking plus some fixes for the keyboard, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions