fix(xremap): prevent modifier leak to Slack with virtual_modifiers - #1224
Conversation
- 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>
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
📝 WalkthroughWalkthroughThis pull request updates several configuration and documentation files: the Makefile's Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Summary of ChangesHello, 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 Highlights
Using Gemini Code AssistThe 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
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 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
|
Mesa DescriptionTL;DRFixed an xremap modifier leak to Electron apps like Slack by adding What changed?
Description generated by Mesa. Update settings |
There was a problem hiding this comment.
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" ]; |
There was a problem hiding this comment.
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 |
| |---|---| | ||
| | `Super + Q` | Close window | | ||
| | `Super + Shift + F` | Toggle floating | | ||
| | `Super Ctrl + F` | Fullscreen (maximize) | |
There was a problem hiding this comment.
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.
| | `Super Ctrl + F` | Fullscreen (maximize) | | |
| Super + Ctrl + F |
There was a problem hiding this comment.
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
📒 Files selected for processing (5)
Makefiledocs/HYPRLAND.mdhome-manager/modules/xremap/default.nixhome-manager/programs/git/.gitignore.globalnamed-hosts/matic/default.nix
| |---|---| | ||
| | `Super + Q` | Close window | | ||
| | `Super + Shift + F` | Toggle floating | | ||
| | `Super Ctrl + F` | Fullscreen (maximize) | |
There was a problem hiding this comment.
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.
| | `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).
| | `Ctrl + Print` | Full screen screenshot | | ||
| | `Hyper + 3` | Full screen screenshot | |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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_modifiersto treatAlt+Shift+Superas 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.
| @@ -0,0 +1,119 @@ | |||
| # Hyprland Keybindings | |||
|
|
|||
| `$mod` = Super (Win key) | |||
There was a problem hiding this comment.
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.
| `$mod` = Super (Win key) | |
| `$mod` = Super (Win key) | |
| `Hyper` = Ctrl + Alt + Shift + Super |
| |---|---| | ||
| | `Super + Q` | Close window | | ||
| | `Super + Shift + F` | Toggle floating | | ||
| | `Super Ctrl + F` | Fullscreen (maximize) | |
There was a problem hiding this comment.
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.
| | `Super Ctrl + F` | Fullscreen (maximize) | | |
| | `Super + Ctrl + F` | Fullscreen (maximize) | |
Summary
virtual_modifiersto xremap config to treatAlt+Shift+Superas an atomic virtual modifierTest plan
Generated with Claude Code by claude-opus-4-6
Summary by cubic
Treat Alt+Shift+Super as a virtual modifier in
xremapto 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
statixfrom the flake dev shell in the Makefile.Written for commit 8d42b08. Summary will update on new commits.