pthom / hello_imgui

Hello, Dear ImGui: unleash your creativity in app development and prototyping
https://pthom.github.io/hello_imgui
MIT License
676 stars 103 forks source link

Drag/move window without decorations? #38

Closed awaowouwu closed 1 year ago

awaowouwu commented 1 year ago

Hello, is it possible to make "backend window" of GLFW draggable for example by grabbing the top "menu bar"? I'd like to replace OS window decorations with my own, but then I think there's no way to drag the window around. I don't use fullscreen or docking, I'd just like to render one small window with it.

pthom commented 1 year ago

Hello,

See configWindowsMoveFromTitleBarOnly in ImGui window params

If false, windows can be dragged from anywhere

pthom commented 1 year ago

Hello,

See configWindowsMoveFromTitleBarOnly in ImGui window params

If false, windows can be dragged from anywhere

Sorry, this works only for inner ImGui windows, not for the main app window.

pthom commented 1 year ago

don't use fullscreen or docking, I'd just like to render one small window with it.

In that case, I don't think of an immediate solution. You may handle this by yourself for example by calling

    auto pos = ImGui::GetMousePos();
    if (pos somewhere near the menu bar)
       if (ImGui::IsMouseDragging(0))
          move the backend window