Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiView: Mouse Cursor Position Shifting in PopupModal #6904

Closed
DKingAlpha opened this issue Oct 5, 2023 · 1 comment
Closed

MultiView: Mouse Cursor Position Shifting in PopupModal #6904

DKingAlpha opened this issue Oct 5, 2023 · 1 comment

Comments

@DKingAlpha
Copy link
Contributor

Version/Branch of Dear ImGui:

Version: latest
Branch: docking (viewport)

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp
Operating System: Arch Linux, KDE Plasma + X11 session
Screen Height: 1440

My Issue/Question:

In multiview mode, if a PopupModal's whole content height exceed screen height, the modal will occupy all the screen height and apply scrollbar inside. However, in some occasions the PopupModal status in imgui.ini looks like this

[Window][Viewport PopupModal]
ViewportPos=1482,-143
ViewportId=0x9319ECC9
Size=238,1434     # screen height minus some padding I guess
Collapsed=0

This will make imgui's virtual cursor looks like shifting 143 pixels from actual mouse position.

Values of ViewportPos looks random to me. It's likely to happen when I try to drag the PopupModal title around.

Screenshots/Video
Screenshot_20231006_051108

Code to reproduce:

    // set next window size if necessary

    if (ImGui::Begin("CheatNG", &main_window_open)) {
        // test viewport popup
        {
            bool viewport_popupmodal_open = true;
            if (ImGui::BeginPopupModal("Viewport Popup"_x, &viewport_popupmodal_open)) {
                for (int i=0; i<100; i++) {
                    ImGui::Selectable("Hello from Viewport Popup");
                }
                ImGui::EndPopup();
            }
            if (ImGui::Button("Open Test Popup")) {
                ImGui::OpenPopup("Viewport Popup");
            }
        }
    }
    ImGui::End();
@ocornut
Copy link
Owner

ocornut commented Oct 6, 2023

This seems unrelated to modals and the same as #2117, WM not honoring a requested position (negative = starts above monitor bounds, which some WM not authorize) which throws off dear imgui off. It thinks the windows is at -143 when it has been moved to 0 by the WM.

It’s documentsd in that thread but since no Linux users are interested in spending the time to thoroughly investigate what it takes to fix this, its been unfixed for years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants