Сlickthrough and Transparent background viewport
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with the create_viewport and set_viewport_clear_color entry points mentioned in the request, then review how the underlying OS-specific windowing APIs handle transparency and input. Done means a transparent viewport background can pass clicks through while Dear PyGui windows remain interactive, with behavior or documented limits across Windows, macOS, and Linux.
Written by the indexing model from the issue text.
Description
Feature Request: Clickthrough Viewport Background with Transparency and Mouse Support
Is your feature request related to a problem? Please describe.
I'm often frustrated when I need to create a Dear PyGui application with a transparent viewport background that allows interaction with underlying applications (clickthrough) while still enabling mouse interactions with Dear PyGui windows. Currently, setting the viewport background to transparent (e.g., dpg.set_viewport_clear_color([0, 0, 0, 0])) results in a black background instead of true transparency, and there’s no built-in support for clickthrough behavior, forcing me to choose between a fully interactive viewport or a completely non-interactive one. This limits the ability to create overlay-like interfaces where the viewport background is invisible and clickthrough, but Dear PyGui windows remain fully interactive.
Describe the solution you'd like
I’d like the ability to:
- Set the viewport background to be fully transparent (alpha channel = 0) so it blends seamlessly with the desktop or applications behind it.
- Enable clickthrough behavior for the transparent viewport background, allowing mouse clicks to pass through to underlying applications.
- Retain full mouse interaction (clicks, hovers, etc.) for Dear PyGui windows within the viewport, ensuring they function normally.
This could be implemented via new viewport configuration options, such as:
dpg.set_viewport_transparency(True)to enable true transparency.dpg.set_viewport_clickthrough(True)to allow clicks to pass through the transparent background but not the Dear PyGui windows.
For example:
import dearpygui.dearpygui as dpg
dpg.create_context()
dpg.create_viewport(title="Transparent App", width=800, height=600)
dpg.set_viewport_transparency(True) # Make viewport background fully transparent
dpg.set_viewport_clickthrough(True) # Clicks pass through transparent areas
with dpg.window(label="Interactive Window", width=200, height=200):
dpg.add_button(label="Click Me") # Window remains interactive
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
Describe alternatives you've considered
- Using C# ImGui with Clickable Transparent Overlay: In C# ImGui, a package like "clickable transparent overlay" achieves this behavior by creating an invisible viewport while keeping ImGui windows interactive. However, this requires switching to C#, which I’d prefer to avoid as I’m more comfortable with Python and Dear PyGui.
- Custom Window Styling: I tried setting the viewport’s clear color to
[0, 0, 0, 0]and adjusting window themes to minimize the background, but this doesn’t achieve true transparency or clickthrough behavior. It also doesn’t allow mouse events to pass through the viewport. - No Title Bar and Custom Windows: I considered using
no_title_bar=Trueandno_background=Truefor windows to simulate a floating interface, but this doesn’t address viewport transparency or clickthrough for the background, and managing multiple windows this way is cumbersome. - External Libraries: I explored using other Python GUI frameworks like PyQt or Tkinter, but they either lack the GPU-accelerated performance of Dear PyGui or have more complex APIs for achieving transparency and clickthrough, making Dear PyGui a better fit if this feature is added.
Additional context
This feature would be highly valuable for creating overlay applications, such as desktop widgets, annotation tools, or HUD-like interfaces, where the viewport background needs to be invisible and non-blocking, but the Dear PyGui windows remain fully functional. Similar functionality exists in C# ImGui, suggesting it’s feasible to implement in Dear PyGui, possibly by leveraging the underlying Dear ImGui or OS-specific windowing APIs (e.g., Win32, Metal, or Vulkan). Existing GitHub issues ( #1142 ) indicate community interest in viewport transparency, but they don’t fully address clickthrough or mouse interaction with windows, so this request extends those ideas. A potential challenge might be OS-specific behavior (e.g., Windows vs. macOS), but a unified API with fallbacks (e.g., partial transparency if full clickthrough isn’t supported) would still be useful.
- Dominant language
- C++
- Stars
- 15.7k
- Forks
- 790
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hoffstadt/DearPyGui
-
Plot series data silently truncated to float32 when passed as numpy array (should be float64/double)Openstate: pending type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
state: pending type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
state: pending type: improvement
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
state: pending type: bug
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
state: pending type: improvement
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in hoffstadt/DearPyGui
Similar issues
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaPossibly taken @lijy91 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
libnativeapi/nativeapi#53 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
bot-triaged module: correctness (silent) module: fft triage review
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
patrickjquinn/Marathon-Shell#84 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
Maintainers usually reply within 1 day