Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ to `main` publishes every changed version at once, so when merging, rename

## Unreleased

### labwc 1:0.20.2-8

- Pressing Home on the lock screen no longer leaves it held down: the lock
screen gets the release too, so it stops repeating the key and keeping
the screen lit.

### labwc 1:0.20.2-7

- In the overview, a long press on a window (a right click, the Menu key)
Expand Down
8 changes: 6 additions & 2 deletions packages/labwc/arch/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pkgname=labwc
_commit=97f28877a343e062f3178d201f0248cd9c2610cf
epoch=1
pkgver=0.20.2
pkgrel=7
pkgrel=8
pkgdesc='stacking wayland compositor with look and feel from openbox, with OrchardLinux tablet patches'
url="https://github.com/labwc/labwc"
arch=('aarch64' 'armv7h')
Expand Down Expand Up @@ -67,6 +67,7 @@ _patches=(
0008-no-pointer-focus-while-cursor-hidden.patch
0009-bottom-swipe-ignore-namespace-list.patch
0010-overview-card-menu.patch
0011-locked-key-release.patch
)
source=("labwc-${_commit}.tar.gz::https://codeload.github.com/labwc/labwc/tar.gz/${_commit}"
"${_patches[@]}")
Expand All @@ -80,7 +81,8 @@ sha256sums=('022676dbcbf6b6206b97d7bac8a339c8a0203e3e99693107c15b5a6183e4b0ea'
'c767678e286a44bc35c18536f2ed7e9fe4d7d0c812dfe024aa30c0d524112283'
'd0bf697fb73e3cc6e3b3e90448b5bc03903e129477d68f691f0dec1542acfc68'
'cfaf13b54c712df2a41dc18d3b9a4358afeecb2384673b2ec44167a7186e9943'
'f7e017810aa37f54c7db0f18bb92486ba1b7d40892377989d58d96e70c00b9c0')
'f7e017810aa37f54c7db0f18bb92486ba1b7d40892377989d58d96e70c00b9c0'
'9fa24e24cd27558826344fa4a0b091b8def183d9d4e6975062a9b73d97487a0a')

prepare() {
local patch
Expand Down Expand Up @@ -116,6 +118,8 @@ check() {
python3 "${startdir}/test-swipe-ignore-list.py" "labwc-${_commit}"
# A card's menu in the overview (0010).
python3 "${startdir}/test-overview-menu.py" "labwc-${_commit}"
# A key pressed on the lock screen gets its release too (0011).
python3 "${startdir}/test-locked-key-release.py" "labwc-${_commit}"
}

package() {
Expand Down
16 changes: 16 additions & 0 deletions packages/labwc/patches/0011-locked-key-release.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- a/src/input/keyboard.c
+++ b/src/input/keyboard.c
@@ -588,6 +588,13 @@
return LAB_KEY_HANDLED_TRUE;
}

+ /*
+ * The press goes to the client, so its release must too. A binding
+ * that matched but does not apply while locked would otherwise stay
+ * current, and its on-release branch above would swallow the release:
+ * the lock screen keeps the key pressed and repeats it.
+ */
+ cur_keybind = NULL;
return LAB_KEY_HANDLED_FALSE;
}

23 changes: 23 additions & 0 deletions packages/labwc/tests/test-locked-key-release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
"""A key press that goes to the client leaves no binding current (0011).

Run by check(): test-locked-key-release.py SOURCE. With the session locked,
a key bound on release (Home) matches a binding that does not apply while
locked; the press goes to the lock screen. The release must follow it, so
the binding must not stay current for the release branch to swallow.
"""
from pathlib import Path
import re
import sys

keyboard = (Path(sys.argv[1]) / 'src/input/keyboard.c').read_text()
start = keyboard.index('\nhandle_compositor_keybindings(')
body = keyboard[start:keyboard.index('\n}\n', start)]
# The release branch swallows the release of a current on-release binding.
assert re.search(r'if \(cur_keybind && cur_keybind->on_release\) \{', body), 'release branch'
# The press that is not the compositor's clears the binding before going on.
tail = body[body.rindex('cur_keybind = match_keybinding('):]
handled = tail.index('return LAB_KEY_HANDLED_TRUE;')
to_client = tail.rindex('return LAB_KEY_HANDLED_FALSE;')
assert 'cur_keybind = NULL;' in tail[handled:to_client], 'a press to the client clears the binding'
print('locked key release: ok')
Loading