Skip to content

steamcompmgr: Invoke xwininfo and xprop with an explicit display parameter#2232

Open
oSoMoN wants to merge 1 commit into
ValveSoftware:masterfrom
oSoMoN:steamcompmgr-fix-debug-focus-xwininfo-xprop
Open

steamcompmgr: Invoke xwininfo and xprop with an explicit display parameter#2232
oSoMoN wants to merge 1 commit into
ValveSoftware:masterfrom
oSoMoN:steamcompmgr-fix-debug-focus-xwininfo-xprop

Conversation

@oSoMoN

@oSoMoN oSoMoN commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

When debugging focus issues, the output of xwininfo and xprop is logged, but both commands were being invoked without a display parameter, resulting in a BadWindow (invalid Window parameter) X error.

…meter

When debugging focus issues, the output of xwininfo and xprop is logged,
but both commands were being invoked without a display parameter,
resulting in a BadWindow (invalid Window parameter) X error.
@pchome

pchome commented Jun 26, 2026

Copy link
Copy Markdown

Not critical but there's also a case when xwininfo is not installed.
Maybe makes sense to check system's return value and suppress further calls but notify developer with proper message.

Pseudo-code

static has_xwnfo = true;
if (has_xwnfo) {
    int ret = system (cmd);
    if (BAD_RET(ret)) {
        has_xwnfo = false;
        xwm_log.errorf("Can not execute 'xwininfo'. Install corresponding system package for detailed output.");
    }
}

@oSoMoN

oSoMoN commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator Author

This logging is behind a flag (debugFocus) which is false by default, and needs to be turned on by passing the --debug-focus argument, so I think it is safe to assume that users of that flag do not need to be explicitly instructed to install the package. Your suggestion wouldn't hurt, of course, but it sounds a tad overkill to me.

@pchome

pchome commented Jun 26, 2026

Copy link
Copy Markdown

Yes and no.

A lot of people using gamescope. Many of them even trying to fix their issues by themselves.
Being "partially"1 open source it's in "gamescope"'s interest to make those people life easier.
Who not only reporting but also debugging thing by themselves.

I myself was a little confused and thought error message was part gamescope debug messages.
Until I dug deeper into the code.

So I guess it's fair to offer a little help to not those damn users, with unhelpful help going to stderr, etc., but to people who help fixing bugs (I suppose there are bunch of them bugs in the focus part)2.

But, It's not your obligation to do this, certainly.

Footnotes

  1. I guess there are a lot of internal testing/thinking going on between "PR/code was introduced" and "code was merged" in both directions (GH<->Valve). So there is no direct connection between user<->dev. I my opinion it's more like Valve -> GH mirror.

  2. To name one: there are lot of "Rerolig global focus" events happen when you keep mouse pointer on one menu item in kcalc and move mouse left and right. Not critical for apps like kcalc but may in theory hurt fps in some games since there are lot of things happening in the "determine focus" code.

@oSoMoN

oSoMoN commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator Author

Fair enough, but let's do this in a separate PR. If you want to propose a patch, I will review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants