mirror of
https://github.com/X11Libre/xf86-input-libinput.git
synced 2026-04-14 10:54:17 +00:00
Compare commits
5 Commits
xlibre-xf8
...
tracking/x
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac862672e4 | ||
|
|
c169537717 | ||
|
|
79b62f322a | ||
|
|
6612ab7e97 | ||
|
|
709d0b0a9a |
17
.editorconfig
Normal file
17
.editorconfig
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# https://editorconfig.org/
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.{c,h}]
|
||||||
|
indent_size = 8
|
||||||
|
indent_style = tab
|
||||||
|
|
||||||
|
[{meson.build,meson_options.txt}]
|
||||||
|
indent_size = 8
|
||||||
|
indent_style = tab
|
||||||
65
.github/ISSUE_TEMPLATE/01-bug-report.yml
vendored
65
.github/ISSUE_TEMPLATE/01-bug-report.yml
vendored
@@ -1,65 +0,0 @@
|
|||||||
name: 🐞 Bug report
|
|
||||||
description: Create a report to help us improve
|
|
||||||
|
|
||||||
labels: [bug, needs-triage]
|
|
||||||
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Please fill out the sections below to help everyone identify and fix the bug. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
|
|
||||||
- type: dropdown
|
|
||||||
id: affected-version
|
|
||||||
attributes:
|
|
||||||
label: Select the version
|
|
||||||
options:
|
|
||||||
- 1.5.0.1
|
|
||||||
- Git master branch
|
|
||||||
- other or don't know
|
|
||||||
default: 1
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: Describe your issue
|
|
||||||
placeholder: When I did X then Y happened.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: steps
|
|
||||||
attributes:
|
|
||||||
label: Steps to reproduce
|
|
||||||
placeholder: |
|
|
||||||
1. Start ...
|
|
||||||
2. Do this
|
|
||||||
3. Do that
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: expected
|
|
||||||
attributes:
|
|
||||||
label: What did you expect?
|
|
||||||
placeholder: I expected this to happen.
|
|
||||||
- type: textarea
|
|
||||||
id: environment
|
|
||||||
attributes:
|
|
||||||
label: Additional Information
|
|
||||||
description: |
|
|
||||||
Additional information you want to provide such as logs, system info, environment, screenshots, etc.
|
|
||||||
placeholder: |
|
|
||||||
Add any other context about the bug here.
|
|
||||||
- type: checkboxes
|
|
||||||
id: checks
|
|
||||||
attributes:
|
|
||||||
label: Extra fields
|
|
||||||
options:
|
|
||||||
- label: I have checked the existing [issues](https://github.com/X11Libre/xf86-input-libinput/issues)
|
|
||||||
required: true
|
|
||||||
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
|
|
||||||
required: true
|
|
||||||
- label: I'd like to work on this issue
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thanks for reporting this issue! We will get back to you as soon as possible.
|
|
||||||
49
.github/ISSUE_TEMPLATE/02-feature-request.yml
vendored
49
.github/ISSUE_TEMPLATE/02-feature-request.yml
vendored
@@ -1,49 +0,0 @@
|
|||||||
name: ✨ Feature request
|
|
||||||
description: Suggest a feature for this software
|
|
||||||
labels: [enhancement, needs-triage]
|
|
||||||
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Please fill out the sections below to properly describe the new software feature you are suggesting. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: "Describe the feature"
|
|
||||||
placeholder: A thing in X that allows to do Y.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: rationale
|
|
||||||
attributes:
|
|
||||||
label: "It should be done because"
|
|
||||||
placeholder: Doing Y is needed for Z.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: alternative
|
|
||||||
attributes:
|
|
||||||
label: "What are the alternatives?"
|
|
||||||
placeholder: We could do A or B instead.
|
|
||||||
- type: textarea
|
|
||||||
id: context
|
|
||||||
attributes:
|
|
||||||
label: Additional context
|
|
||||||
description: Additional information you want to provide such as references to related issues or protocols, the implications on existing use cases, etc.
|
|
||||||
placeholder: |
|
|
||||||
Add any other context about the feature request here.
|
|
||||||
- type: checkboxes
|
|
||||||
id: checks
|
|
||||||
attributes:
|
|
||||||
label: Extra fields
|
|
||||||
options:
|
|
||||||
- label: I have checked the existing [issues](https://github.com/X11Libre/xf86-input-libinput/issues)
|
|
||||||
required: true
|
|
||||||
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
|
|
||||||
required: true
|
|
||||||
- label: I'd like to work on this issue
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thanks for your suggestion! Let's see together if it can be done.
|
|
||||||
49
.github/ISSUE_TEMPLATE/03-code-cleanup.yml
vendored
49
.github/ISSUE_TEMPLATE/03-code-cleanup.yml
vendored
@@ -1,49 +0,0 @@
|
|||||||
name: 🔧 Code cleanup
|
|
||||||
description: Level up the source code
|
|
||||||
labels: [code-cleanup, needs-triage]
|
|
||||||
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Please fill out the sections below to properly describe the code cleanup you are suggesting. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: "Describe the cleanup"
|
|
||||||
placeholder: C in X needs to be changed into D.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: rationale
|
|
||||||
attributes:
|
|
||||||
label: "It should be done because"
|
|
||||||
placeholder: Having D is needed for E.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: alternative
|
|
||||||
attributes:
|
|
||||||
label: "What are the alternatives?"
|
|
||||||
placeholder: We could do A or B instead.
|
|
||||||
- type: textarea
|
|
||||||
id: context
|
|
||||||
attributes:
|
|
||||||
label: Additional context
|
|
||||||
description: Additional information you want to provide such as implications on existing code, how to ensure API/ABI stability, which tests are needed or to be run, related issues, etc.
|
|
||||||
placeholder: |
|
|
||||||
Add any other context about the cleanup here.
|
|
||||||
- type: checkboxes
|
|
||||||
id: checks
|
|
||||||
attributes:
|
|
||||||
label: Extra fields
|
|
||||||
options:
|
|
||||||
- label: I have checked the existing [issues](https://github.com/X11Libre/xf86-input-libinput/issues)
|
|
||||||
required: true
|
|
||||||
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
|
|
||||||
required: true
|
|
||||||
- label: I'd like to work on this issue
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thanks for looking at the source code! Let's see together how it can be improved.
|
|
||||||
38
.github/ISSUE_TEMPLATE/04-doc-update.yml
vendored
38
.github/ISSUE_TEMPLATE/04-doc-update.yml
vendored
@@ -1,38 +0,0 @@
|
|||||||
name: 🔖 Documentation update
|
|
||||||
description: Make your mark for better documentation
|
|
||||||
|
|
||||||
labels: [documentation, needs-triage]
|
|
||||||
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Please fill out the sections below to help others understand our software. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: Describe the update
|
|
||||||
placeholder: These things need to be better documented.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: environment
|
|
||||||
attributes:
|
|
||||||
label: Additional Information
|
|
||||||
description: Additional information you want to provide such as tickets related to changes in the software, affected files, screenshots, etc.
|
|
||||||
placeholder: |
|
|
||||||
Add any other context about the update here.
|
|
||||||
- type: checkboxes
|
|
||||||
id: checks
|
|
||||||
attributes:
|
|
||||||
label: Extra fields
|
|
||||||
options:
|
|
||||||
- label: I have checked the existing [issues](https://github.com/X11Libre/xf86-input-libinput/issues)
|
|
||||||
required: true
|
|
||||||
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
|
|
||||||
required: true
|
|
||||||
- label: I'd like to work on this issue
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thanks for requesting this update! We will get back to you as soon as possible.
|
|
||||||
43
.github/ISSUE_TEMPLATE/05-org-task.yml
vendored
43
.github/ISSUE_TEMPLATE/05-org-task.yml
vendored
@@ -1,43 +0,0 @@
|
|||||||
name: ✅ Organizational task
|
|
||||||
description: Create a task for project organization
|
|
||||||
|
|
||||||
labels: [needs-triage, organization]
|
|
||||||
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Please fill out the sections below to get organizational things done. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: Describe the task
|
|
||||||
placeholder: These things need to be done.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: rationale
|
|
||||||
attributes:
|
|
||||||
label: "It should be done because"
|
|
||||||
placeholder: Doing Y is needed for Z.
|
|
||||||
- type: textarea
|
|
||||||
id: environment
|
|
||||||
attributes:
|
|
||||||
label: Additional Information
|
|
||||||
description: Additional information you want to provide such as the context for bigger tasks, the implicatons on existing workflows, related issues, etc.
|
|
||||||
placeholder: |
|
|
||||||
Add any other context about the task here.
|
|
||||||
- type: checkboxes
|
|
||||||
id: checks
|
|
||||||
attributes:
|
|
||||||
label: Extra fields
|
|
||||||
options:
|
|
||||||
- label: I have checked the existing [issues](https://github.com/X11Libre/xf86-input-libinput/issues)
|
|
||||||
required: true
|
|
||||||
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
|
|
||||||
required: true
|
|
||||||
- label: I'd like to work on this issue
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thanks for adding this task! We will get back to you as soon as possible.
|
|
||||||
8
.github/ISSUE_TEMPLATE/config.yml
vendored
8
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,8 +0,0 @@
|
|||||||
blank_issues_enabled: false
|
|
||||||
contact_links:
|
|
||||||
- name: XLibre Community Support
|
|
||||||
url: https://github.com/orgs/X11Libre/discussions
|
|
||||||
about: Please ask and answer questions here.
|
|
||||||
- name: Mailing List
|
|
||||||
url: https://www.freelists.org/list/xlibre
|
|
||||||
about: You can join the discussions on our mailing list.
|
|
||||||
50
.github/workflows/build.yml
vendored
50
.github/workflows/build.yml
vendored
@@ -1,50 +0,0 @@
|
|||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
ubuntu:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
xserver-version: [ master, xlibre-xserver-25.1.0, xlibre-xserver-25.0.0.18 ]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: X11Libre/action-build-driver/target/ubuntu@v0.3.7
|
|
||||||
with:
|
|
||||||
xserver-version: ${{ matrix.xserver-version }}
|
|
||||||
|
|
||||||
freebsd:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
xserver-version: [ master, xlibre-xserver-25.1.0, xlibre-xserver-25.0.0.18 ]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: X11Libre/action-build-driver/target/freebsd@v0.3.7
|
|
||||||
with:
|
|
||||||
xserver-version: ${{ matrix.xserver-version }}
|
|
||||||
|
|
||||||
dragonfly:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
# xlibre-xserver-25.0.x not compiling on dragonfly yet
|
|
||||||
xserver-version: [ master, xlibre-xserver-25.1.0 ]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: X11Libre/action-build-driver/target/dragonfly@v0.3.7
|
|
||||||
with:
|
|
||||||
xserver-version: ${{ matrix.xserver-version }}
|
|
||||||
|
|
||||||
# not supported on NetBSD
|
|
||||||
|
|
||||||
release-notes:
|
|
||||||
name: Release pushed tag
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ startsWith(github.ref, 'refs/tags/xlibre-') }}
|
|
||||||
needs: [ ubuntu, freebsd, dragonfly ]
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
steps:
|
|
||||||
- uses: X11Libre/action-build-driver/release@v0.3.7
|
|
||||||
83
.gitlab-ci.yml
Normal file
83
.gitlab-ci.yml
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0 filetype=yaml:
|
||||||
|
#
|
||||||
|
# This CI uses the freedesktop.org ci-templates.
|
||||||
|
# Please see the ci-templates documentation for details:
|
||||||
|
# https://freedesktop.pages.freedesktop.org/ci-templates/
|
||||||
|
|
||||||
|
.templates_sha: &template_sha fb9d50ccb3cbbb4c6dc5f9ef53a0ad3cb0d8a177
|
||||||
|
|
||||||
|
include:
|
||||||
|
- project: 'freedesktop/ci-templates'
|
||||||
|
ref: *template_sha
|
||||||
|
file: '/templates/fedora.yml'
|
||||||
|
- project: 'freedesktop/ci-templates'
|
||||||
|
ref: *template_sha
|
||||||
|
file: '/templates/ci-fairy.yml'
|
||||||
|
- template: Security/SAST.gitlab-ci.yml
|
||||||
|
|
||||||
|
variables:
|
||||||
|
FDO_UPSTREAM_REPO: xorg/driver/xf86-input-libinput
|
||||||
|
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- containers
|
||||||
|
- build
|
||||||
|
- test
|
||||||
|
|
||||||
|
.fedora:
|
||||||
|
variables:
|
||||||
|
FDO_DISTRIBUTION_VERSION: 43
|
||||||
|
FDO_DISTRIBUTION_PACKAGES: 'git autoconf automake libtool make xorg-x11-server-devel libudev-devel libevdev-devel libinput-devel xorg-x11-util-macros diffutils'
|
||||||
|
FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/fedora-install.sh'
|
||||||
|
FDO_DISTRIBUTION_TAG: '2025-10-24.0'
|
||||||
|
|
||||||
|
|
||||||
|
fedora@container_build:
|
||||||
|
extends:
|
||||||
|
- .fedora
|
||||||
|
- .fdo.container-build@fedora
|
||||||
|
stage: containers
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
|
||||||
|
|
||||||
|
.default_build:
|
||||||
|
stage: build
|
||||||
|
script:
|
||||||
|
- mkdir _builddir _inst
|
||||||
|
- pushd _builddir > /dev/null
|
||||||
|
- ../autogen.sh --prefix=$(realpath ../_inst) --disable-silent-rules
|
||||||
|
- make && make check
|
||||||
|
- make install
|
||||||
|
- popd > /dev/null
|
||||||
|
artifacts:
|
||||||
|
name: "automake-logs-$CI_JOB_NAME"
|
||||||
|
when: always
|
||||||
|
expire_in: 1 week
|
||||||
|
paths:
|
||||||
|
- _builddir/config.log
|
||||||
|
|
||||||
|
|
||||||
|
fedora@default-build:
|
||||||
|
extends:
|
||||||
|
- .fedora
|
||||||
|
- .fdo.distribution-image@fedora
|
||||||
|
- .default_build
|
||||||
|
|
||||||
|
#
|
||||||
|
# Verify that commit messages are as expected
|
||||||
|
#
|
||||||
|
check-commits:
|
||||||
|
extends:
|
||||||
|
- .fdo.ci-fairy
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- ci-fairy check-commits --junit-xml=results.xml
|
||||||
|
except:
|
||||||
|
- master@xorg/driver/xf86-input-libinput
|
||||||
|
variables:
|
||||||
|
GIT_DEPTH: 100
|
||||||
|
artifacts:
|
||||||
|
reports:
|
||||||
|
junit: results.xml
|
||||||
|
allow_failure: true
|
||||||
9
.gitlab-ci/fedora-install.sh
Executable file
9
.gitlab-ci/fedora-install.sh
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# we require at least inputproto >= 2.3.99.1 which has been released in xorgproto 2021.5
|
||||||
|
git clone https://gitlab.freedesktop.org/xorg/proto/xorgproto.git --depth 1 --branch=xorgproto-2021.5
|
||||||
|
pushd xorgproto
|
||||||
|
./autogen.sh
|
||||||
|
make -j${FDO_CI_CONCURRENT:-4} install
|
||||||
|
popd
|
||||||
|
rm -rf xorgproto
|
||||||
@@ -19,10 +19,7 @@
|
|||||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
# During distcheck, system locations (as provided by pkg-config) may
|
DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir='$${includedir}/xorg'
|
||||||
# not be writable; provide instead relative locations.
|
|
||||||
DISTCHECK_CONFIGURE_FLAGS = --with-xorg-module-dir='$${libdir}/xorg/modules' \
|
|
||||||
--with-sdkdir='$${includedir}/xorg'
|
|
||||||
|
|
||||||
SUBDIRS = src include man test
|
SUBDIRS = src include man test
|
||||||
MAINTAINERCLEANFILES = ChangeLog INSTALL
|
MAINTAINERCLEANFILES = ChangeLog INSTALL
|
||||||
|
|||||||
26
README.md
26
README.md
@@ -2,8 +2,7 @@ xf86-input-libinput - a libinput-based X driver
|
|||||||
===============================================
|
===============================================
|
||||||
|
|
||||||
The official repository for this driver is
|
The official repository for this driver is
|
||||||
|
https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput
|
||||||
https://github.com/X11Libre/xf86-input-evdev
|
|
||||||
|
|
||||||
This is an X driver based on libinput. It is a thin wrapper around libinput,
|
This is an X driver based on libinput. It is a thin wrapper around libinput,
|
||||||
so while it does provide all features that libinput supports it does little
|
so while it does provide all features that libinput supports it does little
|
||||||
@@ -13,6 +12,19 @@ beyond.
|
|||||||
usable input devices in your X session. Use with caution.***
|
usable input devices in your X session. Use with caution.***
|
||||||
|
|
||||||
|
|
||||||
|
Prerequisites
|
||||||
|
-------------
|
||||||
|
|
||||||
|
To build, you'll need the X.Org X server SDK (check your distribution for a
|
||||||
|
xorg-x11-server-devel package or similar) and libinput (check your
|
||||||
|
distribution for libinput-devel or similar).
|
||||||
|
|
||||||
|
To get libinput from source, see:
|
||||||
|
https://www.freedesktop.org/wiki/Software/libinput/
|
||||||
|
|
||||||
|
To build the X server from source:
|
||||||
|
https://www.x.org/wiki/Building_the_X_Window_System/
|
||||||
|
|
||||||
Building
|
Building
|
||||||
--------
|
--------
|
||||||
|
|
||||||
@@ -31,3 +43,13 @@ Install the default configuration file:
|
|||||||
cp conf/99-libinput.conf /etc/X11/xorg.conf.d/
|
cp conf/99-libinput.conf /etc/X11/xorg.conf.d/
|
||||||
|
|
||||||
This will assign this driver to *all* devices. Use with caution.
|
This will assign this driver to *all* devices. Use with caution.
|
||||||
|
|
||||||
|
|
||||||
|
Bugs
|
||||||
|
----
|
||||||
|
|
||||||
|
Bugs in libinput go to the Issues section of the libinput gitlab project:
|
||||||
|
https://gitlab.freedesktop.org/libinput/libinput/issues
|
||||||
|
|
||||||
|
Bugs in this driver go to the Issues section of its gitlab project:
|
||||||
|
https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/issues
|
||||||
|
|||||||
26
configure.ac
26
configure.ac
@@ -22,10 +22,10 @@
|
|||||||
|
|
||||||
# Initialize Autoconf
|
# Initialize Autoconf
|
||||||
AC_PREREQ([2.60])
|
AC_PREREQ([2.60])
|
||||||
AC_INIT([xlibre-xf86-input-libinput],
|
AC_INIT([xf86-input-libinput],
|
||||||
[25.0.1],
|
[1.5.0],
|
||||||
[https://github.com/X11Libre/xf86-input-libinput/issues],
|
[https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/issues],
|
||||||
[xlibre-xf86-input-libinput])
|
[xf86-input-libinput])
|
||||||
AC_CONFIG_SRCDIR([Makefile.am])
|
AC_CONFIG_SRCDIR([Makefile.am])
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
AC_CONFIG_AUX_DIR(.)
|
AC_CONFIG_AUX_DIR(.)
|
||||||
@@ -43,12 +43,14 @@ m4_ifndef([XORG_MACROS_VERSION],
|
|||||||
XORG_MACROS_VERSION(1.8)
|
XORG_MACROS_VERSION(1.8)
|
||||||
XORG_DEFAULT_OPTIONS
|
XORG_DEFAULT_OPTIONS
|
||||||
|
|
||||||
CFLAGS="$CFLAGS -Wno-declaration-after-statement"
|
|
||||||
|
|
||||||
# Obtain compiler/linker options from server and required extensions
|
# Obtain compiler/linker options from server and required extensions
|
||||||
PKG_CHECK_MODULES(XORG, [xorg-server >= 25.0.0] xproto [inputproto >= 2.3.99.1])
|
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.19] xproto [inputproto >= 2.2])
|
||||||
PKG_CHECK_MODULES(LIBINPUT, [libinput >= 1.11.0])
|
PKG_CHECK_MODULES(LIBINPUT, [libinput >= 1.11.0])
|
||||||
|
|
||||||
|
PKG_CHECK_MODULES(INPUTPROTO24, [inputproto >= 2.3.99.1],
|
||||||
|
[AC_DEFINE(HAVE_INPUTPROTO24, [1], [inputproto 2.4 is available])],
|
||||||
|
[:])
|
||||||
|
|
||||||
OLD_LIBS=$LIBS
|
OLD_LIBS=$LIBS
|
||||||
OLD_CFLAGS=$CFLAGS
|
OLD_CFLAGS=$CFLAGS
|
||||||
LIBS="$LIBS $LIBINPUT_LIBS"
|
LIBS="$LIBS $LIBINPUT_LIBS"
|
||||||
@@ -124,12 +126,11 @@ LIBS=$OLD_LIBS
|
|||||||
CFLAGS=$OLD_CFLAGS
|
CFLAGS=$OLD_CFLAGS
|
||||||
|
|
||||||
# Define a configure option for an alternate input module directory
|
# Define a configure option for an alternate input module directory
|
||||||
PKG_PROG_PKG_CONFIG([0.25])
|
|
||||||
AC_ARG_WITH(xorg-module-dir,
|
AC_ARG_WITH(xorg-module-dir,
|
||||||
AS_HELP_STRING([--with-xorg-module-dir=DIR],
|
AC_HELP_STRING([--with-xorg-module-dir=DIR],
|
||||||
[Default xorg module directory]),
|
[Default xorg module directory [[default=$libdir/xorg/modules]]]),
|
||||||
[moduledir="$withval"],
|
[moduledir="$withval"],
|
||||||
[moduledir=`$PKG_CONFIG --variable=moduledir xorg-server`])
|
[moduledir="$libdir/xorg/modules"])
|
||||||
inputdir=${moduledir}/input
|
inputdir=${moduledir}/input
|
||||||
AC_SUBST(inputdir)
|
AC_SUBST(inputdir)
|
||||||
|
|
||||||
@@ -148,6 +149,9 @@ sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
|
|||||||
AC_ARG_WITH([sdkdir], [], [sdkdir="$withval"])
|
AC_ARG_WITH([sdkdir], [], [sdkdir="$withval"])
|
||||||
AC_SUBST([sdkdir])
|
AC_SUBST([sdkdir])
|
||||||
|
|
||||||
|
DRIVER_NAME=libinput
|
||||||
|
AC_SUBST([DRIVER_NAME])
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile
|
AC_CONFIG_FILES([Makefile
|
||||||
include/Makefile
|
include/Makefile
|
||||||
src/Makefile
|
src/Makefile
|
||||||
|
|||||||
@@ -154,12 +154,6 @@
|
|||||||
/* Scroll pixel distance: CARD32, 1 value, read-only */
|
/* Scroll pixel distance: CARD32, 1 value, read-only */
|
||||||
#define LIBINPUT_PROP_SCROLL_PIXEL_DISTANCE_DEFAULT "libinput Scrolling Pixel Distance Default"
|
#define LIBINPUT_PROP_SCROLL_PIXEL_DISTANCE_DEFAULT "libinput Scrolling Pixel Distance Default"
|
||||||
|
|
||||||
/* Scroll factor: FLOAT, 1 value, 32 bit */
|
|
||||||
#define LIBINPUT_PROP_SCROLL_FACTOR "libinput Scrolling Factor"
|
|
||||||
|
|
||||||
/* Scroll factor: FLOAT, 1 value, 32 bit, read-only */
|
|
||||||
#define LIBINPUT_PROP_SCROLL_FACTOR_DEFAULT "libinput Scrolling Factor Default"
|
|
||||||
|
|
||||||
/* Click method: BOOL read-only, 2 values in order buttonareas, clickfinger
|
/* Click method: BOOL read-only, 2 values in order buttonareas, clickfinger
|
||||||
shows available click methods */
|
shows available click methods */
|
||||||
#define LIBINPUT_PROP_CLICK_METHODS_AVAILABLE "libinput Click Methods Available"
|
#define LIBINPUT_PROP_CLICK_METHODS_AVAILABLE "libinput Click Methods Available"
|
||||||
|
|||||||
@@ -22,11 +22,11 @@
|
|||||||
|
|
||||||
drivermandir = $(DRIVER_MAN_DIR)
|
drivermandir = $(DRIVER_MAN_DIR)
|
||||||
|
|
||||||
driverman_PRE = libinput.man
|
driverman_PRE = $(DRIVER_NAME).man
|
||||||
|
|
||||||
driverman_DATA = $(driverman_PRE:man=$(DRIVER_MAN_SUFFIX))
|
driverman_DATA = $(driverman_PRE:man=$(DRIVER_MAN_SUFFIX))
|
||||||
|
|
||||||
EXTRA_DIST = libinput.man
|
EXTRA_DIST = $(DRIVER_NAME).man
|
||||||
|
|
||||||
CLEANFILES = $(driverman_DATA)
|
CLEANFILES = $(driverman_DATA)
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ If you are looking for the library documentation, go to
|
|||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.B libinput
|
.B libinput
|
||||||
is an XLibre input driver based on libinput.
|
is an Xorg input driver based on libinput.
|
||||||
It therefore supports all input devices that libinput can handle, including
|
It therefore supports all input devices that libinput can handle, including
|
||||||
most mice, keyboards, tablets and touchscreens.
|
most mice, keyboards, tablets and touchscreens.
|
||||||
.PP
|
.PP
|
||||||
@@ -178,15 +178,6 @@ Enables left-handed button orientation, i.e. swapping left and right buttons.
|
|||||||
Enables middle button emulation.
|
Enables middle button emulation.
|
||||||
When enabled, pressing the left and right
|
When enabled, pressing the left and right
|
||||||
buttons simultaneously produces a middle mouse button click.
|
buttons simultaneously produces a middle mouse button click.
|
||||||
A synonym
|
|
||||||
.IP
|
|
||||||
.BI "Option \*qEmulate3Buttons\*q \*q" bool \*q
|
|
||||||
.IP
|
|
||||||
is preserved for compatibility with
|
|
||||||
.B evdev
|
|
||||||
driver, with
|
|
||||||
.BI "\*qMiddleEmulation\*q
|
|
||||||
having preference if both are set.
|
|
||||||
.TP 7
|
.TP 7
|
||||||
.BI "Option \*qNaturalScrolling\*q \*q" bool \*q
|
.BI "Option \*qNaturalScrolling\*q \*q" bool \*q
|
||||||
Enables or disables natural scrolling behavior.
|
Enables or disables natural scrolling behavior.
|
||||||
@@ -215,11 +206,6 @@ If disabled (the default), the
|
|||||||
button is considered logically down while held down and up once physically
|
button is considered logically down while held down and up once physically
|
||||||
released.
|
released.
|
||||||
.TP 7
|
.TP 7
|
||||||
.BI "Option \*qScrollFactor\*q \*q" float \*q
|
|
||||||
Sets the scroll factor for scroll events. A value higher than 1.0 means faster scrolling.
|
|
||||||
Applications that don't support xi2 input will instead receive scroll button events
|
|
||||||
less or more frequently depending on the scroll factor value, instead of scrolling "smoother".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qScrollMethod\*q \*q" string \*q
|
.BI "Option \*qScrollMethod\*q \*q" string \*q
|
||||||
Enables a scroll method. Permitted values are
|
Enables a scroll method. Permitted values are
|
||||||
.BR none ,
|
.BR none ,
|
||||||
@@ -400,12 +386,6 @@ Indicates if middle emulation is enabled or disabled.
|
|||||||
Sets the rotation angle of the device,
|
Sets the rotation angle of the device,
|
||||||
clockwise of its natural neutral position.
|
clockwise of its natural neutral position.
|
||||||
.TP 7
|
.TP 7
|
||||||
.B "libinput Scrolling Factor"
|
|
||||||
1 32-bit float value.
|
|
||||||
Sets the scroll factor for scroll events. A value higher than 1.0 means faster scrolling.
|
|
||||||
Applications that don't support xi2 input will instead receive scroll button events
|
|
||||||
less or more frequently depending on the scroll factor value, instead of scrolling "smoother".
|
|
||||||
.TP 7
|
|
||||||
.B "libinput Scroll Methods Available"
|
.B "libinput Scroll Methods Available"
|
||||||
3 boolean values (8 bit, 0 or 1), in order "two-finger", "edge", "button".
|
3 boolean values (8 bit, 0 or 1), in order "two-finger", "edge", "button".
|
||||||
Indicates which scroll methods are available on this device.
|
Indicates which scroll methods are available on this device.
|
||||||
@@ -414,7 +394,7 @@ Indicates which scroll methods are available on this device.
|
|||||||
3 boolean values (8 bit, 0 or 1), in order "two-finger", "edge", "button".
|
3 boolean values (8 bit, 0 or 1), in order "two-finger", "edge", "button".
|
||||||
Indicates which scroll method is currently enabled on this device.
|
Indicates which scroll method is currently enabled on this device.
|
||||||
.TP 7
|
.TP 7
|
||||||
.B "libinput Scrolling Pixel Distance"
|
.B "libinput Scroll Pixel Distance"
|
||||||
1 32-bit value (nonzero, with additional implementation-defined range checks).
|
1 32-bit value (nonzero, with additional implementation-defined range checks).
|
||||||
Changes the movement distance required to trigger one logical wheel click.
|
Changes the movement distance required to trigger one logical wheel click.
|
||||||
.TP 7
|
.TP 7
|
||||||
@@ -477,13 +457,13 @@ button mapping of
|
|||||||
.B "\*q3 2 1 ...\*q"
|
.B "\*q3 2 1 ...\*q"
|
||||||
On systems using the
|
On systems using the
|
||||||
.B libinput
|
.B libinput
|
||||||
XLibre input driver it is recommended to use the
|
Xorg input driver it is recommended to use the
|
||||||
.B LeftHanded
|
.B LeftHanded
|
||||||
option instead.
|
option instead.
|
||||||
.PP
|
.PP
|
||||||
The
|
The
|
||||||
.B libinput
|
.B libinput
|
||||||
XLibre input driver does not use the button mapping after setup.
|
Xorg input driver does not use the button mapping after setup.
|
||||||
Use
|
Use
|
||||||
.BR XSetPointerMapping (3)
|
.BR XSetPointerMapping (3)
|
||||||
to modify the button mapping at runtime.
|
to modify the button mapping at runtime.
|
||||||
@@ -606,7 +586,7 @@ appropriate \fBMatch*\fR statement in the
|
|||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
Peter Hutterer
|
Peter Hutterer
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
.BR XLibre (1),
|
.BR Xorg (1),
|
||||||
.BR xorg.conf (5),
|
.BR xorg.conf (5),
|
||||||
.BR Xserver (1),
|
.BR Xserver (1),
|
||||||
.BR X (7)
|
.BR X (7)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
project('xf86-input-libinput', 'c',
|
project('xf86-input-libinput', 'c',
|
||||||
version: '25.0.1',
|
version: '1.5.0', # bump version in configure.ac
|
||||||
default_options: ['warning_level=2'],
|
default_options: ['warning_level=2'],
|
||||||
meson_version: '>= 0.50.0')
|
meson_version: '>= 0.50.0')
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ add_project_arguments(cc.get_supported_arguments(cflags), language: 'c')
|
|||||||
pkgconfig = import('pkgconfig')
|
pkgconfig = import('pkgconfig')
|
||||||
dep_xserver = dependency('xorg-server', version: '>= 1.19')
|
dep_xserver = dependency('xorg-server', version: '>= 1.19')
|
||||||
dep_xproto = dependency('xproto')
|
dep_xproto = dependency('xproto')
|
||||||
dep_inputproto = dependency('inputproto', version: '>= 2.3.99.1')
|
dep_inputproto = dependency('inputproto', version: '>= 2.2')
|
||||||
dep_libinput = dependency('libinput', version: '>= 1.11.0')
|
dep_libinput = dependency('libinput', version: '>= 1.11.0')
|
||||||
|
|
||||||
config_h = configuration_data()
|
config_h = configuration_data()
|
||||||
@@ -41,6 +41,10 @@ config_h.set('PACKAGE_VERSION_MAJOR', driver_version[0])
|
|||||||
config_h.set('PACKAGE_VERSION_MINOR', driver_version[1])
|
config_h.set('PACKAGE_VERSION_MINOR', driver_version[1])
|
||||||
config_h.set('PACKAGE_VERSION_PATCHLEVEL', driver_version[2])
|
config_h.set('PACKAGE_VERSION_PATCHLEVEL', driver_version[2])
|
||||||
|
|
||||||
|
if dep_inputproto.version().version_compare('>= 2.3.99.1')
|
||||||
|
config_h.set('HAVE_INPUTPROTO24', 1)
|
||||||
|
endif
|
||||||
|
|
||||||
if cc.has_function('libinput_device_config_scroll_get_button_lock',
|
if cc.has_function('libinput_device_config_scroll_get_button_lock',
|
||||||
dependencies: dep_libinput)
|
dependencies: dep_libinput)
|
||||||
config_h.set('HAVE_LIBINPUT_SCROLL_BUTTON_LOCK', 1)
|
config_h.set('HAVE_LIBINPUT_SCROLL_BUTTON_LOCK', 1)
|
||||||
|
|||||||
@@ -28,12 +28,12 @@
|
|||||||
AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS)
|
AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS)
|
||||||
AM_CPPFLAGS =-I$(top_srcdir)/include $(LIBINPUT_CFLAGS)
|
AM_CPPFLAGS =-I$(top_srcdir)/include $(LIBINPUT_CFLAGS)
|
||||||
|
|
||||||
libinput_drv_la_LTLIBRARIES = libinput_drv.la
|
@DRIVER_NAME@_drv_la_LTLIBRARIES = @DRIVER_NAME@_drv.la
|
||||||
libinput_drv_la_LDFLAGS = -module -avoid-version
|
@DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version
|
||||||
libinput_drv_la_LIBADD = $(LIBINPUT_LIBS) libdraglock.la libbezier.la -lm
|
@DRIVER_NAME@_drv_la_LIBADD = $(LIBINPUT_LIBS) libdraglock.la libbezier.la -lm
|
||||||
libinput_drv_ladir = @inputdir@
|
@DRIVER_NAME@_drv_ladir = @inputdir@
|
||||||
|
|
||||||
libinput_drv_la_SOURCES = \
|
@DRIVER_NAME@_drv_la_SOURCES = \
|
||||||
xf86libinput.c \
|
xf86libinput.c \
|
||||||
util-macros.h \
|
util-macros.h \
|
||||||
util-strings.h \
|
util-strings.h \
|
||||||
|
|||||||
@@ -22,7 +22,10 @@
|
|||||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
* IN THE SOFTWARE.
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|||||||
@@ -22,7 +22,10 @@
|
|||||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
* IN THE SOFTWARE.
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef BEZIER_H
|
#ifndef BEZIER_H
|
||||||
#define BEZIER_H
|
#define BEZIER_H
|
||||||
|
|||||||
@@ -22,7 +22,10 @@
|
|||||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
* IN THE SOFTWARE.
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "draglock.h"
|
#include "draglock.h"
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,10 @@
|
|||||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
* IN THE SOFTWARE.
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef DRAGLOCK_H
|
#ifndef DRAGLOCK_H
|
||||||
#define DRAGLOCK_H 1
|
#define DRAGLOCK_H 1
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#define _GNU_SOURCE
|
|
||||||
|
|
||||||
#include "util-strings.h"
|
#include "util-strings.h"
|
||||||
|
|
||||||
@@ -122,9 +121,7 @@ strv_from_string(const char *in, const char *separators, size_t *num_elements)
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t strv_len = nelems + 1; /* NULL-terminated */
|
size_t strv_len = nelems + 1; /* NULL-terminated */
|
||||||
char **strv = calloc(strv_len, sizeof(*strv));
|
char **strv = zalloc(strv_len * sizeof *strv);
|
||||||
if (!strv)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
size_t idx = 0;
|
size_t idx = 0;
|
||||||
const char *word;
|
const char *word;
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@@ -97,6 +100,47 @@ safe_strdup(const char *str)
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple wrapper for asprintf that ensures the passed in-pointer is set
|
||||||
|
* to NULL upon error.
|
||||||
|
* The standard asprintf() call does not guarantee the passed in pointer
|
||||||
|
* will be NULL'ed upon failure, whereas this wrapper does.
|
||||||
|
*
|
||||||
|
* @param strp pointer to set to newly allocated string.
|
||||||
|
* This pointer should be passed to free() to release when done.
|
||||||
|
* @param fmt the format string to use for printing.
|
||||||
|
* @return The number of bytes printed (excluding the null byte terminator)
|
||||||
|
* upon success or -1 upon failure. In the case of failure the pointer is set
|
||||||
|
* to NULL.
|
||||||
|
*/
|
||||||
|
__attribute__ ((format (printf, 2, 3)))
|
||||||
|
static inline int
|
||||||
|
xasprintf(char **strp, const char *fmt, ...)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
va_list args;
|
||||||
|
|
||||||
|
va_start(args, fmt);
|
||||||
|
rc = vasprintf(strp, fmt, args);
|
||||||
|
va_end(args);
|
||||||
|
if ((rc == -1) && strp)
|
||||||
|
*strp = NULL;
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((format (printf, 2, 0)))
|
||||||
|
static inline int
|
||||||
|
xvasprintf(char **strp, const char *fmt, va_list args)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
rc = vasprintf(strp, fmt, args);
|
||||||
|
if ((rc == -1) && strp)
|
||||||
|
*strp = NULL;
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
static inline bool
|
static inline bool
|
||||||
safe_atoi_base(const char *str, int *val, int base)
|
safe_atoi_base(const char *str, int *val, int base)
|
||||||
{
|
{
|
||||||
@@ -253,10 +297,7 @@ double_array_from_string(const char *in,
|
|||||||
if(!strv)
|
if(!strv)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
double *numv = calloc(nelem, sizeof(double));
|
double *numv = zalloc(sizeof(double) * nelem);
|
||||||
if (!numv)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
for (size_t idx = 0; idx < nelem; idx++) {
|
for (size_t idx = 0; idx < nelem; idx++) {
|
||||||
double val;
|
double val;
|
||||||
if (!safe_atod(strv[idx], &val))
|
if (!safe_atod(strv[idx], &val))
|
||||||
@@ -393,3 +434,31 @@ safe_basename(const char *filename);
|
|||||||
|
|
||||||
char *
|
char *
|
||||||
trunkname(const char *filename);
|
trunkname(const char *filename);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a copy of str with all % converted to %% to make the string
|
||||||
|
* acceptable as printf format.
|
||||||
|
*/
|
||||||
|
static inline char *
|
||||||
|
str_sanitize(const char *str)
|
||||||
|
{
|
||||||
|
if (!str)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (!strchr(str, '%'))
|
||||||
|
return strdup(str);
|
||||||
|
|
||||||
|
size_t slen = min(strlen(str), 512);
|
||||||
|
char *sanitized = zalloc(2 * slen + 1);
|
||||||
|
const char *src = str;
|
||||||
|
char *dst = sanitized;
|
||||||
|
|
||||||
|
for (size_t i = 0; i < slen; i++) {
|
||||||
|
if (*src == '%')
|
||||||
|
*dst++ = '%';
|
||||||
|
*dst++ = *src++;
|
||||||
|
}
|
||||||
|
*dst = '\0';
|
||||||
|
|
||||||
|
return sanitized;
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#define _GNU_SOURCE
|
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@@ -53,8 +52,6 @@
|
|||||||
#define TOUCH_MAX_SLOTS 15
|
#define TOUCH_MAX_SLOTS 15
|
||||||
#define XORG_KEYCODE_OFFSET 8
|
#define XORG_KEYCODE_OFFSET 8
|
||||||
#define SCROLL_INCREMENT 15
|
#define SCROLL_INCREMENT 15
|
||||||
#define SCROLL_FACTOR_MIN 0.0001
|
|
||||||
#define SCROLL_FACTOR_MAX 1000.0
|
|
||||||
#define TOUCHPAD_SCROLL_DIST_MIN 10 /* in libinput pixels */
|
#define TOUCHPAD_SCROLL_DIST_MIN 10 /* in libinput pixels */
|
||||||
#define TOUCHPAD_SCROLL_DIST_MAX 50 /* in libinput pixels */
|
#define TOUCHPAD_SCROLL_DIST_MAX 50 /* in libinput pixels */
|
||||||
|
|
||||||
@@ -93,6 +90,12 @@ enum capabilities {
|
|||||||
CAP_GESTURE = 0x40,
|
CAP_GESTURE = 0x40,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if HAVE_INPUTPROTO24
|
||||||
|
#if ABI_XINPUT_VERSION >= SET_ABI_VERSION(24, 4)
|
||||||
|
#define HAVE_GESTURES
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
struct xf86libinput_driver {
|
struct xf86libinput_driver {
|
||||||
struct libinput *libinput;
|
struct libinput *libinput;
|
||||||
int device_enabled_count;
|
int device_enabled_count;
|
||||||
@@ -135,10 +138,6 @@ struct accel_points {
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct xf86libinput_pressure_range {
|
|
||||||
float min, max;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct xf86libinput {
|
struct xf86libinput {
|
||||||
InputInfoPtr pInfo;
|
InputInfoPtr pInfo;
|
||||||
char *path;
|
char *path;
|
||||||
@@ -176,7 +175,6 @@ struct xf86libinput {
|
|||||||
CARD32 scroll_button; /* xorg button number */
|
CARD32 scroll_button; /* xorg button number */
|
||||||
BOOL scroll_buttonlock;
|
BOOL scroll_buttonlock;
|
||||||
uint32_t scroll_pixel_distance;
|
uint32_t scroll_pixel_distance;
|
||||||
float scroll_factor;
|
|
||||||
float speed;
|
float speed;
|
||||||
float matrix[9];
|
float matrix[9];
|
||||||
enum libinput_config_scroll_method scroll_method;
|
enum libinput_config_scroll_method scroll_method;
|
||||||
@@ -197,7 +195,9 @@ struct xf86libinput {
|
|||||||
|
|
||||||
float rotation_angle;
|
float rotation_angle;
|
||||||
struct bezier_control_point pressurecurve[4];
|
struct bezier_control_point pressurecurve[4];
|
||||||
struct xf86libinput_pressure_range pressure_range;
|
struct range {
|
||||||
|
float min, max;
|
||||||
|
} pressure_range;
|
||||||
struct ratio {
|
struct ratio {
|
||||||
int x, y;
|
int x, y;
|
||||||
} area;
|
} area;
|
||||||
@@ -463,7 +463,7 @@ xf86libinput_set_pressurecurve(struct xf86libinput *driver_data,
|
|||||||
|
|
||||||
static inline bool
|
static inline bool
|
||||||
xf86libinput_set_pressure_range(struct xf86libinput *driver_data,
|
xf86libinput_set_pressure_range(struct xf86libinput *driver_data,
|
||||||
const struct xf86libinput_pressure_range *rangeopt)
|
const struct range *range)
|
||||||
{
|
{
|
||||||
#if HAVE_LIBINPUT_PRESSURE_RANGE
|
#if HAVE_LIBINPUT_PRESSURE_RANGE
|
||||||
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
|
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
|
||||||
@@ -473,8 +473,8 @@ xf86libinput_set_pressure_range(struct xf86libinput *driver_data,
|
|||||||
|
|
||||||
return libinput_tablet_tool_config_pressure_range_is_available(tool) &&
|
return libinput_tablet_tool_config_pressure_range_is_available(tool) &&
|
||||||
libinput_tablet_tool_config_pressure_range_set(tool,
|
libinput_tablet_tool_config_pressure_range_set(tool,
|
||||||
rangeopt->min,
|
range->min,
|
||||||
rangeopt->max) == LIBINPUT_CONFIG_STATUS_SUCCESS;
|
range->max) == LIBINPUT_CONFIG_STATUS_SUCCESS;
|
||||||
#else
|
#else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
#endif
|
||||||
@@ -935,16 +935,16 @@ LibinputApplyConfigPressureRange(DeviceIntPtr dev,
|
|||||||
#if HAVE_LIBINPUT_PRESSURE_RANGE
|
#if HAVE_LIBINPUT_PRESSURE_RANGE
|
||||||
InputInfoPtr pInfo = dev->public.devicePrivate;
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
||||||
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
|
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
|
||||||
struct xf86libinput_pressure_range *rangeopt = &driver_data->options.pressure_range;
|
struct range *range = &driver_data->options.pressure_range;
|
||||||
|
|
||||||
if (!subdevice_has_capabilities(dev, CAP_TABLET_TOOL))
|
if (!subdevice_has_capabilities(dev, CAP_TABLET_TOOL))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (tool && libinput_tablet_tool_config_pressure_range_is_available(tool) &&
|
if (tool && libinput_tablet_tool_config_pressure_range_is_available(tool) &&
|
||||||
libinput_tablet_tool_config_pressure_range_set(tool, rangeopt->min, rangeopt->max) != LIBINPUT_CONFIG_STATUS_SUCCESS)
|
libinput_tablet_tool_config_pressure_range_set(tool, range->min, range->max) != LIBINPUT_CONFIG_STATUS_SUCCESS)
|
||||||
xf86IDrvMsg(pInfo, X_ERROR,
|
xf86IDrvMsg(pInfo, X_ERROR,
|
||||||
"Failed to set PressureRange to %.2f..%.2f\n",
|
"Failed to set PressureRange to %.2f..%.2f\n",
|
||||||
rangeopt->min, rangeopt->max);
|
range->min, range->max);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1276,6 +1276,7 @@ xf86libinput_init_touch(InputInfoPtr pInfo)
|
|||||||
InitTouchClassDeviceStruct(dev, ntouches, XIDirectTouch, 2);
|
InitTouchClassDeviceStruct(dev, ntouches, XIDirectTouch, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_GESTURES
|
||||||
static void
|
static void
|
||||||
xf86libinput_init_gesture(InputInfoPtr pInfo)
|
xf86libinput_init_gesture(InputInfoPtr pInfo)
|
||||||
{
|
{
|
||||||
@@ -1283,6 +1284,7 @@ xf86libinput_init_gesture(InputInfoPtr pInfo)
|
|||||||
int ntouches = TOUCH_MAX_SLOTS;
|
int ntouches = TOUCH_MAX_SLOTS;
|
||||||
InitGestureClassDeviceStruct(dev, ntouches);
|
InitGestureClassDeviceStruct(dev, ntouches);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
xf86libinput_init_tablet_pen_or_eraser(InputInfoPtr pInfo,
|
xf86libinput_init_tablet_pen_or_eraser(InputInfoPtr pInfo,
|
||||||
@@ -1533,8 +1535,10 @@ xf86libinput_init(DeviceIntPtr dev)
|
|||||||
}
|
}
|
||||||
if (driver_data->capabilities & CAP_TOUCH)
|
if (driver_data->capabilities & CAP_TOUCH)
|
||||||
xf86libinput_init_touch(pInfo);
|
xf86libinput_init_touch(pInfo);
|
||||||
|
#ifdef HAVE_GESTURES
|
||||||
if (driver_data->capabilities & CAP_GESTURE)
|
if (driver_data->capabilities & CAP_GESTURE)
|
||||||
xf86libinput_init_gesture(pInfo);
|
xf86libinput_init_gesture(pInfo);
|
||||||
|
#endif
|
||||||
if (driver_data->capabilities & CAP_TABLET_TOOL)
|
if (driver_data->capabilities & CAP_TABLET_TOOL)
|
||||||
xf86libinput_init_tablet(pInfo);
|
xf86libinput_init_tablet(pInfo);
|
||||||
if (driver_data->capabilities & CAP_TABLET_PAD)
|
if (driver_data->capabilities & CAP_TABLET_PAD)
|
||||||
@@ -1909,7 +1913,6 @@ calculate_axis_value(struct xf86libinput *driver_data,
|
|||||||
value = value/dist * SCROLL_INCREMENT * 8;
|
value = value/dist * SCROLL_INCREMENT * 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
value *= driver_data->options.scroll_factor;
|
|
||||||
*value_out = value;
|
*value_out = value;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -2009,6 +2012,7 @@ xf86libinput_handle_touch(InputInfoPtr pInfo,
|
|||||||
xf86PostTouchEvent(dev, touchids[slot], type, 0, m);
|
xf86PostTouchEvent(dev, touchids[slot], type, 0, m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_GESTURES
|
||||||
static void
|
static void
|
||||||
xf86libinput_handle_gesture_swipe(InputInfoPtr pInfo,
|
xf86libinput_handle_gesture_swipe(InputInfoPtr pInfo,
|
||||||
struct libinput_event_gesture *event,
|
struct libinput_event_gesture *event,
|
||||||
@@ -2086,6 +2090,7 @@ xf86libinput_handle_gesture_pinch(InputInfoPtr pInfo,
|
|||||||
libinput_event_gesture_get_scale(event),
|
libinput_event_gesture_get_scale(event),
|
||||||
libinput_event_gesture_get_angle_delta(event));
|
libinput_event_gesture_get_angle_delta(event));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static InputInfoPtr
|
static InputInfoPtr
|
||||||
xf86libinput_pick_device(struct xf86libinput_device *shared_device,
|
xf86libinput_pick_device(struct xf86libinput_device *shared_device,
|
||||||
@@ -2684,16 +2689,20 @@ xf86libinput_handle_event(struct libinput_event *event)
|
|||||||
case LIBINPUT_EVENT_GESTURE_SWIPE_BEGIN:
|
case LIBINPUT_EVENT_GESTURE_SWIPE_BEGIN:
|
||||||
case LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE:
|
case LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE:
|
||||||
case LIBINPUT_EVENT_GESTURE_SWIPE_END:
|
case LIBINPUT_EVENT_GESTURE_SWIPE_END:
|
||||||
|
#ifdef HAVE_GESTURES
|
||||||
xf86libinput_handle_gesture_swipe(pInfo,
|
xf86libinput_handle_gesture_swipe(pInfo,
|
||||||
libinput_event_get_gesture_event(event),
|
libinput_event_get_gesture_event(event),
|
||||||
type);
|
type);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case LIBINPUT_EVENT_GESTURE_PINCH_BEGIN:
|
case LIBINPUT_EVENT_GESTURE_PINCH_BEGIN:
|
||||||
case LIBINPUT_EVENT_GESTURE_PINCH_UPDATE:
|
case LIBINPUT_EVENT_GESTURE_PINCH_UPDATE:
|
||||||
case LIBINPUT_EVENT_GESTURE_PINCH_END:
|
case LIBINPUT_EVENT_GESTURE_PINCH_END:
|
||||||
|
#ifdef HAVE_GESTURES
|
||||||
xf86libinput_handle_gesture_pinch(pInfo,
|
xf86libinput_handle_gesture_pinch(pInfo,
|
||||||
libinput_event_get_gesture_event(event),
|
libinput_event_get_gesture_event(event),
|
||||||
type);
|
type);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case LIBINPUT_EVENT_TABLET_TOOL_AXIS:
|
case LIBINPUT_EVENT_TABLET_TOOL_AXIS:
|
||||||
event_handling = xf86libinput_handle_tablet_axis(pInfo,
|
event_handling = xf86libinput_handle_tablet_axis(pInfo,
|
||||||
@@ -2725,20 +2734,6 @@ xf86libinput_handle_event(struct libinput_event *event)
|
|||||||
break;
|
break;
|
||||||
case LIBINPUT_EVENT_SWITCH_TOGGLE:
|
case LIBINPUT_EVENT_SWITCH_TOGGLE:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* new libinput events we don't handle yet */
|
|
||||||
#ifdef LIBINPUT_EVENT_GESTURE_HOLD_BEGIN
|
|
||||||
case LIBINPUT_EVENT_GESTURE_HOLD_BEGIN:
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#ifdef LIBINPUT_EVENT_GESTURE_HOLD_END
|
|
||||||
case LIBINPUT_EVENT_GESTURE_HOLD_END:
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#ifdef LIBINPUT_EVENT_TABLET_PAD_KEY
|
|
||||||
case LIBINPUT_EVENT_TABLET_PAD_KEY:
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
@@ -3440,20 +3435,6 @@ xf86libinput_parse_scroll_pixel_distance_option(InputInfoPtr pInfo,
|
|||||||
return dist;
|
return dist;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline double
|
|
||||||
xf86libinput_parse_scroll_factor_option(InputInfoPtr pInfo,
|
|
||||||
struct libinput_device *device)
|
|
||||||
{
|
|
||||||
const double scroll_factor_default = 1.0;
|
|
||||||
double scroll_factor = xf86SetRealOption(pInfo->options, "ScrollFactor", scroll_factor_default);
|
|
||||||
if (scroll_factor < SCROLL_FACTOR_MIN || scroll_factor > SCROLL_FACTOR_MAX) {
|
|
||||||
xf86IDrvMsg(pInfo, X_ERROR, "Invalid ScrollFactor %f, expected to be between %f and %f\n",
|
|
||||||
scroll_factor, SCROLL_FACTOR_MIN, SCROLL_FACTOR_MAX);
|
|
||||||
scroll_factor = scroll_factor_default;
|
|
||||||
}
|
|
||||||
return scroll_factor;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline unsigned int
|
static inline unsigned int
|
||||||
xf86libinput_parse_clickmethod_option(InputInfoPtr pInfo,
|
xf86libinput_parse_clickmethod_option(InputInfoPtr pInfo,
|
||||||
struct libinput_device *device)
|
struct libinput_device *device)
|
||||||
@@ -3490,17 +3471,13 @@ static inline BOOL
|
|||||||
xf86libinput_parse_middleemulation_option(InputInfoPtr pInfo,
|
xf86libinput_parse_middleemulation_option(InputInfoPtr pInfo,
|
||||||
struct libinput_device *device)
|
struct libinput_device *device)
|
||||||
{
|
{
|
||||||
int enabled;
|
BOOL enabled;
|
||||||
|
|
||||||
if (!libinput_device_config_middle_emulation_is_available(device))
|
if (!libinput_device_config_middle_emulation_is_available(device))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
enabled = xf86SetBoolOption(pInfo->options,
|
enabled = xf86SetBoolOption(pInfo->options,
|
||||||
"MiddleEmulation",
|
"MiddleEmulation",
|
||||||
-1); /* returns -1 if the option has not been set */
|
|
||||||
if (enabled == -1)
|
|
||||||
enabled = xf86SetBoolOption(pInfo->options,
|
|
||||||
"Emulate3Buttons",
|
|
||||||
libinput_device_config_middle_emulation_get_default_enabled(device));
|
libinput_device_config_middle_emulation_get_default_enabled(device));
|
||||||
if (libinput_device_config_middle_emulation_set_enabled(device, enabled) !=
|
if (libinput_device_config_middle_emulation_set_enabled(device, enabled) !=
|
||||||
LIBINPUT_CONFIG_STATUS_SUCCESS) {
|
LIBINPUT_CONFIG_STATUS_SUCCESS) {
|
||||||
@@ -3689,7 +3666,7 @@ out:
|
|||||||
static void
|
static void
|
||||||
xf86libinput_parse_pressure_range_option(InputInfoPtr pInfo,
|
xf86libinput_parse_pressure_range_option(InputInfoPtr pInfo,
|
||||||
struct xf86libinput *driver_data,
|
struct xf86libinput *driver_data,
|
||||||
struct xf86libinput_pressure_range *rangeopt)
|
struct range *range)
|
||||||
{
|
{
|
||||||
#if HAVE_LIBINPUT_PRESSURE_RANGE
|
#if HAVE_LIBINPUT_PRESSURE_RANGE
|
||||||
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
|
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
|
||||||
@@ -3697,8 +3674,8 @@ xf86libinput_parse_pressure_range_option(InputInfoPtr pInfo,
|
|||||||
char *str;
|
char *str;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
rangeopt->min = 0.0;
|
range->min = 0.0;
|
||||||
rangeopt->max = 1.0;
|
range->max = 1.0;
|
||||||
|
|
||||||
if ((driver_data->capabilities & CAP_TABLET_TOOL) == 0)
|
if ((driver_data->capabilities & CAP_TABLET_TOOL) == 0)
|
||||||
return;
|
return;
|
||||||
@@ -3719,8 +3696,8 @@ xf86libinput_parse_pressure_range_option(InputInfoPtr pInfo,
|
|||||||
if (min < 0.0 || max > 1.0 || min >= max)
|
if (min < 0.0 || max > 1.0 || min >= max)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
rangeopt->min = min;
|
range->min = min;
|
||||||
rangeopt->max = max;
|
range->max = max;
|
||||||
out:
|
out:
|
||||||
free(str);
|
free(str);
|
||||||
#endif
|
#endif
|
||||||
@@ -3797,7 +3774,6 @@ xf86libinput_parse_options(InputInfoPtr pInfo,
|
|||||||
options->scroll_button = xf86libinput_parse_scrollbutton_option(pInfo, device);
|
options->scroll_button = xf86libinput_parse_scrollbutton_option(pInfo, device);
|
||||||
options->scroll_buttonlock = xf86libinput_parse_scrollbuttonlock_option(pInfo, device);
|
options->scroll_buttonlock = xf86libinput_parse_scrollbuttonlock_option(pInfo, device);
|
||||||
options->scroll_pixel_distance = xf86libinput_parse_scroll_pixel_distance_option(pInfo, device);
|
options->scroll_pixel_distance = xf86libinput_parse_scroll_pixel_distance_option(pInfo, device);
|
||||||
options->scroll_factor = xf86libinput_parse_scroll_factor_option(pInfo, device);
|
|
||||||
options->click_method = xf86libinput_parse_clickmethod_option(pInfo, device);
|
options->click_method = xf86libinput_parse_clickmethod_option(pInfo, device);
|
||||||
#if HAVE_LIBINPUT_CLICKFINGER_BUTTON_MAP
|
#if HAVE_LIBINPUT_CLICKFINGER_BUTTON_MAP
|
||||||
options->clickfinger_button_map = xf86libinput_parse_clickfinger_map_option(pInfo, device);
|
options->clickfinger_button_map = xf86libinput_parse_clickfinger_map_option(pInfo, device);
|
||||||
@@ -3947,8 +3923,10 @@ xf86libinput_create_subdevice(InputInfoPtr pInfo,
|
|||||||
options = xf86ReplaceBoolOption(options, "_libinput/cap-pointer", 1);
|
options = xf86ReplaceBoolOption(options, "_libinput/cap-pointer", 1);
|
||||||
if (capabilities & CAP_TOUCH)
|
if (capabilities & CAP_TOUCH)
|
||||||
options = xf86ReplaceBoolOption(options, "_libinput/cap-touch", 1);
|
options = xf86ReplaceBoolOption(options, "_libinput/cap-touch", 1);
|
||||||
|
#ifdef HAVE_GESTURES
|
||||||
if (capabilities & CAP_GESTURE)
|
if (capabilities & CAP_GESTURE)
|
||||||
options = xf86ReplaceBoolOption(options, "_libinput/cap-gesture", 1);
|
options = xf86ReplaceBoolOption(options, "_libinput/cap-gesture", 1);
|
||||||
|
#endif
|
||||||
if (capabilities & CAP_TABLET_TOOL)
|
if (capabilities & CAP_TABLET_TOOL)
|
||||||
options = xf86ReplaceBoolOption(options, "_libinput/cap-tablet-tool", 1);
|
options = xf86ReplaceBoolOption(options, "_libinput/cap-tablet-tool", 1);
|
||||||
if (capabilities & CAP_TABLET_PAD)
|
if (capabilities & CAP_TABLET_PAD)
|
||||||
@@ -3987,8 +3965,10 @@ caps_from_options(InputInfoPtr pInfo)
|
|||||||
capabilities |= CAP_POINTER;
|
capabilities |= CAP_POINTER;
|
||||||
if (xf86CheckBoolOption(pInfo->options, "_libinput/cap-touch", 0))
|
if (xf86CheckBoolOption(pInfo->options, "_libinput/cap-touch", 0))
|
||||||
capabilities |= CAP_TOUCH;
|
capabilities |= CAP_TOUCH;
|
||||||
|
#ifdef HAVE_GESTURES
|
||||||
if (xf86CheckBoolOption(pInfo->options, "_libinput/cap-gesture", 0))
|
if (xf86CheckBoolOption(pInfo->options, "_libinput/cap-gesture", 0))
|
||||||
capabilities |= CAP_GESTURE;
|
capabilities |= CAP_GESTURE;
|
||||||
|
#endif
|
||||||
if (xf86CheckBoolOption(pInfo->options, "_libinput/cap-tablet-tool", 0))
|
if (xf86CheckBoolOption(pInfo->options, "_libinput/cap-tablet-tool", 0))
|
||||||
capabilities |= CAP_TABLET_TOOL;
|
capabilities |= CAP_TABLET_TOOL;
|
||||||
|
|
||||||
@@ -4134,8 +4114,10 @@ xf86libinput_pre_init(InputDriverPtr drv,
|
|||||||
driver_data->capabilities |= CAP_KEYBOARD;
|
driver_data->capabilities |= CAP_KEYBOARD;
|
||||||
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TOUCH))
|
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TOUCH))
|
||||||
driver_data->capabilities |= CAP_TOUCH;
|
driver_data->capabilities |= CAP_TOUCH;
|
||||||
|
#ifdef HAVE_GESTURES
|
||||||
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_GESTURE))
|
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_GESTURE))
|
||||||
driver_data->capabilities |= CAP_GESTURE;
|
driver_data->capabilities |= CAP_GESTURE;
|
||||||
|
#endif
|
||||||
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TABLET_TOOL))
|
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TABLET_TOOL))
|
||||||
driver_data->capabilities |= CAP_TABLET;
|
driver_data->capabilities |= CAP_TABLET;
|
||||||
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TABLET_PAD))
|
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TABLET_PAD))
|
||||||
@@ -4279,8 +4261,6 @@ static Atom prop_scroll_buttonlock;
|
|||||||
static Atom prop_scroll_buttonlock_default;
|
static Atom prop_scroll_buttonlock_default;
|
||||||
static Atom prop_scroll_pixel_distance;
|
static Atom prop_scroll_pixel_distance;
|
||||||
static Atom prop_scroll_pixel_distance_default;
|
static Atom prop_scroll_pixel_distance_default;
|
||||||
static Atom prop_scroll_factor;
|
|
||||||
static Atom prop_scroll_factor_default;
|
|
||||||
static Atom prop_click_methods_available;
|
static Atom prop_click_methods_available;
|
||||||
static Atom prop_click_method_enabled;
|
static Atom prop_click_method_enabled;
|
||||||
static Atom prop_click_method_default;
|
static Atom prop_click_method_default;
|
||||||
@@ -5271,34 +5251,6 @@ LibinputSetPropertyScrollPixelDistance(DeviceIntPtr dev,
|
|||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
|
||||||
LibinputSetPropertyScrollFactor(DeviceIntPtr dev,
|
|
||||||
Atom atom,
|
|
||||||
XIPropertyValuePtr val,
|
|
||||||
BOOL checkonly)
|
|
||||||
{
|
|
||||||
InputInfoPtr pInfo = dev->public.devicePrivate;
|
|
||||||
struct xf86libinput *driver_data = pInfo->private;
|
|
||||||
float *scroll_factor;
|
|
||||||
|
|
||||||
if (val->format != 32 || val->size != 1 || val->type != prop_float)
|
|
||||||
return BadMatch;
|
|
||||||
|
|
||||||
scroll_factor = (float*)val->data;
|
|
||||||
|
|
||||||
if (checkonly) {
|
|
||||||
if (*scroll_factor < SCROLL_FACTOR_MIN || *scroll_factor > SCROLL_FACTOR_MAX)
|
|
||||||
return BadValue;
|
|
||||||
|
|
||||||
if (!xf86libinput_check_device(dev, atom))
|
|
||||||
return BadMatch;
|
|
||||||
} else {
|
|
||||||
driver_data->options.scroll_factor = *scroll_factor;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
LibinputSetPropertyRotationAngle(DeviceIntPtr dev,
|
LibinputSetPropertyRotationAngle(DeviceIntPtr dev,
|
||||||
Atom atom,
|
Atom atom,
|
||||||
@@ -5386,28 +5338,28 @@ LibinputSetPropertyPressureRange(DeviceIntPtr dev,
|
|||||||
InputInfoPtr pInfo = dev->public.devicePrivate;
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
||||||
struct xf86libinput *driver_data = pInfo->private;
|
struct xf86libinput *driver_data = pInfo->private;
|
||||||
float *vals;
|
float *vals;
|
||||||
struct xf86libinput_pressure_range rangeopt = { 0.0, 1.0 };
|
struct range range = { 0.0, 1.0 };
|
||||||
|
|
||||||
if (val->format != 32 || val->size != 2 || val->type != prop_float)
|
if (val->format != 32 || val->size != 2 || val->type != prop_float)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
vals = val->data;
|
vals = val->data;
|
||||||
rangeopt.min = vals[0];
|
range.min = vals[0];
|
||||||
rangeopt.max = vals[1];
|
range.max = vals[1];
|
||||||
|
|
||||||
if (checkonly) {
|
if (checkonly) {
|
||||||
if (rangeopt.min < 0.0 || rangeopt.max > 1.0 || rangeopt.min >= rangeopt.max)
|
if (range.min < 0.0 || range.max > 1.0 || range.min >= range.max)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
/* Disallow reducing the range to less than 20% of the range, mostly
|
/* Disallow reducing the range to less than 20% of the range, mostly
|
||||||
* to avoid footguns */
|
* to avoid footguns */
|
||||||
if (rangeopt.max - rangeopt.min < 0.2)
|
if (range.max - range.min < 0.2)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
if (!xf86libinput_check_device(dev, atom))
|
if (!xf86libinput_check_device(dev, atom))
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
} else {
|
} else {
|
||||||
driver_data->options.pressure_range = rangeopt;
|
driver_data->options.pressure_range = range;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
@@ -5554,8 +5506,6 @@ LibinputSetProperty(DeviceIntPtr dev, Atom atom,
|
|||||||
rc = LibinputSetPropertyHorizScroll(dev, atom, val, checkonly);
|
rc = LibinputSetPropertyHorizScroll(dev, atom, val, checkonly);
|
||||||
else if (atom == prop_scroll_pixel_distance)
|
else if (atom == prop_scroll_pixel_distance)
|
||||||
rc = LibinputSetPropertyScrollPixelDistance(dev, atom, val, checkonly);
|
rc = LibinputSetPropertyScrollPixelDistance(dev, atom, val, checkonly);
|
||||||
else if (atom == prop_scroll_factor)
|
|
||||||
rc = LibinputSetPropertyScrollFactor(dev, atom, val, checkonly);
|
|
||||||
else if (atom == prop_mode_groups) {
|
else if (atom == prop_mode_groups) {
|
||||||
InputInfoPtr pInfo = dev->public.devicePrivate;
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
||||||
struct xf86libinput *driver_data = pInfo->private;
|
struct xf86libinput *driver_data = pInfo->private;
|
||||||
@@ -5597,7 +5547,6 @@ LibinputSetProperty(DeviceIntPtr dev, Atom atom,
|
|||||||
atom == prop_scroll_method_default ||
|
atom == prop_scroll_method_default ||
|
||||||
atom == prop_scroll_methods_available ||
|
atom == prop_scroll_methods_available ||
|
||||||
atom == prop_scroll_pixel_distance_default ||
|
atom == prop_scroll_pixel_distance_default ||
|
||||||
atom == prop_scroll_factor_default ||
|
|
||||||
atom == prop_sendevents_available ||
|
atom == prop_sendevents_available ||
|
||||||
atom == prop_sendevents_default ||
|
atom == prop_sendevents_default ||
|
||||||
atom == prop_serial ||
|
atom == prop_serial ||
|
||||||
@@ -5644,8 +5593,7 @@ LibinputInitTapProperty(DeviceIntPtr dev,
|
|||||||
struct xf86libinput *driver_data,
|
struct xf86libinput *driver_data,
|
||||||
struct libinput_device *device)
|
struct libinput_device *device)
|
||||||
{
|
{
|
||||||
// By default tapping property config is true
|
BOOL tap = driver_data->options.tapping;
|
||||||
BOOL tap = driver_data->options.tapping ? driver_data->options.tapping : TRUE;
|
|
||||||
|
|
||||||
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
||||||
return;
|
return;
|
||||||
@@ -6211,32 +6159,6 @@ LibinputInitScrollPixelDistanceProperty(DeviceIntPtr dev,
|
|||||||
1, &dist);
|
1, &dist);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
LibinputInitScrollFactorProperty(DeviceIntPtr dev,
|
|
||||||
struct xf86libinput *driver_data,
|
|
||||||
struct libinput_device *device)
|
|
||||||
{
|
|
||||||
float scroll_factor = driver_data->options.scroll_factor;
|
|
||||||
|
|
||||||
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
|
||||||
return;
|
|
||||||
|
|
||||||
prop_scroll_factor = LibinputMakeProperty(dev,
|
|
||||||
LIBINPUT_PROP_SCROLL_FACTOR,
|
|
||||||
prop_float, 32,
|
|
||||||
1, &scroll_factor);
|
|
||||||
if (!prop_scroll_factor)
|
|
||||||
return;
|
|
||||||
|
|
||||||
prop_scroll_factor_default = LibinputMakeProperty(dev,
|
|
||||||
LIBINPUT_PROP_SCROLL_FACTOR_DEFAULT,
|
|
||||||
prop_float, 32,
|
|
||||||
1, &scroll_factor);
|
|
||||||
|
|
||||||
if (!prop_scroll_factor_default)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
LibinputInitClickMethodsProperty(DeviceIntPtr dev,
|
LibinputInitClickMethodsProperty(DeviceIntPtr dev,
|
||||||
struct xf86libinput *driver_data,
|
struct xf86libinput *driver_data,
|
||||||
@@ -6666,10 +6588,10 @@ LibinputInitPressureRangeProperty(DeviceIntPtr dev,
|
|||||||
{
|
{
|
||||||
#if HAVE_LIBINPUT_PRESSURE_RANGE
|
#if HAVE_LIBINPUT_PRESSURE_RANGE
|
||||||
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
|
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
|
||||||
const struct xf86libinput_pressure_range *rangeopt = &driver_data->options.pressure_range;
|
const struct range *range = &driver_data->options.pressure_range;
|
||||||
float data[2] = {
|
float data[2] = {
|
||||||
rangeopt->min,
|
range->min,
|
||||||
rangeopt->max,
|
range->max,
|
||||||
};
|
};
|
||||||
|
|
||||||
if ((driver_data->capabilities & CAP_TABLET_TOOL) == 0)
|
if ((driver_data->capabilities & CAP_TABLET_TOOL) == 0)
|
||||||
@@ -6782,7 +6704,6 @@ LibinputInitProperty(DeviceIntPtr dev)
|
|||||||
LibinputInitNaturalScrollProperty(dev, driver_data, device);
|
LibinputInitNaturalScrollProperty(dev, driver_data, device);
|
||||||
LibinputInitDisableWhileTypingProperty(dev, driver_data, device);
|
LibinputInitDisableWhileTypingProperty(dev, driver_data, device);
|
||||||
LibinputInitScrollMethodsProperty(dev, driver_data, device);
|
LibinputInitScrollMethodsProperty(dev, driver_data, device);
|
||||||
LibinputInitScrollFactorProperty(dev, driver_data, device);
|
|
||||||
LibinputInitClickMethodsProperty(dev, driver_data, device);
|
LibinputInitClickMethodsProperty(dev, driver_data, device);
|
||||||
LibinputInitClickfingerButtonmapProperty(dev, driver_data, device);
|
LibinputInitClickfingerButtonmapProperty(dev, driver_data, device);
|
||||||
LibinputInitMiddleEmulationProperty(dev, driver_data, device);
|
LibinputInitMiddleEmulationProperty(dev, driver_data, device);
|
||||||
|
|||||||
Reference in New Issue
Block a user