Skip to content

fix(xremap): prevent modifier leak to Slack with virtual_modifiers - #1224

Merged
shunkakinoki merged 5 commits into
mainfrom
make
Mar 20, 2026
Merged

fix(xremap): prevent modifier leak to Slack with virtual_modifiers#1224
shunkakinoki merged 5 commits into
mainfrom
make

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Mar 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add virtual_modifiers to xremap config to treat Alt+Shift+Super as an atomic virtual modifier
  • Prevents intermediate modifier events from leaking to Electron apps (Slack), which caused Framework+C to trigger "mark as unread" alongside copy
  • Also includes: hyprland keybindings docs, amdgpu PSR fix, gitignore AI dirs, statix lint fix

Test plan

  • Rebuild NixOS config and restart xremap
  • Verify Framework+C in Slack copies without triggering mark-as-unread
  • Verify Framework+C/V still works in browser, Ghostty, and other apps

Generated with Claude Code by claude-opus-4-6


Summary by cubic

Treat Alt+Shift+Super as a virtual modifier in xremap to stop modifier events leaking into Electron apps (Slack), so Framework+C copies without toggling mark‑as‑unread. Also fixes Framework 13 screen flicker by disabling AMDGPU PSR/REPLAY.

  • Bug Fixes

    • xremap: Add virtual_modifiers Alt‑Shift‑Super to suppress intermediate events in Electron apps; Framework+C now sends only Ctrl+C in Slack.
    • matic: Set amdgpu.dcdebugmask=0x410 to disable PSR/REPLAY and eliminate flicker.
  • Refactors

    • Run statix from the flake dev shell in the Makefile.
    • Add Hyprland keybindings docs.
    • Ignore local AI tool directories in global gitignore.

Written for commit 8d42b08. Summary will update on new commits.

shunkakinoki and others added 5 commits March 20, 2026 21:18
- Documented comprehensive keybindings and shortcuts for the Hyprland desktop environment.
Framework+C in Slack copies text correctly but also triggers "mark as
unread" because intermediate Alt/Shift/Super modifier events leak through
to Electron before xremap emits the final Ctrl+C. Adding virtual_modifiers
tells xremap to treat Alt+Shift+Super atomically, suppressing those
intermediate events.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 20, 2026 18:40
@mesa-dot-dev

mesa-dot-dev Bot commented Mar 20, 2026

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@shunkakinoki shunkakinoki added the bug Indicates an unexpected problem or unintended behavior. label Mar 20, 2026
@coderabbitai

coderabbitai Bot commented Mar 20, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This pull request updates several configuration and documentation files: the Makefile's nix-lint target now runs statix check inside a Nix develop shell; new Hyprland keybindings documentation is added; virtual_modifiers setting is added to the xremap module configuration; AI-related directories are added to the global Git ignore file; and a kernel parameter is added to address screen flickering on the matic host.

Changes

Cohort / File(s) Summary
Build Configuration
Makefile
Updated nix-lint target to execute statix check inside the Nix develop shell (nix develop ... --command statix check .) instead of direct invocation, with DEVENV_ROOT=$(CURDIR) and $(NIX_ALLOW_UNFREE) flags.
Documentation
docs/HYPRLAND.md
Added comprehensive Hyprland keybindings reference documenting shortcut categories including app launch, window focus, window management, workspace navigation, scratchpad, screenshots, clipboard utilities, system controls, and media keys.
Home-Manager Configuration
home-manager/modules/xremap/default.nix
Added virtual_modifiers = [ "Alt-Shift-Super" ]; setting to the services.xremap.config section for desktop Linux environments.
Version Control Configuration
home-manager/programs/git/.gitignore.global
Added ignore patterns for AI-related directories: .cursor/, .entire/, and .serena/.
System Configuration
named-hosts/matic/default.nix
Added kernel parameter amdgpu.dcdebugmask=0x410 to disable PSR and REPLAY and address screen flickering.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 With modifiers remapped and configs refined,
Keybindings dance where Hyprland's aligned,
Build shells nestled, git patterns unfurled—
A rabbit's burrow of settings, neatly twirled! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title specifically references the main fix (xremap virtual_modifiers) to prevent modifier leak to Slack, which is the primary change in the PR and is directly related to the xremap configuration modification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description accurately describes the main changes (xremap virtual_modifiers fix) and lists all included modifications (Hyprland docs, amdgpu PSR fix, gitignore updates, statix fix) in relation to the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch make

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily addresses a modifier key leakage issue in xremap that affected Electron applications like Slack, causing unintended side effects during key combinations. It introduces a virtual modifier configuration to prevent this. Additionally, the PR includes updates to Hyprland keybinding documentation, a kernel parameter fix for AMD GPU screen flickering, new entries in the global gitignore for AI-related files, and a correction to the Nix linting process in the Makefile.

Highlights

  • xremap Configuration: Configured xremap to use Alt-Shift-Super as an atomic virtual modifier.
  • Modifier Leak Fix: Resolved an issue where intermediate modifier events leaked to Electron apps like Slack, preventing unintended actions (e.g., 'mark as unread' when copying).
  • Hyprland Keybindings Documentation: Documented Hyprland keybindings in a new markdown file.
  • AMD GPU Fix: Implemented a fix for AMD GPU screen flickering by disabling PSR and REPLAY.
  • Gitignore Update: Updated the global gitignore to exclude AI-related directories.
  • Nix Linting Improvement: Adjusted the nix-lint Makefile target to correctly run statix from the development shell.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mesa-dot-dev

mesa-dot-dev Bot commented Mar 20, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Fixed an xremap modifier leak to Electron apps like Slack by adding virtual_modifiers, preventing unintended actions when using keybindings. Also includes miscellaneous updates to hyprland docs, amdgpu, gitignore, and statix.

What changed?

  • Added virtual_modifiers to xremap configuration to treat Alt+Shift+Super as an atomic virtual modifier
  • Prevented intermediate modifier events from leaking to Electron apps (e.g., Slack)
  • Updated hyprland keybindings documentation
  • Applied an amdgpu PSR fix
  • Updated .gitignore to include AI-related directories
  • Fixed statix linting issues

Description generated by Mesa. Update settings

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

The pull request introduces a new docs/HYPRLAND.md file documenting Hyprland keybindings, updates the Makefile to lint Nix files via the flake/dev shell, adds virtual_modifiers = [ "Alt-Shift-Super" ]; to the xremap configuration, includes new AI-related directories in the global .gitignore, and adds amdgpu.dcdebugmask=0x410 to the kernel parameters for the matic host. A review comment suggests correcting a typo in the docs/HYPRLAND.md file, proposing Super + Ctrl + F instead of Super Ctrl + F for consistency.

