[PR #2121] Add coordinate-based screen switching and grave modifier support #1843

Open
opened 2026-05-05 08:03:00 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/debauchee/barrier/pull/2121
Author: @danielsuss
Created: 6/13/2025
Status: 🔄 Open

Base: masterHead: master


📝 Commits (5)

  • f0daa31 Initial Implementation for coordinate switching
  • f7ad724 updated makelists for modern compilation
  • 314f107 Add grave modifier support for hotkeys
  • b8f917d Enhance grave modifier key support and fix missing key definitions
  • 779edb1 Merge pull request #1 from danielsuss/switch-screen-with-coordinates

📊 Changes

24 files changed (+683 additions, -14 deletions)

View changed files

.claude/settings.local.json (+12 -0)
📝 CMakeLists.txt (+1 -1)
COMPILATION_GUIDE.md (+265 -0)
GRAVE_MODIFIER_SETUP.md (+48 -0)
📝 cmake/Version.cmake (+1 -1)
📝 src/gui/CMakeLists.txt (+1 -1)
📝 src/gui/src/Action.cpp (+16 -1)
📝 src/gui/src/Action.h (+12 -0)
📝 src/gui/src/ActionDialog.cpp (+22 -0)
📝 src/gui/src/ActionDialogBase.ui (+170 -0)
📝 src/gui/src/KeySequence.cpp (+16 -0)
📝 src/gui/src/KeySequence.h (+3 -0)
📝 src/lib/barrier/key_types.cpp (+1 -0)
📝 src/lib/barrier/key_types.h (+4 -1)
📝 src/lib/base/String.h (+1 -0)
📝 src/lib/net/FingerprintData.h (+1 -0)
📝 src/lib/platform/XWindowsKeyState.cpp (+11 -0)
📝 src/lib/platform/XWindowsScreen.cpp (+1 -1)
📝 src/lib/platform/XWindowsUtil.cpp (+3 -0)
📝 src/lib/server/Config.cpp (+15 -3)

...and 4 more files

📄 Description

Summary

This PR adds two major features to Barrier:

🎯 Coordinate-Based Screen Switching

  • Extend switchToScreen action to accept optional coordinates: switchToScreen(screen,x,y)
  • GUI support for setting custom cursor positions when switching screens
  • Backward compatible - existing switchToScreen(screen) syntax still works
  • Enables precise cursor positioning for multi-monitor setups

⌨️ Grave Modifier Support

  • Full hotkey support for grave key (`) as modifier alongside Control, Alt, Shift
  • X11 integration with proper modifier mapping to Mod4
  • Consistent behavior across GUI and server components
  • Example: keystroke(Grave+1) = switchToScreen(screen1,960,540)

🔧 Compilation Improvements

  • Updated CMake minimum version requirements (3.4 → 3.5) for modern compatibility
  • Added missing #include <cstdint> headers for C++17+ compilers
  • Comprehensive compilation guide with exact build steps
  • Successfully builds on Ubuntu 24.04+ with GCC 13.3.0

Key Implementation Details

Coordinate Switching:

  • New SwitchToScreenAction constructor accepting x,y coordinates
  • Server-side switchScreen() integration for precise positioning
  • GUI controls in Action Dialog for coordinate input

Grave Modifier:

  • Added KeyModifierGrave constant (0x0080) and bit (7)
  • X11 mapping to Mod4Mask with fallback support
  • Updated hotkey registration to allow grave modifier
  • Qt GUI integration with custom GraveModifier constant

Backward Compatibility

All existing configurations continue to work unchanged
No breaking changes to API or config format
Default behavior preserved when coordinates not specified

Test Results

  • Coordinate switching works with custom positions
  • Grave modifier hotkeys function correctly
  • Builds successfully on modern Linux systems
  • All existing functionality preserved
  • GUI controls work as expected

Documentation

  • Added GRAVE_MODIFIER_SETUP.md with setup instructions
  • Added COMPILATION_GUIDE.md with detailed build steps
  • Inline code documentation for new features

This enhancement significantly improves Barrier's usability for complex multi-monitor setups and provides additional hotkey modifier options.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/debauchee/barrier/pull/2121 **Author:** [@danielsuss](https://github.com/danielsuss) **Created:** 6/13/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (5) - [`f0daa31`](https://github.com/debauchee/barrier/commit/f0daa312d09d2c8a5379159f29a9356332a38ae3) Initial Implementation for coordinate switching - [`f7ad724`](https://github.com/debauchee/barrier/commit/f7ad72457095f9cc8be53ffdcec29afbc542e9e9) updated makelists for modern compilation - [`314f107`](https://github.com/debauchee/barrier/commit/314f1070e5cfb0825eab4f0e0f6280840274cc39) Add grave modifier support for hotkeys - [`b8f917d`](https://github.com/debauchee/barrier/commit/b8f917def2ac2f1f1f8ab99b0f44bb29441ad5bb) Enhance grave modifier key support and fix missing key definitions - [`779edb1`](https://github.com/debauchee/barrier/commit/779edb1d9cf06c0ab6640c2ee108b87f0f453479) Merge pull request #1 from danielsuss/switch-screen-with-coordinates ### 📊 Changes **24 files changed** (+683 additions, -14 deletions) <details> <summary>View changed files</summary> ➕ `.claude/settings.local.json` (+12 -0) 📝 `CMakeLists.txt` (+1 -1) ➕ `COMPILATION_GUIDE.md` (+265 -0) ➕ `GRAVE_MODIFIER_SETUP.md` (+48 -0) 📝 `cmake/Version.cmake` (+1 -1) 📝 `src/gui/CMakeLists.txt` (+1 -1) 📝 `src/gui/src/Action.cpp` (+16 -1) 📝 `src/gui/src/Action.h` (+12 -0) 📝 `src/gui/src/ActionDialog.cpp` (+22 -0) 📝 `src/gui/src/ActionDialogBase.ui` (+170 -0) 📝 `src/gui/src/KeySequence.cpp` (+16 -0) 📝 `src/gui/src/KeySequence.h` (+3 -0) 📝 `src/lib/barrier/key_types.cpp` (+1 -0) 📝 `src/lib/barrier/key_types.h` (+4 -1) 📝 `src/lib/base/String.h` (+1 -0) 📝 `src/lib/net/FingerprintData.h` (+1 -0) 📝 `src/lib/platform/XWindowsKeyState.cpp` (+11 -0) 📝 `src/lib/platform/XWindowsScreen.cpp` (+1 -1) 📝 `src/lib/platform/XWindowsUtil.cpp` (+3 -0) 📝 `src/lib/server/Config.cpp` (+15 -3) _...and 4 more files_ </details> ### 📄 Description ## Summary This PR adds two major features to Barrier: ### 🎯 Coordinate-Based Screen Switching - Extend `switchToScreen` action to accept optional coordinates: `switchToScreen(screen,x,y)` - GUI support for setting custom cursor positions when switching screens - Backward compatible - existing `switchToScreen(screen)` syntax still works - Enables precise cursor positioning for multi-monitor setups ### ⌨️ Grave Modifier Support - Full hotkey support for grave key (`) as modifier alongside Control, Alt, Shift - X11 integration with proper modifier mapping to Mod4 - Consistent behavior across GUI and server components - Example: `keystroke(Grave+1) = switchToScreen(screen1,960,540)` ### 🔧 Compilation Improvements - Updated CMake minimum version requirements (3.4 → 3.5) for modern compatibility - Added missing `#include <cstdint>` headers for C++17+ compilers - Comprehensive compilation guide with exact build steps - Successfully builds on Ubuntu 24.04+ with GCC 13.3.0 ## Key Implementation Details **Coordinate Switching:** - New `SwitchToScreenAction` constructor accepting x,y coordinates - Server-side `switchScreen()` integration for precise positioning - GUI controls in Action Dialog for coordinate input **Grave Modifier:** - Added `KeyModifierGrave` constant (0x0080) and bit (7) - X11 mapping to Mod4Mask with fallback support - Updated hotkey registration to allow grave modifier - Qt GUI integration with custom `GraveModifier` constant ## Backward Compatibility ✅ All existing configurations continue to work unchanged ✅ No breaking changes to API or config format ✅ Default behavior preserved when coordinates not specified ## Test Results - ✅ Coordinate switching works with custom positions - ✅ Grave modifier hotkeys function correctly - ✅ Builds successfully on modern Linux systems - ✅ All existing functionality preserved - ✅ GUI controls work as expected ## Documentation - Added `GRAVE_MODIFIER_SETUP.md` with setup instructions - Added `COMPILATION_GUIDE.md` with detailed build steps - Inline code documentation for new features This enhancement significantly improves Barrier's usability for complex multi-monitor setups and provides additional hotkey modifier options. 🤖 Generated with [Claude Code](https://claude.ai/code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror added the
pull-request
label 2026-05-05 08:03:00 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/barrier#1843
No description provided.