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

Custom Window title bar height change affects dragging #7210

Open
Gellert5225 opened this issue Jan 8, 2024 · 5 comments
Open

Custom Window title bar height change affects dragging #7210

Gellert5225 opened this issue Jan 8, 2024 · 5 comments

Comments

@Gellert5225
Copy link

Gellert5225 commented Jan 8, 2024

Version/Branch of Dear ImGui:

Version 1.89.2, Branch: Docking

Back-ends:

imgui_impl_OpenGL.cpp

Compiler, OS:

Windows 10 + MSVC 2022

Full config/build information:

No response

Details:

My Issue/Question:

I made a custom window using ImGui::Begin(...), and I changed its title bar height using

ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(4.0f, 10.0f));
ImGui::Begin(...);
ImGui::PopStyleVar();

// UI inside the window

ImGui::End();

However, when I tried to drag the window around, the only drag-able area is very tiny, not spanning the entire height of the title bar.

As shown in the image, only area above that red line is drag-able. It's the same area as if I didn't change the frame padding.

What am I doing wrong here? Thanks.

Screenshots/Video:

Capture

@ocornut
Copy link
Owner

ocornut commented Jan 9, 2024

Thanks for reporting. I can confirm there is an issue, which only happens when io.ConfigWindowsMoveFromTitleBarOnly is enabled.

@ocornut
Copy link
Owner

ocornut commented Jan 9, 2024

I'm adding the 'docking' label to this issue because it pertain to another issue we have to make it easier to create widget that move windows with/without undocking. Right now the way the logic is performed (geometry testing every frame instead of maintaining a small bit of state) is causing both issues.

@Gellert5225
Copy link
Author

@ocornut Would you mind linking the issue/PR you mentioned above?

@ocornut
Copy link
Owner

ocornut commented Jan 9, 2024

I don't think there's a GitHub issue for it.

@xezon
Copy link

xezon commented Nov 8, 2024

I just wanted to add a comment here that I looked for making those bars a bit bigger and then found this report on web search, so would also appreciate if we can fix this :-)

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

3 participants