# Only intercept keyd output — SUPER (CapsLock/RightAlt) goes straight to Hyprland
deviceNames = [ "keyd virtual keyboard" ];
config = {
virtual_modifiers = [ "Alt-Shift-Super" ];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Adding virtual_modifiers = [ "Alt-Shift-Super" ]; is a crucial change that directly addresses the modifier leak issue with Electron apps. This ensures that the Alt-Shift-Super combination is treated as an atomic virtual modifier, preventing unintended key events from being sent to applications like Slack.

"amdgpu.abmlevel=3" # auto backlight management
"amdgpu.runpm=1" # runtime power management for GPU
"amd_pstate=active" # AMD P-state driver (better than acpi-cpufreq)
"amdgpu.dcdebugmask=0x410" # disable PSR and REPLAY to fix screen flickering

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The addition of amdgpu.dcdebugmask=0x410 to the kernel parameters to disable PSR and REPLAY is a targeted fix for screen flickering issues on AMD GPUs. This directly improves the stability and user experience on the matic host.

Comment thread docs/HYPRLAND.md
|---|---|
| `Super + Q` | Close window |
| `Super + Shift + F` | Toggle floating |
| `Super Ctrl + F` | Fullscreen (maximize) |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

There appears to be a typo in the shortcut Super Ctrl + F. Based on common keybinding conventions and other entries in the document, it should likely be Super + Ctrl + F to clearly indicate the combination of Super and Ctrl keys.

Suggested change
| `Super Ctrl + F` | Fullscreen (maximize) |
Super + Ctrl + F

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/HYPRLAND.md`:
- Around line 84-85: Replace the unhyphenated phrase "Full screen screenshot"
with "Full-screen screenshot" in the three table cells that use that label;
specifically update the rows identified by the keyboard shortcuts `Ctrl + Print`
and `Hyper + 3`, and the third occurrence elsewhere on the page, so each action
label reads "Full-screen screenshot" for consistency.
- Line 35: Update the shortcut notation on the line containing "`Super Ctrl +
F`" to match the rest of the document by adding the missing plus: change the
string to "`Super + Ctrl + F`" (the entry for Fullscreen (maximize) in
HYPRLAND.md).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b52b1171-2252-45bd-a1c5-0991b6d013b1

📥 Commits

Reviewing files that changed from the base of the PR and between 6b5efbb and 8d42b08.

📒 Files selected for processing (5)
  • Makefile
  • docs/HYPRLAND.md
  • home-manager/modules/xremap/default.nix
  • home-manager/programs/git/.gitignore.global
  • named-hosts/matic/default.nix

Comment thread docs/HYPRLAND.md
|---|---|
| `Super + Q` | Close window |
| `Super + Shift + F` | Toggle floating |
| `Super Ctrl + F` | Fullscreen (maximize) |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix shortcut notation typo for modifier chain.

Line [35] should use the same key-combo format as the rest of the doc: Super + Ctrl + F (currently Super Ctrl + F).

Suggested patch
-| `Super Ctrl + F` | Fullscreen (maximize) |
+| `Super + Ctrl + F` | Fullscreen (maximize) |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| `Super Ctrl + F` | Fullscreen (maximize) |
| `Super + Ctrl + F` | Fullscreen (maximize) |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/HYPRLAND.md` at line 35, Update the shortcut notation on the line
containing "`Super Ctrl + F`" to match the rest of the document by adding the
missing plus: change the string to "`Super + Ctrl + F`" (the entry for
Fullscreen (maximize) in HYPRLAND.md).

Comment thread docs/HYPRLAND.md
Comment on lines +84 to +85
| `Ctrl + Print` | Full screen screenshot |
| `Hyper + 3` | Full screen screenshot |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use hyphenated “full-screen” in action labels.

For consistency and grammar, replace “Full screen screenshot” with “Full-screen screenshot” on Line [84], Line [85], and Line [118].

Suggested patch
-| `Ctrl + Print` | Full screen screenshot |
-| `Hyper + 3` | Full screen screenshot |
+| `Ctrl + Print` | Full-screen screenshot |
+| `Hyper + 3` | Full-screen screenshot |
...
-| `F11` | Full screen screenshot |
+| `F11` | Full-screen screenshot |

Also applies to: 118-118

🧰 Tools
🪛 LanguageTool

[uncategorized] ~84-~84: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ... Window screenshot | | Ctrl + Print | Full screen screenshot | | Hyper + 3 | Full scree...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


[uncategorized] ~85-~85: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...ull screen screenshot | | Hyper + 3 | Full screen screenshot | | Hyper + 4 | Region scr...

(EN_COMPOUND_ADJECTIVE_INTERNAL)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/HYPRLAND.md` around lines 84 - 85, Replace the unhyphenated phrase "Full
screen screenshot" with "Full-screen screenshot" in the three table cells that
use that label; specifically update the rows identified by the keyboard
shortcuts `Ctrl + Print` and `Hyper + 3`, and the third occurrence elsewhere on
the page, so each action label reads "Full-screen screenshot" for consistency.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Nix/Home Manager configuration to prevent modifier key “leakage” in Electron apps (notably Slack) by introducing xremap virtual_modifiers, alongside a few related system/config quality-of-life updates.

Changes:

  • Add xremap virtual_modifiers to treat Alt+Shift+Super as an atomic modifier chord to avoid intermediate modifier events reaching apps like Slack.
  • Add Hyprland keybindings documentation and small maintenance tweaks (global gitignore AI dirs, Makefile statix lint invocation).
  • Apply an AMDGPU kernel parameter tweak intended to mitigate PSR/REPLAY-related screen flickering.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
named-hosts/matic/default.nix Adds an AMDGPU kernel param to address display flickering (PSR/REPLAY).
home-manager/programs/git/.gitignore.global Ignores additional AI/editor-generated directories globally.
home-manager/modules/xremap/default.nix Adds virtual_modifiers to reduce modifier event leakage into apps.
docs/HYPRLAND.md Introduces a Hyprland keybinding reference document.
Makefile Runs statix lint via the flake/dev shell (nix develop ... --command statix).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/HYPRLAND.md
@@ -0,0 +1,119 @@
# Hyprland Keybindings

`$mod` = Super (Win key)

Copilot AI Mar 20, 2026

Copy link

Choose a reason for hiding this comment

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

Hyper is used throughout this doc (e.g. “Hyper + Space”, “Hyper + 3/4/5”, “Hyper + L”), but it isn’t defined at the top. Add a short definition near the $mod definition (and ideally match the actual keyd/Hyprland meaning, e.g. Ctrl+Alt+Shift+Super) so readers can interpret the shortcuts correctly.

Suggested change
`$mod` = Super (Win key)
`$mod` = Super (Win key)
`Hyper` = Ctrl + Alt + Shift + Super

Copilot uses AI. Check for mistakes.
Comment thread docs/HYPRLAND.md
|---|---|
| `Super + Q` | Close window |
| `Super + Shift + F` | Toggle floating |
| `Super Ctrl + F` | Fullscreen (maximize) |

Copilot AI Mar 20, 2026

Copy link

Choose a reason for hiding this comment

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

The “Fullscreen (maximize)” shortcut is written as Super Ctrl + F, but the rest of the doc uses + between modifiers and this is easy to misread as two separate shortcuts. Update it to Super + Ctrl + F (or $mod + Ctrl + F) for consistency with the other entries and the Hyprland bind style.

Suggested change
| `Super Ctrl + F` | Fullscreen (maximize) |
| `Super + Ctrl + F` | Fullscreen (maximize) |

Copilot uses AI. Check for mistakes.
@shunkakinoki
shunkakinoki merged commit e60e0df into main Mar 20, 2026
36 of 37 checks passed
@shunkakinoki
shunkakinoki deleted the make branch March 20, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Indicates an unexpected problem or unintended behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants