mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-25 04:50:05 +01:00
Compare commits
154 commits
master
...
xwayland-2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
449b197e7e | ||
|
|
d2a7903154 | ||
|
|
2c5e87e3df | ||
|
|
fce91bcbe2 | ||
|
|
9d20532389 | ||
|
|
41ae2e70ad | ||
|
|
b7c5685a26 | ||
|
|
437a0cad0b | ||
|
|
fa6b40037a | ||
|
|
34ef671aa5 | ||
|
|
a50e6a2e33 | ||
|
|
1119ea220a | ||
|
|
6f1acb0dff | ||
|
|
3a6d035aec | ||
|
|
91e42e523c | ||
|
|
bd43d90cd1 | ||
|
|
ed54cc2a03 | ||
|
|
b32d637f51 | ||
|
|
852595a51d | ||
|
|
15075baac2 | ||
|
|
6d33c347ea | ||
|
|
5b1d9da00f | ||
|
|
9dbe93ebee | ||
|
|
6f567221a6 | ||
|
|
fb6df2a68c | ||
|
|
1932abe3d0 | ||
|
|
842f4abde4 | ||
|
|
318085a6f5 | ||
|
|
40efa6359c | ||
|
|
cc15c9fa40 | ||
|
|
39c7ed837b | ||
|
|
60df821467 | ||
|
|
bfbb53e0b9 | ||
|
|
80f8d0b8e2 | ||
|
|
543708ae93 | ||
|
|
69f1580140 | ||
|
|
f04096af3c | ||
|
|
ffc3aa63d3 | ||
|
|
f18a83d6f1 | ||
|
|
f7e3397e4d | ||
|
|
cea92a3e09 | ||
|
|
1a8f0cb007 | ||
|
|
e6a5d545ce | ||
|
|
e1b6193a9d | ||
|
|
f8e32cba6e | ||
|
|
1ae92b8f63 | ||
|
|
ffd4d2a268 | ||
|
|
efd3e1ca3d | ||
|
|
5294c436ac | ||
|
|
15a169cd1a | ||
|
|
f221e9f903 | ||
|
|
7c25024879 | ||
|
|
f340f082b8 | ||
|
|
30427d3ddc | ||
|
|
5e320e1193 | ||
|
|
cec5c7c3b2 | ||
|
|
a939e47c13 | ||
|
|
ce9d187101 | ||
|
|
ca0799e7f2 | ||
|
|
3bfef8d7c0 | ||
|
|
26120df7aa | ||
|
|
113245b1ab | ||
|
|
0713e7e382 | ||
|
|
8d9b8249a7 | ||
|
|
02546fa66a | ||
|
|
e4d9cbf0e9 | ||
|
|
5d84e4779b | ||
|
|
2d5494ebbb | ||
|
|
cfda3969a1 | ||
|
|
4335bdeb01 | ||
|
|
6d384ab8bf | ||
|
|
fc7b6c7549 | ||
|
|
83033ce108 | ||
|
|
44d1b7e4c1 | ||
|
|
013311852d | ||
|
|
2f1ea65b6d | ||
|
|
0d1b7672e7 | ||
|
|
a73fb98dc3 | ||
|
|
98fb1d48c4 | ||
|
|
b701969331 | ||
|
|
16645b410d | ||
|
|
13cfe2ec85 | ||
|
|
11d0f4f19d | ||
|
|
e50ea9181a | ||
|
|
fa70fdf961 | ||
|
|
05a3a4068b | ||
|
|
4262fb182b | ||
|
|
54a591b9b8 | ||
|
|
4d88af2228 | ||
|
|
2a360e5c0f | ||
|
|
a2446275c9 | ||
|
|
978093d1a5 | ||
|
|
4543d4a25a | ||
|
|
8937d47d08 | ||
|
|
a1651d41e7 | ||
|
|
b3635ba69e | ||
|
|
fac3486a66 | ||
|
|
ce7fb8139a | ||
|
|
98326b8c9f | ||
|
|
ca52da8cba | ||
|
|
c0bd91f49e | ||
|
|
cec99a3811 | ||
|
|
8130fa083c | ||
|
|
38060228c1 | ||
|
|
4942b7c137 | ||
|
|
f834e104aa | ||
|
|
aa0ea88e13 | ||
|
|
6a916c9658 | ||
|
|
8f611b0f22 | ||
|
|
33486519dc | ||
|
|
6636b7c003 | ||
|
|
4382a4f84e | ||
|
|
1539f208e2 | ||
|
|
b1734ae737 | ||
|
|
23400afb72 | ||
|
|
05f4411523 | ||
|
|
fbd40e878b | ||
|
|
526dcbe120 | ||
|
|
1d21f8db26 | ||
|
|
59bf93c770 | ||
|
|
dc2e34aa0e | ||
|
|
1126d55f80 | ||
|
|
ce0e52dd0b | ||
|
|
2d0dabbe10 | ||
|
|
ce6c665e77 | ||
|
|
3f4745cc4a | ||
|
|
88ab664fab | ||
|
|
5a4b654334 | ||
|
|
9f28e2a85d | ||
|
|
07470d2ca2 | ||
|
|
f10354d16a | ||
|
|
de65e7df4d | ||
|
|
eec66b819d | ||
|
|
cb6c7256ab | ||
|
|
34832a182c | ||
|
|
74d02b98ab | ||
|
|
aa17d7eba6 | ||
|
|
158246a0af | ||
|
|
80af615ea9 | ||
|
|
4725674a23 | ||
|
|
9f4d612e7e | ||
|
|
84b6d7e2c5 | ||
|
|
596db5424d | ||
|
|
751af1243e | ||
|
|
3d5eb2df23 | ||
|
|
9cd94d3976 | ||
|
|
6b100681d6 | ||
|
|
7f3a9a4059 | ||
|
|
94228264a7 | ||
|
|
1f80c795e0 | ||
|
|
dfea734656 | ||
|
|
34fac2d7df | ||
|
|
735009cda3 | ||
|
|
700cdeeee4 |
1303 changed files with 8084 additions and 266670 deletions
|
|
@ -73,7 +73,7 @@ cache:
|
|||
- '%CYGWIN_ROOT%\home\%USERNAME%\.ccache'
|
||||
build_script:
|
||||
- SET PATH=%CYGWIN_ROOT%/bin
|
||||
- '%CYGWIN_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; meson setup --prefix=/usr -Dxv=false -Dxf86bigfont=true -Dxephyr=true -Dxnest=true -Dxvfb=true -Dxwin=true -Dxorg=true -Dpciaccess=false -Dint10=false -Dglamor=false build"'
|
||||
- '%CYGWIN_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; meson setup --prefix=/usr -Dxv=false -Dxf86bigfont=true -Dxvfb=true -Dglamor=false build"'
|
||||
- '%CYGWIN_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; meson configure build"'
|
||||
- '%CYGWIN_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; ninja -C build"'
|
||||
- '%CYGWIN_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; ccache -s"'
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
# This file contains revisions to be ignored by git blame.
|
||||
# These revisions are expected to be formatting-only changes.
|
||||
#
|
||||
# Calling `git blame --ignore-revs-file .git-blame-ignore-revs` will
|
||||
# tell git blame to ignore changes made by these revisions when assigning
|
||||
# assigning blame, as if the change never happened.
|
||||
#
|
||||
# You can enable this as a default for your local repository by running
|
||||
# `git config blame.ignoreRevsFile .git-blame-ignore-revs`
|
||||
# Important: if you do this, then switch to a branch without this file,
|
||||
# `git blame` will fail with an error.
|
||||
#
|
||||
|
||||
# Introduce a consistent coding style
|
||||
9838b7032ea9792bec21af424c53c07078636d21
|
||||
|
||||
# Drop trailing whitespaces
|
||||
732fd7e571b81d63aa44d6e4cf55883479e88f2f
|
||||
|
||||
# glamor: Apply x-indent.sh.
|
||||
d84d71029ae9e462559d64eff7259e2cc7732fac
|
||||
|
||||
# indent fixes (OMG SO UGLY), and nuke old RCS keywords.
|
||||
6d7083bd69724586338d79784655328f1fcd2ae5
|
||||
245
.gitlab-ci.yml
245
.gitlab-ci.yml
|
|
@ -4,7 +4,7 @@
|
|||
# Please see the ci-templates documentation for details:
|
||||
# https://freedesktop.pages.freedesktop.org/ci-templates/
|
||||
|
||||
.templates_sha: &template_sha ef5e4669b7500834a17ffe9277e15fbb6d977fff # see https://docs.gitlab.com/ee/ci/yaml/#includefile
|
||||
.templates_sha: &template_sha c5626190ec14b475271288dda7a7dae8dbe0cd76 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
|
||||
|
||||
# FDO_DISTRIBUTION_TAG is the tag of the docker image used for the build jobs.
|
||||
# If the image doesn't exist yet, the docker-image stage generates it.
|
||||
|
|
@ -16,29 +16,24 @@
|
|||
# gcc/clang or other packages, which might break the build with older commits
|
||||
# using the same tag.
|
||||
variables:
|
||||
FDO_UPSTREAM_REPO: 'xorg/xserver'
|
||||
MESON_BUILDDIR: 'build'
|
||||
REPO_URL_XORGPROTO: 'https://gitlab.freedesktop.org/xorg/proto/xorgproto.git'
|
||||
XORG_DEBIAN_VERSION: 'bullseye-slim'
|
||||
XORG_DEBIAN_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/debian-install.sh'
|
||||
XORG_DEBIAN_TAG: '2025-02-26-xcb-deps'
|
||||
XORG_FREEBSD_VERSION: '14.2'
|
||||
XORG_FREEBSD_EXEC: ''
|
||||
XORG_FREEBSD_TAG: '2025-02-18-vm-image'
|
||||
FDO_UPSTREAM_REPO: xorg/xserver
|
||||
FDO_DISTRIBUTION_VERSION: bullseye-slim
|
||||
FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/debian-install.sh'
|
||||
FDO_DISTRIBUTION_TAG: "2024-09-24-no-xorg"
|
||||
MESON_BUILDDIR: "build"
|
||||
|
||||
include:
|
||||
- project: 'freedesktop/ci-templates'
|
||||
ref: *template_sha
|
||||
file:
|
||||
- '/templates/debian.yml'
|
||||
- '/templates/freebsd.yml'
|
||||
- '/templates/ci-fairy.yml'
|
||||
file: '/templates/debian.yml'
|
||||
- project: 'freedesktop/ci-templates'
|
||||
ref: *template_sha
|
||||
file: '/templates/ci-fairy.yml'
|
||||
- template: Security/SAST.gitlab-ci.yml
|
||||
|
||||
stages:
|
||||
- docker-image
|
||||
- build-and-test
|
||||
- drivers
|
||||
- test
|
||||
|
||||
.ci-run-policy:
|
||||
|
|
@ -50,103 +45,17 @@ stages:
|
|||
# Cancel CI run if a newer commit is pushed to the same branch
|
||||
interruptible: true
|
||||
|
||||
# This is everything but the DDXen
|
||||
.dix_paths: &dix_paths
|
||||
# Directories
|
||||
- .gitlab-ci/**/*
|
||||
- composite/**/*
|
||||
- config/**/*
|
||||
- damageext/**/*
|
||||
- dbe/**/*
|
||||
- dix/**/*
|
||||
- doc/**/*
|
||||
- dri3/**/*
|
||||
- exa/**/*
|
||||
- fb/**/*
|
||||
- glamor/**/*
|
||||
- glx/**/*
|
||||
- include/**/*
|
||||
- m4/**/*
|
||||
- man/**/*
|
||||
- mi/**/*
|
||||
- miext/**/*
|
||||
- os/**/*
|
||||
- present/**/*
|
||||
- pseudoramiX/**/*
|
||||
- randr/**/*
|
||||
- record/**/*
|
||||
- render/**/*
|
||||
- test/**/*
|
||||
- Xext/**/*
|
||||
- xfixes/**/*
|
||||
- Xi/**/*
|
||||
- xkb/**/*
|
||||
# Files
|
||||
- hw/meson.build
|
||||
- .gitlab-ci.yml
|
||||
- meson*
|
||||
- xorg-server.m4
|
||||
- xorg-server.pc.in
|
||||
- xserver.ent.in
|
||||
|
||||
.xorg_paths: &xorg_paths
|
||||
- hw/xfree86/**/*
|
||||
|
||||
.xwayland_paths: &xwayland_paths
|
||||
- hw/xwayland/**/*
|
||||
|
||||
.all_ddx_paths:
|
||||
- hw/**/*
|
||||
|
||||
.debian:
|
||||
variables:
|
||||
FDO_DISTRIBUTION_VERSION: '$XORG_DEBIAN_VERSION'
|
||||
FDO_DISTRIBUTION_EXEC: '$XORG_DEBIAN_EXEC'
|
||||
FDO_DISTRIBUTION_TAG: '$XORG_DEBIAN_TAG'
|
||||
|
||||
.freebsd:
|
||||
tags:
|
||||
- kvm
|
||||
variables:
|
||||
FDO_DISTRIBUTION_TAG: '$XORG_FREEBSD_TAG'
|
||||
FDO_DISTRIBUTION_VERSION: '$XORG_FREEBSD_VERSION'
|
||||
FDO_DISTRIBUTION_EXEC: ''
|
||||
FDO_DISTRIBUTION_PACKAGES: 'git gcc pkgconf autoconf automake libtool xorg-macros xorgproto bash meson ninja pixman xtrans libXau libXdmcp libXfont2 libxkbfile libxcvt libpciaccess font-util libepoll-shim'
|
||||
FDO_IMAGE_SIZE: '30G'
|
||||
|
||||
debian-bullseye:
|
||||
extends:
|
||||
- .fdo.container-build@debian
|
||||
- .ci-run-policy
|
||||
- .debian
|
||||
stage: docker-image
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
|
||||
freebsd-image:
|
||||
extends:
|
||||
- .fdo.qemu-build@freebsd@x86_64
|
||||
- .freebsd
|
||||
stage: docker-image
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
|
||||
.xorg-image@debian:
|
||||
extends:
|
||||
- .fdo.distribution-image@debian
|
||||
- .debian
|
||||
|
||||
.xorg-image@freebsd:
|
||||
extends:
|
||||
- .fdo.distribution-image@freebsd
|
||||
- .freebsd
|
||||
variables:
|
||||
GIT_DEPTH: 1
|
||||
PKG_CONFIG_PATH: /usr/share/pkgconfig:/usr/lib/pkgconfig:/usr/pkg/share/pkgconfig:/usr/pkg/lib/pkgconfig:/usr/local/libdata/pkgconfig
|
||||
|
||||
.common-build-and-test:
|
||||
extends:
|
||||
- .xorg-image@debian
|
||||
- .fdo.distribution-image@debian
|
||||
- .ci-run-policy
|
||||
stage: build-and-test
|
||||
artifacts:
|
||||
|
|
@ -155,7 +64,7 @@ freebsd-image:
|
|||
- $MESON_BUILDDIR/meson-logs/
|
||||
- $MESON_BUILDDIR/test/piglit-results/
|
||||
variables:
|
||||
MESON_ARGS: -Dc_args="-fno-common" -Dprefix=/usr -Dxephyr=true -Dwerror=true -Dxcsecurity=true
|
||||
MESON_ARGS: -Dc_args="-fno-common" -Dprefix=/usr -Dxephyr=true -Dwerror=true
|
||||
CCACHE_COMPILERCHECK: content
|
||||
CCACHE_DIR: /cache/xserver/cache
|
||||
LC_ALL: C.UTF-8
|
||||
|
|
@ -172,73 +81,22 @@ meson:
|
|||
- .gitlab-ci/meson-build.sh --run-test
|
||||
- .gitlab-ci/check-piglit-results.sh
|
||||
- .gitlab-ci/manpages-check
|
||||
- .gitlab-ci/check-ddx-build.sh
|
||||
variables:
|
||||
XTEST_DIR: /root/xts
|
||||
PIGLIT_DIR: /root/piglit
|
||||
LP_NUM_THREADS: 0
|
||||
MESON_DDX_BUILD_ARGS: >
|
||||
-Dxwayland=${BUILD_XWAYLAND} -Dxorg=${BUILD_XORG} -Dxephyr=${BUILD_XEPHYR} -Dxvfb=${BUILD_XVFB} -Dxnest=${BUILD_XNEST}
|
||||
BUILD_XEPHYR: true
|
||||
BUILD_XNEST: true
|
||||
BUILD_XORG: true
|
||||
BUILD_XVFB: true
|
||||
BUILD_XWAYLAND: true
|
||||
MESON_EXTRA_ARGS: ${MESON_DDX_BUILD_ARGS}
|
||||
|
||||
meson-enable-options:
|
||||
extends: meson
|
||||
variables:
|
||||
MESON_EXTRA_ARGS: --auto-features=enabled -Dlisten_tcp=true -Dsuid_wrapper=true -Dxf86bigfont=true -Dxcsecurity=true -Dxpbproxy=true -Ddri1=true -Ddri2=true -Ddri3=true -Dlibunwind=true ${MESON_DDX_BUILD_ARGS}
|
||||
|
||||
meson-disable-options:
|
||||
extends: meson
|
||||
variables:
|
||||
MESON_EXTRA_ARGS: --auto-features=disabled -Dglamor=false -Dglx=false -Dxdmcp=false -Dxdm-auth-1=false -Dint10=false -Dpciaccess=false -Dudev=false -Dudev_kms=false -Dvgahw=false -Dxace=false -Dxcsecurity=false -Dxinerama=false -Dxv=false -Dxvmc=false -Ddrm=false -Ddri1=false -Ddri2=false -Ddri3=false ${MESON_DDX_BUILD_ARGS}
|
||||
|
||||
meson-noglamor:
|
||||
extends: meson
|
||||
variables:
|
||||
MESON_EXTRA_ARGS: -Dglamor=false ${MESON_DDX_BUILD_ARGS}
|
||||
MESON_EXTRA_ARGS: >
|
||||
-Dglamor=false
|
||||
|
||||
xwayland-nolibdecor:
|
||||
meson-nolibdecor:
|
||||
extends: meson
|
||||
variables:
|
||||
BUILD_XEPHYR: false
|
||||
BUILD_XNEST: false
|
||||
BUILD_XORG: false
|
||||
BUILD_XVFB: false
|
||||
MESON_EXTRA_ARGS: -Dlibdecor=false ${MESON_DDX_BUILD_ARGS}
|
||||
|
||||
mingw-cross-build:
|
||||
extends: .common-build-and-test
|
||||
script:
|
||||
- .gitlab-ci/meson-build.sh --run-install
|
||||
variables:
|
||||
MESON_ARGS: --cross-file=.gitlab-ci/cross-i686-w64-mingw32.txt -Dglx=false -Dlisten_tcp=true
|
||||
|
||||
freebsd:
|
||||
stage: build-and-test
|
||||
extends:
|
||||
- .xorg-image@freebsd
|
||||
variables:
|
||||
MESON_ARGS: -Dglx=false -Dglamor=false -Dudev=false -Dudev_kms=false
|
||||
script:
|
||||
# running of of disk space without this
|
||||
# needed until https://gitlab.freedesktop.org/freedesktop/ci-templates/-/issues/67 is fixed
|
||||
- git gc
|
||||
- git clone --depth=1 $REPO_URL_XORGPROTO dep.xorgproto
|
||||
- /app/vmctl start
|
||||
- set +e
|
||||
- scp -r $PWD "vm:"
|
||||
# need to install newer xorgproto
|
||||
- /app/vmctl exec "cd $CI_PROJECT_NAME/dep.xorgproto && ./autogen.sh --prefix=/usr && make && make install"
|
||||
- /app/vmctl exec "cd $CI_PROJECT_NAME && PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\" MESON_ARGS=\"$MESON_ARGS\" MESON_BUILDDIR=\"$MESON_BUILDDIR\" .gitlab-ci/meson-build.sh --skip-test" && touch .success
|
||||
# test not working yet, so skipped
|
||||
# - scp -r vm:$CI_PROJECT_NAME/test-results.xml .
|
||||
- /app/vmctl stop
|
||||
- set -e
|
||||
- test -e .success || exit 1
|
||||
MESON_EXTRA_ARGS: >
|
||||
-Dlibdecor=false
|
||||
|
||||
meson-dist:
|
||||
extends: .common-build-and-test
|
||||
|
|
@ -246,74 +104,15 @@ meson-dist:
|
|||
when: always
|
||||
paths:
|
||||
- $MESON_BUILDDIR/meson-logs/
|
||||
- $MESON_BUILDDIR/xserver-*/$MESON_BUILDDIR/meson-logs/
|
||||
- xserver-tarball/install/
|
||||
- $MESON_BUILDDIR/xwayland-*/$MESON_BUILDDIR/meson-logs/
|
||||
script:
|
||||
- .gitlab-ci/meson-build.sh --run-dist
|
||||
- mkdir xserver-tarball
|
||||
- tar xf $MESON_BUILDDIR/meson-dist/xserver-*.tar.xz -C xserver-tarball --strip-components=1
|
||||
- .gitlab-ci/meson-build.sh -C xserver-tarball --skip-test --skip-dist --run-install
|
||||
- mkdir xwayland-tarball
|
||||
- tar xf $MESON_BUILDDIR/meson-dist/xwayland-*.tar.xz -C xwayland-tarball --strip-components=1
|
||||
- .gitlab-ci/meson-build.sh -C xwayland-tarball --skip-test --skip-dist --run-install
|
||||
variables:
|
||||
MESON_DIST_ARGS: --no-tests
|
||||
MESON_EXTRA_ARGS: -Dprefix=$CI_PROJECT_DIR/xserver-tarball/install/
|
||||
|
||||
xf86-driver-build-test:
|
||||
extends:
|
||||
- .xorg-image@debian
|
||||
- .ci-run-policy
|
||||
stage: drivers
|
||||
parallel:
|
||||
matrix:
|
||||
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-evdev
|
||||
SHA: xf86-input-evdev-2.10.6
|
||||
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput
|
||||
SHA: xf86-input-libinput-1.4.0
|
||||
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-mouse
|
||||
SHA: xf86-input-mouse-1.9.5
|
||||
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-synaptics
|
||||
SHA: xf86-input-synaptics-1.9.2
|
||||
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu
|
||||
SHA: xf86-video-amdgpu-23.0.0
|
||||
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-ati
|
||||
SHA: xf86-video-ati-22.0.0
|
||||
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel
|
||||
SHA: e6a4c4740c15ace9dd79dc7c18955f2eb413a6a5 # no release yet
|
||||
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-qxl
|
||||
SHA: 989ff620220e8d0555cec38c1508b57dfbcfb0c6 # no release yet
|
||||
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vesa
|
||||
SHA: xf86-video-vesa-2.6.0
|
||||
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vmware
|
||||
SHA: xf86-video-vmware-13.4.0
|
||||
script:
|
||||
# built xserver is taken from meson-dist job
|
||||
- export PKG_CONFIG_PATH=$(pwd)/xserver-tarball/install/lib/x86_64-linux-gnu/pkgconfig
|
||||
- export ACLOCAL_PATH=$(pwd)/xserver-tarball/install/share/aclocal/
|
||||
- unset MESON_EXTRA_ARGS
|
||||
- DRIVER=$(basename $REPO)
|
||||
- git clone "$REPO" "$DRIVER"
|
||||
- git -C "$DRIVER" checkout "$SHA"
|
||||
- |
|
||||
if [[ -e "$DRIVER/meson.build" ]] && [[ "$DRIVER" != "xf86-video-intel" ]]; then
|
||||
.gitlab-ci/meson-build.sh -C "$DRIVER" --skip-test
|
||||
else
|
||||
pushd "$DRIVER" || exit 1
|
||||
./autogen.sh && make
|
||||
fi
|
||||
needs:
|
||||
- meson-dist
|
||||
dependencies:
|
||||
- meson-dist
|
||||
variables:
|
||||
GIT_DEPTH: 1
|
||||
MESON_ARGS: -Dprefix=/usr/
|
||||
MESON_EXTRA_ARGS: -Dxwayland=false -Dxnest=false -Dxvfb=false -Dxquartz=false -Ddocs=false
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
||||
changes:
|
||||
*dix_paths
|
||||
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
||||
changes:
|
||||
*xorg_paths
|
||||
DESTDIR: xwayland-tarball/install/
|
||||
|
||||
#
|
||||
# Verify that commit messages are as expected
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -o xtrace
|
||||
|
||||
check_executable () {
|
||||
if [[ ! -x $MESON_BUILDDIR/$1 ]]; then
|
||||
echo "$1 not found after build"
|
||||
exit 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
if [[ -z "$MESON_BUILDDIR" ]]; then
|
||||
echo "\$MESON_BUILDDIR not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[[ "$BUILD_XEPHYR" == true ]] && check_executable "hw/kdrive/ephyr/Xephyr"
|
||||
[[ "$BUILD_XNEST" == true ]] && check_executable "hw/xnest/Xnest"
|
||||
[[ "$BUILD_XORG" == true ]] && check_executable "hw/xfree86/Xorg"
|
||||
[[ "$BUILD_XVFB" == true ]] && check_executable "hw/vfb/Xvfb"
|
||||
[[ "$BUILD_XWAYLAND" == true ]] && check_executable "hw/xwayland/Xwayland"
|
||||
|
||||
exit 0
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
[binaries]
|
||||
c = 'i686-w64-mingw32-gcc'
|
||||
cpp = 'i686-w64-mingw32-g++'
|
||||
ar = 'i686-w64-mingw32-ar'
|
||||
strip = 'i686-w64-mingw32-strip'
|
||||
pkgconfig = '/usr/local/bin/i686-w64-mingw32-pkg-config'
|
||||
windres = 'i686-w64-mingw32-windres'
|
||||
exe_wrapper = 'wine'
|
||||
|
||||
[properties]
|
||||
# Directory that contains 'bin', 'lib', etc for the toolchain
|
||||
root = '/usr/i686-w64-mingw32'
|
||||
# Directory that contains 'bin', 'lib', etc which have been cross-compiled
|
||||
sys_root = '/usr/i686-w64-mingw32'
|
||||
|
||||
[host_machine]
|
||||
system = 'windows'
|
||||
cpu_family = 'x86'
|
||||
cpu = 'i686'
|
||||
endian = 'little'
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -o xtrace
|
||||
|
||||
HOST=$1
|
||||
|
||||
# Debian's cross-pkg-config wrappers are broken for MinGW targets, since
|
||||
# dpkg-architecture doesn't know about MinGW target triplets.
|
||||
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930492
|
||||
cat >/usr/local/bin/${HOST}-pkg-config <<EOF
|
||||
#!/bin/sh
|
||||
|
||||
PKG_CONFIG_SYSROOT_DIR=/usr/${HOST} PKG_CONFIG_LIBDIR=/usr/${HOST}/lib/pkgconfig:/usr/${HOST}/share/pkgconfig pkg-config \$@
|
||||
EOF
|
||||
chmod +x /usr/local/bin/${HOST}-pkg-config
|
||||
|
||||
# when cross-compiling, some autoconf tests cannot be run:
|
||||
|
||||
# --enable-malloc0returnsnull
|
||||
export xorg_cv_malloc0_returns_null=yes
|
||||
|
||||
build() {
|
||||
url=$1
|
||||
commit=$2
|
||||
config=$3
|
||||
|
||||
name=$(basename ${url} .git)
|
||||
|
||||
if [[ $commit =~ ^[[:xdigit:]]{1,}$ ]]
|
||||
then
|
||||
git clone ${url} ${name}
|
||||
git -C ${name} checkout ${commit}
|
||||
else
|
||||
git clone --depth 1 --branch ${commit:-master} --recurse-submodules -c advice.detachedHead=false ${url} ${name}
|
||||
fi
|
||||
|
||||
pushd ${name}
|
||||
NOCONFIGURE=1 ./autogen.sh || ./.bootstrap
|
||||
./configure ${config} --host=${HOST} --prefix= --with-sysroot=/usr/${HOST}/
|
||||
make -j$(nproc)
|
||||
DESTDIR=/usr/${HOST} make install
|
||||
|
||||
popd
|
||||
rm -rf ${OLDPWD}
|
||||
}
|
||||
|
||||
build 'https://gitlab.freedesktop.org/pixman/pixman.git' 'pixman-0.38.4'
|
||||
build 'https://gitlab.freedesktop.org/xorg/lib/pthread-stubs.git' '0.4'
|
||||
# we can't use the xorgproto pkgconfig files from /usr/share/pkgconfig, because
|
||||
# these would add -I/usr/include to CFLAGS, which breaks cross-compilation
|
||||
build 'https://gitlab.freedesktop.org/xorg/proto/xorgproto.git' 'xorgproto-2024.1' '--datadir=/lib'
|
||||
build 'https://gitlab.freedesktop.org/xorg/lib/libXau.git' 'libXau-1.0.9'
|
||||
build 'https://gitlab.freedesktop.org/xorg/proto/xcbproto.git' 'xcb-proto-1.14.1'
|
||||
build 'https://gitlab.freedesktop.org/xorg/lib/libxcb.git' 'libxcb-1.14'
|
||||
build 'https://gitlab.freedesktop.org/xorg/lib/libxtrans.git' 'xtrans-1.4.0'
|
||||
# the default value of keysymdefdir is taken from the includedir variable for
|
||||
# xproto, which isn't adjusted by pkg-config for the sysroot
|
||||
# Using -fcommon to address build failure when cross-compiling for windows.
|
||||
# See discussion at https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/913
|
||||
CFLAGS="-fcommon" build 'https://gitlab.freedesktop.org/xorg/lib/libX11.git' 'libX11-1.6.9' "--with-keysymdefdir=/usr/${HOST}/include/X11"
|
||||
build 'https://gitlab.freedesktop.org/xorg/lib/libxkbfile.git' 'libxkbfile-1.1.0'
|
||||
# freetype needs an explicit --build to know it's cross-compiling
|
||||
# disable png as freetype tries to use libpng-config, even when cross-compiling
|
||||
build 'git://git.savannah.gnu.org/freetype/freetype2.git' 'VER-2-10-1' "--build=$(cc -dumpmachine) --with-png=no"
|
||||
build 'https://gitlab.freedesktop.org/xorg//font/util.git' 'font-util-1.3.2'
|
||||
build 'https://gitlab.freedesktop.org/xorg/lib/libfontenc.git' 'libfontenc-1.1.4'
|
||||
build 'https://gitlab.freedesktop.org/xorg/lib/libXfont.git' 'libXfont2-2.0.3'
|
||||
build 'https://gitlab.freedesktop.org/xorg/lib/libXdmcp.git' 'libXdmcp-1.1.3'
|
||||
build 'https://gitlab.freedesktop.org/xorg/lib/libXfixes.git' 'libXfixes-5.0.3'
|
||||
build 'https://gitlab.freedesktop.org/xorg/lib/libxcb-util.git' 'xcb-util-0.4.1-gitlab'
|
||||
build 'https://gitlab.freedesktop.org/xorg/lib/libxcb-image.git' 'xcb-util-image-0.4.1-gitlab'
|
||||
build 'https://gitlab.freedesktop.org/xorg/lib/libxcb-wm.git' 'xcb-util-wm-0.4.2'
|
||||
|
||||
# workaround xcb_windefs.h leaking all Windows API types into X server build
|
||||
# (some of which clash which types defined by Xmd.h) XXX: This is a bit of a
|
||||
# hack, as it makes this header depend on xorgproto. Maybe an upstreamable
|
||||
# fix would involve a macro defined in the X server (XFree86Server?
|
||||
# XCB_NO_WINAPI?), which makes xcb_windefs.h wrap things like XWinsock.h
|
||||
# does???
|
||||
sed -i s#winsock2#X11/Xwinsock# /usr/${HOST}/include/xcb/xcb_windefs.h
|
||||
|
|
@ -6,8 +6,10 @@ set -o xtrace
|
|||
# Packages which are needed by this script, but not for the xserver build
|
||||
EPHEMERAL="
|
||||
libcairo2-dev
|
||||
libevdev-dev
|
||||
libexpat-dev
|
||||
libgles2-mesa-dev
|
||||
libinput-dev
|
||||
libxkbcommon-dev
|
||||
x11-utils
|
||||
x11-xserver-utils
|
||||
|
|
@ -15,7 +17,7 @@ EPHEMERAL="
|
|||
xvfb
|
||||
"
|
||||
|
||||
# Add bullseye-backports for the newer linux-libc-dev & meson packages
|
||||
# Add bullseye-backports for the newer linux-libc-dev package
|
||||
echo 'deb http://deb.debian.org/debian bullseye-backports main' >> /etc/apt/sources.list
|
||||
apt update
|
||||
|
||||
|
|
@ -27,9 +29,7 @@ apt-get install -y \
|
|||
build-essential \
|
||||
ca-certificates \
|
||||
ccache \
|
||||
dpkg-dev \
|
||||
flex \
|
||||
gcc-mingw-w64-i686 \
|
||||
git \
|
||||
libaudit-dev \
|
||||
libbsd-dev \
|
||||
|
|
@ -48,14 +48,12 @@ apt-get install -y \
|
|||
libgles2 \
|
||||
libglx-mesa0 \
|
||||
libinput10 \
|
||||
libinput-dev \
|
||||
libnvidia-egl-wayland-dev \
|
||||
libpango1.0-0 \
|
||||
libpango1.0-dev \
|
||||
libpciaccess-dev \
|
||||
libpixman-1-dev \
|
||||
libselinux1-dev \
|
||||
libspice-protocol-dev \
|
||||
libsystemd-dev \
|
||||
libtool \
|
||||
libudev-dev \
|
||||
|
|
@ -65,9 +63,6 @@ apt-get install -y \
|
|||
libx11-xcb-dev \
|
||||
libxau-dev \
|
||||
libxaw7-dev \
|
||||
libxcb-damage0-dev \
|
||||
libxcb-dri2-0-dev \
|
||||
libxcb-dri3-dev \
|
||||
libxcb-glx0-dev \
|
||||
libxcb-icccm4-dev \
|
||||
libxcb-image0-dev \
|
||||
|
|
@ -77,15 +72,11 @@ apt-get install -y \
|
|||
libxcb-render0-dev \
|
||||
libxcb-shape0-dev \
|
||||
libxcb-shm0-dev \
|
||||
libxcb-sync-dev \
|
||||
libxcb-util0-dev \
|
||||
libxcb-xf86dri0-dev \
|
||||
libxcb-xinput-dev \
|
||||
libxcb-xkb-dev \
|
||||
libxcb-xv0-dev \
|
||||
libxcb1-dev \
|
||||
libxcursor-dev \
|
||||
libxdamage-dev \
|
||||
libxdmcp-dev \
|
||||
libxext-dev \
|
||||
libxfixes-dev \
|
||||
|
|
@ -97,21 +88,15 @@ apt-get install -y \
|
|||
libxmu-dev \
|
||||
libxmuu-dev \
|
||||
libxpm-dev \
|
||||
libxrandr-dev \
|
||||
libxrender-dev \
|
||||
libxres-dev \
|
||||
libxshmfence-dev \
|
||||
libxss-dev \
|
||||
libxt-dev \
|
||||
libxtst-dev \
|
||||
libxv-dev \
|
||||
libxvmc-dev \
|
||||
libxxf86vm-dev \
|
||||
libz-mingw-w64-dev \
|
||||
linux-libc-dev/bullseye-backports \
|
||||
mesa-common-dev \
|
||||
meson/bullseye-backports \
|
||||
mingw-w64-tools \
|
||||
meson \
|
||||
nettle-dev \
|
||||
pkg-config \
|
||||
python3-attr \
|
||||
|
|
@ -119,7 +104,6 @@ apt-get install -y \
|
|||
python3-mako \
|
||||
python3-numpy \
|
||||
python3-six \
|
||||
valgrind \
|
||||
weston \
|
||||
x11-xkb-utils \
|
||||
xfonts-utils \
|
||||
|
|
@ -127,8 +111,6 @@ apt-get install -y \
|
|||
xtrans-dev \
|
||||
xutils-dev
|
||||
|
||||
.gitlab-ci/cross-prereqs-build.sh i686-w64-mingw32
|
||||
|
||||
cd /root
|
||||
|
||||
# Xwayland requires drm 2.4.116 for drmSyncobjEventfd
|
||||
|
|
@ -163,8 +145,8 @@ ninja -C _build -j${FDO_CI_CONCURRENT:-4} install
|
|||
cd ..
|
||||
rm -rf wayland
|
||||
|
||||
# Xwayland requires wayland-protocols >= 1.38, but Debian bullseye has 1.20 only
|
||||
git clone https://gitlab.freedesktop.org/wayland/wayland-protocols.git --depth 1 --branch=1.38
|
||||
# Xwayland requires wayland-protocols >= 1.34, but Debian bullseye has 1.20 only
|
||||
git clone https://gitlab.freedesktop.org/wayland/wayland-protocols.git --depth 1 --branch=1.34
|
||||
cd wayland-protocols
|
||||
meson _build
|
||||
ninja -C _build -j${FDO_CI_CONCURRENT:-4} install
|
||||
|
|
@ -194,8 +176,10 @@ cd ..
|
|||
|
||||
git clone https://gitlab.freedesktop.org/xorg/test/xts
|
||||
cd xts
|
||||
git checkout 12a887c2c72c4258962b56ced7b0aec782f1ffed
|
||||
./autogen.sh
|
||||
git checkout dbbfa96c036e596346147081cbceda136e7c86c1
|
||||
# Using -fcommon until we get a proper fix into xtst.
|
||||
# See discussion at https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/913
|
||||
CFLAGS=-fcommon ./autogen.sh
|
||||
xvfb-run make -j${FDO_CI_CONCURRENT:-4}
|
||||
cd ..
|
||||
|
||||
|
|
|
|||
3
.mailmap
3
.mailmap
|
|
@ -277,8 +277,7 @@ Paulo Zanoni <paulo.r.zanoni@intel.com> Paulo Ricardo Zanoni <pzanoni@mandriva.c
|
|||
|
||||
Pekka Paalanen <pekka.paalanen@collabora.co.uk> <pekka.paalanen@collabora.com>
|
||||
|
||||
Peter Harris <pharris2@rocketsoftware.com> <peter.harris@hummingbird.com>
|
||||
Peter Harris <pharris2@rocketsoftware.com> <pharris@opentext.com>
|
||||
Peter Harris <pharris@opentext.com> <peter.harris@hummingbird.com>
|
||||
|
||||
Peter Hutterer <peter.hutterer@who-t.net> <peter.hutterer@redhat.com>
|
||||
Peter Hutterer <peter.hutterer@who-t.net> <peter@cs.unisa.edu.au>
|
||||
|
|
|
|||
27
.travis.yml
27
.travis.yml
|
|
@ -1,27 +0,0 @@
|
|||
language: c
|
||||
cache:
|
||||
ccache: true
|
||||
directories:
|
||||
- $HOME/Library/Caches/Homebrew
|
||||
branches:
|
||||
except:
|
||||
- /appveyor.*/
|
||||
|
||||
os: osx
|
||||
osx_image: xcode9.2
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- env: TOOL=meson
|
||||
- env: TOOL=autotools
|
||||
|
||||
install:
|
||||
- brew update
|
||||
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache meson
|
||||
|
||||
script:
|
||||
- ./test/scripts/build-travis-osx.sh $TOOL
|
||||
- ccache -s
|
||||
|
||||
before_cache:
|
||||
- brew cleanup
|
||||
2
COPYING
2
COPYING
|
|
@ -16,7 +16,7 @@ Copyright © 2006 Nokia Corporation
|
|||
Copyright © 2006-2008 Peter Hutterer
|
||||
Copyright © 2006 Adam Jackson
|
||||
Copyright © 2009-2010 NVIDIA Corporation
|
||||
Copyright © 1987, 2003-2006, 2008-2010, 2025 Oracle and/or its affiliates.
|
||||
Copyright © 1987, 2003-2006, 2008-2010 Oracle and/or its affiliates.
|
||||
Copyright © 1999 Keith Packard
|
||||
Copyright © 2007-2009 Red Hat, Inc.
|
||||
Copyright © 2005-2008 Daniel Stone
|
||||
|
|
|
|||
50
SECURITY.md
50
SECURITY.md
|
|
@ -1,50 +0,0 @@
|
|||
# Reporting Security Issues
|
||||
|
||||
Please notify us of any security issues by sending mail to
|
||||
<xorg-security@lists.x.org>.
|
||||
|
||||
See https://www.x.org/wiki/Development/Security/Organization/
|
||||
for more information about the X.Org security team.
|
||||
|
||||
# Learning about Security Fixes
|
||||
|
||||
X.Org announces security bugs and bug fix releases on the xorg-announce
|
||||
mailing list. See the archives at https://lists.x.org/archives/xorg-announce/
|
||||
and see https://lists.x.org/mailman/listinfo/xorg-announce to subscribe.
|
||||
|
||||
Security advisories are also listed on our wiki at
|
||||
https://www.x.org/wiki/Development/Security/ and mailed to the
|
||||
https://oss-security.openwall.org/wiki/mailing-lists/oss-security mailing list.
|
||||
|
||||
# Security model and trust boundaries
|
||||
|
||||
Only the Xorg server is expected to run with elevated privileges.
|
||||
(Some distros may run Xorg with a wrapper to only grant these privileges when
|
||||
necessary.) The Xorg server usually requires root access to hardware devices
|
||||
and I/O registers when using a UMS (Userspace Mode Setting) driver, and not
|
||||
when using a KMS (Kernel Mode Setting) driver, or drivers which do not require
|
||||
actual hardware access (such as xf86-video-dummy).
|
||||
|
||||
All other X servers (Xephyr, Xnest, Xvfb, etc.) are expected to run with only
|
||||
the privileges of the user who started the server. They should not require
|
||||
direct access to any devices.
|
||||
|
||||
The Xorg server uses configuration files to control various aspects of its
|
||||
operation (see the xorg.conf(5) man page), including specifying loadable
|
||||
object modules to run code from with the full privileges of the X server.
|
||||
There is no attempt to sandbox these modules - they are considered to be fully
|
||||
trusted, and thus anyone who can edit a config file is considered to be fully
|
||||
trusted - a module being able to control or crash the X server is not considered
|
||||
a security vulnerability (though a crash would be a non-security bug in the
|
||||
module). The configuration file loading mechanism takes steps to verify that
|
||||
config files are owned by trusted users before reading them, and failure to do
|
||||
so would be considered a security vulnerability.
|
||||
|
||||
Access control for which clients can connect to the X server is provided by
|
||||
a number of mechanisms, see the Xsecurity(7) man page for details. Once a
|
||||
client is authenticated via those mechanisms and has an active connection,
|
||||
we do not consider it a security vulnerability for them to be able to take
|
||||
any actions described in the X11 protocol or extension specifications, such
|
||||
as changing monitor configurations or killing other clients, though we will
|
||||
accept non-security bug reports for clients doing so in a manner or via
|
||||
requests not documented in the protocol specs as doing those operations.
|
||||
|
|
@ -26,7 +26,9 @@ from The Open Group.
|
|||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
|
|
@ -39,7 +41,7 @@ from The Open Group.
|
|||
#include "dixstruct.h"
|
||||
#include "extnsionst.h"
|
||||
#include "opaque.h"
|
||||
#include "extinit_priv.h"
|
||||
#include "extinit.h"
|
||||
|
||||
static int
|
||||
ProcBigReqDispatch(ClientPtr client)
|
||||
|
|
@ -47,6 +49,9 @@ ProcBigReqDispatch(ClientPtr client)
|
|||
REQUEST(xBigReqEnableReq);
|
||||
xBigReqEnableReply rep;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&stuff->length);
|
||||
}
|
||||
if (stuff->brReqType != X_BigReqEnable)
|
||||
return BadRequest;
|
||||
REQUEST_SIZE_MATCH(xBigReqEnableReq);
|
||||
|
|
|
|||
82
Xext/dpms.c
82
Xext/dpms.c
|
|
@ -26,14 +26,12 @@ Equipment Corporation.
|
|||
|
||||
******************************************************************/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
|
||||
#include "os/screensaver.h"
|
||||
#include "Xext/geext.h"
|
||||
|
||||
#include "misc.h"
|
||||
#include "os.h"
|
||||
#include "dixstruct.h"
|
||||
|
|
@ -41,7 +39,7 @@ Equipment Corporation.
|
|||
#include "opaque.h"
|
||||
#include <X11/extensions/dpmsproto.h>
|
||||
#include "dpmsproc.h"
|
||||
#include "extinit_priv.h"
|
||||
#include "extinit.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
#include "protocol-versions.h"
|
||||
|
|
@ -165,7 +163,7 @@ ProcDPMSSelectInput(register ClientPtr client)
|
|||
pHead = (DPMSEventPtr *)malloc(sizeof(DPMSEventPtr));
|
||||
if (!pHead ||
|
||||
!AddResource(eventResource, DPMSEventType, (void *)pHead)) {
|
||||
FreeResource(clientResource, X11_RESTYPE_NONE);
|
||||
FreeResource(clientResource, RT_NONE);
|
||||
return BadAlloc;
|
||||
}
|
||||
*pHead = 0;
|
||||
|
|
@ -494,16 +492,42 @@ static int _X_COLD
|
|||
SProcDPMSGetVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDPMSGetVersionReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
|
||||
swaps(&stuff->majorVersion);
|
||||
swaps(&stuff->minorVersion);
|
||||
return ProcDPMSGetVersion(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcDPMSCapable(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDPMSCapableReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDPMSCapableReq);
|
||||
|
||||
return ProcDPMSCapable(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcDPMSGetTimeouts(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDPMSGetTimeoutsReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
|
||||
|
||||
return ProcDPMSGetTimeouts(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcDPMSSetTimeouts(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDPMSSetTimeoutsReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq);
|
||||
|
||||
swaps(&stuff->standby);
|
||||
|
|
@ -512,10 +536,34 @@ SProcDPMSSetTimeouts(ClientPtr client)
|
|||
return ProcDPMSSetTimeouts(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcDPMSEnable(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDPMSEnableReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDPMSEnableReq);
|
||||
|
||||
return ProcDPMSEnable(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcDPMSDisable(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDPMSDisableReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDPMSDisableReq);
|
||||
|
||||
return ProcDPMSDisable(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcDPMSForceLevel(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDPMSForceLevelReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDPMSForceLevelReq);
|
||||
|
||||
swaps(&stuff->level);
|
||||
|
|
@ -523,10 +571,22 @@ SProcDPMSForceLevel(ClientPtr client)
|
|||
return ProcDPMSForceLevel(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcDPMSInfo(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDPMSInfoReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDPMSInfoReq);
|
||||
|
||||
return ProcDPMSInfo(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcDPMSSelectInput(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDPMSSelectInputReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDPMSSelectInputReq);
|
||||
swapl(&stuff->eventMask);
|
||||
return ProcDPMSSelectInput(client);
|
||||
|
|
@ -542,19 +602,19 @@ SProcDPMSDispatch(ClientPtr client)
|
|||
case X_DPMSGetVersion:
|
||||
return SProcDPMSGetVersion(client);
|
||||
case X_DPMSCapable:
|
||||
return ProcDPMSCapable(client);
|
||||
return SProcDPMSCapable(client);
|
||||
case X_DPMSGetTimeouts:
|
||||
return ProcDPMSGetTimeouts(client);
|
||||
return SProcDPMSGetTimeouts(client);
|
||||
case X_DPMSSetTimeouts:
|
||||
return SProcDPMSSetTimeouts(client);
|
||||
case X_DPMSEnable:
|
||||
return ProcDPMSEnable(client);
|
||||
return SProcDPMSEnable(client);
|
||||
case X_DPMSDisable:
|
||||
return ProcDPMSDisable(client);
|
||||
return SProcDPMSDisable(client);
|
||||
case X_DPMSForceLevel:
|
||||
return SProcDPMSForceLevel(client);
|
||||
case X_DPMSInfo:
|
||||
return ProcDPMSInfo(client);
|
||||
return SProcDPMSInfo(client);
|
||||
case X_DPMSSelectInput:
|
||||
return SProcDPMSSelectInput(client);
|
||||
default:
|
||||
|
|
|
|||
87
Xext/geext.c
87
Xext/geext.c
|
|
@ -23,32 +23,26 @@
|
|||
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/ge.h>
|
||||
|
||||
#include "geint.h"
|
||||
#include "geext.h"
|
||||
#include "protocol-versions.h"
|
||||
#include "extinit_priv.h"
|
||||
#include "extinit.h"
|
||||
|
||||
DevPrivateKeyRec GEClientPrivateKeyRec;
|
||||
|
||||
#define GEClientPrivateKey (&GEClientPrivateKeyRec)
|
||||
GEExtension GEExtensions[MAXEXTENSIONS];
|
||||
|
||||
/** Struct to keep information about registered extensions */
|
||||
typedef struct _GEExtension {
|
||||
/** Event swapping routine */
|
||||
void (*evswap) (xGenericEvent *from, xGenericEvent *to);
|
||||
} GEExtension, *GEExtensionPtr;
|
||||
|
||||
static GEExtension GEExtensions[MAXEXTENSIONS];
|
||||
|
||||
typedef struct _GEClientInfo {
|
||||
CARD32 major_version;
|
||||
CARD32 minor_version;
|
||||
} GEClientInfoRec, *GEClientInfoPtr;
|
||||
|
||||
#define GEGetClient(pClient) ((GEClientInfoPtr)(dixLookupPrivate(&((pClient)->devPrivates), GEClientPrivateKey)))
|
||||
/* Major available requests */
|
||||
static const int version_requests[] = {
|
||||
X_GEQueryVersion, /* before client sends QueryVersion */
|
||||
X_GEQueryVersion, /* must be set to last request in version 1 */
|
||||
};
|
||||
|
||||
/* Forward declarations */
|
||||
static void SGEGenericEvent(xEvent *from, xEvent *to);
|
||||
|
|
@ -95,6 +89,11 @@ ProcGEQueryVersion(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
static int (*ProcGEVector[GENumberRequests]) (ClientPtr) = {
|
||||
/* Version 1.0 */
|
||||
ProcGEQueryVersion,
|
||||
};
|
||||
|
||||
/************************************************************/
|
||||
/* swapped request handlers */
|
||||
/************************************************************/
|
||||
|
|
@ -102,12 +101,19 @@ static int _X_COLD
|
|||
SProcGEQueryVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xGEQueryVersionReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xGEQueryVersionReq);
|
||||
swaps(&stuff->majorVersion);
|
||||
swaps(&stuff->minorVersion);
|
||||
return ProcGEQueryVersion(client);
|
||||
return (*ProcGEVector[stuff->ReqType]) (client);
|
||||
}
|
||||
|
||||
static int (*SProcGEVector[GENumberRequests]) (ClientPtr) = {
|
||||
/* Version 1.0 */
|
||||
SProcGEQueryVersion
|
||||
};
|
||||
|
||||
/************************************************************/
|
||||
/* callbacks */
|
||||
/************************************************************/
|
||||
|
|
@ -116,29 +122,32 @@ SProcGEQueryVersion(ClientPtr client)
|
|||
static int
|
||||
ProcGEDispatch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
GEClientInfoPtr pGEClient = GEGetClient(client);
|
||||
|
||||
switch (stuff->data) {
|
||||
case X_GEQueryVersion:
|
||||
return ProcGEQueryVersion(client);
|
||||
default:
|
||||
REQUEST(xGEReq);
|
||||
|
||||
if (pGEClient->major_version >= ARRAY_SIZE(version_requests))
|
||||
return BadRequest;
|
||||
}
|
||||
if (stuff->ReqType > version_requests[pGEClient->major_version])
|
||||
return BadRequest;
|
||||
|
||||
return (ProcGEVector[stuff->ReqType]) (client);
|
||||
}
|
||||
|
||||
/* dispatch swapped requests */
|
||||
static int _X_COLD
|
||||
SProcGEDispatch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
swaps(&stuff->length);
|
||||
GEClientInfoPtr pGEClient = GEGetClient(client);
|
||||
|
||||
switch (stuff->data) {
|
||||
case X_GEQueryVersion:
|
||||
return SProcGEQueryVersion(client);
|
||||
default:
|
||||
REQUEST(xGEReq);
|
||||
|
||||
if (pGEClient->major_version >= ARRAY_SIZE(version_requests))
|
||||
return BadRequest;
|
||||
}
|
||||
if (stuff->ReqType > version_requests[pGEClient->major_version])
|
||||
return BadRequest;
|
||||
|
||||
return (*SProcGEVector[stuff->ReqType]) (client);
|
||||
}
|
||||
|
||||
/* Reset extension. Called on server shutdown. */
|
||||
|
|
@ -177,16 +186,24 @@ SGEGenericEvent(xEvent *from, xEvent *to)
|
|||
void
|
||||
GEExtensionInit(void)
|
||||
{
|
||||
ExtensionEntry *extEntry;
|
||||
|
||||
if (!dixRegisterPrivateKey
|
||||
(&GEClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(GEClientInfoRec)))
|
||||
FatalError("GEExtensionInit: GE private request failed.\n");
|
||||
|
||||
if (!AddExtension(GE_NAME, 0, GENumberErrors, ProcGEDispatch, SProcGEDispatch,
|
||||
GEResetProc, StandardMinorOpcode))
|
||||
FatalError("GEInit: AddExtensions failed.\n");
|
||||
if ((extEntry = AddExtension(GE_NAME,
|
||||
0, GENumberErrors,
|
||||
ProcGEDispatch, SProcGEDispatch,
|
||||
GEResetProc, StandardMinorOpcode)) != 0) {
|
||||
memset(GEExtensions, 0, sizeof(GEExtensions));
|
||||
|
||||
EventSwapVector[GenericEvent] = (EventSwapPtr) SGEGenericEvent;
|
||||
}
|
||||
else {
|
||||
FatalError("GEInit: AddExtensions failed.\n");
|
||||
}
|
||||
|
||||
memset(GEExtensions, 0, sizeof(GEExtensions));
|
||||
EventSwapVector[GenericEvent] = (EventSwapPtr) SGEGenericEvent;
|
||||
}
|
||||
|
||||
/************************************************************/
|
||||
|
|
|
|||
42
Xext/geext.h
42
Xext/geext.h
|
|
@ -25,12 +25,50 @@ other dealings in this Software without prior written authorization
|
|||
from the author.
|
||||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _GEEXT_H_
|
||||
#define _GEEXT_H_
|
||||
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include <X11/extensions/geproto.h>
|
||||
|
||||
/** Struct to keep information about registered extensions */
|
||||
typedef struct _GEExtension {
|
||||
/** Event swapping routine */
|
||||
void (*evswap) (xGenericEvent *from, xGenericEvent *to);
|
||||
} GEExtension, *GEExtensionPtr;
|
||||
|
||||
/* All registered extensions and their handling functions. */
|
||||
extern _X_EXPORT GEExtension GEExtensions[MAXEXTENSIONS];
|
||||
|
||||
/* Typecast to generic event */
|
||||
#define GEV(ev) ((xGenericEvent*)(ev))
|
||||
/* Returns the extension offset from the event */
|
||||
#define GEEXT(ev) (GEV(ev)->extension)
|
||||
|
||||
/* Return zero-based extension offset (offset - 128). Only for use in arrays */
|
||||
#define GEEXTIDX(ev) (GEEXT(ev) & 0x7F)
|
||||
/* True if mask is set for extension on window */
|
||||
#define GEMaskIsSet(pWin, extension, mask) \
|
||||
((pWin)->optional && \
|
||||
(pWin)->optional->geMasks && \
|
||||
((pWin)->optional->geMasks->eventMasks[(extension) & 0x7F] & (mask)))
|
||||
|
||||
/* Returns first client */
|
||||
#define GECLIENT(pWin) \
|
||||
(((pWin)->optional) ? (pWin)->optional->geMasks->geClients : NULL)
|
||||
|
||||
/* Returns the event_fill for the given event */
|
||||
#define GEEventFill(ev) \
|
||||
GEExtensions[GEEXTIDX(ev)].evfill
|
||||
|
||||
#define GEIsType(ev, ext, ev_type) \
|
||||
((GEV(ev)->type == GenericEvent) && \
|
||||
GEEXT(ev) == (ext) && \
|
||||
GEV(ev)->evtype == (ev_type))
|
||||
|
||||
/* Interface for other extensions */
|
||||
extern _X_EXPORT void GERegisterExtension(int extension,
|
||||
void (*ev_dispatch) (xGenericEvent
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright © 2006-2007 Daniel Stone
|
||||
* Copyright 2007-2008 Peter Hutterer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
@ -20,27 +20,32 @@
|
|||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Author: Daniel Stone <daniel@fooishbar.org>
|
||||
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
#include "input.h"
|
||||
#include "list.h"
|
||||
|
||||
void remove_devices(const char *backend, const char *config_info);
|
||||
BOOL device_is_duplicate(const char *config_info);
|
||||
#ifndef _GEINT_H_
|
||||
#define _GEINT_H_
|
||||
|
||||
#ifdef CONFIG_UDEV
|
||||
int config_udev_pre_init(void);
|
||||
int config_udev_init(void);
|
||||
void config_udev_fini(void);
|
||||
void config_udev_odev_probe(config_odev_probe_proc_ptr probe_callback);
|
||||
#elif defined(CONFIG_HAL)
|
||||
int config_hal_init(void);
|
||||
void config_hal_fini(void);
|
||||
#elif defined(CONFIG_WSCONS)
|
||||
int config_wscons_init(void);
|
||||
void config_wscons_fini(void);
|
||||
#endif
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include "misc.h"
|
||||
#include "os.h"
|
||||
#include "dixstruct.h"
|
||||
#include "extnsionst.h"
|
||||
#include <X11/extensions/geproto.h>
|
||||
|
||||
extern DevPrivateKeyRec GEClientPrivateKeyRec;
|
||||
|
||||
#define GEClientPrivateKey (&GEClientPrivateKeyRec)
|
||||
|
||||
typedef struct _GEClientInfo {
|
||||
CARD32 major_version;
|
||||
CARD32 minor_version;
|
||||
} GEClientInfoRec, *GEClientInfoPtr;
|
||||
|
||||
#define GEGetClient(pClient) ((GEClientInfoPtr)(dixLookupPrivate(&((pClient)->devPrivates), GEClientPrivateKey)))
|
||||
|
||||
#endif /* _GEINT_H_ */
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "misc.h"
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ srcs_xext = [
|
|||
|
||||
hdrs_xext = [
|
||||
'geext.h',
|
||||
'geint.h',
|
||||
'syncsdk.h',
|
||||
]
|
||||
|
||||
|
|
@ -36,6 +37,7 @@ endif
|
|||
|
||||
if build_xace
|
||||
srcs_xext += 'xace.c'
|
||||
hdrs_xext += ['xace.h', 'xacestr.h']
|
||||
endif
|
||||
|
||||
if build_xf86bigfont
|
||||
|
|
@ -71,7 +73,3 @@ libxserver_xext_vidmode = static_library('libxserver_xext_vidmode',
|
|||
include_directories: inc,
|
||||
dependencies: common_dep,
|
||||
)
|
||||
|
||||
if build_xorg
|
||||
install_data(hdrs_xext, install_dir: xorgsdkdir)
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -23,16 +23,14 @@ dealings in this Software without prior written authorization from Digital
|
|||
Equipment Corporation.
|
||||
******************************************************************/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/Xarch.h>
|
||||
#include <X11/extensions/panoramiXproto.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
|
||||
#include "misc.h"
|
||||
#include "cursor.h"
|
||||
#include "cursorstr.h"
|
||||
|
|
@ -45,6 +43,7 @@ Equipment Corporation.
|
|||
#include "windowstr.h"
|
||||
#include "pixmapstr.h"
|
||||
#include "panoramiX.h"
|
||||
#include <X11/extensions/panoramiXproto.h>
|
||||
#include "panoramiXsrv.h"
|
||||
#include "globals.h"
|
||||
#include "servermd.h"
|
||||
|
|
@ -55,7 +54,7 @@ Equipment Corporation.
|
|||
#ifdef COMPOSITE
|
||||
#include "compint.h"
|
||||
#endif
|
||||
#include "extinit_priv.h"
|
||||
#include "extinit.h"
|
||||
#include "protocol-versions.h"
|
||||
|
||||
#ifdef GLXPROXY
|
||||
|
|
@ -744,8 +743,8 @@ PanoramiXMaybeAddDepth(DepthPtr pDepth)
|
|||
|
||||
j = PanoramiXNumDepths;
|
||||
PanoramiXNumDepths++;
|
||||
PanoramiXDepths = XNFreallocarray(PanoramiXDepths,
|
||||
PanoramiXNumDepths, sizeof(DepthRec));
|
||||
PanoramiXDepths = reallocarray(PanoramiXDepths,
|
||||
PanoramiXNumDepths, sizeof(DepthRec));
|
||||
PanoramiXDepths[j].depth = pDepth->depth;
|
||||
PanoramiXDepths[j].numVids = 0;
|
||||
PanoramiXDepths[j].vids = NULL;
|
||||
|
|
@ -817,11 +816,11 @@ PanoramiXConsolidate(void)
|
|||
for (i = 0; i < pScreen->numVisuals; i++)
|
||||
PanoramiXMaybeAddVisual(pVisual++);
|
||||
|
||||
root = XNFcallocarray(1, sizeof(PanoramiXRes));
|
||||
root = malloc(sizeof(PanoramiXRes));
|
||||
root->type = XRT_WINDOW;
|
||||
defmap = XNFcallocarray(1, sizeof(PanoramiXRes));
|
||||
defmap = malloc(sizeof(PanoramiXRes));
|
||||
defmap->type = XRT_COLORMAP;
|
||||
saver = XNFcallocarray(1, sizeof(PanoramiXRes));
|
||||
saver = malloc(sizeof(PanoramiXRes));
|
||||
saver->type = XRT_WINDOW;
|
||||
|
||||
FOR_NSCREENS(i) {
|
||||
|
|
|
|||
|
|
@ -39,8 +39,9 @@ Equipment Corporation.
|
|||
#ifndef _PANORAMIX_H_
|
||||
#define _PANORAMIX_H_
|
||||
|
||||
#define _PANORAMIX_SERVER
|
||||
#include <X11/extensions/panoramiXproto.h>
|
||||
|
||||
#undef _PANORAMIX_SERVER
|
||||
#include "gcstruct.h"
|
||||
#include "dixstruct.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ dealings in this Software without prior written authorization from Digital
|
|||
Equipment Corporation.
|
||||
******************************************************************/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <X11/X.h>
|
||||
|
|
@ -45,10 +47,22 @@ Equipment Corporation.
|
|||
#include "globals.h"
|
||||
#include "panoramiXh.h"
|
||||
|
||||
static int _X_COLD
|
||||
SProcPanoramiXQueryVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xPanoramiXQueryVersionReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
|
||||
return ProcPanoramiXQueryVersion(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcPanoramiXGetState(ClientPtr client)
|
||||
{
|
||||
REQUEST(xPanoramiXGetStateReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
|
||||
swapl(&stuff->window);
|
||||
return ProcPanoramiXGetState(client);
|
||||
|
|
@ -58,6 +72,8 @@ static int _X_COLD
|
|||
SProcPanoramiXGetScreenCount(ClientPtr client)
|
||||
{
|
||||
REQUEST(xPanoramiXGetScreenCountReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
|
||||
swapl(&stuff->window);
|
||||
return ProcPanoramiXGetScreenCount(client);
|
||||
|
|
@ -67,19 +83,41 @@ static int _X_COLD
|
|||
SProcPanoramiXGetScreenSize(ClientPtr client)
|
||||
{
|
||||
REQUEST(xPanoramiXGetScreenSizeReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
|
||||
swapl(&stuff->window);
|
||||
swapl(&stuff->screen);
|
||||
return ProcPanoramiXGetScreenSize(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcXineramaIsActive(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXineramaIsActiveReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
|
||||
return ProcXineramaIsActive(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcXineramaQueryScreens(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXineramaQueryScreensReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
|
||||
return ProcXineramaQueryScreens(client);
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcPanoramiXDispatch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
switch (stuff->data) {
|
||||
case X_PanoramiXQueryVersion:
|
||||
return ProcPanoramiXQueryVersion(client);
|
||||
return SProcPanoramiXQueryVersion(client);
|
||||
case X_PanoramiXGetState:
|
||||
return SProcPanoramiXGetState(client);
|
||||
case X_PanoramiXGetScreenCount:
|
||||
|
|
@ -87,9 +125,9 @@ SProcPanoramiXDispatch(ClientPtr client)
|
|||
case X_PanoramiXGetScreenSize:
|
||||
return SProcPanoramiXGetScreenSize(client);
|
||||
case X_XineramaIsActive:
|
||||
return ProcXineramaIsActive(client);
|
||||
return SProcXineramaIsActive(client);
|
||||
case X_XineramaQueryScreens:
|
||||
return ProcXineramaQueryScreens(client);
|
||||
return SProcXineramaQueryScreens(client);
|
||||
}
|
||||
return BadRequest;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,15 +25,13 @@ Equipment Corporation.
|
|||
|
||||
/* Massively rewritten by Mark Vojkovich <markv@valinux.com> */
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "os/osdep.h"
|
||||
|
||||
#include "windowstr.h"
|
||||
#include "dixfontstr.h"
|
||||
#include "gcstruct.h"
|
||||
|
|
@ -477,7 +475,7 @@ PanoramiXConfigureWindow(ClientPtr client)
|
|||
|
||||
/* because we need the parent */
|
||||
result = dixLookupResourceByType((void **) &pWin, stuff->window,
|
||||
X11_RESTYPE_WINDOW, client, DixWriteAccess);
|
||||
RT_WINDOW, client, DixWriteAccess);
|
||||
if (result != Success)
|
||||
return result;
|
||||
|
||||
|
|
|
|||
168
Xext/saver.c
168
Xext/saver.c
|
|
@ -26,18 +26,12 @@ in this Software without prior written authorization from the X Consortium.
|
|||
* Author: Keith Packard, MIT X Consortium
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/extensions/saverproto.h>
|
||||
|
||||
#include "dix/colormap_priv.h"
|
||||
#include "dix/dix_priv.h"
|
||||
#include "os/osdep.h"
|
||||
#include "os/screensaver.h"
|
||||
|
||||
#include "misc.h"
|
||||
#include "os.h"
|
||||
#include "windowstr.h"
|
||||
|
|
@ -46,35 +40,53 @@ in this Software without prior written authorization from the X Consortium.
|
|||
#include "extnsionst.h"
|
||||
#include "dixstruct.h"
|
||||
#include "resource.h"
|
||||
#include "opaque.h"
|
||||
#include <X11/extensions/saverproto.h>
|
||||
#include "gcstruct.h"
|
||||
#include "cursorstr.h"
|
||||
#include "colormapst.h"
|
||||
#include "xace.h"
|
||||
#include "inputstr.h"
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
#include "panoramiX.h"
|
||||
#include "panoramiXsrv.h"
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
#ifdef DPMSExtension
|
||||
#include <X11/extensions/dpmsconst.h>
|
||||
#include "dpmsproc.h"
|
||||
#endif
|
||||
#include "protocol-versions.h"
|
||||
#include "extinit_priv.h"
|
||||
|
||||
// temporary workaround for win32/mingw32 name clash
|
||||
// see: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1355
|
||||
#undef CreateWindow
|
||||
#include <stdio.h>
|
||||
|
||||
#include "extinit.h"
|
||||
|
||||
static int ScreenSaverEventBase = 0;
|
||||
|
||||
static Bool ScreenSaverHandle(ScreenPtr pScreen, int xstate, Bool force);
|
||||
static Bool CreateSaverWindow(ScreenPtr pScreen);
|
||||
static Bool DestroySaverWindow(ScreenPtr pScreen);
|
||||
static void UninstallSaverColormap(ScreenPtr pScreen);
|
||||
static void CheckScreenPrivate(ScreenPtr pScreen);
|
||||
static void SScreenSaverNotifyEvent(xScreenSaverNotifyEvent *from,
|
||||
xScreenSaverNotifyEvent *to);
|
||||
static Bool ScreenSaverHandle(ScreenPtr /* pScreen */ ,
|
||||
int /* xstate */ ,
|
||||
Bool /* force */
|
||||
);
|
||||
|
||||
static Bool
|
||||
CreateSaverWindow(ScreenPtr /* pScreen */
|
||||
);
|
||||
|
||||
static Bool
|
||||
DestroySaverWindow(ScreenPtr /* pScreen */
|
||||
);
|
||||
|
||||
static void
|
||||
UninstallSaverColormap(ScreenPtr /* pScreen */
|
||||
);
|
||||
|
||||
static void
|
||||
CheckScreenPrivate(ScreenPtr /* pScreen */
|
||||
);
|
||||
|
||||
static void SScreenSaverNotifyEvent(xScreenSaverNotifyEvent * /* from */ ,
|
||||
xScreenSaverNotifyEvent * /* to */
|
||||
);
|
||||
|
||||
static RESTYPE SuspendType; /* resource type for suspension records */
|
||||
|
||||
|
|
@ -181,6 +193,8 @@ static DevPrivateKeyRec ScreenPrivateKeyRec;
|
|||
dixSetPrivate(&(s)->devPrivates, ScreenPrivateKey, v);
|
||||
#define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = (s ? GetScreenPrivate(s) : NULL)
|
||||
|
||||
#define New(t) (malloc(sizeof (t)))
|
||||
|
||||
static void
|
||||
CheckScreenPrivate(ScreenPtr pScreen)
|
||||
{
|
||||
|
|
@ -203,7 +217,7 @@ MakeScreenPrivate(ScreenPtr pScreen)
|
|||
|
||||
if (pPriv)
|
||||
return pPriv;
|
||||
pPriv = calloc(1, sizeof(ScreenSaverScreenPrivateRec));
|
||||
pPriv = New(ScreenSaverScreenPrivateRec);
|
||||
if (!pPriv)
|
||||
return 0;
|
||||
pPriv->events = 0;
|
||||
|
|
@ -253,7 +267,7 @@ setEventMask(ScreenPtr pScreen, ClientPtr client, unsigned long mask)
|
|||
}
|
||||
else {
|
||||
if (!pEv) {
|
||||
pEv = calloc(1, sizeof(ScreenSaverEventRec));
|
||||
pEv = New(ScreenSaverEventRec);
|
||||
if (!pEv) {
|
||||
CheckScreenPrivate(pScreen);
|
||||
return FALSE;
|
||||
|
|
@ -436,7 +450,7 @@ UninstallSaverColormap(ScreenPtr pScreen)
|
|||
|
||||
if (pPriv && pPriv->installedMap != None) {
|
||||
rc = dixLookupResourceByType((void **) &pCmap, pPriv->installedMap,
|
||||
X11_RESTYPE_COLORMAP, serverClient,
|
||||
RT_COLORMAP, serverClient,
|
||||
DixUninstallAccess);
|
||||
if (rc == Success)
|
||||
(*pCmap->pScreen->UninstallColormap) (pCmap);
|
||||
|
|
@ -460,7 +474,7 @@ CreateSaverWindow(ScreenPtr pScreen)
|
|||
pSaver = &pScreen->screensaver;
|
||||
if (pSaver->pWindow) {
|
||||
pSaver->pWindow = NullWindow;
|
||||
FreeResource(pSaver->wid, X11_RESTYPE_NONE);
|
||||
FreeResource(pSaver->wid, RT_NONE);
|
||||
if (pPriv) {
|
||||
UninstallSaverColormap(pScreen);
|
||||
pPriv->hasWindow = FALSE;
|
||||
|
|
@ -484,7 +498,7 @@ CreateSaverWindow(ScreenPtr pScreen)
|
|||
if (!pWin)
|
||||
return FALSE;
|
||||
|
||||
if (!AddResource(pWin->drawable.id, X11_RESTYPE_WINDOW, pWin))
|
||||
if (!AddResource(pWin->drawable.id, RT_WINDOW, pWin))
|
||||
return FALSE;
|
||||
|
||||
mask = 0;
|
||||
|
|
@ -504,7 +518,7 @@ CreateSaverWindow(ScreenPtr pScreen)
|
|||
CursorPtr cursor;
|
||||
if (!pWin->optional)
|
||||
if (!MakeWindowOptional(pWin)) {
|
||||
FreeResource(pWin->drawable.id, X11_RESTYPE_NONE);
|
||||
FreeResource(pWin->drawable.id, RT_NONE);
|
||||
return FALSE;
|
||||
}
|
||||
cursor = RefCursor(pAttr->pCursor);
|
||||
|
|
@ -532,7 +546,7 @@ CreateSaverWindow(ScreenPtr pScreen)
|
|||
if (wantMap == None || IsMapInstalled(wantMap, pWin))
|
||||
return TRUE;
|
||||
|
||||
result = dixLookupResourceByType((void **) &pCmap, wantMap, X11_RESTYPE_COLORMAP,
|
||||
result = dixLookupResourceByType((void **) &pCmap, wantMap, RT_COLORMAP,
|
||||
serverClient, DixInstallAccess);
|
||||
if (result != Success)
|
||||
return TRUE;
|
||||
|
|
@ -556,7 +570,7 @@ DestroySaverWindow(ScreenPtr pScreen)
|
|||
pSaver = &pScreen->screensaver;
|
||||
if (pSaver->pWindow) {
|
||||
pSaver->pWindow = NullWindow;
|
||||
FreeResource(pSaver->wid, X11_RESTYPE_NONE);
|
||||
FreeResource(pSaver->wid, RT_NONE);
|
||||
}
|
||||
pPriv->hasWindow = FALSE;
|
||||
CheckScreenPrivate(pScreen);
|
||||
|
|
@ -587,9 +601,9 @@ ScreenSaverHandle(ScreenPtr pScreen, int xstate, Bool force)
|
|||
ret = TRUE;
|
||||
|
||||
}
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
if (noPanoramiXExtension || !pScreen->myNum)
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
SendScreenSaverNotify(pScreen, state, force);
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -610,8 +624,6 @@ ProcScreenSaverQueryVersion(ClientPtr client)
|
|||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.majorVersion);
|
||||
swaps(&rep.minorVersion);
|
||||
}
|
||||
WriteToClient(client, sizeof(xScreenSaverQueryVersionReply), &rep);
|
||||
return Success;
|
||||
|
|
@ -633,7 +645,8 @@ ProcScreenSaverQueryInfo(ClientPtr client)
|
|||
DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
rc = XaceHookScreensaverAccess(client, pDraw->pScreen, DixGetAttrAccess);
|
||||
rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, pDraw->pScreen,
|
||||
DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
|
|
@ -702,7 +715,8 @@ ProcScreenSaverSelectInput(ClientPtr client)
|
|||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
rc = XaceHookScreensaverAccess(client, pDraw->pScreen, DixSetAttrAccess);
|
||||
rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, pDraw->pScreen,
|
||||
DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
|
|
@ -712,8 +726,9 @@ ProcScreenSaverSelectInput(ClientPtr client)
|
|||
}
|
||||
|
||||
static int
|
||||
ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
||||
ScreenSaverSetAttributes(ClientPtr client)
|
||||
{
|
||||
REQUEST(xScreenSaverSetAttributesReq);
|
||||
DrawablePtr pDraw;
|
||||
WindowPtr pParent;
|
||||
ScreenPtr pScreen;
|
||||
|
|
@ -736,6 +751,7 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
|||
Colormap cmap;
|
||||
ColormapPtr pCmap;
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
|
||||
ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
||||
DixGetAttrAccess);
|
||||
if (ret != Success)
|
||||
|
|
@ -743,11 +759,11 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
|||
pScreen = pDraw->pScreen;
|
||||
pParent = pScreen->root;
|
||||
|
||||
ret = XaceHookScreensaverAccess(client, pScreen, DixSetAttrAccess);
|
||||
ret = XaceHook(XACE_SCREENSAVER_ACCESS, client, pScreen, DixSetAttrAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
|
||||
len = client->req_len - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
|
||||
len = stuff->length - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
|
||||
if (Ones(stuff->mask) != len)
|
||||
return BadLength;
|
||||
if (!stuff->width || !stuff->height) {
|
||||
|
|
@ -832,7 +848,7 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
|||
if (!pPriv)
|
||||
return FALSE;
|
||||
}
|
||||
pAttr = calloc(1, sizeof(ScreenSaverAttrRec));
|
||||
pAttr = New(ScreenSaverAttrRec);
|
||||
if (!pAttr) {
|
||||
ret = BadAlloc;
|
||||
goto bail;
|
||||
|
|
@ -883,7 +899,7 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
|||
else {
|
||||
ret =
|
||||
dixLookupResourceByType((void **) &pPixmap, pixID,
|
||||
X11_RESTYPE_PIXMAP, client, DixReadAccess);
|
||||
RT_PIXMAP, client, DixReadAccess);
|
||||
if (ret == Success) {
|
||||
if ((pPixmap->drawable.depth != depth) ||
|
||||
(pPixmap->drawable.pScreen != pScreen)) {
|
||||
|
|
@ -915,7 +931,7 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
|||
else {
|
||||
ret =
|
||||
dixLookupResourceByType((void **) &pPixmap, pixID,
|
||||
X11_RESTYPE_PIXMAP, client, DixReadAccess);
|
||||
RT_PIXMAP, client, DixReadAccess);
|
||||
if (ret == Success) {
|
||||
if ((pPixmap->drawable.depth != depth) ||
|
||||
(pPixmap->drawable.pScreen != pScreen)) {
|
||||
|
|
@ -998,7 +1014,7 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
|||
break;
|
||||
case CWColormap:
|
||||
cmap = (Colormap) * pVlist;
|
||||
ret = dixLookupResourceByType((void **) &pCmap, cmap, X11_RESTYPE_COLORMAP,
|
||||
ret = dixLookupResourceByType((void **) &pCmap, cmap, RT_COLORMAP,
|
||||
client, DixUseAccess);
|
||||
if (ret != Success) {
|
||||
client->errorValue = cmap;
|
||||
|
|
@ -1018,7 +1034,7 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
|||
}
|
||||
else {
|
||||
ret = dixLookupResourceByType((void **) &pCursor, cursorID,
|
||||
X11_RESTYPE_CURSOR, client, DixUseAccess);
|
||||
RT_CURSOR, client, DixUseAccess);
|
||||
if (ret != Success) {
|
||||
client->errorValue = cursorID;
|
||||
goto PatchUp;
|
||||
|
|
@ -1052,13 +1068,16 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
|||
}
|
||||
|
||||
static int
|
||||
ScreenSaverUnsetAttributes(ClientPtr client, Drawable drawable)
|
||||
ScreenSaverUnsetAttributes(ClientPtr client)
|
||||
{
|
||||
REQUEST(xScreenSaverSetAttributesReq);
|
||||
DrawablePtr pDraw;
|
||||
ScreenSaverScreenPrivatePtr pPriv;
|
||||
int rc;
|
||||
|
||||
rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixGetAttrAccess);
|
||||
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
|
||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
||||
DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
pPriv = GetScreenPrivate(pDraw->pScreen);
|
||||
|
|
@ -1074,11 +1093,9 @@ ScreenSaverUnsetAttributes(ClientPtr client, Drawable drawable)
|
|||
static int
|
||||
ProcScreenSaverSetAttributes(ClientPtr client)
|
||||
{
|
||||
REQUEST(xScreenSaverSetAttributesReq);
|
||||
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
|
||||
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
if (!noPanoramiXExtension) {
|
||||
REQUEST(xScreenSaverSetAttributesReq);
|
||||
PanoramiXRes *draw;
|
||||
PanoramiXRes *backPix = NULL;
|
||||
PanoramiXRes *bordPix = NULL;
|
||||
|
|
@ -1087,13 +1104,15 @@ ProcScreenSaverSetAttributes(ClientPtr client)
|
|||
int pback_offset = 0, pbord_offset = 0, cmap_offset = 0;
|
||||
XID orig_visual, tmp;
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
|
||||
|
||||
status = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
||||
XRC_DRAWABLE, client, DixWriteAccess);
|
||||
if (status != Success)
|
||||
return (status == BadValue) ? BadDrawable : status;
|
||||
|
||||
len =
|
||||
client->req_len -
|
||||
stuff->length -
|
||||
bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
|
||||
if (Ones(stuff->mask) != len)
|
||||
return BadLength;
|
||||
|
|
@ -1148,27 +1167,26 @@ ProcScreenSaverSetAttributes(ClientPtr client)
|
|||
if (orig_visual != CopyFromParent)
|
||||
stuff->visualID = PanoramiXTranslateVisualID(i, orig_visual);
|
||||
|
||||
status = ScreenSaverSetAttributes(client, stuff);
|
||||
status = ScreenSaverSetAttributes(client);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
|
||||
return ScreenSaverSetAttributes(client, stuff);
|
||||
return ScreenSaverSetAttributes(client);
|
||||
}
|
||||
|
||||
static int
|
||||
ProcScreenSaverUnsetAttributes(ClientPtr client)
|
||||
{
|
||||
REQUEST(xScreenSaverUnsetAttributesReq);
|
||||
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
|
||||
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
if (!noPanoramiXExtension) {
|
||||
REQUEST(xScreenSaverUnsetAttributesReq);
|
||||
PanoramiXRes *draw;
|
||||
int rc, i;
|
||||
|
||||
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
|
||||
|
||||
rc = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
||||
XRC_DRAWABLE, client, DixWriteAccess);
|
||||
|
|
@ -1176,14 +1194,15 @@ ProcScreenSaverUnsetAttributes(ClientPtr client)
|
|||
return (rc == BadValue) ? BadDrawable : rc;
|
||||
|
||||
for (i = PanoramiXNumScreens - 1; i > 0; i--) {
|
||||
ScreenSaverUnsetAttributes(client, draw->info[i].id);
|
||||
stuff->drawable = draw->info[i].id;
|
||||
ScreenSaverUnsetAttributes(client);
|
||||
}
|
||||
|
||||
stuff->drawable = draw->info[0].id;
|
||||
}
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
|
||||
return ScreenSaverUnsetAttributes(client, stuff->drawable);
|
||||
return ScreenSaverUnsetAttributes(client);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -1212,7 +1231,7 @@ ProcScreenSaverSuspend(ClientPtr client)
|
|||
if (suspend == TRUE)
|
||||
this->count++;
|
||||
else if (--this->count == 0)
|
||||
FreeResource(this->clientResource, X11_RESTYPE_NONE);
|
||||
FreeResource(this->clientResource, RT_NONE);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
@ -1252,13 +1271,11 @@ ProcScreenSaverSuspend(ClientPtr client)
|
|||
}
|
||||
|
||||
static int (*NormalVector[]) (ClientPtr /* client */ ) = {
|
||||
ProcScreenSaverQueryVersion,
|
||||
ProcScreenSaverQueryVersion,
|
||||
ProcScreenSaverQueryInfo,
|
||||
ProcScreenSaverSelectInput,
|
||||
ProcScreenSaverSetAttributes,
|
||||
ProcScreenSaverUnsetAttributes,
|
||||
ProcScreenSaverSuspend,
|
||||
};
|
||||
ProcScreenSaverUnsetAttributes, ProcScreenSaverSuspend,};
|
||||
|
||||
static int
|
||||
ProcScreenSaverDispatch(ClientPtr client)
|
||||
|
|
@ -1270,10 +1287,20 @@ ProcScreenSaverDispatch(ClientPtr client)
|
|||
return BadRequest;
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcScreenSaverQueryVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xScreenSaverQueryVersionReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq);
|
||||
return ProcScreenSaverQueryVersion(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcScreenSaverQueryInfo(ClientPtr client)
|
||||
{
|
||||
REQUEST(xScreenSaverQueryInfoReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq);
|
||||
swapl(&stuff->drawable);
|
||||
return ProcScreenSaverQueryInfo(client);
|
||||
|
|
@ -1283,6 +1310,7 @@ static int _X_COLD
|
|||
SProcScreenSaverSelectInput(ClientPtr client)
|
||||
{
|
||||
REQUEST(xScreenSaverSelectInputReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq);
|
||||
swapl(&stuff->drawable);
|
||||
swapl(&stuff->eventMask);
|
||||
|
|
@ -1293,6 +1321,7 @@ static int _X_COLD
|
|||
SProcScreenSaverSetAttributes(ClientPtr client)
|
||||
{
|
||||
REQUEST(xScreenSaverSetAttributesReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
|
||||
swapl(&stuff->drawable);
|
||||
swaps(&stuff->x);
|
||||
|
|
@ -1310,6 +1339,7 @@ static int _X_COLD
|
|||
SProcScreenSaverUnsetAttributes(ClientPtr client)
|
||||
{
|
||||
REQUEST(xScreenSaverUnsetAttributesReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
|
||||
swapl(&stuff->drawable);
|
||||
return ProcScreenSaverUnsetAttributes(client);
|
||||
|
|
@ -1319,19 +1349,19 @@ static int _X_COLD
|
|||
SProcScreenSaverSuspend(ClientPtr client)
|
||||
{
|
||||
REQUEST(xScreenSaverSuspendReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
|
||||
swapl(&stuff->suspend);
|
||||
return ProcScreenSaverSuspend(client);
|
||||
}
|
||||
|
||||
static int (*SwappedVector[]) (ClientPtr /* client */ ) = {
|
||||
ProcScreenSaverQueryVersion,
|
||||
SProcScreenSaverQueryVersion,
|
||||
SProcScreenSaverQueryInfo,
|
||||
SProcScreenSaverSelectInput,
|
||||
SProcScreenSaverSetAttributes,
|
||||
SProcScreenSaverUnsetAttributes,
|
||||
SProcScreenSaverSuspend,
|
||||
};
|
||||
SProcScreenSaverUnsetAttributes, SProcScreenSaverSuspend,};
|
||||
|
||||
static int _X_COLD
|
||||
SProcScreenSaverDispatch(ClientPtr client)
|
||||
|
|
|
|||
|
|
@ -24,19 +24,12 @@ in this Software without prior written authorization from The Open Group.
|
|||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/Xmd.h>
|
||||
#include <X11/extensions/securproto.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
#endif
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "dix/registry_priv.h"
|
||||
#include "include/extinit_priv.h"
|
||||
#include "os/audit.h"
|
||||
#include "os/auth.h"
|
||||
#include "os/client_priv.h"
|
||||
#include "os/osdep.h"
|
||||
|
||||
#include "scrnintstr.h"
|
||||
#include "inputstr.h"
|
||||
|
|
@ -46,6 +39,7 @@ in this Software without prior written authorization from The Open Group.
|
|||
#include "privates.h"
|
||||
#include "xacestr.h"
|
||||
#include "securitysrv.h"
|
||||
#include <X11/extensions/securproto.h>
|
||||
#include "extinit.h"
|
||||
#include "protocol-versions.h"
|
||||
|
||||
|
|
@ -206,7 +200,7 @@ SecurityDeleteAuthorization(void *value, XID id)
|
|||
.authId = pAuth->id
|
||||
};
|
||||
WriteEventsToClient(rClient(pEventClient), 1, (xEvent *) &are);
|
||||
FreeResource(pEventClient->resource, X11_RESTYPE_NONE);
|
||||
FreeResource(pEventClient->resource, RT_NONE);
|
||||
}
|
||||
|
||||
/* kill all clients using this auth */
|
||||
|
|
@ -312,7 +306,7 @@ SecurityAuthorizationExpired(OsTimerPtr timer, CARD32 time, void *pval)
|
|||
pAuth->secondsRemaining);
|
||||
}
|
||||
else {
|
||||
FreeResource(pAuth->id, X11_RESTYPE_NONE);
|
||||
FreeResource(pAuth->id, RT_NONE);
|
||||
return 0;
|
||||
}
|
||||
} /* SecurityAuthorizationExpired */
|
||||
|
|
@ -376,7 +370,7 @@ SecurityEventSelectForAuthorization(SecurityAuthorizationPtr pAuth,
|
|||
pEventClient; pEventClient = pEventClient->next) {
|
||||
if (SameClient(pEventClient, client)) {
|
||||
if (mask == 0)
|
||||
FreeResource(pEventClient->resource, X11_RESTYPE_NONE);
|
||||
FreeResource(pEventClient->resource, RT_NONE);
|
||||
else
|
||||
pEventClient->mask = mask;
|
||||
return Success;
|
||||
|
|
@ -588,7 +582,7 @@ ProcSecurityRevokeAuthorization(ClientPtr client)
|
|||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
FreeResource(stuff->authId, X11_RESTYPE_NONE);
|
||||
FreeResource(stuff->authId, RT_NONE);
|
||||
return Success;
|
||||
} /* ProcSecurityRevokeAuthorization */
|
||||
|
||||
|
|
@ -613,6 +607,8 @@ static int _X_COLD
|
|||
SProcSecurityQueryVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSecurityQueryVersionReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
|
||||
swaps(&stuff->majorVersion);
|
||||
swaps(&stuff->minorVersion);
|
||||
|
|
@ -626,6 +622,8 @@ SProcSecurityGenerateAuthorization(ClientPtr client)
|
|||
CARD32 *values;
|
||||
unsigned long nvalues;
|
||||
int values_offset;
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
|
||||
swaps(&stuff->nbytesAuthProto);
|
||||
swaps(&stuff->nbytesAuthData);
|
||||
|
|
@ -633,10 +631,10 @@ SProcSecurityGenerateAuthorization(ClientPtr client)
|
|||
values_offset = bytes_to_int32(stuff->nbytesAuthProto) +
|
||||
bytes_to_int32(stuff->nbytesAuthData);
|
||||
if (values_offset >
|
||||
client->req_len - bytes_to_int32(sz_xSecurityGenerateAuthorizationReq))
|
||||
stuff->length - bytes_to_int32(sz_xSecurityGenerateAuthorizationReq))
|
||||
return BadLength;
|
||||
values = (CARD32 *) (&stuff[1]) + values_offset;
|
||||
nvalues = (((CARD32 *) stuff) + client->req_len) - values;
|
||||
nvalues = (((CARD32 *) stuff) + stuff->length) - values;
|
||||
SwapLongs(values, nvalues);
|
||||
return ProcSecurityGenerateAuthorization(client);
|
||||
} /* SProcSecurityGenerateAuthorization */
|
||||
|
|
@ -645,6 +643,8 @@ static int _X_COLD
|
|||
SProcSecurityRevokeAuthorization(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSecurityRevokeAuthorizationReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
|
||||
swapl(&stuff->authId);
|
||||
return ProcSecurityRevokeAuthorization(client);
|
||||
|
|
@ -749,12 +749,12 @@ SecurityResource(CallbackListPtr *pcbl, void *unused, void *calldata)
|
|||
subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
|
||||
|
||||
/* disable background None for untrusted windows */
|
||||
if ((requested & DixCreateAccess) && (rec->rtype == X11_RESTYPE_WINDOW))
|
||||
if ((requested & DixCreateAccess) && (rec->rtype == RT_WINDOW))
|
||||
if (subj->haveState && subj->trustLevel != XSecurityClientTrusted)
|
||||
((WindowPtr) rec->res)->forcedBG = TRUE;
|
||||
|
||||
/* additional permissions for specific resource types */
|
||||
if (rec->rtype == X11_RESTYPE_WINDOW)
|
||||
if (rec->rtype == RT_WINDOW)
|
||||
allowed |= SecurityWindowExtraMask;
|
||||
|
||||
/* special checks for server-owned resources */
|
||||
|
|
@ -763,7 +763,7 @@ SecurityResource(CallbackListPtr *pcbl, void *unused, void *calldata)
|
|||
/* additional operations allowed on root windows */
|
||||
allowed |= SecurityRootWindowExtraMask;
|
||||
|
||||
else if (rec->rtype == X11_RESTYPE_COLORMAP)
|
||||
else if (rec->rtype == RT_COLORMAP)
|
||||
/* allow access to default colormaps */
|
||||
allowed = requested;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,8 +30,27 @@ from The Open Group.
|
|||
#ifndef _SECURITY_SRV_H
|
||||
#define _SECURITY_SRV_H
|
||||
|
||||
/* Allow client side portions of <X11/extensions/security.h> to compile */
|
||||
#ifndef Status
|
||||
#define Status int
|
||||
#define NEED_UNDEF_Status
|
||||
#endif
|
||||
#ifndef Display
|
||||
#define Display void
|
||||
#define NEED_UNDEF_Display
|
||||
#endif
|
||||
|
||||
#include <X11/extensions/secur.h>
|
||||
|
||||
#ifdef NEED_UNDEF_Status
|
||||
#undef Status
|
||||
#undef NEED_UNDEF_Status
|
||||
#endif
|
||||
#ifdef NEED_UNDEF_Display
|
||||
#undef Display
|
||||
#undef NEED_UNDEF_Display
|
||||
#endif
|
||||
|
||||
#include "input.h" /* for DeviceIntPtr */
|
||||
#include "property.h" /* for PropertyPtr */
|
||||
#include "pixmap.h" /* for DrawablePtr */
|
||||
|
|
|
|||
79
Xext/shape.c
79
Xext/shape.c
|
|
@ -24,16 +24,14 @@ in this Software without prior written authorization from The Open Group.
|
|||
|
||||
********************************************************/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/extensions/shapeproto.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "dix/gc_priv.h"
|
||||
|
||||
#include "misc.h"
|
||||
#include "os.h"
|
||||
#include "windowstr.h"
|
||||
|
|
@ -43,9 +41,10 @@ in this Software without prior written authorization from The Open Group.
|
|||
#include "dixstruct.h"
|
||||
#include "resource.h"
|
||||
#include "opaque.h"
|
||||
#include <X11/extensions/shapeproto.h>
|
||||
#include "regionstr.h"
|
||||
#include "gcstruct.h"
|
||||
#include "extinit_priv.h"
|
||||
#include "extinit.h"
|
||||
#include "protocol-versions.h"
|
||||
|
||||
typedef RegionPtr (*CreateDftPtr) (WindowPtr /* pWin */
|
||||
|
|
@ -65,10 +64,10 @@ static void SShapeNotifyEvent(xShapeNotifyEvent * /* from */ ,
|
|||
* externally by the Xfixes extension and are now defined in window.h
|
||||
*/
|
||||
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
#include "panoramiX.h"
|
||||
#include "panoramiXsrv.h"
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
|
||||
static int ShapeEventBase = 0;
|
||||
static RESTYPE ClientType, ShapeEventType; /* resource types for event masks */
|
||||
|
|
@ -266,7 +265,7 @@ ProcShapeRectangles(ClientPtr client)
|
|||
client->errorValue = stuff->ordering;
|
||||
return BadValue;
|
||||
}
|
||||
nrects = ((client->req_len << 2) - sizeof(xShapeRectanglesReq));
|
||||
nrects = ((stuff->length << 2) - sizeof(xShapeRectanglesReq));
|
||||
if (nrects & 4)
|
||||
return BadLength;
|
||||
nrects >>= 3;
|
||||
|
|
@ -297,7 +296,7 @@ ProcShapeRectangles(ClientPtr client)
|
|||
stuff->xOff, stuff->yOff, createDefault);
|
||||
}
|
||||
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
static int
|
||||
ProcPanoramiXShapeRectangles(ClientPtr client)
|
||||
{
|
||||
|
|
@ -320,7 +319,7 @@ ProcPanoramiXShapeRectangles(ClientPtr client)
|
|||
}
|
||||
return result;
|
||||
}
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
|
||||
/**************
|
||||
* ProcShapeMask
|
||||
|
|
@ -363,7 +362,7 @@ ProcShapeMask(ClientPtr client)
|
|||
srcRgn = 0;
|
||||
else {
|
||||
rc = dixLookupResourceByType((void **) &pPixmap, stuff->src,
|
||||
X11_RESTYPE_PIXMAP, client, DixReadAccess);
|
||||
RT_PIXMAP, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
if (pPixmap->drawable.pScreen != pScreen ||
|
||||
|
|
@ -395,7 +394,7 @@ ProcShapeMask(ClientPtr client)
|
|||
stuff->xOff, stuff->yOff, createDefault);
|
||||
}
|
||||
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
static int
|
||||
ProcPanoramiXShapeMask(ClientPtr client)
|
||||
{
|
||||
|
|
@ -429,7 +428,7 @@ ProcPanoramiXShapeMask(ClientPtr client)
|
|||
}
|
||||
return result;
|
||||
}
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
|
||||
/************
|
||||
* ProcShapeCombine
|
||||
|
|
@ -523,7 +522,7 @@ ProcShapeCombine(ClientPtr client)
|
|||
stuff->xOff, stuff->yOff, createDefault);
|
||||
}
|
||||
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
static int
|
||||
ProcPanoramiXShapeCombine(ClientPtr client)
|
||||
{
|
||||
|
|
@ -552,7 +551,7 @@ ProcPanoramiXShapeCombine(ClientPtr client)
|
|||
}
|
||||
return result;
|
||||
}
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
|
||||
/*************
|
||||
* ProcShapeOffset
|
||||
|
|
@ -594,7 +593,7 @@ ProcShapeOffset(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
static int
|
||||
ProcPanoramiXShapeOffset(ClientPtr client)
|
||||
{
|
||||
|
|
@ -617,7 +616,7 @@ ProcPanoramiXShapeOffset(ClientPtr client)
|
|||
}
|
||||
return result;
|
||||
}
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
|
||||
static int
|
||||
ProcShapeQueryExtents(ClientPtr client)
|
||||
|
|
@ -784,7 +783,7 @@ ProcShapeSelectInput(ClientPtr client)
|
|||
if (!pHead ||
|
||||
!AddResource(pWin->drawable.id, ShapeEventType,
|
||||
(void *) pHead)) {
|
||||
FreeResource(clientResource, X11_RESTYPE_NONE);
|
||||
FreeResource(clientResource, RT_NONE);
|
||||
return BadAlloc;
|
||||
}
|
||||
*pHead = 0;
|
||||
|
|
@ -1035,32 +1034,32 @@ ProcShapeDispatch(ClientPtr client)
|
|||
case X_ShapeQueryVersion:
|
||||
return ProcShapeQueryVersion(client);
|
||||
case X_ShapeRectangles:
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
if (!noPanoramiXExtension)
|
||||
return ProcPanoramiXShapeRectangles(client);
|
||||
else
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
return ProcShapeRectangles(client);
|
||||
case X_ShapeMask:
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
if (!noPanoramiXExtension)
|
||||
return ProcPanoramiXShapeMask(client);
|
||||
else
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
return ProcShapeMask(client);
|
||||
case X_ShapeCombine:
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
if (!noPanoramiXExtension)
|
||||
return ProcPanoramiXShapeCombine(client);
|
||||
else
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
return ProcShapeCombine(client);
|
||||
case X_ShapeOffset:
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
if (!noPanoramiXExtension)
|
||||
return ProcPanoramiXShapeOffset(client);
|
||||
else
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
return ProcShapeOffset(client);
|
||||
case X_ShapeQueryExtents:
|
||||
return ProcShapeQueryExtents(client);
|
||||
|
|
@ -1090,10 +1089,21 @@ SShapeNotifyEvent(xShapeNotifyEvent * from, xShapeNotifyEvent * to)
|
|||
to->shaped = from->shaped;
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcShapeQueryVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xShapeQueryVersionReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
return ProcShapeQueryVersion(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcShapeRectangles(ClientPtr client)
|
||||
{
|
||||
REQUEST(xShapeRectanglesReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xShapeRectanglesReq);
|
||||
swapl(&stuff->dest);
|
||||
swaps(&stuff->xOff);
|
||||
|
|
@ -1106,6 +1116,8 @@ static int _X_COLD
|
|||
SProcShapeMask(ClientPtr client)
|
||||
{
|
||||
REQUEST(xShapeMaskReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShapeMaskReq);
|
||||
swapl(&stuff->dest);
|
||||
swaps(&stuff->xOff);
|
||||
|
|
@ -1118,6 +1130,8 @@ static int _X_COLD
|
|||
SProcShapeCombine(ClientPtr client)
|
||||
{
|
||||
REQUEST(xShapeCombineReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShapeCombineReq);
|
||||
swapl(&stuff->dest);
|
||||
swaps(&stuff->xOff);
|
||||
|
|
@ -1130,6 +1144,8 @@ static int _X_COLD
|
|||
SProcShapeOffset(ClientPtr client)
|
||||
{
|
||||
REQUEST(xShapeOffsetReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShapeOffsetReq);
|
||||
swapl(&stuff->dest);
|
||||
swaps(&stuff->xOff);
|
||||
|
|
@ -1141,6 +1157,8 @@ static int _X_COLD
|
|||
SProcShapeQueryExtents(ClientPtr client)
|
||||
{
|
||||
REQUEST(xShapeQueryExtentsReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShapeQueryExtentsReq);
|
||||
swapl(&stuff->window);
|
||||
return ProcShapeQueryExtents(client);
|
||||
|
|
@ -1150,6 +1168,8 @@ static int _X_COLD
|
|||
SProcShapeSelectInput(ClientPtr client)
|
||||
{
|
||||
REQUEST(xShapeSelectInputReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShapeSelectInputReq);
|
||||
swapl(&stuff->window);
|
||||
return ProcShapeSelectInput(client);
|
||||
|
|
@ -1159,6 +1179,8 @@ static int _X_COLD
|
|||
SProcShapeInputSelected(ClientPtr client)
|
||||
{
|
||||
REQUEST(xShapeInputSelectedReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShapeInputSelectedReq);
|
||||
swapl(&stuff->window);
|
||||
return ProcShapeInputSelected(client);
|
||||
|
|
@ -1168,6 +1190,7 @@ static int _X_COLD
|
|||
SProcShapeGetRectangles(ClientPtr client)
|
||||
{
|
||||
REQUEST(xShapeGetRectanglesReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
|
||||
swapl(&stuff->window);
|
||||
return ProcShapeGetRectangles(client);
|
||||
|
|
@ -1179,7 +1202,7 @@ SProcShapeDispatch(ClientPtr client)
|
|||
REQUEST(xReq);
|
||||
switch (stuff->data) {
|
||||
case X_ShapeQueryVersion:
|
||||
return ProcShapeQueryVersion(client);
|
||||
return SProcShapeQueryVersion(client);
|
||||
case X_ShapeRectangles:
|
||||
return SProcShapeRectangles(client);
|
||||
case X_ShapeMask:
|
||||
|
|
|
|||
91
Xext/shm.c
91
Xext/shm.c
|
|
@ -28,29 +28,24 @@ in this Software without prior written authorization from The Open Group.
|
|||
|
||||
#define SHM
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
#ifdef HAVE_MEMFD_CREATE
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/extensions/shmproto.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "os/auth.h"
|
||||
#include "os/busfault.h"
|
||||
#include "os/client_priv.h"
|
||||
#include "os/osdep.h"
|
||||
|
||||
#include "misc.h"
|
||||
#include "os.h"
|
||||
#include "dixstruct_priv.h"
|
||||
#include "dixstruct.h"
|
||||
#include "resource.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
|
|
@ -60,8 +55,11 @@ in this Software without prior written authorization from The Open Group.
|
|||
#include "servermd.h"
|
||||
#include "shmint.h"
|
||||
#include "xace.h"
|
||||
#include "extinit_priv.h"
|
||||
#include <X11/extensions/shmproto.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include <sys/mman.h>
|
||||
#include "protocol-versions.h"
|
||||
#include "busfault.h"
|
||||
|
||||
/* Needed for Solaris cross-zone shared memory extension */
|
||||
#ifdef HAVE_SHMCTL64
|
||||
|
|
@ -90,10 +88,12 @@ in this Software without prior written authorization from The Open Group.
|
|||
#define SHMPERM_MODE(p) p->mode
|
||||
#endif
|
||||
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
#include "panoramiX.h"
|
||||
#include "panoramiXsrv.h"
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
|
||||
#include "extinit.h"
|
||||
|
||||
typedef struct _ShmScrPrivateRec {
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
|
|
@ -210,7 +210,7 @@ ShmInitScreenPriv(ScreenPtr pScreen)
|
|||
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
|
||||
|
||||
if (!screen_priv) {
|
||||
screen_priv = XNFcallocarray(1, sizeof(ShmScrPrivateRec));
|
||||
screen_priv = calloc(1, sizeof(ShmScrPrivateRec));
|
||||
screen_priv->CloseScreen = pScreen->CloseScreen;
|
||||
dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, screen_priv);
|
||||
pScreen->CloseScreen = ShmCloseScreen;
|
||||
|
|
@ -251,14 +251,13 @@ ShmDestroyPixmap(PixmapPtr pPixmap)
|
|||
ScreenPtr pScreen = pPixmap->drawable.pScreen;
|
||||
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
|
||||
void *shmdesc = NULL;
|
||||
Bool ret = TRUE;
|
||||
Bool ret;
|
||||
|
||||
if (pPixmap->refcnt == 1)
|
||||
shmdesc = dixLookupPrivate(&pPixmap->devPrivates, shmPixmapPrivateKey);
|
||||
|
||||
pScreen->DestroyPixmap = screen_priv->destroyPixmap;
|
||||
if (pScreen->DestroyPixmap)
|
||||
ret = pScreen->DestroyPixmap(pPixmap);
|
||||
ret = (*pScreen->DestroyPixmap) (pPixmap);
|
||||
screen_priv->destroyPixmap = pScreen->DestroyPixmap;
|
||||
pScreen->DestroyPixmap = ShmDestroyPixmap;
|
||||
|
||||
|
|
@ -460,7 +459,7 @@ ProcShmDetach(ClientPtr client)
|
|||
|
||||
REQUEST_SIZE_MATCH(xShmDetachReq);
|
||||
VERIFY_SHMSEG(stuff->shmseg, shmdesc, client);
|
||||
FreeResource(stuff->shmseg, X11_RESTYPE_NONE);
|
||||
FreeResource(stuff->shmseg, RT_NONE);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
@ -482,8 +481,8 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
|
|||
PixmapBytePad(w, depth), data);
|
||||
if (!pPixmap)
|
||||
return;
|
||||
(void) pGC->ops->CopyArea((DrawablePtr) pPixmap, dst, pGC,
|
||||
sx, sy, sw, sh, dx, dy);
|
||||
pGC->ops->CopyArea((DrawablePtr) pPixmap, dst, pGC, sx, sy, sw, sh, dx,
|
||||
dy);
|
||||
FreeScratchPixmapHeader(pPixmap);
|
||||
}
|
||||
else {
|
||||
|
|
@ -732,7 +731,7 @@ ProcShmGetImage(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
static int
|
||||
ProcPanoramiXShmPutImage(ClientPtr client)
|
||||
{
|
||||
|
|
@ -997,8 +996,8 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
|
|||
stuff->offset);
|
||||
|
||||
if (pMap) {
|
||||
result = XaceHookResourceAccess(client, stuff->pid,
|
||||
X11_RESTYPE_PIXMAP, pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
||||
result = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid,
|
||||
RT_PIXMAP, pMap, RT_NONE, NULL, DixCreateAccess);
|
||||
if (result != Success) {
|
||||
pDraw->pScreen->DestroyPixmap(pMap);
|
||||
break;
|
||||
|
|
@ -1007,7 +1006,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
|
|||
shmdesc->refcnt++;
|
||||
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
||||
pMap->drawable.id = newPix->info[j].id;
|
||||
if (!AddResource(newPix->info[j].id, X11_RESTYPE_PIXMAP, (void *) pMap)) {
|
||||
if (!AddResource(newPix->info[j].id, RT_PIXMAP, (void *) pMap)) {
|
||||
result = BadAlloc;
|
||||
break;
|
||||
}
|
||||
|
|
@ -1020,7 +1019,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
|
|||
|
||||
if (result != Success) {
|
||||
while (j--)
|
||||
FreeResource(newPix->info[j].id, X11_RESTYPE_NONE);
|
||||
FreeResource(newPix->info[j].id, RT_NONE);
|
||||
free(newPix);
|
||||
}
|
||||
else
|
||||
|
|
@ -1028,7 +1027,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
|
|||
|
||||
return result;
|
||||
}
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
|
||||
static PixmapPtr
|
||||
fbShmCreatePixmap(ScreenPtr pScreen,
|
||||
|
|
@ -1112,8 +1111,8 @@ ProcShmCreatePixmap(ClientPtr client)
|
|||
shmdesc->addr +
|
||||
stuff->offset);
|
||||
if (pMap) {
|
||||
rc = XaceHookResourceAccess(client, stuff->pid, X11_RESTYPE_PIXMAP,
|
||||
pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, RT_PIXMAP,
|
||||
pMap, RT_NONE, NULL, DixCreateAccess);
|
||||
if (rc != Success) {
|
||||
pDraw->pScreen->DestroyPixmap(pMap);
|
||||
return rc;
|
||||
|
|
@ -1122,7 +1121,7 @@ ProcShmCreatePixmap(ClientPtr client)
|
|||
shmdesc->refcnt++;
|
||||
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
||||
pMap->drawable.id = stuff->pid;
|
||||
if (AddResource(stuff->pid, X11_RESTYPE_PIXMAP, (void *) pMap)) {
|
||||
if (AddResource(stuff->pid, RT_PIXMAP, (void *) pMap)) {
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
|
@ -1140,7 +1139,7 @@ ShmBusfaultNotify(void *context)
|
|||
(unsigned int) shmdesc->resource);
|
||||
busfault_unregister(shmdesc->busfault);
|
||||
shmdesc->busfault = NULL;
|
||||
FreeResource (shmdesc->resource, X11_RESTYPE_NONE);
|
||||
FreeResource (shmdesc->resource, RT_NONE);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -1322,7 +1321,7 @@ ProcShmCreateSegment(ClientPtr client)
|
|||
}
|
||||
|
||||
if (WriteFdToClient(client, fd, TRUE) < 0) {
|
||||
FreeResource(stuff->shmseg, X11_RESTYPE_NONE);
|
||||
FreeResource(stuff->shmseg, RT_NONE);
|
||||
close(fd);
|
||||
return BadAlloc;
|
||||
}
|
||||
|
|
@ -1348,22 +1347,22 @@ ProcShmDispatch(ClientPtr client)
|
|||
case X_ShmDetach:
|
||||
return ProcShmDetach(client);
|
||||
case X_ShmPutImage:
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
if (!noPanoramiXExtension)
|
||||
return ProcPanoramiXShmPutImage(client);
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
return ProcShmPutImage(client);
|
||||
case X_ShmGetImage:
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
if (!noPanoramiXExtension)
|
||||
return ProcPanoramiXShmGetImage(client);
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
return ProcShmGetImage(client);
|
||||
case X_ShmCreatePixmap:
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
if (!noPanoramiXExtension)
|
||||
return ProcPanoramiXShmCreatePixmap(client);
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
return ProcShmCreatePixmap(client);
|
||||
#ifdef SHM_FD_PASSING
|
||||
case X_ShmAttachFd:
|
||||
|
|
@ -1388,10 +1387,20 @@ SShmCompletionEvent(xShmCompletionEvent * from, xShmCompletionEvent * to)
|
|||
cpswapl(from->offset, to->offset);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcShmQueryVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xShmQueryVersionReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
return ProcShmQueryVersion(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcShmAttach(ClientPtr client)
|
||||
{
|
||||
REQUEST(xShmAttachReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShmAttachReq);
|
||||
swapl(&stuff->shmseg);
|
||||
swapl(&stuff->shmid);
|
||||
|
|
@ -1402,6 +1411,7 @@ static int _X_COLD
|
|||
SProcShmDetach(ClientPtr client)
|
||||
{
|
||||
REQUEST(xShmDetachReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShmDetachReq);
|
||||
swapl(&stuff->shmseg);
|
||||
return ProcShmDetach(client);
|
||||
|
|
@ -1411,6 +1421,7 @@ static int _X_COLD
|
|||
SProcShmPutImage(ClientPtr client)
|
||||
{
|
||||
REQUEST(xShmPutImageReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShmPutImageReq);
|
||||
swapl(&stuff->drawable);
|
||||
swapl(&stuff->gc);
|
||||
|
|
@ -1431,6 +1442,7 @@ static int _X_COLD
|
|||
SProcShmGetImage(ClientPtr client)
|
||||
{
|
||||
REQUEST(xShmGetImageReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShmGetImageReq);
|
||||
swapl(&stuff->drawable);
|
||||
swaps(&stuff->x);
|
||||
|
|
@ -1447,6 +1459,7 @@ static int _X_COLD
|
|||
SProcShmCreatePixmap(ClientPtr client)
|
||||
{
|
||||
REQUEST(xShmCreatePixmapReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
|
||||
swapl(&stuff->pid);
|
||||
swapl(&stuff->drawable);
|
||||
|
|
@ -1463,6 +1476,7 @@ SProcShmAttachFd(ClientPtr client)
|
|||
{
|
||||
REQUEST(xShmAttachFdReq);
|
||||
SetReqFds(client, 1);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShmAttachFdReq);
|
||||
swapl(&stuff->shmseg);
|
||||
return ProcShmAttachFd(client);
|
||||
|
|
@ -1472,6 +1486,7 @@ static int _X_COLD
|
|||
SProcShmCreateSegment(ClientPtr client)
|
||||
{
|
||||
REQUEST(xShmCreateSegmentReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShmCreateSegmentReq);
|
||||
swapl(&stuff->shmseg);
|
||||
swapl(&stuff->size);
|
||||
|
|
@ -1485,7 +1500,7 @@ SProcShmDispatch(ClientPtr client)
|
|||
REQUEST(xReq);
|
||||
|
||||
if (stuff->data == X_ShmQueryVersion)
|
||||
return ProcShmQueryVersion(client);
|
||||
return SProcShmQueryVersion(client);
|
||||
|
||||
if (!client->local)
|
||||
return BadRequest;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,9 @@ in this Software without prior written authorization from The Open Group.
|
|||
|
||||
/* dixsleep.c - implement millisecond timeouts for X clients */
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "sleepuntil.h"
|
||||
#include <X11/X.h>
|
||||
|
|
@ -164,7 +166,7 @@ SertafiedBlockHandler(void *data, void *wt)
|
|||
pNext = pReq->next;
|
||||
if (CompareTimeStamps(pReq->revive, now) == LATER)
|
||||
break;
|
||||
FreeResource(pReq->id, X11_RESTYPE_NONE);
|
||||
FreeResource(pReq->id, RT_NONE);
|
||||
|
||||
/* AttendClient() may have been called via the resource delete
|
||||
* function so a client may have input to be processed and so
|
||||
|
|
@ -193,7 +195,7 @@ SertafiedWakeupHandler(void *data, int i)
|
|||
pNext = pReq->next;
|
||||
if (CompareTimeStamps(pReq->revive, now) == LATER)
|
||||
break;
|
||||
FreeResource(pReq->id, X11_RESTYPE_NONE);
|
||||
FreeResource(pReq->id, RT_NONE);
|
||||
}
|
||||
if (!pPending) {
|
||||
RemoveBlockAndWakeupHandlers(SertafiedBlockHandler,
|
||||
|
|
|
|||
97
Xext/sync.c
97
Xext/sync.c
|
|
@ -49,35 +49,35 @@ PERFORMANCE OF THIS SOFTWARE.
|
|||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/Xmd.h>
|
||||
#include <X11/extensions/syncproto.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "os/osdep.h"
|
||||
|
||||
#include "scrnintstr.h"
|
||||
#include "os.h"
|
||||
#include "extnsionst.h"
|
||||
#include "dixstruct.h"
|
||||
#include "pixmapstr.h"
|
||||
#include "resource.h"
|
||||
#include "opaque.h"
|
||||
#include <X11/extensions/syncproto.h>
|
||||
#include "syncsrv.h"
|
||||
#include "syncsdk.h"
|
||||
#include "protocol-versions.h"
|
||||
#include "inputstr.h"
|
||||
#include "misync_priv.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#if !defined(WIN32)
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include "extinit_priv.h"
|
||||
#include "extinit.h"
|
||||
|
||||
/*
|
||||
* Local Global Variables
|
||||
|
|
@ -696,7 +696,7 @@ SyncAwaitTriggerFired(SyncTrigger * pTrigger)
|
|||
/* unblock the client */
|
||||
AttendClient(pAwaitUnion->header.client);
|
||||
/* delete the await */
|
||||
FreeResource(pAwaitUnion->header.delete_id, X11_RESTYPE_NONE);
|
||||
FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
|
||||
}
|
||||
|
||||
static int64_t
|
||||
|
|
@ -751,7 +751,7 @@ SyncEventSelectForAlarm(SyncAlarm * pAlarm, ClientPtr client, Bool wantevents)
|
|||
* nothing, since it's already got them.
|
||||
*/
|
||||
if (!wantevents) {
|
||||
FreeResource(pClients->delete_id, X11_RESTYPE_NONE);
|
||||
FreeResource(pClients->delete_id, RT_NONE);
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
|
@ -946,7 +946,7 @@ SyncCreateFenceFromFD(ClientPtr client, DrawablePtr pDraw, XID id, int fd, BOOL
|
|||
|
||||
status = miSyncInitFenceFromFD(pDraw, pFence, fd, initially_triggered);
|
||||
if (status != Success) {
|
||||
FreeResource(pFence->sync.id, X11_RESTYPE_NONE);
|
||||
FreeResource(pFence->sync.id, RT_NONE);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
@ -1004,8 +1004,8 @@ SyncCreateSystemCounter(const char *name,
|
|||
|
||||
psci = malloc(sizeof(SysCounterInfo));
|
||||
if (!psci) {
|
||||
FreeResource(pCounter->sync.id, X11_RESTYPE_NONE);
|
||||
return NULL;
|
||||
FreeResource(pCounter->sync.id, RT_NONE);
|
||||
return pCounter;
|
||||
}
|
||||
pCounter->pSysCounterInfo = psci;
|
||||
psci->pCounter = pCounter;
|
||||
|
|
@ -1027,7 +1027,7 @@ SyncDestroySystemCounter(void *pSysCounter)
|
|||
{
|
||||
SyncCounter *pCounter = (SyncCounter *) pSysCounter;
|
||||
|
||||
FreeResource(pCounter->sync.id, X11_RESTYPE_NONE);
|
||||
FreeResource(pCounter->sync.id, RT_NONE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1140,7 +1140,7 @@ FreeAlarm(void *addr, XID id)
|
|||
/* delete event selections */
|
||||
|
||||
while (pAlarm->pEventClients)
|
||||
FreeResource(pAlarm->pEventClients->delete_id, X11_RESTYPE_NONE);
|
||||
FreeResource(pAlarm->pEventClients->delete_id, RT_NONE);
|
||||
|
||||
SyncDeleteTriggerFromSyncObject(&pAlarm->trigger);
|
||||
|
||||
|
|
@ -1505,7 +1505,7 @@ ProcSyncDestroyCounter(ClientPtr client)
|
|||
client->errorValue = stuff->counter;
|
||||
return BadAccess;
|
||||
}
|
||||
FreeResource(pCounter->sync.id, X11_RESTYPE_NONE);
|
||||
FreeResource(pCounter->sync.id, RT_NONE);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
@ -1606,7 +1606,7 @@ ProcSyncAwait(ClientPtr client)
|
|||
/* this should take care of removing any triggers created by
|
||||
* this request that have already been registered on sync objects
|
||||
*/
|
||||
FreeResource(pAwaitUnion->header.delete_id, X11_RESTYPE_NONE);
|
||||
FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
|
||||
client->errorValue = pProtocolWaitConds->counter;
|
||||
return SyncErrorBase + XSyncBadCounter;
|
||||
}
|
||||
|
|
@ -1626,7 +1626,7 @@ ProcSyncAwait(ClientPtr client)
|
|||
/* this should take care of removing any triggers created by
|
||||
* this request that have already been registered on sync objects
|
||||
*/
|
||||
FreeResource(pAwaitUnion->header.delete_id, X11_RESTYPE_NONE);
|
||||
FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
|
||||
return status;
|
||||
}
|
||||
/* this is not a mistake -- same function works for both cases */
|
||||
|
|
@ -1757,7 +1757,7 @@ ProcSyncCreateAlarm(ClientPtr client)
|
|||
|
||||
if (!SyncCheckWarnIsCounter(pTrigger->pSync,
|
||||
WARN_INVALID_COUNTER_ALARM)) {
|
||||
FreeResource(stuff->id, X11_RESTYPE_NONE);
|
||||
FreeResource(stuff->id, RT_NONE);
|
||||
return BadAlloc;
|
||||
}
|
||||
|
||||
|
|
@ -1888,7 +1888,7 @@ ProcSyncDestroyAlarm(ClientPtr client)
|
|||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
FreeResource(stuff->alarm, X11_RESTYPE_NONE);
|
||||
FreeResource(stuff->alarm, RT_NONE);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
@ -1993,7 +1993,7 @@ ProcSyncDestroyFence(ClientPtr client)
|
|||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
FreeResource(stuff->fid, X11_RESTYPE_NONE);
|
||||
FreeResource(stuff->fid, RT_NONE);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
@ -2071,7 +2071,7 @@ ProcSyncAwaitFence(ClientPtr client)
|
|||
/* this should take care of removing any triggers created by
|
||||
* this request that have already been registered on sync objects
|
||||
*/
|
||||
FreeResource(pAwaitUnion->header.delete_id, X11_RESTYPE_NONE);
|
||||
FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
|
||||
client->errorValue = *pProtocolFences;
|
||||
return SyncErrorBase + XSyncBadFence;
|
||||
}
|
||||
|
|
@ -2090,7 +2090,7 @@ ProcSyncAwaitFence(ClientPtr client)
|
|||
/* this should take care of removing any triggers created by
|
||||
* this request that have already been registered on sync objects
|
||||
*/
|
||||
FreeResource(pAwaitUnion->header.delete_id, X11_RESTYPE_NONE);
|
||||
FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
|
||||
return status;
|
||||
}
|
||||
/* this is not a mistake -- same function works for both cases */
|
||||
|
|
@ -2165,10 +2165,31 @@ ProcSyncDispatch(ClientPtr client)
|
|||
* Boring Swapping stuff ...
|
||||
*/
|
||||
|
||||
static int _X_COLD
|
||||
SProcSyncInitialize(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncInitializeReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSyncInitializeReq);
|
||||
|
||||
return ProcSyncInitialize(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcSyncListSystemCounters(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncListSystemCountersReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSyncListSystemCountersReq);
|
||||
|
||||
return ProcSyncListSystemCounters(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcSyncCreateCounter(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncCreateCounterReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSyncCreateCounterReq);
|
||||
swapl(&stuff->cid);
|
||||
swapl(&stuff->initial_value_lo);
|
||||
|
|
@ -2181,6 +2202,7 @@ static int _X_COLD
|
|||
SProcSyncSetCounter(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncSetCounterReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSyncSetCounterReq);
|
||||
swapl(&stuff->cid);
|
||||
swapl(&stuff->value_lo);
|
||||
|
|
@ -2193,6 +2215,7 @@ static int _X_COLD
|
|||
SProcSyncChangeCounter(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncChangeCounterReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSyncChangeCounterReq);
|
||||
swapl(&stuff->cid);
|
||||
swapl(&stuff->value_lo);
|
||||
|
|
@ -2205,6 +2228,7 @@ static int _X_COLD
|
|||
SProcSyncQueryCounter(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncQueryCounterReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSyncQueryCounterReq);
|
||||
swapl(&stuff->counter);
|
||||
|
||||
|
|
@ -2215,6 +2239,7 @@ static int _X_COLD
|
|||
SProcSyncDestroyCounter(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncDestroyCounterReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSyncDestroyCounterReq);
|
||||
swapl(&stuff->counter);
|
||||
|
||||
|
|
@ -2225,6 +2250,7 @@ static int _X_COLD
|
|||
SProcSyncAwait(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncAwaitReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xSyncAwaitReq);
|
||||
SwapRestL(stuff);
|
||||
|
||||
|
|
@ -2235,6 +2261,7 @@ static int _X_COLD
|
|||
SProcSyncCreateAlarm(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncCreateAlarmReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq);
|
||||
swapl(&stuff->id);
|
||||
swapl(&stuff->valueMask);
|
||||
|
|
@ -2247,6 +2274,7 @@ static int _X_COLD
|
|||
SProcSyncChangeAlarm(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncChangeAlarmReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq);
|
||||
swapl(&stuff->alarm);
|
||||
swapl(&stuff->valueMask);
|
||||
|
|
@ -2258,6 +2286,7 @@ static int _X_COLD
|
|||
SProcSyncQueryAlarm(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncQueryAlarmReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSyncQueryAlarmReq);
|
||||
swapl(&stuff->alarm);
|
||||
|
||||
|
|
@ -2268,6 +2297,7 @@ static int _X_COLD
|
|||
SProcSyncDestroyAlarm(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncDestroyAlarmReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq);
|
||||
swapl(&stuff->alarm);
|
||||
|
||||
|
|
@ -2278,6 +2308,7 @@ static int _X_COLD
|
|||
SProcSyncSetPriority(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncSetPriorityReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSyncSetPriorityReq);
|
||||
swapl(&stuff->id);
|
||||
swapl(&stuff->priority);
|
||||
|
|
@ -2289,6 +2320,7 @@ static int _X_COLD
|
|||
SProcSyncGetPriority(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncGetPriorityReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSyncGetPriorityReq);
|
||||
swapl(&stuff->id);
|
||||
|
||||
|
|
@ -2299,6 +2331,7 @@ static int _X_COLD
|
|||
SProcSyncCreateFence(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncCreateFenceReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSyncCreateFenceReq);
|
||||
swapl(&stuff->d);
|
||||
swapl(&stuff->fid);
|
||||
|
|
@ -2310,6 +2343,7 @@ static int _X_COLD
|
|||
SProcSyncTriggerFence(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncTriggerFenceReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSyncTriggerFenceReq);
|
||||
swapl(&stuff->fid);
|
||||
|
||||
|
|
@ -2320,6 +2354,7 @@ static int _X_COLD
|
|||
SProcSyncResetFence(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncResetFenceReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSyncResetFenceReq);
|
||||
swapl(&stuff->fid);
|
||||
|
||||
|
|
@ -2330,6 +2365,7 @@ static int _X_COLD
|
|||
SProcSyncDestroyFence(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncDestroyFenceReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSyncDestroyFenceReq);
|
||||
swapl(&stuff->fid);
|
||||
|
||||
|
|
@ -2340,6 +2376,7 @@ static int _X_COLD
|
|||
SProcSyncQueryFence(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncQueryFenceReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSyncQueryFenceReq);
|
||||
swapl(&stuff->fid);
|
||||
|
||||
|
|
@ -2350,6 +2387,7 @@ static int _X_COLD
|
|||
SProcSyncAwaitFence(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncAwaitFenceReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xSyncAwaitFenceReq);
|
||||
SwapRestL(stuff);
|
||||
|
||||
|
|
@ -2363,9 +2401,9 @@ SProcSyncDispatch(ClientPtr client)
|
|||
|
||||
switch (stuff->data) {
|
||||
case X_SyncInitialize:
|
||||
return ProcSyncInitialize(client);
|
||||
return SProcSyncInitialize(client);
|
||||
case X_SyncListSystemCounters:
|
||||
return ProcSyncListSystemCounters(client);
|
||||
return SProcSyncListSystemCounters(client);
|
||||
case X_SyncCreateCounter:
|
||||
return SProcSyncCreateCounter(client);
|
||||
case X_SyncSetCounter:
|
||||
|
|
@ -2620,11 +2658,9 @@ IdleTimeQueryValue(void *pCounter, int64_t *pValue_return)
|
|||
int deviceid;
|
||||
CARD32 idle;
|
||||
|
||||
*pValue_return = 0;
|
||||
if (pCounter) {
|
||||
SyncCounter *counter = pCounter;
|
||||
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
|
||||
BUG_RETURN(priv == NULL);
|
||||
deviceid = priv->deviceid;
|
||||
}
|
||||
else
|
||||
|
|
@ -2638,7 +2674,6 @@ IdleTimeBlockHandler(void *pCounter, void *wt)
|
|||
{
|
||||
SyncCounter *counter = pCounter;
|
||||
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
|
||||
BUG_RETURN(priv == NULL);
|
||||
int64_t *less = priv->value_less;
|
||||
int64_t *greater = priv->value_greater;
|
||||
int64_t idle, old_idle;
|
||||
|
|
@ -2729,7 +2764,6 @@ IdleTimeWakeupHandler(void *pCounter, int rc)
|
|||
{
|
||||
SyncCounter *counter = pCounter;
|
||||
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
|
||||
BUG_RETURN(priv == NULL);
|
||||
int64_t *less = priv->value_less;
|
||||
int64_t *greater = priv->value_greater;
|
||||
int64_t idle;
|
||||
|
|
@ -2763,7 +2797,6 @@ IdleTimeBracketValues(void *pCounter, int64_t *pbracket_less,
|
|||
{
|
||||
SyncCounter *counter = pCounter;
|
||||
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
|
||||
BUG_RETURN(priv == NULL);
|
||||
int64_t *less = priv->value_less;
|
||||
int64_t *greater = priv->value_greater;
|
||||
Bool registered = (less || greater);
|
||||
|
|
@ -2801,10 +2834,8 @@ init_system_idle_counter(const char *name, int deviceid)
|
|||
if (idle_time_counter != NULL) {
|
||||
IdleCounterPriv *priv = malloc(sizeof(IdleCounterPriv));
|
||||
|
||||
if (priv) {
|
||||
priv->value_less = priv->value_greater = NULL;
|
||||
priv->deviceid = deviceid;
|
||||
}
|
||||
priv->value_less = priv->value_greater = NULL;
|
||||
priv->deviceid = deviceid;
|
||||
|
||||
idle_time_counter->pSysCounterInfo->private = priv;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,9 @@ from Kaleb S. KEITHLEY
|
|||
*/
|
||||
/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifdef XF86VIDMODE
|
||||
|
||||
|
|
@ -469,7 +471,7 @@ ProcVidModeAddModeLine(ClientPtr client)
|
|||
if (ver < 2) {
|
||||
/* convert from old format */
|
||||
stuff = &newstuff;
|
||||
stuff->length = client->req_len;
|
||||
stuff->length = oldstuff->length;
|
||||
stuff->screen = oldstuff->screen;
|
||||
stuff->dotclock = oldstuff->dotclock;
|
||||
stuff->hdisplay = oldstuff->hdisplay;
|
||||
|
|
@ -639,7 +641,7 @@ ProcVidModeDeleteModeLine(ClientPtr client)
|
|||
if (ver < 2) {
|
||||
/* convert from old format */
|
||||
stuff = &newstuff;
|
||||
stuff->length = client->req_len;
|
||||
stuff->length = oldstuff->length;
|
||||
stuff->screen = oldstuff->screen;
|
||||
stuff->dotclock = oldstuff->dotclock;
|
||||
stuff->hdisplay = oldstuff->hdisplay;
|
||||
|
|
@ -668,7 +670,7 @@ ProcVidModeDeleteModeLine(ClientPtr client)
|
|||
"len = %d, length = %d\n",
|
||||
(unsigned long) client->req_len,
|
||||
(int) sizeof(xXF86VidModeDeleteModeLineReq) >> 2,
|
||||
(unsigned long) stuff->privsize, len, client->req_len);
|
||||
(unsigned long) stuff->privsize, len, stuff->length);
|
||||
return BadLength;
|
||||
}
|
||||
|
||||
|
|
@ -763,7 +765,7 @@ ProcVidModeModModeLine(ClientPtr client)
|
|||
if (ver < 2) {
|
||||
/* convert from old format */
|
||||
stuff = &newstuff;
|
||||
stuff->length = client->req_len;
|
||||
stuff->length = oldstuff->length;
|
||||
stuff->screen = oldstuff->screen;
|
||||
stuff->hdisplay = oldstuff->hdisplay;
|
||||
stuff->hsyncstart = oldstuff->hsyncstart;
|
||||
|
|
@ -806,8 +808,6 @@ ProcVidModeModModeLine(ClientPtr client)
|
|||
return BadValue;
|
||||
|
||||
modetmp = VidModeCreateMode();
|
||||
if (modetmp == NULL)
|
||||
return BadAlloc;
|
||||
VidModeCopyMode(mode, modetmp);
|
||||
|
||||
VidModeSetModeValue(modetmp, VIDMODE_H_DISPLAY, stuff->hdisplay);
|
||||
|
|
@ -899,7 +899,7 @@ ProcVidModeValidateModeLine(ClientPtr client)
|
|||
if (ver < 2) {
|
||||
/* convert from old format */
|
||||
stuff = &newstuff;
|
||||
stuff->length = client->req_len;
|
||||
stuff->length = oldstuff->length;
|
||||
stuff->screen = oldstuff->screen;
|
||||
stuff->dotclock = oldstuff->dotclock;
|
||||
stuff->hdisplay = oldstuff->hdisplay;
|
||||
|
|
@ -951,8 +951,6 @@ ProcVidModeValidateModeLine(ClientPtr client)
|
|||
return BadValue;
|
||||
|
||||
modetmp = VidModeCreateMode();
|
||||
if (modetmp == NULL)
|
||||
return BadAlloc;
|
||||
VidModeCopyMode(mode, modetmp);
|
||||
|
||||
VidModeSetModeValue(modetmp, VIDMODE_H_DISPLAY, stuff->hdisplay);
|
||||
|
|
@ -1054,7 +1052,7 @@ ProcVidModeSwitchToMode(ClientPtr client)
|
|||
if (ver < 2) {
|
||||
/* convert from old format */
|
||||
stuff = &newstuff;
|
||||
stuff->length = client->req_len;
|
||||
stuff->length = oldstuff->length;
|
||||
stuff->screen = oldstuff->screen;
|
||||
stuff->dotclock = oldstuff->dotclock;
|
||||
stuff->hdisplay = oldstuff->hdisplay;
|
||||
|
|
@ -1705,10 +1703,19 @@ ProcVidModeDispatch(ClientPtr client)
|
|||
}
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcVidModeQueryVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeQueryVersionReq);
|
||||
swaps(&stuff->length);
|
||||
return ProcVidModeQueryVersion(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcVidModeGetModeLine(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetModeLineReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetModeLineReq);
|
||||
swaps(&stuff->screen);
|
||||
return ProcVidModeGetModeLine(client);
|
||||
|
|
@ -1718,6 +1725,7 @@ static int _X_COLD
|
|||
SProcVidModeGetAllModeLines(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetAllModeLinesReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq);
|
||||
swaps(&stuff->screen);
|
||||
return ProcVidModeGetAllModeLines(client);
|
||||
|
|
@ -1733,6 +1741,7 @@ SProcVidModeAddModeLine(ClientPtr client)
|
|||
REQUEST(xXF86VidModeAddModeLineReq);
|
||||
ver = ClientMajorVersion(client);
|
||||
if (ver < 2) {
|
||||
swaps(&oldstuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeAddModeLineReq);
|
||||
swapl(&oldstuff->screen);
|
||||
swaps(&oldstuff->hdisplay);
|
||||
|
|
@ -1748,6 +1757,7 @@ SProcVidModeAddModeLine(ClientPtr client)
|
|||
SwapRestL(oldstuff);
|
||||
}
|
||||
else {
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXF86VidModeAddModeLineReq);
|
||||
swapl(&stuff->screen);
|
||||
swaps(&stuff->hdisplay);
|
||||
|
|
@ -1776,6 +1786,7 @@ SProcVidModeDeleteModeLine(ClientPtr client)
|
|||
REQUEST(xXF86VidModeDeleteModeLineReq);
|
||||
ver = ClientMajorVersion(client);
|
||||
if (ver < 2) {
|
||||
swaps(&oldstuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeDeleteModeLineReq);
|
||||
swapl(&oldstuff->screen);
|
||||
swaps(&oldstuff->hdisplay);
|
||||
|
|
@ -1791,6 +1802,7 @@ SProcVidModeDeleteModeLine(ClientPtr client)
|
|||
SwapRestL(oldstuff);
|
||||
}
|
||||
else {
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXF86VidModeDeleteModeLineReq);
|
||||
swapl(&stuff->screen);
|
||||
swaps(&stuff->hdisplay);
|
||||
|
|
@ -1819,6 +1831,7 @@ SProcVidModeModModeLine(ClientPtr client)
|
|||
REQUEST(xXF86VidModeModModeLineReq);
|
||||
ver = ClientMajorVersion(client);
|
||||
if (ver < 2) {
|
||||
swaps(&oldstuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeModModeLineReq);
|
||||
swapl(&oldstuff->screen);
|
||||
swaps(&oldstuff->hdisplay);
|
||||
|
|
@ -1834,6 +1847,7 @@ SProcVidModeModModeLine(ClientPtr client)
|
|||
SwapRestL(oldstuff);
|
||||
}
|
||||
else {
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXF86VidModeModModeLineReq);
|
||||
swapl(&stuff->screen);
|
||||
swaps(&stuff->hdisplay);
|
||||
|
|
@ -1862,6 +1876,7 @@ SProcVidModeValidateModeLine(ClientPtr client)
|
|||
REQUEST(xXF86VidModeValidateModeLineReq);
|
||||
ver = ClientMajorVersion(client);
|
||||
if (ver < 2) {
|
||||
swaps(&oldstuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeValidateModeLineReq);
|
||||
swapl(&oldstuff->screen);
|
||||
swaps(&oldstuff->hdisplay);
|
||||
|
|
@ -1877,6 +1892,7 @@ SProcVidModeValidateModeLine(ClientPtr client)
|
|||
SwapRestL(oldstuff);
|
||||
}
|
||||
else {
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXF86VidModeValidateModeLineReq);
|
||||
swapl(&stuff->screen);
|
||||
swaps(&stuff->hdisplay);
|
||||
|
|
@ -1899,6 +1915,7 @@ static int _X_COLD
|
|||
SProcVidModeSwitchMode(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeSwitchModeReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeSwitchModeReq);
|
||||
swaps(&stuff->screen);
|
||||
swaps(&stuff->zoom);
|
||||
|
|
@ -1909,6 +1926,7 @@ static int _X_COLD
|
|||
SProcVidModeSwitchToMode(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeSwitchToModeReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeSwitchToModeReq);
|
||||
swapl(&stuff->screen);
|
||||
return ProcVidModeSwitchToMode(client);
|
||||
|
|
@ -1918,6 +1936,7 @@ static int _X_COLD
|
|||
SProcVidModeLockModeSwitch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeLockModeSwitchReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeLockModeSwitchReq);
|
||||
swaps(&stuff->screen);
|
||||
swaps(&stuff->lock);
|
||||
|
|
@ -1928,6 +1947,7 @@ static int _X_COLD
|
|||
SProcVidModeGetMonitor(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetMonitorReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq);
|
||||
swaps(&stuff->screen);
|
||||
return ProcVidModeGetMonitor(client);
|
||||
|
|
@ -1937,6 +1957,7 @@ static int _X_COLD
|
|||
SProcVidModeGetViewPort(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetViewPortReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetViewPortReq);
|
||||
swaps(&stuff->screen);
|
||||
return ProcVidModeGetViewPort(client);
|
||||
|
|
@ -1946,6 +1967,7 @@ static int _X_COLD
|
|||
SProcVidModeSetViewPort(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeSetViewPortReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeSetViewPortReq);
|
||||
swaps(&stuff->screen);
|
||||
swapl(&stuff->x);
|
||||
|
|
@ -1957,6 +1979,7 @@ static int _X_COLD
|
|||
SProcVidModeGetDotClocks(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetDotClocksReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq);
|
||||
swaps(&stuff->screen);
|
||||
return ProcVidModeGetDotClocks(client);
|
||||
|
|
@ -1966,6 +1989,7 @@ static int _X_COLD
|
|||
SProcVidModeSetClientVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeSetClientVersionReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeSetClientVersionReq);
|
||||
swaps(&stuff->major);
|
||||
swaps(&stuff->minor);
|
||||
|
|
@ -1976,6 +2000,7 @@ static int _X_COLD
|
|||
SProcVidModeSetGamma(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeSetGammaReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeSetGammaReq);
|
||||
swaps(&stuff->screen);
|
||||
swapl(&stuff->red);
|
||||
|
|
@ -1988,6 +2013,7 @@ static int _X_COLD
|
|||
SProcVidModeGetGamma(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetGammaReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaReq);
|
||||
swaps(&stuff->screen);
|
||||
return ProcVidModeGetGamma(client);
|
||||
|
|
@ -1999,6 +2025,7 @@ SProcVidModeSetGammaRamp(ClientPtr client)
|
|||
int length;
|
||||
|
||||
REQUEST(xXF86VidModeSetGammaRampReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXF86VidModeSetGammaRampReq);
|
||||
swaps(&stuff->size);
|
||||
swaps(&stuff->screen);
|
||||
|
|
@ -2012,6 +2039,7 @@ static int _X_COLD
|
|||
SProcVidModeGetGammaRamp(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetGammaRampReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
|
||||
swaps(&stuff->size);
|
||||
swaps(&stuff->screen);
|
||||
|
|
@ -2022,6 +2050,7 @@ static int _X_COLD
|
|||
SProcVidModeGetGammaRampSize(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetGammaRampSizeReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq);
|
||||
swaps(&stuff->screen);
|
||||
return ProcVidModeGetGammaRampSize(client);
|
||||
|
|
@ -2031,6 +2060,7 @@ static int _X_COLD
|
|||
SProcVidModeGetPermissions(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetPermissionsReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq);
|
||||
swaps(&stuff->screen);
|
||||
return ProcVidModeGetPermissions(client);
|
||||
|
|
@ -2042,7 +2072,7 @@ SProcVidModeDispatch(ClientPtr client)
|
|||
REQUEST(xReq);
|
||||
switch (stuff->data) {
|
||||
case X_XF86VidModeQueryVersion:
|
||||
return ProcVidModeQueryVersion(client);
|
||||
return SProcVidModeQueryVersion(client);
|
||||
case X_XF86VidModeGetModeLine:
|
||||
return SProcVidModeGetModeLine(client);
|
||||
case X_XF86VidModeGetMonitor:
|
||||
|
|
|
|||
189
Xext/xace.c
189
Xext/xace.c
|
|
@ -17,12 +17,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
********************************************************/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "os/client_priv.h"
|
||||
|
||||
#include "scrnintstr.h"
|
||||
#include "extnsionst.h"
|
||||
#include "pixmapstr.h"
|
||||
|
|
@ -34,8 +33,9 @@ CallbackListPtr XaceHooks[XACE_NUM_HOOKS] = { 0 };
|
|||
|
||||
/* Special-cased hook functions. Called by Xserver.
|
||||
*/
|
||||
#undef XaceHookDispatch
|
||||
int
|
||||
XaceHookDispatch0(ClientPtr client, int major)
|
||||
XaceHookDispatch(ClientPtr client, int major)
|
||||
{
|
||||
/* Call the extension dispatch hook */
|
||||
ExtensionEntry *ext = GetExtensionEntry(major);
|
||||
|
|
@ -63,85 +63,130 @@ XaceHookSelectionAccess(ClientPtr client, Selection ** ppSel, Mask access_mode)
|
|||
return rec.status;
|
||||
}
|
||||
|
||||
int XaceHookResourceAccess(ClientPtr client, XID id, RESTYPE rtype, void *res,
|
||||
RESTYPE ptype, void *parent, Mask access_mode)
|
||||
/* Entry point for hook functions. Called by Xserver.
|
||||
*/
|
||||
int
|
||||
XaceHook(int hook, ...)
|
||||
{
|
||||
XaceResourceAccessRec rec = { client, id, rtype, res, ptype, parent,
|
||||
access_mode, Success };
|
||||
CallCallbacks(&XaceHooks[XACE_RESOURCE_ACCESS], &rec);
|
||||
return rec.status;
|
||||
}
|
||||
union {
|
||||
XaceResourceAccessRec res;
|
||||
XaceDeviceAccessRec dev;
|
||||
XaceSendAccessRec send;
|
||||
XaceReceiveAccessRec recv;
|
||||
XaceClientAccessRec client;
|
||||
XaceExtAccessRec ext;
|
||||
XaceServerAccessRec server;
|
||||
XaceScreenAccessRec screen;
|
||||
XaceAuthAvailRec auth;
|
||||
XaceKeyAvailRec key;
|
||||
} u;
|
||||
int *prv = NULL; /* points to return value from callback */
|
||||
va_list ap; /* argument list */
|
||||
|
||||
int XaceHookDeviceAccess(ClientPtr client, DeviceIntPtr dev, Mask access_mode)
|
||||
{
|
||||
XaceDeviceAccessRec rec = { client, dev, access_mode, Success };
|
||||
CallCallbacks(&XaceHooks[XACE_DEVICE_ACCESS], &rec);
|
||||
return rec.status;
|
||||
}
|
||||
if (!XaceHooks[hook])
|
||||
return Success;
|
||||
|
||||
int XaceHookSendAccess(ClientPtr client, DeviceIntPtr dev, WindowPtr win,
|
||||
xEventPtr ev, int count)
|
||||
{
|
||||
XaceSendAccessRec rec = { client, dev, win, ev, count, Success };
|
||||
CallCallbacks(&XaceHooks[XACE_SEND_ACCESS], &rec);
|
||||
return rec.status;
|
||||
}
|
||||
va_start(ap, hook);
|
||||
|
||||
int XaceHookReceiveAccess(ClientPtr client, WindowPtr win,
|
||||
xEventPtr ev, int count)
|
||||
{
|
||||
XaceReceiveAccessRec rec = { client, win, ev, count, Success };
|
||||
CallCallbacks(&XaceHooks[XACE_RECEIVE_ACCESS], &rec);
|
||||
return rec.status;
|
||||
}
|
||||
/* Marshal arguments for passing to callback.
|
||||
* Each callback has its own case, which sets up a structure to hold
|
||||
* the arguments and integer return parameter, or in some cases just
|
||||
* sets calldata directly to a single argument (with no return result)
|
||||
*/
|
||||
switch (hook) {
|
||||
case XACE_RESOURCE_ACCESS:
|
||||
u.res.client = va_arg(ap, ClientPtr);
|
||||
u.res.id = va_arg(ap, XID);
|
||||
u.res.rtype = va_arg(ap, RESTYPE);
|
||||
u.res.res = va_arg(ap, void *);
|
||||
u.res.ptype = va_arg(ap, RESTYPE);
|
||||
u.res.parent = va_arg(ap, void *);
|
||||
u.res.access_mode = va_arg(ap, Mask);
|
||||
|
||||
int XaceHookClientAccess(ClientPtr client, ClientPtr target, Mask access_mode)
|
||||
{
|
||||
XaceClientAccessRec rec = { client, target, access_mode, Success };
|
||||
CallCallbacks(&XaceHooks[XACE_CLIENT_ACCESS], &rec);
|
||||
return rec.status;
|
||||
}
|
||||
u.res.status = Success; /* default allow */
|
||||
prv = &u.res.status;
|
||||
break;
|
||||
case XACE_DEVICE_ACCESS:
|
||||
u.dev.client = va_arg(ap, ClientPtr);
|
||||
u.dev.dev = va_arg(ap, DeviceIntPtr);
|
||||
u.dev.access_mode = va_arg(ap, Mask);
|
||||
|
||||
int XaceHookExtAccess(ClientPtr client, ExtensionEntry *ext)
|
||||
{
|
||||
XaceExtAccessRec rec = { client, ext, DixGetAttrAccess, Success };
|
||||
CallCallbacks(&XaceHooks[XACE_EXT_ACCESS], &rec);
|
||||
return rec.status;
|
||||
}
|
||||
u.dev.status = Success; /* default allow */
|
||||
prv = &u.dev.status;
|
||||
break;
|
||||
case XACE_SEND_ACCESS:
|
||||
u.send.client = va_arg(ap, ClientPtr);
|
||||
u.send.dev = va_arg(ap, DeviceIntPtr);
|
||||
u.send.pWin = va_arg(ap, WindowPtr);
|
||||
|
||||
int XaceHookServerAccess(ClientPtr client, Mask access_mode)
|
||||
{
|
||||
XaceServerAccessRec rec = { client, access_mode, Success };
|
||||
CallCallbacks(&XaceHooks[XACE_SERVER_ACCESS], &rec);
|
||||
return rec.status;
|
||||
}
|
||||
u.send.events = va_arg(ap, xEventPtr);
|
||||
u.send.count = va_arg(ap, int);
|
||||
|
||||
int XaceHookScreenAccess(ClientPtr client, ScreenPtr screen, Mask access_mode)
|
||||
{
|
||||
XaceScreenAccessRec rec = { client, screen, access_mode, Success };
|
||||
CallCallbacks(&XaceHooks[XACE_SCREEN_ACCESS], &rec);
|
||||
return rec.status;
|
||||
}
|
||||
u.send.status = Success; /* default allow */
|
||||
prv = &u.send.status;
|
||||
break;
|
||||
case XACE_RECEIVE_ACCESS:
|
||||
u.recv.client = va_arg(ap, ClientPtr);
|
||||
u.recv.pWin = va_arg(ap, WindowPtr);
|
||||
|
||||
int XaceHookScreensaverAccess(ClientPtr client, ScreenPtr screen, Mask access_mode)
|
||||
{
|
||||
XaceScreenAccessRec rec = { client, screen, access_mode, Success };
|
||||
CallCallbacks(&XaceHooks[XACE_SCREENSAVER_ACCESS], &rec);
|
||||
return rec.status;
|
||||
}
|
||||
u.recv.events = va_arg(ap, xEventPtr);
|
||||
u.recv.count = va_arg(ap, int);
|
||||
|
||||
int XaceHookAuthAvail(ClientPtr client, XID authId)
|
||||
{
|
||||
XaceAuthAvailRec rec = { client, authId };
|
||||
CallCallbacks(&XaceHooks[XACE_AUTH_AVAIL], &rec);
|
||||
return Success;
|
||||
}
|
||||
u.recv.status = Success; /* default allow */
|
||||
prv = &u.recv.status;
|
||||
break;
|
||||
case XACE_CLIENT_ACCESS:
|
||||
u.client.client = va_arg(ap, ClientPtr);
|
||||
u.client.target = va_arg(ap, ClientPtr);
|
||||
u.client.access_mode = va_arg(ap, Mask);
|
||||
|
||||
int XaceHookKeyAvail(xEventPtr ev, DeviceIntPtr dev, int count)
|
||||
{
|
||||
XaceKeyAvailRec rec = { ev, dev, count };
|
||||
CallCallbacks(&XaceHooks[XACE_KEY_AVAIL], &rec);
|
||||
return Success;
|
||||
u.client.status = Success; /* default allow */
|
||||
prv = &u.client.status;
|
||||
break;
|
||||
case XACE_EXT_ACCESS:
|
||||
u.ext.client = va_arg(ap, ClientPtr);
|
||||
|
||||
u.ext.ext = va_arg(ap, ExtensionEntry *);
|
||||
u.ext.access_mode = DixGetAttrAccess;
|
||||
u.ext.status = Success; /* default allow */
|
||||
prv = &u.ext.status;
|
||||
break;
|
||||
case XACE_SERVER_ACCESS:
|
||||
u.server.client = va_arg(ap, ClientPtr);
|
||||
u.server.access_mode = va_arg(ap, Mask);
|
||||
|
||||
u.server.status = Success; /* default allow */
|
||||
prv = &u.server.status;
|
||||
break;
|
||||
case XACE_SCREEN_ACCESS:
|
||||
case XACE_SCREENSAVER_ACCESS:
|
||||
u.screen.client = va_arg(ap, ClientPtr);
|
||||
u.screen.screen = va_arg(ap, ScreenPtr);
|
||||
u.screen.access_mode = va_arg(ap, Mask);
|
||||
|
||||
u.screen.status = Success; /* default allow */
|
||||
prv = &u.screen.status;
|
||||
break;
|
||||
case XACE_AUTH_AVAIL:
|
||||
u.auth.client = va_arg(ap, ClientPtr);
|
||||
u.auth.authId = va_arg(ap, XID);
|
||||
|
||||
break;
|
||||
case XACE_KEY_AVAIL:
|
||||
u.key.event = va_arg(ap, xEventPtr);
|
||||
u.key.keybd = va_arg(ap, DeviceIntPtr);
|
||||
u.key.count = va_arg(ap, int);
|
||||
|
||||
break;
|
||||
default:
|
||||
va_end(ap);
|
||||
return 0; /* unimplemented hook number */
|
||||
}
|
||||
va_end(ap);
|
||||
|
||||
/* call callbacks and return result, if any. */
|
||||
CallCallbacks(&XaceHooks[hook], &u);
|
||||
return prv ? *prv : Success;
|
||||
}
|
||||
|
||||
/* XaceHookIsSet
|
||||
|
|
|
|||
81
Xext/xace.h
81
Xext/xace.h
|
|
@ -25,7 +25,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#define XACE_MAJOR_VERSION 2
|
||||
#define XACE_MINOR_VERSION 0
|
||||
|
||||
#include "extnsionst.h"
|
||||
#include "pixmap.h"
|
||||
#include "region.h"
|
||||
#include "window.h"
|
||||
|
|
@ -55,47 +54,31 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#define XACE_KEY_AVAIL 14
|
||||
#define XACE_NUM_HOOKS 15
|
||||
|
||||
extern CallbackListPtr XaceHooks[XACE_NUM_HOOKS];
|
||||
extern _X_EXPORT CallbackListPtr XaceHooks[XACE_NUM_HOOKS];
|
||||
|
||||
/* Entry point for hook functions. Called by Xserver.
|
||||
* Required by libdbe and libextmod
|
||||
*/
|
||||
/* needs to be exported for in-tree modsetting driver, but not part
|
||||
of public API for external modules */
|
||||
_X_EXPORT int XaceHook(int hook, ... /* appropriate args for hook */);
|
||||
extern _X_EXPORT int XaceHook(int /*hook */ ,
|
||||
... /*appropriate args for hook */
|
||||
);
|
||||
|
||||
/* determine whether any callbacks are present for the XACE hook */
|
||||
int XaceHookIsSet(int hook);
|
||||
extern _X_EXPORT int XaceHookIsSet(int hook);
|
||||
|
||||
/* Special-cased hook functions
|
||||
*/
|
||||
int XaceHookDispatch0(ClientPtr ptr, int major);
|
||||
extern _X_EXPORT int XaceHookDispatch(ClientPtr ptr, int major);
|
||||
#define XaceHookDispatch(c, m) \
|
||||
((XaceHooks[XACE_EXT_DISPATCH] && (m) >= EXTENSION_BASE) ? \
|
||||
XaceHookDispatch0((c), (m)) : \
|
||||
XaceHookDispatch((c), (m)) : \
|
||||
Success)
|
||||
|
||||
int XaceHookPropertyAccess(ClientPtr ptr, WindowPtr pWin, PropertyPtr *ppProp,
|
||||
Mask access_mode);
|
||||
int XaceHookSelectionAccess(ClientPtr ptr, Selection ** ppSel, Mask access_mode);
|
||||
|
||||
/* needs to be exported for in-tree modsetting, but not part of public API */
|
||||
_X_EXPORT int XaceHookResourceAccess(ClientPtr client, XID id, RESTYPE rtype, void *res,
|
||||
RESTYPE ptype, void *parent, Mask access_mode);
|
||||
|
||||
int XaceHookDeviceAccess(ClientPtr client, DeviceIntPtr dev, Mask access_mode);
|
||||
|
||||
int XaceHookSendAccess(ClientPtr client, DeviceIntPtr dev, WindowPtr win,
|
||||
xEventPtr ev, int count);
|
||||
int XaceHookReceiveAccess(ClientPtr client, WindowPtr win, xEventPtr ev, int count);
|
||||
int XaceHookClientAccess(ClientPtr client, ClientPtr target, Mask access_mode);
|
||||
int XaceHookExtAccess(ClientPtr client, ExtensionEntry *ext);
|
||||
int XaceHookServerAccess(ClientPtr client, Mask access_mode);
|
||||
int XaceHookScreenAccess(ClientPtr client, ScreenPtr screen, Mask access_mode);
|
||||
int XaceHookScreensaverAccess(ClientPtr client, ScreenPtr screen, Mask access_mode);
|
||||
int XaceHookAuthAvail(ClientPtr client, XID authId);
|
||||
int XaceHookKeyAvail(xEventPtr ev, DeviceIntPtr dev, int count);
|
||||
|
||||
extern _X_EXPORT int XaceHookPropertyAccess(ClientPtr ptr, WindowPtr pWin,
|
||||
PropertyPtr *ppProp,
|
||||
Mask access_mode);
|
||||
extern _X_EXPORT int XaceHookSelectionAccess(ClientPtr ptr, Selection ** ppSel,
|
||||
Mask access_mode);
|
||||
|
||||
/* Register a callback for a given hook.
|
||||
*/
|
||||
|
|
@ -109,18 +92,18 @@ int XaceHookKeyAvail(xEventPtr ev, DeviceIntPtr dev, int count);
|
|||
|
||||
/* XTrans wrappers for use by security modules
|
||||
*/
|
||||
int XaceGetConnectionNumber(ClientPtr ptr);
|
||||
int XaceIsLocal(ClientPtr ptr);
|
||||
extern _X_EXPORT int XaceGetConnectionNumber(ClientPtr ptr);
|
||||
extern _X_EXPORT int XaceIsLocal(ClientPtr ptr);
|
||||
|
||||
/* From the original Security extension...
|
||||
*/
|
||||
|
||||
void XaceCensorImage(ClientPtr client,
|
||||
RegionPtr pVisibleRegion,
|
||||
long widthBytesLine,
|
||||
DrawablePtr pDraw,
|
||||
int x, int y, int w, int h,
|
||||
unsigned int format, char *pBuf);
|
||||
extern _X_EXPORT void XaceCensorImage(ClientPtr client,
|
||||
RegionPtr pVisibleRegion,
|
||||
long widthBytesLine,
|
||||
DrawablePtr pDraw,
|
||||
int x, int y, int w, int h,
|
||||
unsigned int format, char *pBuf);
|
||||
|
||||
#else /* XACE */
|
||||
|
||||
|
|
@ -130,38 +113,18 @@ void XaceCensorImage(ClientPtr client,
|
|||
/* Define calls away when XACE is not being built. */
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define XaceHook(args...) Success
|
||||
#define XaceHookIsSet(args...) 0
|
||||
#define XaceHookDispatch(args...) Success
|
||||
#define XaceHookPropertyAccess(args...) Success
|
||||
#define XaceHookSelectionAccess(args...) Success
|
||||
#define XaceHookResourceAccess(args...) Success
|
||||
#define XaceHookDeviceAccess(args...) Success
|
||||
#define XaceHookSendAccess(args...) Success
|
||||
#define XaceHookReceiveAccess(args...) Success
|
||||
#define XaceHookClientAccess(args...) Success
|
||||
#define XaceHookExtAccess(args...) Success
|
||||
#define XaceHookServerAccess(args...) Success
|
||||
#define XaceHookScreenAccess(args...) Success
|
||||
#define XaceHookScreensaverAccess(args...) Success
|
||||
#define XaceHookAuthAvail(args...) Success
|
||||
#define XaceHookKeyAvail(args...) Success
|
||||
#define XaceCensorImage(args...) { ; }
|
||||
#else
|
||||
#define XaceHook(...) Success
|
||||
#define XaceHookIsSet(...) 0
|
||||
#define XaceHookDispatch(...) Success
|
||||
#define XaceHookPropertyAccess(...) Success
|
||||
#define XaceHookSelectionAccess(...) Success
|
||||
#define XaceHookResourceAccess(...) Success
|
||||
#define XaceHookDeviceAccess(...) Success
|
||||
#define XaceHookSendAccess(...) Success
|
||||
#define XaceHookReceiveAccess(...) Success
|
||||
#define XaceHookClientAccess(...) Success
|
||||
#define XaceHookExtAccess(...) Success
|
||||
#define XaceHookServerAccess(...) Success
|
||||
#define XaceHookScreenAccess(...) Success
|
||||
#define XaceHookScreensaverAccess(...) Success
|
||||
#define XaceHookAuthAvail(...) Success
|
||||
#define XaceHookKeyAvail(...) Success
|
||||
#define XaceCensorImage(...) { ; }
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,9 @@ from The Open Group.
|
|||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
|
|
@ -36,7 +38,7 @@ from The Open Group.
|
|||
#include "extnsionst.h"
|
||||
#include "swaprep.h"
|
||||
#include <X11/extensions/xcmiscproto.h>
|
||||
#include "extinit_priv.h"
|
||||
#include "extinit.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
|
@ -144,18 +146,30 @@ static int _X_COLD
|
|||
SProcXCMiscGetVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXCMiscGetVersionReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
|
||||
swaps(&stuff->majorVersion);
|
||||
swaps(&stuff->minorVersion);
|
||||
return ProcXCMiscGetVersion(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcXCMiscGetXIDRange(ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
return ProcXCMiscGetXIDRange(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcXCMiscGetXIDList(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXCMiscGetXIDListReq);
|
||||
REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->count);
|
||||
return ProcXCMiscGetXIDList(client);
|
||||
}
|
||||
|
|
@ -168,7 +182,7 @@ SProcXCMiscDispatch(ClientPtr client)
|
|||
case X_XCMiscGetVersion:
|
||||
return SProcXCMiscGetVersion(client);
|
||||
case X_XCMiscGetXIDRange:
|
||||
return ProcXCMiscGetXIDRange(client);
|
||||
return SProcXCMiscGetXIDRange(client);
|
||||
case X_XCMiscGetXIDList:
|
||||
return SProcXCMiscGetXIDList(client);
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@
|
|||
* XLoadQueryFont).
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef MITSHM
|
||||
|
|
@ -56,22 +58,20 @@
|
|||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/extensions/xf86bigfproto.h>
|
||||
#include <X11/fonts/fontstruct.h>
|
||||
#include <X11/fonts/libxfont2.h>
|
||||
|
||||
#include "misc.h"
|
||||
#include "os.h"
|
||||
#include "dixstruct.h"
|
||||
#include "gcstruct.h"
|
||||
#include "dixfontstr.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit_priv.h"
|
||||
#include "extinit.h"
|
||||
#include "protocol-versions.h"
|
||||
|
||||
#include <X11/extensions/xf86bigfproto.h>
|
||||
#include "xf86bigfontsrv.h"
|
||||
|
||||
static void XF86BigfontResetProc(ExtensionEntry *extEntry );
|
||||
static void XF86BigfontResetProc(ExtensionEntry * /* extEntry */
|
||||
);
|
||||
|
||||
#ifdef MITSHM
|
||||
|
||||
|
|
@ -339,7 +339,9 @@ ProcXF86BigfontQueryFont(ClientPtr client)
|
|||
CARD16 *pUniqIndex2Index;
|
||||
CARD32 nUniqCharInfos;
|
||||
|
||||
/* protocol version is decided based on request packet size */
|
||||
#if 0
|
||||
REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq);
|
||||
#else
|
||||
switch (client->req_len) {
|
||||
case 2: /* client with version 1.0 libX11 */
|
||||
stuff_flags = (client->local &&
|
||||
|
|
@ -351,7 +353,7 @@ ProcXF86BigfontQueryFont(ClientPtr client)
|
|||
default:
|
||||
return BadLength;
|
||||
}
|
||||
|
||||
#endif
|
||||
if (dixLookupFontable(&pFont, stuff->id, client, DixGetAttrAccess) !=
|
||||
Success)
|
||||
return BadFont; /* procotol spec says only error is BadFont */
|
||||
|
|
@ -651,7 +653,9 @@ ProcXF86BigfontDispatch(ClientPtr client)
|
|||
static int _X_COLD
|
||||
SProcXF86BigfontQueryVersion(ClientPtr client)
|
||||
{
|
||||
/* REQUEST(xXF86BigfontQueryVersionReq); */
|
||||
REQUEST(xXF86BigfontQueryVersionReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
return ProcXF86BigfontQueryVersion(client);
|
||||
}
|
||||
|
||||
|
|
@ -659,6 +663,8 @@ static int _X_COLD
|
|||
SProcXF86BigfontQueryFont(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86BigfontQueryFontReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq);
|
||||
swapl(&stuff->id);
|
||||
return ProcXF86BigfontQueryFont(client);
|
||||
|
|
|
|||
13
Xext/xres.c
13
Xext/xres.c
|
|
@ -2,28 +2,30 @@
|
|||
Copyright (c) 2002 XFree86 Inc
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/extensions/XResproto.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "dix/registry_priv.h"
|
||||
#include "os/client_priv.h"
|
||||
|
||||
#include "misc.h"
|
||||
#include "os.h"
|
||||
#include "dixstruct.h"
|
||||
#include "extnsionst.h"
|
||||
#include "swaprep.h"
|
||||
#include <X11/extensions/XResproto.h>
|
||||
#include "pixmapstr.h"
|
||||
#include "windowstr.h"
|
||||
#include "gcstruct.h"
|
||||
#include "extinit_priv.h"
|
||||
#include "extinit.h"
|
||||
#include "protocol-versions.h"
|
||||
#include "client.h"
|
||||
#include "list.h"
|
||||
#include "misc.h"
|
||||
#include <string.h>
|
||||
|
|
@ -224,8 +226,6 @@ ProcXResQueryClients(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xXResQueryClientsReq);
|
||||
|
||||
current_clients = xallocarray(currentMaxClients, sizeof(int));
|
||||
if (current_clients == NULL)
|
||||
return BadAlloc;
|
||||
|
||||
num_clients = 0;
|
||||
for (i = 0; i < currentMaxClients; i++) {
|
||||
|
|
@ -1080,6 +1080,7 @@ static int _X_COLD
|
|||
SProcResDispatch (ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
swaps(&stuff->length);
|
||||
|
||||
switch (stuff->data) {
|
||||
case X_XResQueryVersion:
|
||||
|
|
|
|||
|
|
@ -17,16 +17,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
********************************************************/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#endif
|
||||
|
||||
#include "selection.h"
|
||||
#include "inputstr.h"
|
||||
#include "windowstr.h"
|
||||
#include "propertyst.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit_priv.h"
|
||||
#include "extinit.h"
|
||||
#include "xselinuxint.h"
|
||||
|
||||
#define CTX_DEV offsetof(SELinuxSubjectRec, dev_create_sid)
|
||||
|
|
@ -69,6 +69,7 @@ ProcSELinuxQueryVersion(ClientPtr client)
|
|||
SELinuxQueryVersionReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = 0,
|
||||
.server_major = SELINUX_MAJOR_VERSION,
|
||||
.server_minor = SELINUX_MINOR_VERSION
|
||||
};
|
||||
|
|
@ -85,6 +86,7 @@ ProcSELinuxQueryVersion(ClientPtr client)
|
|||
static int
|
||||
SELinuxSendContextReply(ClientPtr client, security_id_t sid)
|
||||
{
|
||||
SELinuxGetContextReply rep;
|
||||
char *ctx = NULL;
|
||||
int len = 0;
|
||||
|
||||
|
|
@ -94,7 +96,7 @@ SELinuxSendContextReply(ClientPtr client, security_id_t sid)
|
|||
len = strlen(ctx) + 1;
|
||||
}
|
||||
|
||||
SELinuxGetContextReply rep = {
|
||||
rep = (SELinuxGetContextReply) {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = bytes_to_int32(len),
|
||||
|
|
@ -341,9 +343,13 @@ static int
|
|||
SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec * items,
|
||||
int size, int count)
|
||||
{
|
||||
int rc = BadAlloc, k, pos = 0;
|
||||
CARD32 *buf = calloc(size, sizeof(CARD32));
|
||||
int rc, k, pos = 0;
|
||||
SELinuxListItemsReply rep;
|
||||
CARD32 *buf;
|
||||
|
||||
buf = calloc(size, sizeof(CARD32));
|
||||
if (size && !buf) {
|
||||
rc = BadAlloc;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
|
@ -371,7 +377,7 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec * items,
|
|||
}
|
||||
|
||||
/* Send reply to client */
|
||||
SELinuxListItemsReply rep = {
|
||||
rep = (SELinuxListItemsReply) {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = size,
|
||||
|
|
@ -449,10 +455,8 @@ ProcSELinuxListSelections(ClientPtr client)
|
|||
count = 0;
|
||||
for (pSel = CurrentSelections; pSel; pSel = pSel->next)
|
||||
count++;
|
||||
if (count == 0)
|
||||
return SELinuxSendItemsToClient(client, NULL, 0, 0);
|
||||
items = calloc(count, sizeof(SELinuxListItemRec));
|
||||
if (!items)
|
||||
if (count && !items)
|
||||
return BadAlloc;
|
||||
|
||||
/* Fill in the items and calculate size */
|
||||
|
|
@ -620,6 +624,8 @@ SProcSELinuxDispatch(ClientPtr client)
|
|||
{
|
||||
REQUEST(xReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
|
||||
switch (stuff->data) {
|
||||
case X_SELinuxQueryVersion:
|
||||
return SProcSELinuxQueryVersion(client);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
* All rights reserved.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/socket.h>
|
||||
|
|
@ -30,10 +32,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <stdarg.h>
|
||||
#include <libaudit.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
#include "dix/registry_priv.h"
|
||||
#include "os/client_priv.h"
|
||||
|
||||
#include "selection.h"
|
||||
#include "inputstr.h"
|
||||
|
|
@ -42,6 +42,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include "propertyst.h"
|
||||
#include "extnsionst.h"
|
||||
#include "xacestr.h"
|
||||
#include "client.h"
|
||||
#define _XSELINUX_NEED_FLASK_MAP
|
||||
#include "xselinuxint.h"
|
||||
|
||||
|
|
@ -200,7 +201,7 @@ SELinuxLabelInitial(void)
|
|||
|
||||
/* Do the default colormap */
|
||||
dixLookupResourceByType(&unused, screenInfo.screens[i]->defColormap,
|
||||
X11_RESTYPE_COLORMAP, serverClient, DixCreateAccess);
|
||||
RT_COLORMAP, serverClient, DixCreateAccess);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -663,7 +664,7 @@ SELinuxResource(CallbackListPtr *pcbl, void *unused, void *calldata)
|
|||
rec->status = rc;
|
||||
|
||||
/* Perform the background none check on windows */
|
||||
if (access_mode & DixCreateAccess && rec->rtype == X11_RESTYPE_WINDOW) {
|
||||
if (access_mode & DixCreateAccess && rec->rtype == RT_WINDOW) {
|
||||
rc = SELinuxDoCheck(subj, obj, class, DixBlendAccess, &auditdata);
|
||||
if (rc != Success)
|
||||
((WindowPtr) rec->res)->forcedBG = TRUE;
|
||||
|
|
@ -765,7 +766,7 @@ SELinuxResourceState(CallbackListPtr *pcbl, void *unused, void *calldata)
|
|||
SELinuxObjectRec *obj;
|
||||
WindowPtr pWin;
|
||||
|
||||
if (rec->type != X11_RESTYPE_WINDOW)
|
||||
if (rec->type != RT_WINDOW)
|
||||
return;
|
||||
if (rec->state != ResourceStateAdding)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
********************************************************/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <selinux/label.h>
|
||||
|
||||
|
|
@ -137,12 +139,8 @@ SELinuxAtomToSID(Atom atom, int prop, SELinuxObjectRec ** obj_rtn)
|
|||
rec = SELinuxArrayGet(&arr_atoms, atom);
|
||||
if (!rec) {
|
||||
rec = calloc(1, sizeof(SELinuxAtomRec));
|
||||
if (!rec)
|
||||
if (!rec || !SELinuxArraySet(&arr_atoms, atom, rec))
|
||||
return BadAlloc;
|
||||
if (!SELinuxArraySet(&arr_atoms, atom, rec)) {
|
||||
free(rec);
|
||||
return BadAlloc;
|
||||
}
|
||||
}
|
||||
|
||||
if (prop) {
|
||||
|
|
@ -325,13 +323,13 @@ SELinuxTypeToClass(RESTYPE type)
|
|||
|
||||
if (type & RC_DRAWABLE)
|
||||
class = SECCLASS_X_DRAWABLE;
|
||||
else if (type == X11_RESTYPE_GC)
|
||||
else if (type == RT_GC)
|
||||
class = SECCLASS_X_GC;
|
||||
else if (type == X11_RESTYPE_FONT)
|
||||
else if (type == RT_FONT)
|
||||
class = SECCLASS_X_FONT;
|
||||
else if (type == X11_RESTYPE_CURSOR)
|
||||
else if (type == RT_CURSOR)
|
||||
class = SECCLASS_X_CURSOR;
|
||||
else if (type == X11_RESTYPE_COLORMAP)
|
||||
else if (type == RT_COLORMAP)
|
||||
class = SECCLASS_X_COLORMAP;
|
||||
else {
|
||||
/* Need to do a string lookup */
|
||||
|
|
|
|||
54
Xext/xtest.c
54
Xext/xtest.c
|
|
@ -26,23 +26,13 @@
|
|||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/extensions/xtestproto.h>
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/input_priv.h"
|
||||
#include "dix/dix_priv.h"
|
||||
#include "dix/exevents_priv.h"
|
||||
#include "mi/mi_priv.h"
|
||||
#include "mi/mipointer_priv.h"
|
||||
#include "os/client_priv.h"
|
||||
#include "os/osdep.h"
|
||||
|
||||
#include "misc.h"
|
||||
#include "os.h"
|
||||
#include "dixstruct.h"
|
||||
|
|
@ -52,14 +42,20 @@
|
|||
#include "scrnintstr.h"
|
||||
#include "dixevents.h"
|
||||
#include "sleepuntil.h"
|
||||
#include "mi.h"
|
||||
#include "xkbsrv.h"
|
||||
#include "xkbstr.h"
|
||||
#include <X11/extensions/xtestproto.h>
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exglobals.h"
|
||||
#include "mipointer.h"
|
||||
#include "xserver-properties.h"
|
||||
#include "exevents.h"
|
||||
#include "eventstr.h"
|
||||
#include "inpututils.h"
|
||||
#include "extinit_priv.h"
|
||||
|
||||
#include "extinit.h"
|
||||
|
||||
/* XTest events are sent during request processing and may be interrupted by
|
||||
* a SIGIO. We need a separate event list to avoid events overwriting each
|
||||
|
|
@ -79,10 +75,10 @@ static InternalEvent *xtest_evlist;
|
|||
*/
|
||||
DeviceIntPtr xtestpointer, xtestkeyboard;
|
||||
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
#include "panoramiX.h"
|
||||
#include "panoramiXsrv.h"
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
|
||||
static int XTestSwapFakeInput(ClientPtr /* client */ ,
|
||||
xReq * /* req */
|
||||
|
|
@ -133,7 +129,7 @@ ProcXTestCompareCursor(ClientPtr client)
|
|||
pCursor = GetSpriteCursor(ptr);
|
||||
else {
|
||||
rc = dixLookupResourceByType((void **) &pCursor, stuff->cursor,
|
||||
X11_RESTYPE_CURSOR, client, DixReadAccess);
|
||||
RT_CURSOR, client, DixReadAccess);
|
||||
if (rc != Success) {
|
||||
client->errorValue = stuff->cursor;
|
||||
return rc;
|
||||
|
|
@ -198,7 +194,7 @@ ProcXTestFakeInput(ClientPtr client)
|
|||
int flags = 0;
|
||||
int need_ptr_update = 1;
|
||||
|
||||
nev = (client->req_len << 2) - sizeof(xReq);
|
||||
nev = (stuff->length << 2) - sizeof(xReq);
|
||||
if ((nev % sizeof(xEvent)) || !nev)
|
||||
return BadLength;
|
||||
nev /= sizeof(xEvent);
|
||||
|
|
@ -350,10 +346,6 @@ ProcXTestFakeInput(ClientPtr client)
|
|||
return BadAccess;
|
||||
|
||||
dev = GetXTestDevice(dev);
|
||||
|
||||
/* This can only happen if we passed a slave to GetXTestDevice() */
|
||||
if (!dev)
|
||||
return BadAccess;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -378,6 +370,7 @@ ProcXTestFakeInput(ClientPtr client)
|
|||
/* swap the request back so we can simply re-execute it */
|
||||
if (client->swapped) {
|
||||
(void) XTestSwapFakeInput(client, (xReq *) stuff);
|
||||
swaps(&stuff->length);
|
||||
}
|
||||
ResetCurrentRequest(client);
|
||||
client->sequence--;
|
||||
|
|
@ -491,6 +484,8 @@ static int _X_COLD
|
|||
SProcXTestGetVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXTestGetVersionReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXTestGetVersionReq);
|
||||
swaps(&stuff->minorVersion);
|
||||
return ProcXTestGetVersion(client);
|
||||
|
|
@ -500,6 +495,8 @@ static int _X_COLD
|
|||
SProcXTestCompareCursor(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXTestCompareCursorReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
|
||||
swapl(&stuff->window);
|
||||
swapl(&stuff->cursor);
|
||||
|
|
@ -514,7 +511,7 @@ XTestSwapFakeInput(ClientPtr client, xReq * req)
|
|||
xEvent sev;
|
||||
EventSwapPtr proc;
|
||||
|
||||
nev = ((client->req_len << 2) - sizeof(xReq)) / sizeof(xEvent);
|
||||
nev = ((req->length << 2) - sizeof(xReq)) / sizeof(xEvent);
|
||||
for (ev = (xEvent *) &req[1]; --nev >= 0; ev++) {
|
||||
int evtype = ev->u.u.type & 0177;
|
||||
/* Swap event */
|
||||
|
|
@ -537,12 +534,23 @@ SProcXTestFakeInput(ClientPtr client)
|
|||
|
||||
REQUEST(xReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
n = XTestSwapFakeInput(client, stuff);
|
||||
if (n != Success)
|
||||
return n;
|
||||
return ProcXTestFakeInput(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcXTestGrabControl(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXTestGrabControlReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXTestGrabControlReq);
|
||||
return ProcXTestGrabControl(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcXTestDispatch(ClientPtr client)
|
||||
{
|
||||
|
|
@ -555,7 +563,7 @@ SProcXTestDispatch(ClientPtr client)
|
|||
case X_XTestFakeInput:
|
||||
return SProcXTestFakeInput(client);
|
||||
case X_XTestGrabControl:
|
||||
return ProcXTestGrabControl(client);
|
||||
return SProcXTestGrabControl(client);
|
||||
default:
|
||||
return BadRequest;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,18 +21,14 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
******************************************************************/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/extensions/Xv.h>
|
||||
#include <X11/extensions/Xvproto.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "Xext/xvdix_priv.h"
|
||||
|
||||
#include "misc.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
|
|
@ -41,6 +37,10 @@ SOFTWARE.
|
|||
#include "dixstruct.h"
|
||||
#include "resource.h"
|
||||
#include "opaque.h"
|
||||
|
||||
#include <X11/extensions/Xv.h>
|
||||
#include <X11/extensions/Xvproto.h>
|
||||
#include "xvdix.h"
|
||||
#ifdef MITSHM
|
||||
#include <X11/extensions/shmproto.h>
|
||||
#include "shmint.h"
|
||||
|
|
@ -48,12 +48,12 @@ SOFTWARE.
|
|||
|
||||
#include "xvdisp.h"
|
||||
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
#include "panoramiX.h"
|
||||
#include "panoramiXsrv.h"
|
||||
|
||||
unsigned long XvXRTPort;
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
|
||||
static int
|
||||
SWriteQueryExtensionReply(ClientPtr client, xvQueryExtensionReply * rep)
|
||||
|
|
@ -1115,11 +1115,21 @@ ProcXvDispatch(ClientPtr client)
|
|||
|
||||
/* Swapped Procs */
|
||||
|
||||
static int _X_COLD
|
||||
SProcXvQueryExtension(ClientPtr client)
|
||||
{
|
||||
REQUEST(xvQueryExtensionReq);
|
||||
REQUEST_SIZE_MATCH(xvQueryExtensionReq);
|
||||
swaps(&stuff->length);
|
||||
return XvProcVector[xv_QueryExtension] (client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcXvQueryAdaptors(ClientPtr client)
|
||||
{
|
||||
REQUEST(xvQueryAdaptorsReq);
|
||||
REQUEST_SIZE_MATCH(xvQueryAdaptorsReq);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->window);
|
||||
return XvProcVector[xv_QueryAdaptors] (client);
|
||||
}
|
||||
|
|
@ -1129,6 +1139,7 @@ SProcXvQueryEncodings(ClientPtr client)
|
|||
{
|
||||
REQUEST(xvQueryEncodingsReq);
|
||||
REQUEST_SIZE_MATCH(xvQueryEncodingsReq);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
return XvProcVector[xv_QueryEncodings] (client);
|
||||
}
|
||||
|
|
@ -1138,6 +1149,7 @@ SProcXvGrabPort(ClientPtr client)
|
|||
{
|
||||
REQUEST(xvGrabPortReq);
|
||||
REQUEST_SIZE_MATCH(xvGrabPortReq);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->time);
|
||||
return XvProcVector[xv_GrabPort] (client);
|
||||
|
|
@ -1148,6 +1160,7 @@ SProcXvUngrabPort(ClientPtr client)
|
|||
{
|
||||
REQUEST(xvUngrabPortReq);
|
||||
REQUEST_SIZE_MATCH(xvUngrabPortReq);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->time);
|
||||
return XvProcVector[xv_UngrabPort] (client);
|
||||
|
|
@ -1158,6 +1171,7 @@ SProcXvPutVideo(ClientPtr client)
|
|||
{
|
||||
REQUEST(xvPutVideoReq);
|
||||
REQUEST_SIZE_MATCH(xvPutVideoReq);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->drawable);
|
||||
swapl(&stuff->gc);
|
||||
|
|
@ -1177,6 +1191,7 @@ SProcXvPutStill(ClientPtr client)
|
|||
{
|
||||
REQUEST(xvPutStillReq);
|
||||
REQUEST_SIZE_MATCH(xvPutStillReq);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->drawable);
|
||||
swapl(&stuff->gc);
|
||||
|
|
@ -1196,6 +1211,7 @@ SProcXvGetVideo(ClientPtr client)
|
|||
{
|
||||
REQUEST(xvGetVideoReq);
|
||||
REQUEST_SIZE_MATCH(xvGetVideoReq);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->drawable);
|
||||
swapl(&stuff->gc);
|
||||
|
|
@ -1215,6 +1231,7 @@ SProcXvGetStill(ClientPtr client)
|
|||
{
|
||||
REQUEST(xvGetStillReq);
|
||||
REQUEST_SIZE_MATCH(xvGetStillReq);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->drawable);
|
||||
swapl(&stuff->gc);
|
||||
|
|
@ -1234,6 +1251,7 @@ SProcXvPutImage(ClientPtr client)
|
|||
{
|
||||
REQUEST(xvPutImageReq);
|
||||
REQUEST_AT_LEAST_SIZE(xvPutImageReq);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->drawable);
|
||||
swapl(&stuff->gc);
|
||||
|
|
@ -1257,6 +1275,7 @@ SProcXvShmPutImage(ClientPtr client)
|
|||
{
|
||||
REQUEST(xvShmPutImageReq);
|
||||
REQUEST_SIZE_MATCH(xvShmPutImageReq);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->drawable);
|
||||
swapl(&stuff->gc);
|
||||
|
|
@ -1284,6 +1303,7 @@ SProcXvSelectVideoNotify(ClientPtr client)
|
|||
{
|
||||
REQUEST(xvSelectVideoNotifyReq);
|
||||
REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->drawable);
|
||||
return XvProcVector[xv_SelectVideoNotify] (client);
|
||||
}
|
||||
|
|
@ -1293,6 +1313,7 @@ SProcXvSelectPortNotify(ClientPtr client)
|
|||
{
|
||||
REQUEST(xvSelectPortNotifyReq);
|
||||
REQUEST_SIZE_MATCH(xvSelectPortNotifyReq);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
return XvProcVector[xv_SelectPortNotify] (client);
|
||||
}
|
||||
|
|
@ -1302,6 +1323,7 @@ SProcXvStopVideo(ClientPtr client)
|
|||
{
|
||||
REQUEST(xvStopVideoReq);
|
||||
REQUEST_SIZE_MATCH(xvStopVideoReq);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->drawable);
|
||||
return XvProcVector[xv_StopVideo] (client);
|
||||
|
|
@ -1312,6 +1334,7 @@ SProcXvSetPortAttribute(ClientPtr client)
|
|||
{
|
||||
REQUEST(xvSetPortAttributeReq);
|
||||
REQUEST_SIZE_MATCH(xvSetPortAttributeReq);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->attribute);
|
||||
swapl(&stuff->value);
|
||||
|
|
@ -1323,6 +1346,7 @@ SProcXvGetPortAttribute(ClientPtr client)
|
|||
{
|
||||
REQUEST(xvGetPortAttributeReq);
|
||||
REQUEST_SIZE_MATCH(xvGetPortAttributeReq);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->attribute);
|
||||
return XvProcVector[xv_GetPortAttribute] (client);
|
||||
|
|
@ -1333,6 +1357,7 @@ SProcXvQueryBestSize(ClientPtr client)
|
|||
{
|
||||
REQUEST(xvQueryBestSizeReq);
|
||||
REQUEST_SIZE_MATCH(xvQueryBestSizeReq);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swaps(&stuff->vid_w);
|
||||
swaps(&stuff->vid_h);
|
||||
|
|
@ -1346,6 +1371,7 @@ SProcXvQueryPortAttributes(ClientPtr client)
|
|||
{
|
||||
REQUEST(xvQueryPortAttributesReq);
|
||||
REQUEST_SIZE_MATCH(xvQueryPortAttributesReq);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
return XvProcVector[xv_QueryPortAttributes] (client);
|
||||
}
|
||||
|
|
@ -1355,6 +1381,7 @@ SProcXvQueryImageAttributes(ClientPtr client)
|
|||
{
|
||||
REQUEST(xvQueryImageAttributesReq);
|
||||
REQUEST_SIZE_MATCH(xvQueryImageAttributesReq);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->id);
|
||||
swaps(&stuff->width);
|
||||
|
|
@ -1367,12 +1394,13 @@ SProcXvListImageFormats(ClientPtr client)
|
|||
{
|
||||
REQUEST(xvListImageFormatsReq);
|
||||
REQUEST_SIZE_MATCH(xvListImageFormatsReq);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
return XvProcVector[xv_ListImageFormats] (client);
|
||||
}
|
||||
|
||||
static int (*SXvProcVector[xvNumRequests]) (ClientPtr) = {
|
||||
ProcXvQueryExtension,
|
||||
SProcXvQueryExtension,
|
||||
SProcXvQueryAdaptors,
|
||||
SProcXvQueryEncodings,
|
||||
SProcXvGrabPort,
|
||||
|
|
@ -1405,7 +1433,7 @@ SProcXvDispatch(ClientPtr client)
|
|||
return SXvProcVector[stuff->data] (client);
|
||||
}
|
||||
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
static int
|
||||
XineramaXvStopVideo(ClientPtr client)
|
||||
{
|
||||
|
|
@ -1513,7 +1541,7 @@ XineramaXvShmPutImage(ClientPtr client)
|
|||
}
|
||||
#else
|
||||
#define XineramaXvShmPutImage ProcXvShmPutImage
|
||||
#endif /* MITSHM */
|
||||
#endif
|
||||
|
||||
static int
|
||||
XineramaXvPutImage(ClientPtr client)
|
||||
|
|
@ -1768,17 +1796,17 @@ XineramifyXv(void)
|
|||
XvProcVector[xv_PutImage] = XineramaXvPutImage;
|
||||
XvProcVector[xv_ShmPutImage] = XineramaXvShmPutImage;
|
||||
}
|
||||
#endif /* XINERAMA */
|
||||
#endif /* PANORAMIX */
|
||||
|
||||
void
|
||||
XvResetProcVector(void)
|
||||
{
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
XvProcVector[xv_PutVideo] = ProcXvPutVideo;
|
||||
XvProcVector[xv_PutStill] = ProcXvPutStill;
|
||||
XvProcVector[xv_StopVideo] = ProcXvStopVideo;
|
||||
XvProcVector[xv_SetPortAttribute] = ProcXvSetPortAttribute;
|
||||
XvProcVector[xv_PutImage] = ProcXvPutImage;
|
||||
XvProcVector[xv_ShmPutImage] = ProcXvShmPutImage;
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
79
Xext/xvdix.h
79
Xext/xvdix.h
|
|
@ -55,6 +55,21 @@ SOFTWARE.
|
|||
#include "scrnintstr.h"
|
||||
#include <X11/extensions/Xvproto.h>
|
||||
|
||||
extern _X_EXPORT unsigned long XvExtensionGeneration;
|
||||
extern _X_EXPORT unsigned long XvScreenGeneration;
|
||||
extern _X_EXPORT unsigned long XvResourceGeneration;
|
||||
|
||||
extern _X_EXPORT int XvReqCode;
|
||||
extern _X_EXPORT int XvEventBase;
|
||||
extern _X_EXPORT int XvErrorBase;
|
||||
|
||||
extern _X_EXPORT RESTYPE XvRTPort;
|
||||
extern _X_EXPORT RESTYPE XvRTEncoding;
|
||||
extern _X_EXPORT RESTYPE XvRTGrab;
|
||||
extern _X_EXPORT RESTYPE XvRTVideoNotify;
|
||||
extern _X_EXPORT RESTYPE XvRTVideoNotifyList;
|
||||
extern _X_EXPORT RESTYPE XvRTPortNotify;
|
||||
|
||||
typedef struct {
|
||||
int numerator;
|
||||
int denominator;
|
||||
|
|
@ -70,7 +85,18 @@ typedef struct {
|
|||
ClientPtr client;
|
||||
} XvGrabRec, *XvGrabPtr;
|
||||
|
||||
typedef struct _XvPortNotifyRec *XvPortNotifyPtr;
|
||||
typedef struct _XvVideoNotifyRec {
|
||||
struct _XvVideoNotifyRec *next;
|
||||
ClientPtr client;
|
||||
unsigned long id;
|
||||
unsigned long mask;
|
||||
} XvVideoNotifyRec, *XvVideoNotifyPtr;
|
||||
|
||||
typedef struct _XvPortNotifyRec {
|
||||
struct _XvPortNotifyRec *next;
|
||||
ClientPtr client;
|
||||
unsigned long id;
|
||||
} XvPortNotifyRec, *XvPortNotifyPtr;
|
||||
|
||||
typedef struct {
|
||||
int id;
|
||||
|
|
@ -169,6 +195,14 @@ typedef struct _XvPortRec {
|
|||
DevUnion devPriv;
|
||||
} XvPortRec, *XvPortPtr;
|
||||
|
||||
#define VALIDATE_XV_PORT(portID, pPort, mode)\
|
||||
{\
|
||||
int rc = dixLookupResourceByType((void **)&(pPort), portID,\
|
||||
XvRTPort, client, mode);\
|
||||
if (rc != Success)\
|
||||
return rc;\
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
int version, revision;
|
||||
int nAdaptors;
|
||||
|
|
@ -178,8 +212,51 @@ typedef struct {
|
|||
CloseScreenProcPtr CloseScreen;
|
||||
} XvScreenRec, *XvScreenPtr;
|
||||
|
||||
#define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = ((XvScreenPtr) \
|
||||
dixLookupPrivate(&(pScreen)->devPrivates, XvScreenKey))->field)
|
||||
|
||||
#define SCREEN_EPILOGUE(pScreen, field, wrapper)\
|
||||
((pScreen)->field = wrapper)
|
||||
|
||||
/* Errors */
|
||||
|
||||
#define _XvBadPort (XvBadPort+XvErrorBase)
|
||||
#define _XvBadEncoding (XvBadEncoding+XvErrorBase)
|
||||
|
||||
extern _X_EXPORT int ProcXvDispatch(ClientPtr);
|
||||
extern _X_EXPORT int SProcXvDispatch(ClientPtr);
|
||||
|
||||
extern _X_EXPORT int XvScreenInit(ScreenPtr);
|
||||
extern _X_EXPORT DevPrivateKey XvGetScreenKey(void);
|
||||
extern _X_EXPORT unsigned long XvGetRTPort(void);
|
||||
extern _X_EXPORT void XvFreeAdaptor(XvAdaptorPtr pAdaptor);
|
||||
extern void _X_EXPORT XvFillColorKey(DrawablePtr pDraw, CARD32 key,
|
||||
RegionPtr region);
|
||||
extern _X_EXPORT int XvdiSendPortNotify(XvPortPtr, Atom, INT32);
|
||||
|
||||
extern _X_EXPORT int XvdiPutVideo(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
|
||||
INT16, INT16, CARD16, CARD16,
|
||||
INT16, INT16, CARD16, CARD16);
|
||||
extern _X_EXPORT int XvdiPutStill(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
|
||||
INT16, INT16, CARD16, CARD16,
|
||||
INT16, INT16, CARD16, CARD16);
|
||||
extern _X_EXPORT int XvdiGetVideo(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
|
||||
INT16, INT16, CARD16, CARD16,
|
||||
INT16, INT16, CARD16, CARD16);
|
||||
extern _X_EXPORT int XvdiGetStill(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
|
||||
INT16, INT16, CARD16, CARD16,
|
||||
INT16, INT16, CARD16, CARD16);
|
||||
extern _X_EXPORT int XvdiPutImage(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
|
||||
INT16, INT16, CARD16, CARD16,
|
||||
INT16, INT16, CARD16, CARD16,
|
||||
XvImagePtr, unsigned char *, Bool,
|
||||
CARD16, CARD16);
|
||||
extern _X_EXPORT int XvdiSelectVideoNotify(ClientPtr, DrawablePtr, BOOL);
|
||||
extern _X_EXPORT int XvdiSelectPortNotify(ClientPtr, XvPortPtr, BOOL);
|
||||
extern _X_EXPORT int XvdiSetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32);
|
||||
extern _X_EXPORT int XvdiGetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32 *);
|
||||
extern _X_EXPORT int XvdiStopVideo(ClientPtr, XvPortPtr, DrawablePtr);
|
||||
extern _X_EXPORT int XvdiMatchPort(XvPortPtr, DrawablePtr);
|
||||
extern _X_EXPORT int XvdiGrabPort(ClientPtr, XvPortPtr, Time, int *);
|
||||
extern _X_EXPORT int XvdiUngrabPort(ClientPtr, XvPortPtr, Time);
|
||||
#endif /* XVDIX_H */
|
||||
|
|
|
|||
|
|
@ -1,84 +0,0 @@
|
|||
/* SPDX-License-Identifier: MIT OR X11
|
||||
*
|
||||
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
|
||||
*/
|
||||
#ifndef _XORG_XVDIX_PRIV_H
|
||||
|
||||
#include <X11/Xdefs.h>
|
||||
|
||||
#include "include/pixmap.h"
|
||||
#include "include/regionstr.h"
|
||||
#include "Xext/xvdix.h"
|
||||
|
||||
#define VALIDATE_XV_PORT(portID, pPort, mode)\
|
||||
{\
|
||||
int rc = dixLookupResourceByType((void **)&(pPort), portID,\
|
||||
XvRTPort, client, mode);\
|
||||
if (rc != Success)\
|
||||
return rc;\
|
||||
}
|
||||
|
||||
/* Errors */
|
||||
|
||||
#define _XvBadPort (XvBadPort+XvErrorBase)
|
||||
|
||||
typedef struct _XvPortNotifyRec {
|
||||
struct _XvPortNotifyRec *next;
|
||||
ClientPtr client;
|
||||
unsigned long id;
|
||||
} XvPortNotifyRec, *XvPortNotifyPtr;
|
||||
|
||||
extern int XvReqCode;
|
||||
extern int XvErrorBase;
|
||||
|
||||
extern RESTYPE XvRTPort;
|
||||
|
||||
/* dispatch functions */
|
||||
int ProcXvDispatch(ClientPtr);
|
||||
int SProcXvDispatch(ClientPtr);
|
||||
|
||||
void XvFreeAdaptor(XvAdaptorPtr pAdaptor);
|
||||
|
||||
void XvFillColorKey(DrawablePtr pDraw, CARD32 key, RegionPtr region);
|
||||
|
||||
int XvdiSelectVideoNotify(ClientPtr client, DrawablePtr pDraw, BOOL onoff);
|
||||
int XvdiSelectPortNotify(ClientPtr client, XvPortPtr pPort, BOOL onoff);
|
||||
|
||||
int XvdiPutVideo(ClientPtr client, DrawablePtr pDraw, XvPortPtr pPort,
|
||||
GCPtr pGC, INT16 vid_x, INT16 vid_y, CARD16 vid_w,
|
||||
CARD16 wid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w,
|
||||
CARD16 drw_h);
|
||||
int XvdiPutStill(ClientPtr client, DrawablePtr pDraw, XvPortPtr pPort,
|
||||
GCPtr pGC, INT16 vid_x, INT16 vid_y, CARD16 vid_w,
|
||||
CARD16 vid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w,
|
||||
CARD16 drw_h);
|
||||
int XvdiPutImage(ClientPtr client, DrawablePtr pDraw, XvPortPtr pPort,
|
||||
GCPtr pGC, INT16 src_x, INT16 src_y, CARD16 src_w,
|
||||
CARD16 src_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w,
|
||||
CARD16 drw_h, XvImagePtr image, unsigned char *data,
|
||||
Bool sync, CARD16 width, CARD16 height);
|
||||
|
||||
int XvdiGetVideo(ClientPtr client, DrawablePtr pDraw, XvPortPtr pPort,
|
||||
GCPtr pGC, INT16 vid_x, INT16 vid_y, CARD16 vid_w,
|
||||
CARD16 vid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w,
|
||||
CARD16 drw_h);
|
||||
int XvdiGetStill(ClientPtr client, DrawablePtr pDraw, XvPortPtr pPort,
|
||||
GCPtr pGC, INT16 vid_x, INT16 vid_y, CARD16 vid_w,
|
||||
CARD16 vid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w,
|
||||
CARD16 drw_h);
|
||||
|
||||
int XvdiSetPortAttribute(ClientPtr client, XvPortPtr pPort, Atom attribute,
|
||||
INT32 value);
|
||||
int XvdiGetPortAttribute(ClientPtr client, XvPortPtr pPort, Atom attribute,
|
||||
INT32 *p_value);
|
||||
|
||||
int XvdiStopVideo(ClientPtr client, XvPortPtr pPort, DrawablePtr pDraw);
|
||||
|
||||
int XvdiMatchPort(XvPortPtr pPort, DrawablePtr pDraw);
|
||||
|
||||
int XvdiGrabPort(ClientPtr client, XvPortPtr pPort, Time ctime, int *p_result);
|
||||
int XvdiUngrabPort(ClientPtr client, XvPortPtr pPort, Time ctime);
|
||||
|
||||
XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id);
|
||||
|
||||
#endif /* _XORG_XVDIX_PRIV_H */
|
||||
|
|
@ -73,16 +73,14 @@ SOFTWARE.
|
|||
**
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/extensions/Xv.h>
|
||||
#include <X11/extensions/Xvproto.h>
|
||||
|
||||
#include "Xext/xvdix_priv.h"
|
||||
|
||||
#include "misc.h"
|
||||
#include "os.h"
|
||||
#include "scrnintstr.h"
|
||||
|
|
@ -90,50 +88,41 @@ SOFTWARE.
|
|||
#include "pixmapstr.h"
|
||||
#include "gcstruct.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit_priv.h"
|
||||
#include "extinit.h"
|
||||
#include "dixstruct.h"
|
||||
#include "resource.h"
|
||||
#include "opaque.h"
|
||||
#include "input.h"
|
||||
|
||||
#ifdef XINERAMA
|
||||
#define GLOBAL
|
||||
|
||||
#include <X11/extensions/Xv.h>
|
||||
#include <X11/extensions/Xvproto.h>
|
||||
#include "xvdix.h"
|
||||
|
||||
#ifdef PANORAMIX
|
||||
#include "panoramiX.h"
|
||||
#include "panoramiXsrv.h"
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
#include "xvdisp.h"
|
||||
|
||||
#define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = ((XvScreenPtr) \
|
||||
dixLookupPrivate(&(pScreen)->devPrivates, XvScreenKey))->field)
|
||||
|
||||
#define SCREEN_EPILOGUE(pScreen, field, wrapper)\
|
||||
((pScreen)->field = wrapper)
|
||||
|
||||
typedef struct _XvVideoNotifyRec {
|
||||
struct _XvVideoNotifyRec *next;
|
||||
ClientPtr client;
|
||||
unsigned long id;
|
||||
unsigned long mask;
|
||||
} XvVideoNotifyRec, *XvVideoNotifyPtr;
|
||||
|
||||
static DevPrivateKeyRec XvScreenKeyRec;
|
||||
|
||||
Bool noXvExtension = FALSE;
|
||||
|
||||
#define XvScreenKey (&XvScreenKeyRec)
|
||||
static unsigned long XvExtensionGeneration = 0;
|
||||
static unsigned long XvScreenGeneration = 0;
|
||||
static unsigned long XvResourceGeneration = 0;
|
||||
unsigned long XvExtensionGeneration = 0;
|
||||
unsigned long XvScreenGeneration = 0;
|
||||
unsigned long XvResourceGeneration = 0;
|
||||
|
||||
int XvReqCode;
|
||||
static int XvEventBase;
|
||||
int XvEventBase;
|
||||
int XvErrorBase;
|
||||
|
||||
RESTYPE XvRTPort;
|
||||
static RESTYPE XvRTEncoding;
|
||||
static RESTYPE XvRTGrab;
|
||||
static RESTYPE XvRTVideoNotify;
|
||||
static RESTYPE XvRTVideoNotifyList;
|
||||
static RESTYPE XvRTPortNotify;
|
||||
RESTYPE XvRTEncoding;
|
||||
RESTYPE XvRTGrab;
|
||||
RESTYPE XvRTVideoNotify;
|
||||
RESTYPE XvRTVideoNotifyList;
|
||||
RESTYPE XvRTPortNotify;
|
||||
|
||||
/* EXTERNAL */
|
||||
|
||||
|
|
@ -174,9 +163,9 @@ XvExtensionInit(void)
|
|||
ErrorF("XvExtensionInit: Unable to allocate resource types\n");
|
||||
return;
|
||||
}
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
XineramaRegisterConnectionBlockCallback(XineramifyXv);
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
XvScreenGeneration = serverGeneration;
|
||||
}
|
||||
|
||||
|
|
@ -267,9 +256,9 @@ XvScreenInit(ScreenPtr pScreen)
|
|||
ErrorF("XvScreenInit: Unable to allocate resource types\n");
|
||||
return BadAlloc;
|
||||
}
|
||||
#ifdef XINERAMA
|
||||
#ifdef PANORAMIX
|
||||
XineramaRegisterConnectionBlockCallback(XineramifyXv);
|
||||
#endif /* XINERAMA */
|
||||
#endif
|
||||
XvScreenGeneration = serverGeneration;
|
||||
}
|
||||
|
||||
|
|
@ -371,14 +360,13 @@ static Bool
|
|||
XvDestroyPixmap(PixmapPtr pPix)
|
||||
{
|
||||
ScreenPtr pScreen = pPix->drawable.pScreen;
|
||||
Bool status = TRUE;
|
||||
Bool status;
|
||||
|
||||
if (pPix->refcnt == 1)
|
||||
XvStopAdaptors(&pPix->drawable);
|
||||
|
||||
SCREEN_PROLOGUE(pScreen, DestroyPixmap);
|
||||
if (pScreen->DestroyPixmap)
|
||||
status = pScreen->DestroyPixmap(pPix);
|
||||
status = (*pScreen->DestroyPixmap) (pPix);
|
||||
SCREEN_EPILOGUE(pScreen, DestroyPixmap, XvDestroyPixmap);
|
||||
|
||||
return status;
|
||||
|
|
@ -481,7 +469,7 @@ XvdiSendVideoNotify(XvPortPtr pPort, DrawablePtr pDraw, int reason)
|
|||
|
||||
}
|
||||
|
||||
static int
|
||||
int
|
||||
XvdiSendPortNotify(XvPortPtr pPort, Atom attribute, INT32 value)
|
||||
{
|
||||
XvPortNotifyPtr pn;
|
||||
|
|
|
|||
17
Xext/xvmc.c
17
Xext/xvmc.c
|
|
@ -1,21 +1,22 @@
|
|||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
|
||||
#include "Xext/xvdix_priv.h"
|
||||
|
||||
#include "misc.h"
|
||||
#include "os.h"
|
||||
#include "dixstruct.h"
|
||||
#include "resource.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit_priv.h"
|
||||
#include "extinit.h"
|
||||
#include "servermd.h"
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include "xvdix.h"
|
||||
#include <X11/extensions/XvMC.h>
|
||||
#include <X11/extensions/Xvproto.h>
|
||||
#include <X11/extensions/XvMCproto.h>
|
||||
|
|
@ -43,6 +44,8 @@ static RESTYPE XvMCRTContext;
|
|||
static RESTYPE XvMCRTSurface;
|
||||
static RESTYPE XvMCRTSubpicture;
|
||||
|
||||
int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr) = NULL;
|
||||
|
||||
typedef struct {
|
||||
int num_adaptors;
|
||||
XvMCAdaptorPtr adaptors;
|
||||
|
|
@ -287,7 +290,7 @@ ProcXvMCDestroyContext(ClientPtr client)
|
|||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
FreeResource(stuff->context_id, X11_RESTYPE_NONE);
|
||||
FreeResource(stuff->context_id, RT_NONE);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
@ -365,7 +368,7 @@ ProcXvMCDestroySurface(ClientPtr client)
|
|||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
FreeResource(stuff->surface_id, X11_RESTYPE_NONE);
|
||||
FreeResource(stuff->surface_id, RT_NONE);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
@ -493,7 +496,7 @@ ProcXvMCDestroySubpicture(ClientPtr client)
|
|||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
FreeResource(stuff->subpicture_id, X11_RESTYPE_NONE);
|
||||
FreeResource(stuff->subpicture_id, RT_NONE);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,9 +84,13 @@ typedef struct {
|
|||
XvMCDestroySubpictureProcPtr DestroySubpicture;
|
||||
} XvMCAdaptorRec, *XvMCAdaptorPtr;
|
||||
|
||||
extern int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr);
|
||||
|
||||
extern _X_EXPORT int XvMCScreenInit(ScreenPtr pScreen,
|
||||
int num, XvMCAdaptorPtr adapt);
|
||||
|
||||
extern _X_EXPORT XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id);
|
||||
|
||||
extern _X_EXPORT int xf86XvMCRegisterDRInfo(ScreenPtr pScreen, const char *name,
|
||||
const char *busID, int major, int minor,
|
||||
int patchLevel);
|
||||
|
|
|
|||
19
Xi/allowev.c
19
Xi/allowev.c
|
|
@ -50,16 +50,16 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "dix/input_priv.h"
|
||||
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "allowev.h"
|
||||
#include "dixevents.h"
|
||||
|
||||
|
|
@ -73,6 +73,7 @@ int _X_COLD
|
|||
SProcXAllowDeviceEvents(ClientPtr client)
|
||||
{
|
||||
REQUEST(xAllowDeviceEventsReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
|
||||
swapl(&stuff->time);
|
||||
return (ProcXAllowDeviceEvents(client));
|
||||
|
|
@ -101,22 +102,22 @@ ProcXAllowDeviceEvents(ClientPtr client)
|
|||
|
||||
switch (stuff->mode) {
|
||||
case ReplayThisDevice:
|
||||
AllowSome(client, time, thisdev, GRAB_STATE_NOT_GRABBED);
|
||||
AllowSome(client, time, thisdev, NOT_GRABBED);
|
||||
break;
|
||||
case SyncThisDevice:
|
||||
AllowSome(client, time, thisdev, GRAB_STATE_FREEZE_NEXT_EVENT);
|
||||
AllowSome(client, time, thisdev, FREEZE_NEXT_EVENT);
|
||||
break;
|
||||
case AsyncThisDevice:
|
||||
AllowSome(client, time, thisdev, GRAB_STATE_THAWED);
|
||||
AllowSome(client, time, thisdev, THAWED);
|
||||
break;
|
||||
case AsyncOtherDevices:
|
||||
AllowSome(client, time, thisdev, GRAB_STATE_THAW_OTHERS);
|
||||
AllowSome(client, time, thisdev, THAW_OTHERS);
|
||||
break;
|
||||
case SyncAll:
|
||||
AllowSome(client, time, thisdev, GRAB_STATE_FREEZE_BOTH_NEXT_EVENT);
|
||||
AllowSome(client, time, thisdev, FREEZE_BOTH_NEXT_EVENT);
|
||||
break;
|
||||
case AsyncAll:
|
||||
AllowSome(client, time, thisdev, GRAB_STATE_THAWED_BOTH);
|
||||
AllowSome(client, time, thisdev, THAWED_BOTH);
|
||||
break;
|
||||
default:
|
||||
client->errorValue = stuff->mode;
|
||||
|
|
|
|||
16
Xi/chgdctl.c
16
Xi/chgdctl.c
|
|
@ -50,17 +50,18 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h> /* control constants */
|
||||
|
||||
#include "dix/exevents_priv.h"
|
||||
#include "dix/input_priv.h"
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h> /* control constants */
|
||||
#include "XIstubs.h"
|
||||
|
||||
#include "exglobals.h"
|
||||
#include "exevents.h"
|
||||
|
||||
#include "chgdctl.h"
|
||||
|
||||
/***********************************************************************
|
||||
|
|
@ -76,6 +77,7 @@ SProcXChangeDeviceControl(ClientPtr client)
|
|||
xDeviceCtl *ctl;
|
||||
|
||||
REQUEST(xChangeDeviceControlReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
|
||||
swaps(&stuff->control);
|
||||
ctl = (xDeviceCtl *) &stuff[1];
|
||||
|
|
@ -115,7 +117,7 @@ ProcXChangeDeviceControl(ClientPtr client)
|
|||
REQUEST(xChangeDeviceControlReq);
|
||||
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
|
||||
|
||||
len = client->req_len - bytes_to_int32(sizeof(xChangeDeviceControlReq));
|
||||
len = stuff->length - bytes_to_int32(sizeof(xChangeDeviceControlReq));
|
||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
||||
if (ret != Success)
|
||||
goto out;
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
|
|
@ -73,6 +75,7 @@ int _X_COLD
|
|||
SProcXChangeFeedbackControl(ClientPtr client)
|
||||
{
|
||||
REQUEST(xChangeFeedbackControlReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
|
||||
swapl(&stuff->mask);
|
||||
return (ProcXChangeFeedbackControl(client));
|
||||
|
|
@ -435,7 +438,7 @@ ProcXChangeFeedbackControl(ClientPtr client)
|
|||
REQUEST(xChangeFeedbackControlReq);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
|
||||
|
||||
len = client->req_len - bytes_to_int32(sizeof(xChangeFeedbackControlReq));
|
||||
len = stuff->length - bytes_to_int32(sizeof(xChangeFeedbackControlReq));
|
||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
|
|
|||
19
Xi/chgkbd.c
19
Xi/chgkbd.c
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
|
|
@ -69,6 +71,23 @@ SOFTWARE.
|
|||
* This procedure changes the keyboard device.
|
||||
*
|
||||
*/
|
||||
|
||||
int _X_COLD
|
||||
SProcXChangeKeyboardDevice(ClientPtr client)
|
||||
{
|
||||
REQUEST(xChangeKeyboardDeviceReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
|
||||
return (ProcXChangeKeyboardDevice(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure is invoked to swap the request bytes if the server and
|
||||
* client have a different byte order.
|
||||
*
|
||||
*/
|
||||
|
||||
int
|
||||
ProcXChangeKeyboardDevice(ClientPtr client)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef CHGKBD_H
|
||||
#define CHGKBD_H 1
|
||||
|
||||
int SProcXChangeKeyboardDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXChangeKeyboardDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
|
|
|
|||
13
Xi/chgkmap.c
13
Xi/chgkmap.c
|
|
@ -50,14 +50,14 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/exevents_priv.h"
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "chgkmap.h"
|
||||
|
|
@ -75,6 +75,7 @@ SProcXChangeDeviceKeyMapping(ClientPtr client)
|
|||
unsigned int count;
|
||||
|
||||
REQUEST(xChangeDeviceKeyMappingReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
|
||||
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
|
||||
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
|
||||
|
|
@ -105,7 +106,7 @@ ProcXChangeDeviceKeyMapping(ClientPtr client)
|
|||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
len = client->req_len - bytes_to_int32(sizeof(xChangeDeviceKeyMappingReq));
|
||||
len = stuff->length - bytes_to_int32(sizeof(xChangeDeviceKeyMappingReq));
|
||||
|
||||
ret = ChangeKeyMapping(client, dev, len, DeviceMappingNotify,
|
||||
stuff->firstKeyCode, stuff->keyCodes,
|
||||
|
|
|
|||
15
Xi/chgprop.c
15
Xi/chgprop.c
|
|
@ -50,18 +50,18 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "dix/exevents_priv.h"
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "chgprop.h"
|
||||
#include "grabdev.h"
|
||||
|
||||
|
|
@ -75,6 +75,7 @@ int _X_COLD
|
|||
SProcXChangeDeviceDontPropagateList(ClientPtr client)
|
||||
{
|
||||
REQUEST(xChangeDeviceDontPropagateListReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
|
||||
swapl(&stuff->window);
|
||||
swaps(&stuff->count);
|
||||
|
|
@ -101,7 +102,7 @@ ProcXChangeDeviceDontPropagateList(ClientPtr client)
|
|||
REQUEST(xChangeDeviceDontPropagateListReq);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
|
||||
|
||||
if (client->req_len !=
|
||||
if (stuff->length !=
|
||||
bytes_to_int32(sizeof(xChangeDeviceDontPropagateListReq)) +
|
||||
stuff->count)
|
||||
return BadLength;
|
||||
|
|
|
|||
18
Xi/chgptr.c
18
Xi/chgptr.c
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
|
|
@ -65,6 +67,22 @@ SOFTWARE.
|
|||
|
||||
#include "chgptr.h"
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure is invoked to swap the request bytes if the server and
|
||||
* client have a different byte order.
|
||||
*
|
||||
*/
|
||||
|
||||
int _X_COLD
|
||||
SProcXChangePointerDevice(ClientPtr client)
|
||||
{
|
||||
REQUEST(xChangePointerDeviceReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
|
||||
return (ProcXChangePointerDevice(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure changes the device used as the X pointer.
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef CHGPTR_H
|
||||
#define CHGPTR_H 1
|
||||
|
||||
int SProcXChangePointerDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXChangePointerDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
|
|
@ -62,6 +64,21 @@ SOFTWARE.
|
|||
|
||||
#include "closedev.h"
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure closes an input device.
|
||||
*
|
||||
*/
|
||||
|
||||
int _X_COLD
|
||||
SProcXCloseDevice(ClientPtr client)
|
||||
{
|
||||
REQUEST(xCloseDeviceReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xCloseDeviceReq);
|
||||
return (ProcXCloseDevice(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Clear out event selections and passive grabs from a window for the
|
||||
|
|
@ -85,7 +102,7 @@ DeleteDeviceEvents(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
|
|||
next = grab->next;
|
||||
if ((grab->device == dev) &&
|
||||
(client->clientAsMask == CLIENT_BITS(grab->resource)))
|
||||
FreeResource(grab->resource, X11_RESTYPE_NONE);
|
||||
FreeResource(grab->resource, RT_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef CLOSEDEV_H
|
||||
#define CLOSEDEV_H 1
|
||||
|
||||
int SProcXCloseDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXCloseDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
|
|
|
|||
17
Xi/devbell.c
17
Xi/devbell.c
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
|
|
@ -59,6 +61,21 @@ SOFTWARE.
|
|||
|
||||
#include "devbell.h"
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure is invoked to swap the request bytes if the server and
|
||||
* client have a different byte order.
|
||||
*
|
||||
*/
|
||||
|
||||
int _X_COLD
|
||||
SProcXDeviceBell(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDeviceBellReq);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXDeviceBell(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure rings a bell on an extension device.
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef DEVBELL_H
|
||||
#define DEVBELL_H 1
|
||||
|
||||
int SProcXDeviceBell(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXDeviceBell(ClientPtr /* client */
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -78,37 +78,38 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "inputstr.h"
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/extensions/geproto.h>
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include <X11/extensions/XI2proto.h>
|
||||
#include <X11/extensions/XKBproto.h>
|
||||
#include <X11/extensions/geproto.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "dix/dixgrabs_priv.h"
|
||||
#include "dix/eventconvert.h"
|
||||
#include "dix/exevents_priv.h"
|
||||
#include "dix/input_priv.h"
|
||||
#include "mi/mi_priv.h"
|
||||
|
||||
#include "inputstr.h"
|
||||
#include "windowstr.h"
|
||||
#include "miscstruct.h"
|
||||
#include "region.h"
|
||||
#include "exevents.h"
|
||||
#include "extnsionst.h"
|
||||
#include "exglobals.h"
|
||||
#include "eventstr.h"
|
||||
#include "dixevents.h" /* DeliverFocusedEvent */
|
||||
#include "dixgrabs.h" /* CreateGrab() */
|
||||
#include "scrnintstr.h"
|
||||
#include "listdev.h" /* for CopySwapXXXClass */
|
||||
#include "xace.h"
|
||||
#include "xiquerydevice.h" /* For List*Info */
|
||||
#include "eventstr.h"
|
||||
#include "inpututils.h"
|
||||
#include "mi.h"
|
||||
|
||||
#include <X11/extensions/XKBproto.h>
|
||||
#include "xkbsrv.h"
|
||||
|
||||
#define WID(w) ((w) ? ((w)->drawable.id) : 0)
|
||||
|
|
@ -614,7 +615,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
|
|||
|
||||
if (from->button->xkb_acts) {
|
||||
size_t maxbuttons = max(to->button->numButtons, from->button->numButtons);
|
||||
to->button->xkb_acts = XNFreallocarray(to->button->xkb_acts,
|
||||
to->button->xkb_acts = xnfreallocarray(to->button->xkb_acts,
|
||||
maxbuttons,
|
||||
sizeof(XkbAction));
|
||||
memset(to->button->xkb_acts, 0, maxbuttons * sizeof(XkbAction));
|
||||
|
|
@ -1093,7 +1094,7 @@ DeliverOneTouchEvent(ClientPtr client, DeviceIntPtr dev, TouchPointInfoPtr ti,
|
|||
|
||||
FixUpEventFromWindow(&ti->sprite, xi2, win, child, FALSE);
|
||||
filter = GetEventFilter(dev, xi2);
|
||||
if (XaceHookReceiveAccess(client, win, xi2, 1) != Success)
|
||||
if (XaceHook(XACE_RECEIVE_ACCESS, client, win, xi2, 1) != Success)
|
||||
return FALSE;
|
||||
err = TryClientEvents(client, dev, xi2, 1, filter, filter, NullGrab);
|
||||
free(xi2);
|
||||
|
|
@ -1386,7 +1387,6 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
|||
else
|
||||
evtype = GetXI2Type(ev->any.type);
|
||||
|
||||
BUG_RETURN_VAL(!wOtherInputMasks(*win), FALSE);
|
||||
nt_list_for_each_entry(iclients,
|
||||
wOtherInputMasks(*win)->inputClients, next)
|
||||
if (xi2mask_isset(iclients->xi2mask, dev, evtype))
|
||||
|
|
@ -1401,7 +1401,6 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
|||
int xi_type = GetXIType(TouchGetPointerEventType(ev));
|
||||
Mask xi_filter = event_get_filter_from_type(dev, xi_type);
|
||||
|
||||
BUG_RETURN_VAL(!wOtherInputMasks(*win), FALSE);
|
||||
nt_list_for_each_entry(iclients,
|
||||
wOtherInputMasks(*win)->inputClients, next)
|
||||
if (iclients->mask[dev->id] & xi_filter)
|
||||
|
|
@ -1539,7 +1538,7 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
|||
l = &ti->listeners[ti->num_listeners - 1];
|
||||
l->listener = g->resource;
|
||||
l->grab = g;
|
||||
//l->resource_type = X11_RESTYPE_NONE;
|
||||
//l->resource_type = RT_NONE;
|
||||
|
||||
if (devgrab->grabtype != XI2 || devgrab->type != XI_TouchBegin)
|
||||
l->type = TOUCH_LISTENER_POINTER_GRAB;
|
||||
|
|
@ -1881,7 +1880,7 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
|
|||
int count;
|
||||
|
||||
if (EventToCore(ev, &core, &count) == Success && count > 0) {
|
||||
XaceHookKeyAvail(core, device, 0);
|
||||
XaceHook(XACE_KEY_AVAIL, core, device, 0);
|
||||
free(core);
|
||||
}
|
||||
}
|
||||
|
|
@ -2241,7 +2240,7 @@ DeliverOneGestureEvent(ClientPtr client, DeviceIntPtr dev, GestureInfoPtr gi,
|
|||
|
||||
FixUpEventFromWindow(&gi->sprite, xi2, win, child, FALSE);
|
||||
filter = GetEventFilter(dev, xi2);
|
||||
if (XaceHookReceiveAccess(client, win, xi2, 1) != Success)
|
||||
if (XaceHook(XACE_RECEIVE_ACCESS, client, win, xi2, 1) != Success)
|
||||
return FALSE;
|
||||
err = TryClientEvents(client, dev, xi2, 1, filter, filter, NullGrab);
|
||||
free(xi2);
|
||||
|
|
@ -2291,7 +2290,6 @@ RetrieveGestureDeliveryData(DeviceIntPtr dev, InternalEvent *ev, GestureListener
|
|||
listener->type == GESTURE_LISTENER_REGULAR */
|
||||
evtype = GetXI2Type(ev->any.type);
|
||||
|
||||
BUG_RETURN_VAL(!wOtherInputMasks(*win), FALSE);
|
||||
nt_list_for_each_entry(iclients, wOtherInputMasks(*win)->inputClients, next)
|
||||
if (xi2mask_isset(iclients->xi2mask, dev, evtype))
|
||||
break;
|
||||
|
|
@ -2506,7 +2504,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
|
|||
cursor = NullCursor;
|
||||
else {
|
||||
rc = dixLookupResourceByType((void **) &cursor, param->cursor,
|
||||
X11_RESTYPE_CURSOR, client, DixUseAccess);
|
||||
RT_CURSOR, client, DixUseAccess);
|
||||
if (rc != Success) {
|
||||
client->errorValue = param->cursor;
|
||||
return rc;
|
||||
|
|
@ -2516,7 +2514,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
|
|||
if (param->this_device_mode == GrabModeSync ||
|
||||
param->other_devices_mode == GrabModeSync)
|
||||
access_mode |= DixFreezeAccess;
|
||||
rc = XaceHookDeviceAccess(client, dev, access_mode);
|
||||
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess);
|
||||
|
|
@ -2572,7 +2570,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
|
|||
if (param->this_device_mode == GrabModeSync ||
|
||||
param->other_devices_mode == GrabModeSync)
|
||||
access_mode |= DixFreezeAccess;
|
||||
rc = XaceHookDeviceAccess(client, dev, access_mode);
|
||||
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
|
|
@ -2605,7 +2603,7 @@ GrabWindow(ClientPtr client, DeviceIntPtr dev, int type,
|
|||
cursor = NullCursor;
|
||||
else {
|
||||
rc = dixLookupResourceByType((void **) &cursor, param->cursor,
|
||||
X11_RESTYPE_CURSOR, client, DixUseAccess);
|
||||
RT_CURSOR, client, DixUseAccess);
|
||||
if (rc != Success) {
|
||||
client->errorValue = param->cursor;
|
||||
return rc;
|
||||
|
|
@ -2615,7 +2613,7 @@ GrabWindow(ClientPtr client, DeviceIntPtr dev, int type,
|
|||
if (param->this_device_mode == GrabModeSync ||
|
||||
param->other_devices_mode == GrabModeSync)
|
||||
access_mode |= DixFreezeAccess;
|
||||
rc = XaceHookDeviceAccess(client, dev, access_mode);
|
||||
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
|
|
@ -2646,7 +2644,7 @@ GrabTouchOrGesture(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr mod_dev,
|
|||
rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
rc = XaceHookDeviceAccess(client, dev, DixGrabAccess);
|
||||
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixGrabAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
|
|
@ -2693,7 +2691,7 @@ SelectForWindow(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client,
|
|||
if (i == EMASKSIZE) {
|
||||
RecalculateDeviceDeliverableEvents(pWin);
|
||||
if (ShouldFreeInputMasks(pWin, FALSE))
|
||||
FreeResource(others->resource, X11_RESTYPE_NONE);
|
||||
FreeResource(others->resource, RT_NONE);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
|
@ -2959,7 +2957,7 @@ SendEvent(ClientPtr client, DeviceIntPtr d, Window dest, Bool propagate,
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if (!XaceHookSendAccess(client, NULL, pWin, ev, count))
|
||||
else if (!XaceHook(XACE_SEND_ACCESS, client, NULL, pWin, ev, count))
|
||||
DeliverEventsToWindow(d, pWin, ev, count, mask, NullGrab);
|
||||
return Success;
|
||||
}
|
||||
|
|
@ -3120,7 +3118,7 @@ DeleteWindowFromAnyExtEvents(WindowPtr pWin, Bool freeResources)
|
|||
ic = inputMasks->inputClients;
|
||||
for (i = 0; i < EMASKSIZE; i++)
|
||||
inputMasks->dontPropagateMask[i] = 0;
|
||||
FreeResource(ic->resource, X11_RESTYPE_NONE);
|
||||
FreeResource(ic->resource, RT_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3236,19 +3234,14 @@ DeviceEventSuppressForWindow(WindowPtr pWin, ClientPtr client, Mask mask,
|
|||
inputMasks->dontPropagateMask[maskndx] = mask;
|
||||
}
|
||||
else {
|
||||
if (!inputMasks) {
|
||||
int ret = AddExtensionClient(pWin, client, 0, 0);
|
||||
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
inputMasks = wOtherInputMasks(pWin);
|
||||
BUG_RETURN_VAL(!inputMasks, BadAlloc);
|
||||
}
|
||||
if (!inputMasks)
|
||||
AddExtensionClient(pWin, client, 0, 0);
|
||||
inputMasks = wOtherInputMasks(pWin);
|
||||
inputMasks->dontPropagateMask[maskndx] = mask;
|
||||
}
|
||||
RecalculateDeviceDeliverableEvents(pWin);
|
||||
if (inputMasks && ShouldFreeInputMasks(pWin, FALSE))
|
||||
FreeResource(inputMasks->inputClients->resource, X11_RESTYPE_NONE);
|
||||
if (ShouldFreeInputMasks(pWin, FALSE))
|
||||
FreeResource(inputMasks->inputClients->resource, RT_NONE);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
@ -3342,7 +3335,6 @@ XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client,
|
|||
if (len && !others) {
|
||||
if (AddExtensionClient(win, client, 0, 0) != Success)
|
||||
return BadAlloc;
|
||||
BUG_RETURN_VAL(!wOtherInputMasks(win), BadAlloc);
|
||||
others = wOtherInputMasks(win)->inputClients;
|
||||
}
|
||||
|
||||
|
|
|
|||
56
Xi/extinit.c
56
Xi/extinit.c
|
|
@ -51,22 +51,22 @@ SOFTWARE.
|
|||
*/
|
||||
#define NUMTYPES 15
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include <X11/extensions/XI2proto.h>
|
||||
#include <X11/extensions/geproto.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "dix/exevents_priv.h"
|
||||
#endif
|
||||
|
||||
#include "inputstr.h"
|
||||
#include "gcstruct.h" /* pointer for extnsionst.h */
|
||||
#include "extnsionst.h" /* extension entry */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include <X11/extensions/XI2proto.h>
|
||||
#include <X11/extensions/geproto.h>
|
||||
#include "geext.h" /* extension interfaces for ge */
|
||||
|
||||
#include "dixevents.h"
|
||||
#include "extinit_priv.h"
|
||||
#include "exevents.h"
|
||||
#include "extinit.h"
|
||||
#include "exglobals.h"
|
||||
#include "swaprep.h"
|
||||
#include "privates.h"
|
||||
|
|
@ -252,19 +252,19 @@ static int (*ProcIVector[]) (ClientPtr) = {
|
|||
|
||||
/* For swapped clients */
|
||||
static int (*SProcIVector[]) (ClientPtr) = {
|
||||
NULL, /* 0 */
|
||||
NULL, /* 0 */
|
||||
SProcXGetExtensionVersion, /* 1 */
|
||||
ProcXListInputDevices, /* 2 */
|
||||
ProcXOpenDevice, /* 3 */
|
||||
ProcXCloseDevice, /* 4 */
|
||||
ProcXSetDeviceMode, /* 5 */
|
||||
SProcXListInputDevices, /* 2 */
|
||||
SProcXOpenDevice, /* 3 */
|
||||
SProcXCloseDevice, /* 4 */
|
||||
SProcXSetDeviceMode, /* 5 */
|
||||
SProcXSelectExtensionEvent, /* 6 */
|
||||
SProcXGetSelectedExtensionEvents, /* 7 */
|
||||
SProcXChangeDeviceDontPropagateList, /* 8 */
|
||||
SProcXGetDeviceDontPropagateList, /* 9 */
|
||||
SProcXGetDeviceMotionEvents, /* 10 */
|
||||
ProcXChangeKeyboardDevice, /* 11 */
|
||||
ProcXChangePointerDevice, /* 12 */
|
||||
SProcXChangeKeyboardDevice, /* 11 */
|
||||
SProcXChangePointerDevice, /* 12 */
|
||||
SProcXGrabDevice, /* 13 */
|
||||
SProcXUngrabDevice, /* 14 */
|
||||
SProcXGrabDeviceKey, /* 15 */
|
||||
|
|
@ -272,30 +272,30 @@ static int (*SProcIVector[]) (ClientPtr) = {
|
|||
SProcXGrabDeviceButton, /* 17 */
|
||||
SProcXUngrabDeviceButton, /* 18 */
|
||||
SProcXAllowDeviceEvents, /* 19 */
|
||||
ProcXGetDeviceFocus, /* 20 */
|
||||
SProcXGetDeviceFocus, /* 20 */
|
||||
SProcXSetDeviceFocus, /* 21 */
|
||||
ProcXGetFeedbackControl, /* 22 */
|
||||
SProcXGetFeedbackControl, /* 22 */
|
||||
SProcXChangeFeedbackControl, /* 23 */
|
||||
ProcXGetDeviceKeyMapping, /* 24 */
|
||||
SProcXGetDeviceKeyMapping, /* 24 */
|
||||
SProcXChangeDeviceKeyMapping, /* 25 */
|
||||
ProcXGetDeviceModifierMapping, /* 26 */
|
||||
ProcXSetDeviceModifierMapping, /* 27 */
|
||||
ProcXGetDeviceButtonMapping, /* 28 */
|
||||
ProcXSetDeviceButtonMapping, /* 29 */
|
||||
ProcXQueryDeviceState, /* 30 */
|
||||
SProcXGetDeviceModifierMapping, /* 26 */
|
||||
SProcXSetDeviceModifierMapping, /* 27 */
|
||||
SProcXGetDeviceButtonMapping, /* 28 */
|
||||
SProcXSetDeviceButtonMapping, /* 29 */
|
||||
SProcXQueryDeviceState, /* 30 */
|
||||
SProcXSendExtensionEvent, /* 31 */
|
||||
ProcXDeviceBell, /* 32 */
|
||||
ProcXSetDeviceValuators, /* 33 */
|
||||
SProcXDeviceBell, /* 32 */
|
||||
SProcXSetDeviceValuators, /* 33 */
|
||||
SProcXGetDeviceControl, /* 34 */
|
||||
SProcXChangeDeviceControl, /* 35 */
|
||||
ProcXListDeviceProperties, /* 36 */
|
||||
SProcXListDeviceProperties, /* 36 */
|
||||
SProcXChangeDeviceProperty, /* 37 */
|
||||
SProcXDeleteDeviceProperty, /* 38 */
|
||||
SProcXGetDeviceProperty, /* 39 */
|
||||
SProcXIQueryPointer, /* 40 */
|
||||
SProcXIWarpPointer, /* 41 */
|
||||
SProcXIChangeCursor, /* 42 */
|
||||
ProcXIChangeHierarchy, /* 43 */
|
||||
SProcXIChangeHierarchy, /* 43 */
|
||||
SProcXISetClientPointer, /* 44 */
|
||||
SProcXIGetClientPointer, /* 45 */
|
||||
SProcXISelectEvents, /* 46 */
|
||||
|
|
|
|||
16
Xi/getbmap.c
16
Xi/getbmap.c
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
|
|
@ -59,6 +61,20 @@ SOFTWARE.
|
|||
|
||||
#include "getbmap.h"
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure gets the button mapping for the specified device.
|
||||
*
|
||||
*/
|
||||
|
||||
int _X_COLD
|
||||
SProcXGetDeviceButtonMapping(ClientPtr client)
|
||||
{
|
||||
REQUEST(xGetDeviceButtonMappingReq);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXGetDeviceButtonMapping(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure gets the button mapping for the specified device.
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef GETBMAP_H
|
||||
#define GETBMAP_H 1
|
||||
|
||||
int SProcXGetDeviceButtonMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXGetDeviceButtonMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
|
|
@ -70,6 +72,7 @@ int _X_COLD
|
|||
SProcXGetDeviceControl(ClientPtr client)
|
||||
{
|
||||
REQUEST(xGetDeviceControlReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
|
||||
swaps(&stuff->control);
|
||||
return (ProcXGetDeviceControl(client));
|
||||
|
|
|
|||
18
Xi/getfctl.c
18
Xi/getfctl.c
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
|
|
@ -59,6 +61,21 @@ SOFTWARE.
|
|||
|
||||
#include "getfctl.h"
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure gets the control attributes for an extension device,
|
||||
* for clients on machines with a different byte ordering than the server.
|
||||
*
|
||||
*/
|
||||
|
||||
int _X_COLD
|
||||
SProcXGetFeedbackControl(ClientPtr client)
|
||||
{
|
||||
REQUEST(xGetFeedbackControlReq);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXGetFeedbackControl(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies KbdFeedbackClass data, swapping if necessary.
|
||||
|
|
@ -80,7 +97,6 @@ CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
|
|||
k2->pitch = k->ctrl.bell_pitch;
|
||||
k2->duration = k->ctrl.bell_duration;
|
||||
k2->led_mask = k->ctrl.leds;
|
||||
k2->led_values = k->ctrl.leds;
|
||||
k2->global_auto_repeat = k->ctrl.autoRepeat;
|
||||
for (i = 0; i < 32; i++)
|
||||
k2->auto_repeats[i] = k->ctrl.autoRepeats[i];
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef GETFCTL_H
|
||||
#define GETFCTL_H 1
|
||||
|
||||
int SProcXGetFeedbackControl(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXGetFeedbackControl(ClientPtr /* client */
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "windowstr.h" /* focus struct */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
|
|
@ -60,6 +62,20 @@ SOFTWARE.
|
|||
|
||||
#include "getfocus.h"
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure gets the focus for a device.
|
||||
*
|
||||
*/
|
||||
|
||||
int _X_COLD
|
||||
SProcXGetDeviceFocus(ClientPtr client)
|
||||
{
|
||||
REQUEST(xGetDeviceFocusReq);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXGetDeviceFocus(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure gets the focus for a device.
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef GETFOCUS_H
|
||||
#define GETFOCUS_H 1
|
||||
|
||||
int SProcXGetDeviceFocus(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXGetDeviceFocus(ClientPtr /* client */
|
||||
);
|
||||
|
||||
|
|
|
|||
17
Xi/getkmap.c
17
Xi/getkmap.c
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
|
|
@ -62,6 +64,21 @@ SOFTWARE.
|
|||
|
||||
#include "getkmap.h"
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure gets the key mapping for an extension device,
|
||||
* for clients on machines with a different byte ordering than the server.
|
||||
*
|
||||
*/
|
||||
|
||||
int _X_COLD
|
||||
SProcXGetDeviceKeyMapping(ClientPtr client)
|
||||
{
|
||||
REQUEST(xGetDeviceKeyMappingReq);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXGetDeviceKeyMapping(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Get the device key mapping.
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef GETKMAP_H
|
||||
#define GETKMAP_H 1
|
||||
|
||||
int SProcXGetDeviceKeyMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXGetDeviceKeyMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
|
|
|
|||
17
Xi/getmmap.c
17
Xi/getmmap.c
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
|
|
@ -59,6 +61,21 @@ SOFTWARE.
|
|||
|
||||
#include "getmmap.h"
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure gets the modifier mapping for an extension device,
|
||||
* for clients on machines with a different byte ordering than the server.
|
||||
*
|
||||
*/
|
||||
|
||||
int _X_COLD
|
||||
SProcXGetDeviceModifierMapping(ClientPtr client)
|
||||
{
|
||||
REQUEST(xGetDeviceModifierMappingReq);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXGetDeviceModifierMapping(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Get the device Modifier mapping.
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef GETMMAP_H
|
||||
#define GETMMAP_H 1
|
||||
|
||||
int SProcXGetDeviceModifierMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXGetDeviceModifierMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
|
|
|
|||
13
Xi/getprop.c
13
Xi/getprop.c
|
|
@ -50,17 +50,17 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structs */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exglobals.h"
|
||||
#include "swaprep.h"
|
||||
|
||||
#include "getprop.h"
|
||||
|
||||
extern XExtEventInfo EventInfo[];
|
||||
|
|
@ -76,6 +76,7 @@ int _X_COLD
|
|||
SProcXGetDeviceDontPropagateList(ClientPtr client)
|
||||
{
|
||||
REQUEST(xGetDeviceDontPropagateListReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
|
||||
swapl(&stuff->window);
|
||||
return (ProcXGetDeviceDontPropagateList(client));
|
||||
|
|
@ -118,8 +119,6 @@ ProcXGetDeviceDontPropagateList(ClientPtr client)
|
|||
if (count) {
|
||||
rep.count = count;
|
||||
buf = xallocarray(rep.count, sizeof(XEventClass));
|
||||
if (buf == NULL)
|
||||
return BadAlloc;
|
||||
rep.length = bytes_to_int32(rep.count * sizeof(XEventClass));
|
||||
|
||||
tbuf = buf;
|
||||
|
|
|
|||
|
|
@ -50,17 +50,17 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window struct */
|
||||
#include "exglobals.h"
|
||||
#include "swaprep.h"
|
||||
|
||||
#include "getprop.h"
|
||||
#include "getselev.h"
|
||||
|
||||
|
|
@ -74,6 +74,7 @@ int _X_COLD
|
|||
SProcXGetSelectedExtensionEvents(ClientPtr client)
|
||||
{
|
||||
REQUEST(xGetSelectedExtensionEventsReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
|
||||
swapl(&stuff->window);
|
||||
return (ProcXGetSelectedExtensionEvents(client));
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
|
|
@ -72,6 +74,7 @@ int _X_COLD
|
|||
SProcXGetExtensionVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xGetExtensionVersionReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
|
||||
swaps(&stuff->nbytes);
|
||||
return (ProcXGetExtensionVersion(client));
|
||||
|
|
@ -91,7 +94,7 @@ ProcXGetExtensionVersion(ClientPtr client)
|
|||
REQUEST(xGetExtensionVersionReq);
|
||||
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
|
||||
|
||||
if (client->req_len != bytes_to_int32(sizeof(xGetExtensionVersionReq) +
|
||||
if (stuff->length != bytes_to_int32(sizeof(xGetExtensionVersionReq) +
|
||||
stuff->nbytes))
|
||||
return BadLength;
|
||||
|
||||
|
|
|
|||
16
Xi/grabdev.c
16
Xi/grabdev.c
|
|
@ -50,17 +50,17 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exglobals.h"
|
||||
#include "dixevents.h" /* GrabDevice */
|
||||
|
||||
#include "grabdev.h"
|
||||
|
||||
extern XExtEventInfo EventInfo[];
|
||||
|
|
@ -76,13 +76,13 @@ int _X_COLD
|
|||
SProcXGrabDevice(ClientPtr client)
|
||||
{
|
||||
REQUEST(xGrabDeviceReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
|
||||
|
||||
swapl(&stuff->grabWindow);
|
||||
swapl(&stuff->time);
|
||||
swaps(&stuff->event_count);
|
||||
|
||||
if (client->req_len !=
|
||||
if (stuff->length !=
|
||||
bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
|
||||
return BadLength;
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ ProcXGrabDevice(ClientPtr client)
|
|||
REQUEST(xGrabDeviceReq);
|
||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
|
||||
|
||||
if (client->req_len !=
|
||||
if (stuff->length !=
|
||||
bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
|
||||
return BadLength;
|
||||
|
||||
|
|
|
|||
|
|
@ -50,17 +50,18 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/exevents_priv.h"
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
#include "xace.h"
|
||||
|
||||
#include "grabdev.h"
|
||||
#include "grabdevb.h"
|
||||
|
||||
|
|
@ -74,6 +75,7 @@ int _X_COLD
|
|||
SProcXGrabDeviceButton(ClientPtr client)
|
||||
{
|
||||
REQUEST(xGrabDeviceButtonReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
|
||||
swapl(&stuff->grabWindow);
|
||||
swaps(&stuff->modifiers);
|
||||
|
|
@ -105,7 +107,7 @@ ProcXGrabDeviceButton(ClientPtr client)
|
|||
REQUEST(xGrabDeviceButtonReq);
|
||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
|
||||
|
||||
if (client->req_len !=
|
||||
if (stuff->length !=
|
||||
bytes_to_int32(sizeof(xGrabDeviceButtonReq)) + stuff->event_count)
|
||||
return BadLength;
|
||||
|
||||
|
|
@ -123,7 +125,7 @@ ProcXGrabDeviceButton(ClientPtr client)
|
|||
}
|
||||
else {
|
||||
mdev = PickKeyboard(client);
|
||||
ret = XaceHookDeviceAccess(client, mdev, DixUseAccess);
|
||||
ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixUseAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,17 +50,18 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/exevents_priv.h"
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
#include "xace.h"
|
||||
|
||||
#include "grabdev.h"
|
||||
#include "grabdevk.h"
|
||||
|
||||
|
|
@ -74,6 +75,7 @@ int _X_COLD
|
|||
SProcXGrabDeviceKey(ClientPtr client)
|
||||
{
|
||||
REQUEST(xGrabDeviceKeyReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
|
||||
swapl(&stuff->grabWindow);
|
||||
swaps(&stuff->modifiers);
|
||||
|
|
@ -103,7 +105,7 @@ ProcXGrabDeviceKey(ClientPtr client)
|
|||
REQUEST(xGrabDeviceKeyReq);
|
||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
|
||||
|
||||
if (client->req_len !=
|
||||
if (stuff->length !=
|
||||
bytes_to_int32(sizeof(xGrabDeviceKeyReq)) + stuff->event_count)
|
||||
return BadLength;
|
||||
|
||||
|
|
@ -121,7 +123,7 @@ ProcXGrabDeviceKey(ClientPtr client)
|
|||
}
|
||||
else {
|
||||
mdev = PickKeyboard(client);
|
||||
ret = XaceHookDeviceAccess(client, mdev, DixUseAccess);
|
||||
ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixUseAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,15 +50,16 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/exevents_priv.h"
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "gtmotion.h"
|
||||
|
||||
/***********************************************************************
|
||||
|
|
@ -71,6 +72,7 @@ int _X_COLD
|
|||
SProcXGetDeviceMotionEvents(ClientPtr client)
|
||||
{
|
||||
REQUEST(xGetDeviceMotionEventsReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
|
||||
swapl(&stuff->start);
|
||||
swapl(&stuff->stop);
|
||||
|
|
|
|||
28
Xi/listdev.c
28
Xi/listdev.c
|
|
@ -50,24 +50,38 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/input_priv.h"
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "XIstubs.h"
|
||||
#include "extnsionst.h"
|
||||
#include "exevents.h"
|
||||
#include "xace.h"
|
||||
#include "xkbsrv.h"
|
||||
#include "xkbstr.h"
|
||||
|
||||
#include "listdev.h"
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure lists the input devices available to the server.
|
||||
*
|
||||
*/
|
||||
|
||||
int _X_COLD
|
||||
SProcXListInputDevices(ClientPtr client)
|
||||
{
|
||||
REQUEST(xListInputDevicesReq);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXListInputDevices(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure calculates the size of the information to be returned
|
||||
|
|
@ -295,7 +309,7 @@ ShouldSkipDevice(ClientPtr client, DeviceIntPtr d)
|
|||
{
|
||||
/* don't send master devices other than VCP/VCK */
|
||||
if (!IsMaster(d) || d == inputInfo.pointer ||d == inputInfo.keyboard) {
|
||||
int rc = XaceHookDeviceAccess(client, d, DixGetAttrAccess);
|
||||
int rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
|
||||
|
||||
if (rc == Success)
|
||||
return FALSE;
|
||||
|
|
@ -363,10 +377,6 @@ ProcXListInputDevices(ClientPtr client)
|
|||
/* allocate space for reply */
|
||||
total_length = numdevs * sizeof(xDeviceInfo) + size + namesize;
|
||||
devbuf = (char *) calloc(1, total_length);
|
||||
if (!devbuf) {
|
||||
free(skip);
|
||||
return BadAlloc;
|
||||
}
|
||||
classbuf = devbuf + (numdevs * sizeof(xDeviceInfo));
|
||||
namebuf = classbuf + size;
|
||||
savbuf = devbuf;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
|
||||
#define VPC 20 /* Max # valuators per chunk */
|
||||
|
||||
int SProcXListInputDevices(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXListInputDevices(ClientPtr /* client */
|
||||
);
|
||||
|
||||
|
|
|
|||
17
Xi/opendev.c
17
Xi/opendev.c
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
|
|
@ -64,6 +66,21 @@ SOFTWARE.
|
|||
|
||||
extern CARD8 event_base[];
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure swaps the request if the server and client have different
|
||||
* byte orderings.
|
||||
*
|
||||
*/
|
||||
|
||||
int _X_COLD
|
||||
SProcXOpenDevice(ClientPtr client)
|
||||
{
|
||||
REQUEST(xOpenDeviceReq);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXOpenDevice(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure causes the server to open an input device.
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef OPENDEV_H
|
||||
#define OPENDEV_H 1
|
||||
|
||||
int SProcXOpenDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXOpenDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
|
|
|
|||
26
Xi/queryst.c
26
Xi/queryst.c
|
|
@ -32,21 +32,35 @@ from The Open Group.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/exevents_priv.h"
|
||||
#include "dix/input_priv.h"
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
#include "xkbsrv.h"
|
||||
#include "xkbstr.h"
|
||||
|
||||
#include "queryst.h"
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure allows a client to query the state of a device.
|
||||
*
|
||||
*/
|
||||
|
||||
int _X_COLD
|
||||
SProcXQueryDeviceState(ClientPtr client)
|
||||
{
|
||||
REQUEST(xQueryDeviceStateReq);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXQueryDeviceState(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure allows frozen events to be routed.
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef QUERYST_H
|
||||
#define QUERYST_H 1
|
||||
|
||||
int SProcXQueryDeviceState(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXQueryDeviceState(ClientPtr /* client */
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -50,18 +50,18 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XI2.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "dix/exevents_priv.h"
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XI2.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "grabdev.h"
|
||||
#include "selectev.h"
|
||||
|
||||
|
|
@ -121,6 +121,7 @@ int _X_COLD
|
|||
SProcXSelectExtensionEvent(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSelectExtensionEventReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
|
||||
swapl(&stuff->window);
|
||||
swaps(&stuff->count);
|
||||
|
|
@ -147,7 +148,7 @@ ProcXSelectExtensionEvent(ClientPtr client)
|
|||
REQUEST(xSelectExtensionEventReq);
|
||||
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
|
||||
|
||||
if (client->req_len !=
|
||||
if (stuff->length !=
|
||||
bytes_to_int32(sizeof(xSelectExtensionEventReq)) + stuff->count)
|
||||
return BadLength;
|
||||
|
||||
|
|
|
|||
|
|
@ -50,17 +50,18 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/exevents_priv.h"
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* Window */
|
||||
#include "extnsionst.h" /* EventSwapPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "grabdev.h"
|
||||
#include "sendexev.h"
|
||||
|
||||
|
|
@ -82,11 +83,12 @@ SProcXSendExtensionEvent(ClientPtr client)
|
|||
EventSwapPtr proc;
|
||||
|
||||
REQUEST(xSendExtensionEventReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
|
||||
swapl(&stuff->destination);
|
||||
swaps(&stuff->count);
|
||||
|
||||
if (client->req_len !=
|
||||
if (stuff->length !=
|
||||
bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
|
||||
bytes_to_int32(stuff->num_events * sizeof(xEvent)))
|
||||
return BadLength;
|
||||
|
|
@ -132,7 +134,7 @@ ProcXSendExtensionEvent(ClientPtr client)
|
|||
REQUEST(xSendExtensionEventReq);
|
||||
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
|
||||
|
||||
if (client->req_len !=
|
||||
if (stuff->length !=
|
||||
bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
|
||||
(stuff->num_events * bytes_to_int32(sizeof(xEvent))))
|
||||
return BadLength;
|
||||
|
|
|
|||
26
Xi/setbmap.c
26
Xi/setbmap.c
|
|
@ -50,18 +50,32 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/input_priv.h"
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "setbmap.h"
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure changes the button mapping.
|
||||
*
|
||||
*/
|
||||
|
||||
int _X_COLD
|
||||
SProcXSetDeviceButtonMapping(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSetDeviceButtonMappingReq);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXSetDeviceButtonMapping(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure lists the input devices available to the server.
|
||||
|
|
@ -78,7 +92,7 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
|
|||
REQUEST(xSetDeviceButtonMappingReq);
|
||||
REQUEST_AT_LEAST_SIZE(xSetDeviceButtonMappingReq);
|
||||
|
||||
if (client->req_len !=
|
||||
if (stuff->length !=
|
||||
bytes_to_int32(sizeof(xSetDeviceButtonMappingReq) + stuff->map_length))
|
||||
return BadLength;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef SETBMAP_H
|
||||
#define SETBMAP_H 1
|
||||
|
||||
int SProcXSetDeviceButtonMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXSetDeviceButtonMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
|
|
|
|||
26
Xi/setdval.c
26
Xi/setdval.c
|
|
@ -50,18 +50,32 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/input_priv.h"
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "XIstubs.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "setdval.h"
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Handle a request from a client with a different byte order.
|
||||
*
|
||||
*/
|
||||
|
||||
int _X_COLD
|
||||
SProcXSetDeviceValuators(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSetDeviceValuatorsReq);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXSetDeviceValuators(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure sets the value of valuators on an extension input device.
|
||||
|
|
@ -86,7 +100,7 @@ ProcXSetDeviceValuators(ClientPtr client)
|
|||
.status = Success
|
||||
};
|
||||
|
||||
if (client->req_len != bytes_to_int32(sizeof(xSetDeviceValuatorsReq)) +
|
||||
if (stuff->length != bytes_to_int32(sizeof(xSetDeviceValuatorsReq)) +
|
||||
stuff->num_valuators)
|
||||
return BadLength;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef SETDVAL_H
|
||||
#define SETDVAL_H 1
|
||||
|
||||
int SProcXSetDeviceValuators(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXSetDeviceValuators(ClientPtr /* client */
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -50,18 +50,19 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#endif
|
||||
|
||||
#include "windowstr.h" /* focus struct */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dixevents.h"
|
||||
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "setfocus.h"
|
||||
|
||||
/***********************************************************************
|
||||
|
|
@ -74,6 +75,7 @@ int _X_COLD
|
|||
SProcXSetDeviceFocus(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSetDeviceFocusReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
|
||||
swapl(&stuff->focus);
|
||||
swapl(&stuff->time);
|
||||
|
|
|
|||
25
Xi/setmmap.c
25
Xi/setmmap.c
|
|
@ -50,19 +50,34 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XI2.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/input_priv.h"
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "setmmap.h"
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure sets the modifier mapping for an extension device,
|
||||
* for clients on machines with a different byte ordering than the server.
|
||||
*
|
||||
*/
|
||||
|
||||
int _X_COLD
|
||||
SProcXSetDeviceModifierMapping(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSetDeviceModifierMappingReq);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXSetDeviceModifierMapping(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Set the device Modifier mapping.
|
||||
|
|
@ -79,7 +94,7 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
|
|||
REQUEST(xSetDeviceModifierMappingReq);
|
||||
REQUEST_AT_LEAST_SIZE(xSetDeviceModifierMappingReq);
|
||||
|
||||
if (client->req_len != bytes_to_int32(sizeof(xSetDeviceModifierMappingReq)) +
|
||||
if (stuff->length != bytes_to_int32(sizeof(xSetDeviceModifierMappingReq)) +
|
||||
(stuff->numKeyPerModifier << 1))
|
||||
return BadLength;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef SETMMAP_H
|
||||
#define SETMMAP_H 1
|
||||
|
||||
int SProcXSetDeviceModifierMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXSetDeviceModifierMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
|
|
|
|||
24
Xi/setmode.c
24
Xi/setmode.c
|
|
@ -50,18 +50,32 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/input_priv.h"
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "XIstubs.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "setmode.h"
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Handle a request from a client with a different byte order.
|
||||
*
|
||||
*/
|
||||
|
||||
int _X_COLD
|
||||
SProcXSetDeviceMode(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSetDeviceModeReq);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXSetDeviceMode(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure sets the mode of a device.
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef SETMODE_H
|
||||
#define SETMODE_H 1
|
||||
|
||||
int SProcXSetDeviceMode(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXSetDeviceMode(ClientPtr /* client */
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,9 @@ SOFTWARE.
|
|||
* Xnest could do the same thing.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
|
|
@ -69,6 +71,7 @@ int _X_COLD
|
|||
SProcXUngrabDevice(ClientPtr client)
|
||||
{
|
||||
REQUEST(xUngrabDeviceReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xUngrabDeviceReq);
|
||||
swapl(&stuff->time);
|
||||
return (ProcXUngrabDevice(client));
|
||||
|
|
|
|||
|
|
@ -50,17 +50,17 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "dix/dixgrabs_priv.h"
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exglobals.h"
|
||||
#include "dixgrabs.h"
|
||||
|
||||
#include "ungrdevb.h"
|
||||
|
||||
#define AllModifiersMask ( \
|
||||
|
|
@ -77,6 +77,7 @@ int _X_COLD
|
|||
SProcXUngrabDeviceButton(ClientPtr client)
|
||||
{
|
||||
REQUEST(xUngrabDeviceButtonReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
|
||||
swapl(&stuff->grabWindow);
|
||||
swaps(&stuff->modifiers);
|
||||
|
|
|
|||
|
|
@ -50,19 +50,19 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "dix/dixgrabs_priv.h"
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exglobals.h"
|
||||
#include "dixgrabs.h"
|
||||
#include "xkbsrv.h"
|
||||
#include "xkbstr.h"
|
||||
|
||||
#include "ungrdevk.h"
|
||||
|
||||
#define AllModifiersMask ( \
|
||||
|
|
@ -79,6 +79,7 @@ int _X_COLD
|
|||
SProcXUngrabDeviceKey(ClientPtr client)
|
||||
{
|
||||
REQUEST(xUngrabDeviceKeyReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
|
||||
swapl(&stuff->grabWindow);
|
||||
swaps(&stuff->modifiers);
|
||||
|
|
|
|||
|
|
@ -29,21 +29,19 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/extensions/XI2.h>
|
||||
#include <X11/extensions/XI2proto.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "dix/exevents_priv.h"
|
||||
#include "dix/input_priv.h"
|
||||
#include "os/fmt.h"
|
||||
#endif
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include "mi.h"
|
||||
#include "eventstr.h"
|
||||
#include <X11/extensions/XI2.h>
|
||||
#include <X11/extensions/XI2proto.h>
|
||||
|
||||
#include "exglobals.h" /* BadDevice */
|
||||
#include "exevents.h"
|
||||
#include "xiallowev.h"
|
||||
|
||||
int _X_COLD
|
||||
|
|
@ -52,9 +50,10 @@ SProcXIAllowEvents(ClientPtr client)
|
|||
REQUEST(xXIAllowEventsReq);
|
||||
REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
swaps(&stuff->deviceid);
|
||||
swapl(&stuff->time);
|
||||
if (client->req_len > 3) {
|
||||
if (stuff->length > 3) {
|
||||
xXI2_2AllowEventsReq *req_xi22 = (xXI2_2AllowEventsReq *) stuff;
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq);
|
||||
|
|
@ -95,25 +94,25 @@ ProcXIAllowEvents(ClientPtr client)
|
|||
|
||||
switch (stuff->mode) {
|
||||
case XIReplayDevice:
|
||||
AllowSome(client, time, dev, GRAB_STATE_NOT_GRABBED);
|
||||
AllowSome(client, time, dev, NOT_GRABBED);
|
||||
break;
|
||||
case XISyncDevice:
|
||||
AllowSome(client, time, dev, GRAB_STATE_FREEZE_NEXT_EVENT);
|
||||
AllowSome(client, time, dev, FREEZE_NEXT_EVENT);
|
||||
break;
|
||||
case XIAsyncDevice:
|
||||
AllowSome(client, time, dev, GRAB_STATE_THAWED);
|
||||
AllowSome(client, time, dev, THAWED);
|
||||
break;
|
||||
case XIAsyncPairedDevice:
|
||||
if (IsMaster(dev))
|
||||
AllowSome(client, time, dev, GRAB_STATE_THAW_OTHERS);
|
||||
AllowSome(client, time, dev, THAW_OTHERS);
|
||||
break;
|
||||
case XISyncPair:
|
||||
if (IsMaster(dev))
|
||||
AllowSome(client, time, dev, GRAB_STATE_FREEZE_BOTH_NEXT_EVENT);
|
||||
AllowSome(client, time, dev, FREEZE_BOTH_NEXT_EVENT);
|
||||
break;
|
||||
case XIAsyncPair:
|
||||
if (IsMaster(dev))
|
||||
AllowSome(client, time, dev, GRAB_STATE_THAWED_BOTH);
|
||||
AllowSome(client, time, dev, THAWED_BOTH);
|
||||
break;
|
||||
case XIRejectTouch:
|
||||
case XIAcceptTouch:
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue