Skip to content

Commit

Permalink
steamcompmgr: Fix icon/title being spam set
Browse files Browse the repository at this point in the history
Overlays should not get an appid, that's just for focus id logic.
  • Loading branch information
misyltoad committed Mar 1, 2025
1 parent 6a99868 commit 918b61d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/steamcompmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4046,8 +4046,11 @@ determine_and_apply_focus( global_focus_t *pFocus )
if ( pFocus->focusWindow )
{
pFocus->GetNestedHints()->SetVisible( true );
pFocus->GetNestedHints()->SetTitle( pFocus->focusWindow->title );
pFocus->GetNestedHints()->SetIcon( pFocus->focusWindow->icon );
if ( previousLocalFocus.focusWindow != pFocus->focusWindow )
{
pFocus->GetNestedHints()->SetTitle( pFocus->focusWindow->title );
pFocus->GetNestedHints()->SetIcon( pFocus->focusWindow->icon );
}
}
else
{
Expand Down Expand Up @@ -4285,9 +4288,15 @@ map_win(xwayland_ctx_t* ctx, Window id, unsigned long sequence)
{
w->appID = w->xwayland().id;
}

w->isOverlay = get_prop(ctx, w->xwayland().id, ctx->atoms.overlayAtom, 0);
w->isExternalOverlay = get_prop(ctx, w->xwayland().id, ctx->atoms.externalOverlayAtom, 0);

// misyl: Disable appID for overlay types, as parts of the code don't expect that focus-wise.
// Fixes mangoapp usage when nested, and not in SteamOS.
if ( w->IsAnyOverlay() )
w->appID = 0;

get_size_hints(ctx, w);

get_net_wm_state(ctx, w);
Expand Down Expand Up @@ -4547,6 +4556,9 @@ add_win(xwayland_ctx_t *ctx, Window id, Window prev, unsigned long sequence)
new_win->appID = id;
}

if ( new_win->IsAnyOverlay() )
new_win->appID = 0;

Window transientFor = None;
if ( XGetTransientForHint( ctx->dpy, id, &transientFor ) )
{
Expand Down Expand Up @@ -4782,7 +4794,7 @@ damage_win(xwayland_ctx_t *ctx, XDamageNotifyEvent *de)
if (!w)
return;

if ((w->isOverlay || w->isExternalOverlay) && !w->opacity)
if (w->IsAnyOverlay() && !w->opacity)
return;

// First damage event we get, compute focus; we only want to focus damaged
Expand Down Expand Up @@ -5365,6 +5377,8 @@ handle_property_notify(xwayland_ctx_t *ctx, XPropertyEvent *ev)
xwm_log.errorf( "appid clash was %u now %u", w->appID, appID );
}
w->appID = appID;
if ( w->IsAnyOverlay() )
w->appID = 0;

MakeFocusDirty();
}
Expand All @@ -5375,6 +5389,8 @@ handle_property_notify(xwayland_ctx_t *ctx, XPropertyEvent *ev)
if (w)
{
w->isOverlay = get_prop(ctx, w->xwayland().id, ctx->atoms.overlayAtom, 0);
if ( w->IsAnyOverlay() )
w->appID = 0;
MakeFocusDirty();
}
}
Expand All @@ -5384,6 +5400,8 @@ handle_property_notify(xwayland_ctx_t *ctx, XPropertyEvent *ev)
if (w)
{
w->isExternalOverlay = get_prop(ctx, w->xwayland().id, ctx->atoms.externalOverlayAtom, 0);
if ( w->IsAnyOverlay() )
w->appID = 0;
MakeFocusDirty();
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/steamcompmgr_shared.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ struct steamcompmgr_win_t {
uint32_t appID = 0;
bool isOverlay = false;
bool isExternalOverlay = false;

bool IsAnyOverlay() const
{
return isOverlay || isExternalOverlay;
}

bool isFullscreen = false;
bool isSysTrayIcon = false;
bool sizeHintsSpecified = false;
Expand Down

0 comments on commit 918b61d

Please sign in to comment.