Skip to content

drm: Respect XDG_SEAT for libinput seat selection - #779

Merged
TingPing merged 1 commit into
Igalia:masterfrom
flipperdevices:drm-libinput-seat
Jun 11, 2026
Merged

drm: Respect XDG_SEAT for libinput seat selection#779
TingPing merged 1 commit into
Igalia:masterfrom
flipperdevices:drm-libinput-seat

Conversation

@alchark

@alchark alchark commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Instead of hardcoding "seat0" for enumerating available inputs under the DRM platform, use the value optionally provided by the standard environment variable XDG_SEAT, and fall back to the previous default if unavailable.

This allows running cog on a dedicated seat with its own display and input devices, while leaving the default seat0 available for other uses.

This comment was marked as abuse.

alchark added a commit to flipperdevices/flipperone-linux-build-scripts that referenced this pull request Mar 30, 2026
Add our custom patched version of cog with support of seat selection
(also submitted upstream as PR 779), and assign Flipper One keys to
seat1 to avoid leaking keypresses into a graphical DE session.

Link: Igalia/cog#779
Signed-off-by: Alexey Charkov <alchark@flipper.net>
@alchark
alchark requested a review from Copilot March 30, 2026 17:01

This comment was marked as abuse.

@aperezdc aperezdc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alchark I like the idea of allowing configuring the seat, but rather than using only an environment variable, it would be better to allow setting it in the configuration file and/or via the -O/--platform-params= command line option. Would you be open to try and implement that in the init_config() function?

P.S: Please don't use Copilot for code reviews.

@alchark

alchark commented Apr 8, 2026

Copy link
Copy Markdown
Contributor Author

@aperezdc sure, let me try and add config/cmdline parsing too. I believe the precedence should be:

  1. Use cmdline value if available
  2. Else use config value if available
  3. Else use environment variable value if available
  4. Else fallback to seat0

As for Copilot, I don't think I did anything to trigger it, but it might be some "helpful" default buried somewhere in Github settings. Any pointers welcome :-D

@alchark
alchark force-pushed the drm-libinput-seat branch from df059ba to 36a63cf Compare April 8, 2026 14:01
@alchark
alchark requested a review from aperezdc April 8, 2026 14:01
@aperezdc

Copy link
Copy Markdown
Member

@aperezdc sure, let me try and add config/cmdline parsing too. I believe the precedence should be:

1. Use cmdline value if available

2. Else use config value if available

3. Else use environment variable value if available

4. Else fallback to `seat0`

This makes sense, indeed.

Also I was checking around and it looks like the name of the XDG_SEAT environment variable is commonly used by Wayland compositors and other applications. So we may want to actually keep using that for consistency with the rest of the ecosystem.

As for Copilot, I don't think I did anything to trigger it, but it might be some "helpful" default buried somewhere in Github settings. Any pointers welcome :-D

It looks like it was some repo setting that triggered it automatically, hopefully it is disabled now after some fiddling with the repo settings (not they make it easy to disable 🙃).

@aperezdc aperezdc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alchark Thanks for iterating on this. I left one small comment, and otherwise the patch looks good to me. Could you take a look?

(Don't worry about the failed ARM build in the CI, the job is having some issue picking the toolchain, so that's on us.)

Comment thread platform/drm/cog-platform-drm.c Outdated
zhovner pushed a commit to flipperdevices/flipperone-linux-build-scripts that referenced this pull request Apr 16, 2026
Add our custom patched version of cog with support of seat selection
(also submitted upstream as PR 779), and assign Flipper One keys to
seat1 to avoid leaking keypresses into a graphical DE session.

Link: Igalia/cog#779
Signed-off-by: Alexey Charkov <alchark@flipper.net>
@alchark
alchark force-pushed the drm-libinput-seat branch from 36a63cf to 7ec7afa Compare April 29, 2026 09:14
@alchark
alchark requested a review from aperezdc April 29, 2026 09:15
@zhovner

zhovner commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

@alchark can we resolve conflict please?

So we can ask Patrick @TingPing to look here too.

@TingPing
TingPing enabled auto-merge (rebase) June 4, 2026 19:06
auto-merge was automatically disabled June 4, 2026 19:19

Head branch was pushed to by a user without write access

@alchark
alchark force-pushed the drm-libinput-seat branch from 7bb9845 to f4442df Compare June 4, 2026 19:19
@TingPing

TingPing commented Jun 4, 2026

Copy link
Copy Markdown
Member

This branch cannot be rebased due to conflicts

@alchark

alchark commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

This branch cannot be rebased due to conflicts

That's weird. Let me rebase manually and re-publish, sorry for the noise.

Instead of hardcoding "seat0" for enumerating available inputs under the DRM
platform, use the value optionally provided by the standard environment
variable XDG_SEAT, or by the config file setting "seat", or by a command line
setting "seat", and fall back to the previous default if unavailable.

This allows running cog on a dedicated seat with its own display and input
devices, while leaving the default seat0 available for other uses.
@alchark
alchark force-pushed the drm-libinput-seat branch from f4442df to 4c4f70a Compare June 4, 2026 19:46
@alchark

alchark commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@TingPing would you mind giving this another look? No conflicts now.

@TingPing
TingPing merged commit b19d72a into Igalia:master Jun 11, 2026
3 of 5 checks passed
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.

5 participants