mirror of
https://github.com/hyprwm/Hyprland
synced 2025-12-24 13:10:13 +01:00
Merge 9b3bebaab4 into 6175ecd4c4
This commit is contained in:
commit
bc6582697d
6 changed files with 34 additions and 18 deletions
|
|
@ -125,7 +125,7 @@ static bool test() {
|
||||||
}
|
}
|
||||||
|
|
||||||
OK(getFromSocket("/keyword gestures:workspace_swipe_invert 1"));
|
OK(getFromSocket("/keyword gestures:workspace_swipe_invert 1"));
|
||||||
OK(getFromSocket("/keyword gestures:workspace_swipe_create_new 0"));
|
OK(getFromSocket("/keyword gestures:workspace_swipe_bound 0"));
|
||||||
|
|
||||||
OK(getFromSocket("/dispatch plugin:test:gesture left,3"));
|
OK(getFromSocket("/dispatch plugin:test:gesture left,3"));
|
||||||
|
|
||||||
|
|
|
||||||
14
pointer-scroll.txt
Normal file
14
pointer-scroll.txt
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
> binding to global: wl_seat (version 9) with id 1
|
||||||
|
> binding to global: wl_compositor (version 6) with id 3
|
||||||
|
> binding to global: wl_shm (version 1) with id 5
|
||||||
|
> binding to global: xdg_wm_base (version 7) with id 37
|
||||||
|
started
|
||||||
|
Got pointer enter event, serial 807, x 240128, y 132608
|
||||||
|
axis: ax 0 delta 10
|
||||||
|
10.00
|
||||||
|
axis: ax 0 delta 20
|
||||||
|
20.00
|
||||||
|
axis: ax 0 delta 30
|
||||||
|
30.00
|
||||||
|
axis: ax 0 delta 40
|
||||||
|
40.00
|
||||||
|
|
@ -812,10 +812,11 @@ inline static const std::vector<SConfigOptionDescription> CONFIG_OPTIONS = {
|
||||||
.data = SConfigOptionDescription::SFloatData{0.5, 0, 1},
|
.data = SConfigOptionDescription::SFloatData{0.5, 0, 1},
|
||||||
},
|
},
|
||||||
SConfigOptionDescription{
|
SConfigOptionDescription{
|
||||||
.value = "gestures:workspace_swipe_create_new",
|
.value = "gestures:workspace_swipe_bound",
|
||||||
.description = "whether a swipe right on the last workspace should create a new one.",
|
.description =
|
||||||
.type = CONFIG_OPTION_BOOL,
|
"what to do when swiping to before the first or after the last workspace. Options: 0 (do nothing), 1 (create new after last), 2 (wrap between first and last)",
|
||||||
.data = SConfigOptionDescription::SBoolData{true},
|
.type = CONFIG_OPTION_INT,
|
||||||
|
.data = SConfigOptionDescription::SRangeData{1, 0, 2},
|
||||||
},
|
},
|
||||||
SConfigOptionDescription{
|
SConfigOptionDescription{
|
||||||
.value = "gestures:workspace_swipe_direction_lock",
|
.value = "gestures:workspace_swipe_direction_lock",
|
||||||
|
|
|
||||||
|
|
@ -704,7 +704,7 @@ CConfigManager::CConfigManager() {
|
||||||
registerConfigVar("gestures:workspace_swipe_invert", Hyprlang::INT{1});
|
registerConfigVar("gestures:workspace_swipe_invert", Hyprlang::INT{1});
|
||||||
registerConfigVar("gestures:workspace_swipe_min_speed_to_force", Hyprlang::INT{30});
|
registerConfigVar("gestures:workspace_swipe_min_speed_to_force", Hyprlang::INT{30});
|
||||||
registerConfigVar("gestures:workspace_swipe_cancel_ratio", {0.5f});
|
registerConfigVar("gestures:workspace_swipe_cancel_ratio", {0.5f});
|
||||||
registerConfigVar("gestures:workspace_swipe_create_new", Hyprlang::INT{1});
|
registerConfigVar("gestures:workspace_swipe_bound", Hyprlang::INT{1});
|
||||||
registerConfigVar("gestures:workspace_swipe_direction_lock", Hyprlang::INT{1});
|
registerConfigVar("gestures:workspace_swipe_direction_lock", Hyprlang::INT{1});
|
||||||
registerConfigVar("gestures:workspace_swipe_direction_lock_threshold", Hyprlang::INT{10});
|
registerConfigVar("gestures:workspace_swipe_direction_lock_threshold", Hyprlang::INT{10});
|
||||||
registerConfigVar("gestures:workspace_swipe_forever", Hyprlang::INT{0});
|
registerConfigVar("gestures:workspace_swipe_forever", Hyprlang::INT{0});
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ void CUnifiedWorkspaceSwipeGesture::update(double delta) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
static auto PSWIPEDIST = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_distance");
|
static auto PSWIPEDIST = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_distance");
|
||||||
static auto PSWIPENEW = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_create_new");
|
static auto PSWIPEBOUND = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_bound");
|
||||||
static auto PSWIPEDIRLOCK = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_direction_lock");
|
static auto PSWIPEDIRLOCK = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_direction_lock");
|
||||||
static auto PSWIPEDIRLOCKTHRESHOLD = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_direction_lock_threshold");
|
static auto PSWIPEDIRLOCKTHRESHOLD = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_direction_lock_threshold");
|
||||||
static auto PSWIPEFOREVER = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_forever");
|
static auto PSWIPEFOREVER = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_forever");
|
||||||
|
|
@ -56,7 +56,7 @@ void CUnifiedWorkspaceSwipeGesture::update(double delta) {
|
||||||
auto workspaceIDLeft = getWorkspaceIDNameFromString((*PSWIPEUSER ? "r-1" : "m-1")).id;
|
auto workspaceIDLeft = getWorkspaceIDNameFromString((*PSWIPEUSER ? "r-1" : "m-1")).id;
|
||||||
auto workspaceIDRight = getWorkspaceIDNameFromString((*PSWIPEUSER ? "r+1" : "m+1")).id;
|
auto workspaceIDRight = getWorkspaceIDNameFromString((*PSWIPEUSER ? "r+1" : "m+1")).id;
|
||||||
|
|
||||||
if ((workspaceIDLeft == WORKSPACE_INVALID || workspaceIDRight == WORKSPACE_INVALID || workspaceIDLeft == m_workspaceBegin->m_id) && !*PSWIPENEW) {
|
if ((workspaceIDLeft == WORKSPACE_INVALID || workspaceIDRight == WORKSPACE_INVALID || workspaceIDLeft == m_workspaceBegin->m_id) && *PSWIPEBOUND != 1) {
|
||||||
m_workspaceBegin = nullptr; // invalidate the swipe
|
m_workspaceBegin = nullptr; // invalidate the swipe
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -65,8 +65,9 @@ void CUnifiedWorkspaceSwipeGesture::update(double delta) {
|
||||||
|
|
||||||
m_delta = std::clamp(m_delta, sc<double>(-SWIPEDISTANCE), sc<double>(SWIPEDISTANCE));
|
m_delta = std::clamp(m_delta, sc<double>(-SWIPEDISTANCE), sc<double>(SWIPEDISTANCE));
|
||||||
|
|
||||||
if ((m_workspaceBegin->m_id == workspaceIDLeft && *PSWIPENEW && (m_delta < 0)) ||
|
if ((m_workspaceBegin->m_id == workspaceIDLeft && *PSWIPEBOUND == 1 && (m_delta < 0)) ||
|
||||||
(m_delta > 0 && m_workspaceBegin->getWindows() == 0 && workspaceIDRight <= m_workspaceBegin->m_id) || (m_delta < 0 && m_workspaceBegin->m_id <= workspaceIDLeft)) {
|
(m_delta > 0 && m_workspaceBegin->getWindows() == 0 && workspaceIDRight <= m_workspaceBegin->m_id) ||
|
||||||
|
(m_delta < 0 && m_workspaceBegin->m_id <= workspaceIDLeft && *PSWIPEBOUND != 2)) {
|
||||||
|
|
||||||
m_delta = 0;
|
m_delta = 0;
|
||||||
g_pHyprRenderer->damageMonitor(m_monitor.lock());
|
g_pHyprRenderer->damageMonitor(m_monitor.lock());
|
||||||
|
|
@ -84,8 +85,8 @@ void CUnifiedWorkspaceSwipeGesture::update(double delta) {
|
||||||
if (m_delta < 0) {
|
if (m_delta < 0) {
|
||||||
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(workspaceIDLeft);
|
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(workspaceIDLeft);
|
||||||
|
|
||||||
if (workspaceIDLeft > m_workspaceBegin->m_id || !PWORKSPACE) {
|
if ((workspaceIDLeft > m_workspaceBegin->m_id && *PSWIPEBOUND != 2) || !PWORKSPACE) {
|
||||||
if (*PSWIPENEW) {
|
if (*PSWIPEBOUND == 1) {
|
||||||
g_pHyprRenderer->damageMonitor(m_monitor.lock());
|
g_pHyprRenderer->damageMonitor(m_monitor.lock());
|
||||||
|
|
||||||
if (VERTANIMS)
|
if (VERTANIMS)
|
||||||
|
|
@ -124,8 +125,8 @@ void CUnifiedWorkspaceSwipeGesture::update(double delta) {
|
||||||
} else {
|
} else {
|
||||||
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(workspaceIDRight);
|
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(workspaceIDRight);
|
||||||
|
|
||||||
if (workspaceIDRight < m_workspaceBegin->m_id || !PWORKSPACE) {
|
if ((workspaceIDRight < m_workspaceBegin->m_id && *PSWIPEBOUND != 2) || !PWORKSPACE) {
|
||||||
if (*PSWIPENEW) {
|
if (*PSWIPEBOUND) {
|
||||||
g_pHyprRenderer->damageMonitor(m_monitor.lock());
|
g_pHyprRenderer->damageMonitor(m_monitor.lock());
|
||||||
|
|
||||||
if (VERTANIMS)
|
if (VERTANIMS)
|
||||||
|
|
@ -182,7 +183,7 @@ void CUnifiedWorkspaceSwipeGesture::end() {
|
||||||
static auto PSWIPEPERC = CConfigValue<Hyprlang::FLOAT>("gestures:workspace_swipe_cancel_ratio");
|
static auto PSWIPEPERC = CConfigValue<Hyprlang::FLOAT>("gestures:workspace_swipe_cancel_ratio");
|
||||||
static auto PSWIPEDIST = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_distance");
|
static auto PSWIPEDIST = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_distance");
|
||||||
static auto PSWIPEFORC = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_min_speed_to_force");
|
static auto PSWIPEFORC = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_min_speed_to_force");
|
||||||
static auto PSWIPENEW = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_create_new");
|
static auto PSWIPEBOUND = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_bound");
|
||||||
static auto PSWIPEUSER = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_use_r");
|
static auto PSWIPEUSER = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_use_r");
|
||||||
static auto PWORKSPACEGAP = CConfigValue<Hyprlang::INT>("general:gaps_workspaces");
|
static auto PWORKSPACEGAP = CConfigValue<Hyprlang::INT>("general:gaps_workspaces");
|
||||||
const auto ANIMSTYLE = m_workspaceBegin->m_renderOffset->getStyle();
|
const auto ANIMSTYLE = m_workspaceBegin->m_renderOffset->getStyle();
|
||||||
|
|
@ -195,7 +196,7 @@ void CUnifiedWorkspaceSwipeGesture::end() {
|
||||||
|
|
||||||
// If we've been swiping off the right end with PSWIPENEW enabled, there is
|
// If we've been swiping off the right end with PSWIPENEW enabled, there is
|
||||||
// no workspace there yet, and we need to choose an ID for a new one now.
|
// no workspace there yet, and we need to choose an ID for a new one now.
|
||||||
if (workspaceIDRight <= m_workspaceBegin->m_id && *PSWIPENEW)
|
if (workspaceIDRight <= m_workspaceBegin->m_id && *PSWIPEBOUND == 1)
|
||||||
workspaceIDRight = getWorkspaceIDNameFromString("r+1").id;
|
workspaceIDRight = getWorkspaceIDNameFromString("r+1").id;
|
||||||
|
|
||||||
auto PWORKSPACER = g_pCompositor->getWorkspaceByID(workspaceIDRight); // not guaranteed if PSWIPENEW || PSWIPENUMBER
|
auto PWORKSPACER = g_pCompositor->getWorkspaceByID(workspaceIDRight); // not guaranteed if PSWIPENEW || PSWIPENUMBER
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
void CWorkspaceSwipeGesture::begin(const ITrackpadGesture::STrackpadGestureBegin& e) {
|
void CWorkspaceSwipeGesture::begin(const ITrackpadGesture::STrackpadGestureBegin& e) {
|
||||||
ITrackpadGesture::begin(e);
|
ITrackpadGesture::begin(e);
|
||||||
|
|
||||||
static auto PSWIPENEW = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_create_new");
|
static auto PSWIPEBOUND = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_bound");
|
||||||
|
|
||||||
if (g_pSessionLockManager->isSessionLocked() || g_pUnifiedWorkspaceSwipe->isGestureInProgress())
|
if (g_pSessionLockManager->isSessionLocked() || g_pUnifiedWorkspaceSwipe->isGestureInProgress())
|
||||||
return;
|
return;
|
||||||
|
|
@ -20,7 +20,7 @@ void CWorkspaceSwipeGesture::begin(const ITrackpadGesture::STrackpadGestureBegin
|
||||||
onMonitor++;
|
onMonitor++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (onMonitor < 2 && !*PSWIPENEW)
|
if (onMonitor < 2 && *PSWIPEBOUND != 1)
|
||||||
return; // disallow swiping when there's 1 workspace on a monitor
|
return; // disallow swiping when there's 1 workspace on a monitor
|
||||||
|
|
||||||
g_pUnifiedWorkspaceSwipe->begin();
|
g_pUnifiedWorkspaceSwipe->begin();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue