Allow window draw list rendering behind window decorations? #9565

Open
opened 2026-09-29 21:18:52 +00:00 by itsRythem · 0 comments
itsRythem commented 2026-09-29 21:18:52 +00:00 (Migrated from github.com)

Version/Branch of Dear ImGui:

Version 1.93.0, Branch: master

Back-ends:

n/a

Compiler, OS:

n/a

Full config/build information:

No response

Details:

Feature request

It would be nice if ImGui::Begin() / ImGui::End() could reserve draw list channels to allow user rendering behind the window decorations.

I'm thinking something along the lines of adding this to ImGui::Begin(), before RenderWindowDecorations():

window->DrawList->ChannelsSplit( 3 );
window->DrawList->ChannelsSetCurrent( 1 );

and this to ImGui::End():

window->DrawList->ChannelsMerge( );

This would allow code like:

const bool item_visible = ImGui::Begin( str_id, nullptr, ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize );
if ( !item_visible )
    return false;

ImDrawList* draw_list = ImGui::GetWindowDrawList( );

const ImVec2 p1 = ImGui::GetWindowPos( );
const ImVec2 p2 = ImGui::GetWindowPos( ) + ImGui::GetWindowSize( );

draw_list->ChannelsSetCurrent( 0 );
draw_list->AddRectFilled( p1 - ImVec2( 4.0f, 4.0f ), p2 + ImVec2( 4.0f, 4.0f ), IM_COL32( 0, 0, 255, 255 ) );
draw_list->ChannelsSetCurrent( 1 );

The idea is that channel 0 would be rendered behind the window decorations, while channel 1 would remain the normal window contents, and channel '2' would act as a foreground above the window simply for consistency.

This would make it possible to easily draw things like backgrounds, glows, shadows, etc. that extend outside/behind the window decorations without having to modify ImGui or manually manage the draw list around Begin() / End().

I believe the existing ImDrawList channel API already provides everything needed for this; this would mainly make the functionality available through the normal Begin() / End() flow.

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

// Here's some code anyone can copy and paste to reproduce your issue
ImGui::Begin("Example Bug");
MoreCodeToExplainMyIssue();
ImGui::End();
### Version/Branch of Dear ImGui: Version 1.93.0, Branch: master ### Back-ends: n/a ### Compiler, OS: n/a ### Full config/build information: _No response_ ### Details: ### Feature request It would be nice if `ImGui::Begin()` / `ImGui::End()` could reserve draw list channels to allow user rendering behind the window decorations. I'm thinking something along the lines of adding this to `ImGui::Begin()`, before `RenderWindowDecorations()`: ```cpp window->DrawList->ChannelsSplit( 3 ); window->DrawList->ChannelsSetCurrent( 1 ); ``` and this to `ImGui::End()`: ```cpp window->DrawList->ChannelsMerge( ); ``` This would allow code like: ```cpp const bool item_visible = ImGui::Begin( str_id, nullptr, ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize ); if ( !item_visible ) return false; ImDrawList* draw_list = ImGui::GetWindowDrawList( ); const ImVec2 p1 = ImGui::GetWindowPos( ); const ImVec2 p2 = ImGui::GetWindowPos( ) + ImGui::GetWindowSize( ); draw_list->ChannelsSetCurrent( 0 ); draw_list->AddRectFilled( p1 - ImVec2( 4.0f, 4.0f ), p2 + ImVec2( 4.0f, 4.0f ), IM_COL32( 0, 0, 255, 255 ) ); draw_list->ChannelsSetCurrent( 1 ); ``` The idea is that channel `0` would be rendered behind the window decorations, while channel `1` would remain the normal window contents, and channel '2' would act as a foreground above the window simply for consistency. This would make it possible to easily draw things like backgrounds, glows, shadows, etc. that extend outside/behind the window decorations without having to modify ImGui or manually manage the draw list around `Begin()` / `End()`. I believe the existing `ImDrawList` channel API already provides everything needed for this; this would mainly make the functionality available through the normal `Begin()` / `End()` flow. ### Screenshots/Video: _No response_ ### Minimal, Complete and Verifiable Example code: ```cpp // Here's some code anyone can copy and paste to reproduce your issue ImGui::Begin("Example Bug"); MoreCodeToExplainMyIssue(); ImGui::End(); ```
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#9565
No description provided.