How to only move window from title bar

I have a window, that I want to block the ImGui window move by clicking and dragging in the content area, but still allow the window to be moved by clicking and dragging the title bar. The ImGuiWindowFlags_NoMove flag blocks all moves even from the title bar.

Is there a way around this or can a new flag be added to allow this mode?


There’s literally a configuration flag called io.ConfigWindowsMoveFromTitleBarOnly.

Sorry, I searched all over thru the code and missed that. Hopefully this topic will at least save someone else the trouble.

No problem!
Also generally try to search on the github, if I search for How to only move window from title bar here one of the topic that appears is Add flag to prevent window move unless dragging title bar which describe this flag.

I’ve used this workaround a couple of times (as I have a bunch of images which I like the whole window move feature on), no issues found so far:

ImGui::BeginChild(..., ImGuiWindowFlags_NoMove);

First post here, which has to include a tremendous high five for a next to perfect gui framework. It has brought many ideas to live - currently using it in a handful of projects. Pushing it in my network as often as I can.