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

Easier identification of ImGui windows on X11 #8289

Open
Ikos3k opened this issue Jan 3, 2025 · 1 comment
Open

Easier identification of ImGui windows on X11 #8289

Ikos3k opened this issue Jan 3, 2025 · 1 comment

Comments

@Ikos3k
Copy link

Ikos3k commented Jan 3, 2025

Version/Branch of Dear ImGui:

Version 1.91.7 WIP, Branch: docking

Back-ends:

imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp

Compiler, OS:

Linux i3wm (x11)

Full config/build information:

Dear ImGui 1.91.7 WIP (19163)
--------------------------------
sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20
define: __cplusplus=201703
define: __linux__
define: __GNUC__=14
define: IMGUI_HAS_VIEWPORT
define: IMGUI_HAS_DOCK
--------------------------------
io.BackendPlatformName: imgui_impl_glfw
io.BackendRendererName: imgui_impl_opengl3
io.ConfigFlags: 0x00000480
 DockingEnable
 ViewportsEnable
io.ConfigViewportsNoDecoration
io.ConfigNavCaptureKeyboard
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.ConfigMemoryCompactTimer = 60.0
io.BackendFlags: 0x00001C0E
 HasMouseCursors
 HasSetMousePos
 PlatformHasViewports
 HasMouseHoveredViewport
 RendererHasVtxOffset
 RendererHasViewports
--------------------------------
io.Fonts: 1 fonts, Flags: 0x00000000, TexSize: 512,128
io.DisplaySize: 800.00,600.00
io.DisplayFramebufferScale: 1.00,1.00
--------------------------------
style.WindowPadding: 8.00,8.00
style.WindowBorderSize: 1.00
style.FramePadding: 4.00,3.00
style.FrameRounding: 0.00
style.FrameBorderSize: 0.00
style.ItemSpacing: 8.00,4.00
style.ItemInnerSpacing: 4.00,4.00

Details:

My Issue:
Managing ImGui windows under i3wm (or other tiling window managers) is problematic because all ImGui windows either lack sufficient unique identifiers or share a generic WM_CLASS property. This limitation makes it difficult to apply specific window management rules, such as automatically enabling floating mode for docked ImGui windows. For example, in i3wm’s configuration file, users would like to apply a rule like:
for_window [class="ImGui"] floating enable
for_window [instance="ImGui"] floating enable

Proposed Solution:
ImGui could set a custom WM_CLASS property or another identifier for their windows on X11, allowing for easier and more precise window management in tiling window managers like i3wm.

Screenshots/Video:

image

2025-01-03.23-20-38.mp4

xprop output of ImGui docked window:
image

Minimal, Complete and Verifiable Example code:

ImGui::Begin("Example Bug");
ImGui::End();
@Ikos3k Ikos3k changed the title feature request: easier Identification of ImGui windows on X11 feature request: easier identification of ImGui windows on X11 Jan 3, 2025
@ocornut
Copy link
Owner

ocornut commented Jan 6, 2025

Hello,
I don't know how to implement this but it would be great it would largely help with #2117
A PR would be welcome.

@ocornut ocornut changed the title feature request: easier identification of ImGui windows on X11 Easier identification of ImGui windows on X11 Jan 6, 2025
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