mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-09 13:08:12 +02:00
Compare commits
92 commits
master
...
xorg-serve
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
971d418113 | ||
|
|
da15c74139 | ||
|
|
8a59e3b7db | ||
|
|
cfc3dec09e | ||
|
|
2a0c6c15c3 | ||
|
|
f5dc787fc9 | ||
|
|
4795c069a5 | ||
|
|
1e3c5d614e | ||
|
|
b58aa8ed9b | ||
|
|
b1215fb075 | ||
|
|
a41b6ef224 | ||
|
|
9403335910 | ||
|
|
c26a47b4f2 | ||
|
|
fb01b238c6 | ||
|
|
cc4051ad6a | ||
|
|
64a7aac257 | ||
|
|
fcbdb7c8b0 | ||
|
|
83ef02839c | ||
|
|
66d36010a3 | ||
|
|
795c58a1fe | ||
|
|
bb384d0b11 | ||
|
|
26a83f9833 | ||
|
|
bdeab7863e | ||
|
|
8e646ca985 | ||
|
|
fdb80a327c | ||
|
|
cffac815b9 | ||
|
|
8dd7173eeb | ||
|
|
1191b23f94 | ||
|
|
1b0db2c742 | ||
|
|
48300a7775 | ||
|
|
cd19a752f8 | ||
|
|
5396a4aa08 | ||
|
|
051a0efc5c | ||
|
|
1508ea6806 | ||
|
|
101d15c763 | ||
|
|
9347326d28 | ||
|
|
cbf1ca2dba | ||
|
|
18a52a8e16 | ||
|
|
c256e31a9e | ||
|
|
2da0bde449 | ||
|
|
b9e9eda08b | ||
|
|
5c0662d448 | ||
|
|
10285bc36b | ||
|
|
a530198ac0 | ||
|
|
cd7680adcc | ||
|
|
ebd4cd71f4 | ||
|
|
1f169d5b38 | ||
|
|
bc1882aa23 | ||
|
|
d60ce5b01f | ||
|
|
79795bf9df | ||
|
|
820ce7cb8b | ||
|
|
ba6a928381 | ||
|
|
91ec6245d6 | ||
|
|
821f38fa56 | ||
|
|
2f4d0d8426 | ||
|
|
394ed02f87 | ||
|
|
8c2f0f8cbd | ||
|
|
180ab06d45 | ||
|
|
c641d10ef0 | ||
|
|
79ebd7f689 | ||
|
|
81969ab773 | ||
|
|
60020989b9 | ||
|
|
cb698ec2ba | ||
|
|
8ffee3a6bd | ||
|
|
aad1525180 | ||
|
|
831f7194b7 | ||
|
|
60eda2af0a | ||
|
|
f8e96b22bf | ||
|
|
443e3348bb | ||
|
|
dea40be935 | ||
|
|
04a19291c9 | ||
|
|
de40a55235 | ||
|
|
2d31a40db5 | ||
|
|
65d46b2dfd | ||
|
|
38835d1d8f | ||
|
|
d7220428da | ||
|
|
9e417072bc | ||
|
|
2e66ed066e | ||
|
|
883d4d00b4 | ||
|
|
55171d738a | ||
|
|
64bf285729 | ||
|
|
273115a012 | ||
|
|
69980e4e5a | ||
|
|
33f20c38fc | ||
|
|
544caffae1 | ||
|
|
a9a17581ce | ||
|
|
c3a06e330b | ||
|
|
662273397c | ||
|
|
590374bd92 | ||
|
|
5407be2c51 | ||
|
|
acd881e271 | ||
|
|
c09c78298c |
1532 changed files with 208908 additions and 67872 deletions
|
|
@ -5,80 +5,29 @@ version: '{build}'
|
||||||
skip_tags: true
|
skip_tags: true
|
||||||
clone_depth: 8
|
clone_depth: 8
|
||||||
environment:
|
environment:
|
||||||
APPVEYOR_SAVE_CACHE_ON_ERROR: true
|
|
||||||
CYGWIN_MIRROR: http://cygwin.mirror.constant.com
|
CYGWIN_MIRROR: http://cygwin.mirror.constant.com
|
||||||
CACHE: C:\cache
|
CACHE: C:\cache
|
||||||
matrix:
|
matrix:
|
||||||
- BUILD: i686-pc-cygwin
|
- BUILD: i686-pc-cygwin
|
||||||
CYGWIN_ROOT: C:\cygwin
|
|
||||||
SETUP: setup-x86.exe
|
|
||||||
- BUILD: x86_64-pc-cygwin
|
- BUILD: x86_64-pc-cygwin
|
||||||
CYGWIN_ROOT: C:\cygwin64
|
|
||||||
SETUP: setup-x86_64.exe
|
|
||||||
install:
|
install:
|
||||||
|
- if "%BUILD%"=="x86_64-pc-cygwin" set SETUP=setup-x86_64.exe && set CYGWIN_ROOT=C:\cygwin64
|
||||||
|
- if "%BUILD%"=="i686-pc-cygwin" set SETUP=setup-x86.exe && set CYGWIN_ROOT=C:\cygwin
|
||||||
|
- curl -fsSL https://gist.githubusercontent.com/jon-turney/0338af595313f598bfab15a0ac0df847/raw/bd0eeca6be899e7846aa988fbcf15e4e12f5f842/zp_libtool_cleanlafiles.sh -o %CYGWIN_ROOT%\etc\postinstall\zp_libtool_cleanlafiles.sh
|
||||||
- echo Updating Cygwin and installing build prerequisites
|
- echo Updating Cygwin and installing build prerequisites
|
||||||
- "%CYGWIN_ROOT%\\%SETUP% -qnNdO -R %CYGWIN_ROOT% -s %CYGWIN_MIRROR% -l %CACHE% -g -P \
|
- '%CYGWIN_ROOT%\%SETUP% -qnNdO -R "%CYGWIN_ROOT%" -s "%CYGWIN_MIRROR%" -l "%CACHE%" -g -P "meson,binutils,bison,bzip2,diffutils,fileutils,findutils,flex,gawk,gcc-core,make,patch,pkg-config,python3,sed,tar,xorgproto,windowsdriproto,libdmx-devel,libfontenc-devel,libfreetype-devel,libGL-devel,libpixman1-devel,libX11-devel,libXRes-devel,libXau-devel,libXaw-devel,libXdmcp-devel,libXext-devel,libXfont2-devel,libXi-devel,libXinerama-devel,libXmu-devel,libXpm-devel,libXrender-devel,libXtst-devel,libxcb-ewmh-devel,libxcb-icccm-devel,libxcb-image-devel,libxcb-keysyms-devel,libxcb-randr-devel,libxcb-render-devel,libxcb-render-util-devel,libxcb-shape-devel,libxcb-util-devel,libxcb-xkb-devel,libxkbfile-devel,zlib,font-util,khronos-opengl-registry,python3-lxml,xorg-util-macros,xtrans,xkbcomp,xkeyboard-config,libnettle-devel,libepoxy-devel,libtirpc-devel"'
|
||||||
binutils,\
|
|
||||||
bison,\
|
|
||||||
ccache,\
|
|
||||||
flex,\
|
|
||||||
gcc-core,\
|
|
||||||
meson,\
|
|
||||||
ninja,\
|
|
||||||
pkg-config,\
|
|
||||||
python38,\
|
|
||||||
windowsdriproto,\
|
|
||||||
xorgproto,\
|
|
||||||
libepoxy-devel,\
|
|
||||||
libfontenc-devel,\
|
|
||||||
libfreetype-devel,\
|
|
||||||
libGL-devel,\
|
|
||||||
libnettle-devel,\
|
|
||||||
libpixman1-devel,\
|
|
||||||
libtirpc-devel,\
|
|
||||||
libXRes-devel,\
|
|
||||||
libXaw-devel,\
|
|
||||||
libXdmcp-devel,\
|
|
||||||
libXext-devel,\
|
|
||||||
libXfont2-devel,\
|
|
||||||
libXi-devel,\
|
|
||||||
libXinerama-devel,\
|
|
||||||
libXmu-devel,\
|
|
||||||
libXpm-devel,\
|
|
||||||
libXrender-devel,\
|
|
||||||
libXtst-devel,\
|
|
||||||
libxcb-composite-devel,\
|
|
||||||
libxcb-ewmh-devel,\
|
|
||||||
libxcb-icccm-devel,\
|
|
||||||
libxcb-image-devel,\
|
|
||||||
libxcb-keysyms-devel,\
|
|
||||||
libxcb-randr-devel,\
|
|
||||||
libxcb-render-devel,\
|
|
||||||
libxcb-render-util-devel,\
|
|
||||||
libxcb-shape-devel,\
|
|
||||||
libxcb-util-devel,\
|
|
||||||
libxcb-xkb-devel,\
|
|
||||||
libxcvt-devel,\
|
|
||||||
libxkbfile-devel,\
|
|
||||||
font-util,\
|
|
||||||
khronos-opengl-registry,\
|
|
||||||
python38-lxml,\
|
|
||||||
xkbcomp-devel,\
|
|
||||||
xkeyboard-config,\
|
|
||||||
xtrans"
|
|
||||||
- echo Install done
|
- echo Install done
|
||||||
- "%CYGWIN_ROOT%\\%SETUP% -qnNdO -R %CYGWIN_ROOT% -s %CYGWIN_MIRROR% -l %CACHE% -g"
|
|
||||||
cache:
|
cache:
|
||||||
- C:\cache
|
- C:\cache
|
||||||
- '%CYGWIN_ROOT%\home\%USERNAME%\.ccache'
|
|
||||||
build_script:
|
build_script:
|
||||||
- SET PATH=%CYGWIN_ROOT%/bin
|
- 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 -Ddmx=true -Dxephyr=true -Dxnest=true -Dxvfb=true -Dxwin=true -Dxorg=true -Dhal=false -Dudev=false -Dpciaccess=false -Dint10=false build"'
|
||||||
- '%CYGWIN_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; meson configure 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; ninja -C build"'
|
||||||
- '%CYGWIN_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; ccache -s"'
|
|
||||||
test_script:
|
test_script:
|
||||||
- '%CYGWIN_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; ninja -C build test"'
|
- '%CYGWIN_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; ninja -C build test"'
|
||||||
after_test:
|
after_test:
|
||||||
- '%CYGWIN_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; ninja -C build install"'
|
- '%CYGWIN_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; ninja -C build install"'
|
||||||
|
artifacts:
|
||||||
|
- path: staging
|
||||||
deploy: off
|
deploy: off
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
((c-mode . ((c-basic-offset . 4) (indent-tabs-mode . nil))))
|
((c-mode . ((c-basic-offset . 4) (indent-tabs-mode . nil))))
|
||||||
|
|
@ -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
|
|
||||||
82
.gitignore
vendored
82
.gitignore
vendored
|
|
@ -1,4 +1,82 @@
|
||||||
|
#
|
||||||
|
# X.Org module default exclusion patterns
|
||||||
|
# The next section if for module specific patterns
|
||||||
|
#
|
||||||
|
# Do not edit the following section
|
||||||
|
# GNU Build System (Autotools)
|
||||||
|
aclocal.m4
|
||||||
|
autom4te.cache/
|
||||||
|
autoscan.log
|
||||||
|
ChangeLog
|
||||||
|
compile
|
||||||
|
config.guess
|
||||||
|
config.h
|
||||||
|
config.h.in
|
||||||
|
config.log
|
||||||
|
config-ml.in
|
||||||
|
config.py
|
||||||
|
config.status
|
||||||
|
config.status.lineno
|
||||||
|
config.sub
|
||||||
|
configure
|
||||||
|
configure.scan
|
||||||
|
depcomp
|
||||||
|
.deps/
|
||||||
|
INSTALL
|
||||||
|
install-sh
|
||||||
|
.libs/
|
||||||
|
libtool
|
||||||
|
libtool.m4
|
||||||
|
ltmain.sh
|
||||||
|
lt~obsolete.m4
|
||||||
|
ltoptions.m4
|
||||||
|
ltsugar.m4
|
||||||
|
ltversion.m4
|
||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
mdate-sh
|
||||||
|
missing
|
||||||
|
mkinstalldirs
|
||||||
|
*.pc
|
||||||
|
py-compile
|
||||||
|
stamp-h?
|
||||||
|
symlink-tree
|
||||||
|
test-driver
|
||||||
|
texinfo.tex
|
||||||
|
ylwrap
|
||||||
|
|
||||||
|
# Do not edit the following section
|
||||||
|
# Edit Compile Debug Document Distribute
|
||||||
*~
|
*~
|
||||||
*.swp
|
*.[0-9]
|
||||||
|
*.[0-9]x
|
||||||
|
*.bak
|
||||||
|
*.bin
|
||||||
|
core
|
||||||
|
*.dll
|
||||||
|
*.exe
|
||||||
|
*-ISO*.bdf
|
||||||
|
*-JIS*.bdf
|
||||||
|
*-KOI8*.bdf
|
||||||
|
*.kld
|
||||||
|
*.ko
|
||||||
|
*.ko.cmd
|
||||||
|
*.lai
|
||||||
|
*.l[oa]
|
||||||
|
*.[oa]
|
||||||
|
*.obj
|
||||||
*.patch
|
*.patch
|
||||||
tags
|
*.so
|
||||||
|
*.pcf.gz
|
||||||
|
*.pdb
|
||||||
|
*.tar.bz2
|
||||||
|
*.tar.gz
|
||||||
|
#
|
||||||
|
# Add & Override patterns for xserver
|
||||||
|
#
|
||||||
|
# Edit the following section as needed
|
||||||
|
# For example, !report.pc overrides *.pc. See 'man gitignore'
|
||||||
|
#
|
||||||
|
doltcompile
|
||||||
|
doltlibtool
|
||||||
|
xserver.ent
|
||||||
|
|
|
||||||
13
.gitlab-ci.yml
Normal file
13
.gitlab-ci.yml
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
image: docker:latest
|
||||||
|
services:
|
||||||
|
- docker:dind
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- echo FROM nwnk/xserver-travis-rawhide:v5 > Dockerfile
|
||||||
|
- echo ADD . /root >> Dockerfile
|
||||||
|
- echo WORKDIR /root >> Dockerfile
|
||||||
|
- docker build -t withgit .
|
||||||
|
|
||||||
|
job:
|
||||||
|
script:
|
||||||
|
- docker run --volume $HOME/.ccache:/root/.ccache withgit ./test/scripts/build-travis-deps.sh
|
||||||
366
.mailmap
366
.mailmap
|
|
@ -1,366 +0,0 @@
|
||||||
Adam Jackson <ajax@redhat.com> <ajax@aspartame.nwnk.net>
|
|
||||||
Adam Jackson <ajax@redhat.com> <ajax@benzedrine.nwnk.net>
|
|
||||||
Adam Jackson <ajax@redhat.com> <ajax@nwnk.net>
|
|
||||||
Adam Jackson <ajax@redhat.com> <ajax@theobromine.nwnk.net>
|
|
||||||
|
|
||||||
Adam Tkac <atkac@redhat.com> <vonsch@gmail.com>
|
|
||||||
|
|
||||||
Alan Coopersmith <alan.coopersmith@oracle.com> <alan.coopersmith@sun.com>
|
|
||||||
Alan Coopersmith <alan.coopersmith@oracle.com> <alanc@alf.(none)>
|
|
||||||
|
|
||||||
Alan Hourihane <alanh@vmware.com> <alanh@fairlite.demon.co.uk>
|
|
||||||
Alan Hourihane <alanh@vmware.com> <alanh@tungstengraphics.com>
|
|
||||||
|
|
||||||
Alex Deucher <alexdeucher@gmail.com> <agd5f@yahoo.com>
|
|
||||||
Alex Deucher <alexdeucher@gmail.com> <alex@botch2.(none)>
|
|
||||||
Alex Deucher <alexdeucher@gmail.com> <alex@botch2.com>
|
|
||||||
Alex Deucher <alexdeucher@gmail.com> <alex@cube.(none)>
|
|
||||||
Alex Deucher <alexdeucher@gmail.com> <alex@samba.(none)>
|
|
||||||
Alex Deucher <alexdeucher@gmail.com> <alexander.deucher@amd.com>
|
|
||||||
|
|
||||||
Alexandr Shadchin <alexandr.shadchin@gmail.com> <Alexandr.Shadchin@gmail.com>
|
|
||||||
|
|
||||||
Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> <ander@mandriva.com.br>
|
|
||||||
|
|
||||||
Arjan van de Ven <arjan@infradead.org> <arjan@linux.intel.com>
|
|
||||||
|
|
||||||
Arkadiusz Miśkiewicz <arekm@maven.pl>
|
|
||||||
|
|
||||||
Axel Davy <davyaxel0@gmail.com> <axel.davy@ens.fr>
|
|
||||||
|
|
||||||
Bart Trojanowski <bart@jukie.net> <bart@symbio-technologies.com>
|
|
||||||
|
|
||||||
Ben Byer <bbyer@apple.com> <bbyer@bbyer.(none)>
|
|
||||||
Ben Byer <bbyer@apple.com> <bbyer@bbyer.apple.com>
|
|
||||||
Ben Byer <bbyer@apple.com> <bbyer@bbyer.local>
|
|
||||||
Ben Byer <bbyer@apple.com> <bbyer@bushing.apple.com>
|
|
||||||
Ben Byer <bbyer@apple.com> <bbyer@freedesktop.org>
|
|
||||||
Ben Byer <bbyer@apple.com> <bbyer@xyzzy.local>
|
|
||||||
|
|
||||||
Ben Gamari <bgamari.foss@gmail.com> <bgamari@gmail.com>
|
|
||||||
|
|
||||||
Ben Skeggs <bskeggs@redhat.com> <skeggsb@gmail.com>
|
|
||||||
|
|
||||||
Benjamin Close <benjamin.close@clearchain.com> <Benjamin.Close@clearchain.com>
|
|
||||||
|
|
||||||
Benjamin Tissoires <benjamin.tissoires@gmail.com> <tissoire@cena.fr>
|
|
||||||
|
|
||||||
Brian Paul <brianp@vmware.com> Brian <brian@i915.localnet.net>
|
|
||||||
Brian Paul <brianp@vmware.com> Brian <brian@yutani.localnet.net>
|
|
||||||
Brian Paul <brianp@vmware.com> <brian.paul@tungstengraphics.com>
|
|
||||||
|
|
||||||
Brice Goglin <bgoglin@debian.org> <brice.goglin@ens-lyon.org>
|
|
||||||
|
|
||||||
Carl Worth <cworth@cworth.org> <cworth@samich.home.cworth.org>
|
|
||||||
Carl Worth <cworth@cworth.org> <root@samich.home.cworth.org>
|
|
||||||
|
|
||||||
Chase Douglas <chase.douglas@canonical.com> <chase.douglas@ubuntu.com>
|
|
||||||
Chase Douglas <chase.douglas@canonical.com> <chasedouglas@gmail.com>
|
|
||||||
|
|
||||||
Christian König <christian.koenig@amd.com> <christian.koenig at amd.com>
|
|
||||||
|
|
||||||
Colin Guthrie <gmane@colin.guthr.ie> <cguthrie@mandriva.org>
|
|
||||||
|
|
||||||
Colin Harrison <colin@xming.myzen.co.uk> <colin.harrison-at-virgin.net>
|
|
||||||
Colin Harrison <colin@xming.myzen.co.uk> <colin.harrison@virgin.net>
|
|
||||||
|
|
||||||
Dan Nicholson <dbn.lists@gmail.com> <dan@conor.dwcab.com>
|
|
||||||
|
|
||||||
Daniel Drake <drake@endlessm.com> <d.drake@mmm.com>
|
|
||||||
Daniel Drake <drake@endlessm.com> <dsd@gentoo.org>
|
|
||||||
Daniel Drake <drake@endlessm.com> <dsd@laptop.org>
|
|
||||||
|
|
||||||
Daniel Martin <consume.noise@gmail.com> <daniel.martin@secunet.com>
|
|
||||||
|
|
||||||
Daniel Stone <daniels@collabora.com> <daniel.stone@nokia.com>
|
|
||||||
Daniel Stone <daniels@collabora.com> <daniel@fooishbar.org>
|
|
||||||
|
|
||||||
Dave Airlie <airlied@redhat.com> <airlied@clockmaker.usersys.redhat.com>
|
|
||||||
Dave Airlie <airlied@redhat.com> <airlied@gmail.com>
|
|
||||||
Dave Airlie <airlied@redhat.com> <airlied@linux.ie>
|
|
||||||
Dave Airlie <airlied@redhat.com> <airlied@panoply-rh.(none)>
|
|
||||||
Dave Airlie <airlied@redhat.com> <airlied@pegasus.(none)>
|
|
||||||
|
|
||||||
David Heidelberg <david@ixit.cz> David Heidelberger <david.heidelberger@ixit.cz>
|
|
||||||
|
|
||||||
David Miller <davem@davemloft.net>
|
|
||||||
|
|
||||||
David Nusinow <dnusinow@debian.org> <david@nee.(none)>
|
|
||||||
|
|
||||||
David Reveman <reveman@chromium.org> <c99drn@cs.umu.se>
|
|
||||||
David Reveman <reveman@chromium.org> <davidr@novell.com>
|
|
||||||
|
|
||||||
Demi Marie Obenour <demiobenour@gmail.com> <demi@invisiblethingslab.com>
|
|
||||||
|
|
||||||
Dodji Seketeli <dodji@seketeli.org> <dodji@openedhand.com>
|
|
||||||
|
|
||||||
Donnie Berkholz <dberkholz@gentoo.org> <donnie@supernova.(none)>
|
|
||||||
Donnie Berkholz <dberkholz@gentoo.org> <spyderous@gentoo.org>
|
|
||||||
|
|
||||||
Drew Parsons <dparsons@debian.org> <drew@emerall.com>
|
|
||||||
Drew Parsons <dparsons@debian.org> <drew@pug.localdomain>
|
|
||||||
|
|
||||||
Eamon Walsh <ewalsh@tycho.nsa.gov> <efw@eamonwalsh.com>
|
|
||||||
Eamon Walsh <ewalsh@tycho.nsa.gov> <ewalsh@epoch.ncsc.mil>
|
|
||||||
Eamon Walsh <ewalsh@tycho.nsa.gov> <ewalsh@moss-huskies.epoch.ncsc.mil>
|
|
||||||
Eamon Walsh <ewalsh@tycho.nsa.gov> <ewalsh@moss-uranus.epoch.ncsc.mil>
|
|
||||||
|
|
||||||
Egbert Eich <eich@suse.de> <eich@freedesktop.org>
|
|
||||||
Egbert Eich <eich@suse.de> <eich@ovid.suse.de>
|
|
||||||
Egbert Eich <eich@suse.de> <eich@pdx.freedesktop.org>
|
|
||||||
|
|
||||||
Emil Velikov <emil.l.velikov@gmail.com> <emil.velikov@collabora.com>
|
|
||||||
|
|
||||||
Emma Anholt <emma@anholt.net> <anholt@FreeBSD.org>
|
|
||||||
Emma Anholt <emma@anholt.net> <eric@anholt.net>
|
|
||||||
|
|
||||||
Eric Engestrom <eric@igalia.com> <eric@engestrom.ch>
|
|
||||||
Eric Engestrom <eric@igalia.com> <eric.engestrom@imgtec.com>
|
|
||||||
|
|
||||||
Éric Piel <eric.piel@trempin-utc.net>
|
|
||||||
Éric Piel <eric.piel@trempin-utc.net> <E.A.B.Piel@tudelft.nl>
|
|
||||||
|
|
||||||
Erik Andrén <erik.andren@gmail.com>
|
|
||||||
|
|
||||||
Faith Ekstrand <faith.ekstrand@collabora.com> <jason@jlekstrand.net>
|
|
||||||
Faith Ekstrand <faith.ekstrand@collabora.com> <jason.ekstrand@intel.com>
|
|
||||||
Faith Ekstrand <faith.ekstrand@collabora.com> <faith@gfxstrand.net>
|
|
||||||
|
|
||||||
Felix Kuehling <felix.kuehling@amd.com> <fxkuehl@gmx.de>
|
|
||||||
|
|
||||||
François Tigeot <ftigeot@wolfpond.org>
|
|
||||||
|
|
||||||
George Sapountzis <gsapountzis@gmail.com> <gsap7@yahoo.gr>
|
|
||||||
|
|
||||||
George Staplin <gstaplin@apple.com> <gps@Georges-Workstation.local>
|
|
||||||
George Staplin <gstaplin@apple.com> <georgestaplin@george-staplins-mac-pro.local>
|
|
||||||
|
|
||||||
Haihao Xiang <haihao.xiang@intel.com>
|
|
||||||
|
|
||||||
Hans de Goede <hdegoede@redhat.com>
|
|
||||||
Hans de Goede <hdegoede@redhat.com> <j.w.r.degoede@hhs.nl>
|
|
||||||
|
|
||||||
Henry Zhao <henry.zhao@oracle.com> <henryz@localhost.localdomain>
|
|
||||||
|
|
||||||
Ian Romanick <ian.d.romanick@intel.com> <idr@localhost.localdomain>
|
|
||||||
Ian Romanick <ian.d.romanick@intel.com> <idr@umwelt.(none)>
|
|
||||||
Ian Romanick <ian.d.romanick@intel.com> <idr@us.ibm.com>
|
|
||||||
|
|
||||||
Jan Beich <jbeich@freebsd.org> <jbeich@FreeBSD.org>
|
|
||||||
|
|
||||||
Jay Cotton <jay.cotton@oracle.com> <jay.cotton@sun.com>
|
|
||||||
|
|
||||||
Jeffrey Smith <whydoubt@gmail.com>
|
|
||||||
Jeffrey Smith <whydoubt@gmail.com> <whydoubt@yahoo.com>
|
|
||||||
|
|
||||||
Jeremy C. Reed <reed@glacier.reedmedia.net> <reed@reedmedia.net>
|
|
||||||
|
|
||||||
Jeremy Huddleston Sequoia <jeremyhu@apple.com>
|
|
||||||
Jeremy Huddleston Sequoia <jeremyhu@apple.com> <jeremy@dhcp-38-248.EECS.Berkeley.EDU>
|
|
||||||
Jeremy Huddleston Sequoia <jeremyhu@apple.com> <jeremy@tifa-2.local>
|
|
||||||
Jeremy Huddleston Sequoia <jeremyhu@apple.com> <jeremy@tifa.local>
|
|
||||||
Jeremy Huddleston Sequoia <jeremyhu@apple.com> <jeremy@yuffie.local>
|
|
||||||
Jeremy Huddleston Sequoia <jeremyhu@apple.com> <jeremyhu@freedesktop.org>
|
|
||||||
|
|
||||||
Jeremy Uejio <jeremy.uejio@oracle.com> <jeremy.uejio@sun.com>
|
|
||||||
|
|
||||||
Jerome Glisse <jglisse@redhat.com> <glisse@freedesktop.org>
|
|
||||||
|
|
||||||
Jesse Adkins <jesserayadkins@gmail.com> <jesse_adkins7@yahoo.com>
|
|
||||||
|
|
||||||
Jesse Barnes <jesse.barnes@intel.com> <jbarnes@jbarnes-mobile.amr.corp.intel.com>
|
|
||||||
Jesse Barnes <jesse.barnes@intel.com> <jbarnes@jbarnes-t61.(none)>
|
|
||||||
Jesse Barnes <jesse.barnes@intel.com> <jbarnes@nietzche.virtuousgeek.org>
|
|
||||||
Jesse Barnes <jesse.barnes@intel.com> <jbarnes@virtuousgeek.org>
|
|
||||||
|
|
||||||
Joel Bosveld <joel.bosveld@gmail.com> <Joel.Bosveld@gmail.com>
|
|
||||||
|
|
||||||
John Tapsell <johnflux@gmail.com> <john.tapsell@john-desktop.(none)>
|
|
||||||
|
|
||||||
Jon Turney <jon.turney@dronecode.org.uk>
|
|
||||||
|
|
||||||
Julien Isorce <j.isorce@samsung.com> <julien.isorce@gmail.com>
|
|
||||||
|
|
||||||
Keith Packard <keithp@keithp.com> <keithp@dulcimer.keithp.com>
|
|
||||||
Keith Packard <keithp@keithp.com> <keithp@guitar.keithp.com>
|
|
||||||
Keith Packard <keithp@keithp.com> <keithp@koto.keithp.com>
|
|
||||||
Keith Packard <keithp@keithp.com> <keithp@mandolin.keithp.com>
|
|
||||||
Keith Packard <keithp@keithp.com> <keithp@neko.keithp.com>
|
|
||||||
Keith Packard <keithp@keithp.com> <keithp@ukulele.keithp.com>
|
|
||||||
Keith Packard <keithp@keithp.com> <keithp@viola.jf.intel.com>
|
|
||||||
|
|
||||||
Kevin E Martin <kem@redhat.com> <kem@freedesktop.org>
|
|
||||||
Kevin E Martin <kem@redhat.com> <kem@kem.org>
|
|
||||||
|
|
||||||
Kristian Høgsberg <krh@bitplanet.net>
|
|
||||||
Kristian Høgsberg <krh@bitplanet.net> <krh@redhat.com>
|
|
||||||
Kristian Høgsberg <krh@bitplanet.net> <krh@sasori.boston.redhat.com>
|
|
||||||
Kristian Høgsberg <krh@bitplanet.net> <krh@temari.boston.redhat.com>
|
|
||||||
|
|
||||||
Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
|
|
||||||
Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br> <lbsousajr@gmail.com>
|
|
||||||
|
|
||||||
Lina Versace <lina@kiwitree.net> <chad.versace@linux.intel.com>
|
|
||||||
|
|
||||||
Lucas Stach <dev@lynxeye.de> <l.stach@pengutronix.de>
|
|
||||||
|
|
||||||
Łukasz Spintzyk <lukasz.spintzyk@synaptics.com>
|
|
||||||
Łukasz Spintzyk <lukasz.spintzyk@synaptics.com> <lukasz.spintzyk@gmail.com>
|
|
||||||
|
|
||||||
Lyude Paul <lyude@redhat.com>
|
|
||||||
Lyude Paul <lyude@redhat.com> <cpaul@redhat.com>
|
|
||||||
|
|
||||||
Maarten Lankhorst <maarten.lankhorst@ubuntu.com> <dev@mblankhorst.nl>
|
|
||||||
Maarten Lankhorst <maarten.lankhorst@ubuntu.com> <maarten.lankhorst@canonical.com>
|
|
||||||
|
|
||||||
Marc Aurele La France <tsi@ualberta.ca> <tsi@ualberta.edu>
|
|
||||||
|
|
||||||
Mario Kleiner <mario.kleiner.de@gmail.com> <mario.kleiner@tuebingen.mpg.de>
|
|
||||||
|
|
||||||
Mark Kettenis <kettenis@openbsd.org> <mark.kettenis@xs4all.nl>
|
|
||||||
|
|
||||||
Matthew Allum <mallum@openedhand.com> <breakfast@10.am>
|
|
||||||
Matthew Allum <mallum@openedhand.com> <mallum@polystyrene.(none)>
|
|
||||||
|
|
||||||
Matthieu Herrb <matthieu@herrb.eu> <matthieu.herrb@laas.fr>
|
|
||||||
Matthieu Herrb <matthieu@herrb.eu> <matthieu@bluenote.herrb.com>
|
|
||||||
Matthieu Herrb <matthieu@herrb.eu> <matthieu@blues.laas.fr>
|
|
||||||
Matthieu Herrb <matthieu@herrb.eu> <matthieu@crux.(none)>
|
|
||||||
Matthieu Herrb <matthieu@herrb.eu> <matthieu@deville.herrb.com>
|
|
||||||
Matthieu Herrb <matthieu@herrb.eu> <matthieu@laas.fr>
|
|
||||||
Matthieu Herrb <matthieu@herrb.eu> <matthieu@roadrock.(none)>
|
|
||||||
|
|
||||||
Max Schwarz <Max@x-quadraht.de> <max.schwarz@online.de>
|
|
||||||
|
|
||||||
Maya Rashish <maya@NetBSD.org>
|
|
||||||
Maya Rashish <maya@NetBSD.org> <coypu@sdf.org>
|
|
||||||
|
|
||||||
Michal Srb <msrb@suse.com> <msrb@novell.com>
|
|
||||||
|
|
||||||
Michal Suchanek <hramrach@gmail.com> <hramrach@centrum.cz>
|
|
||||||
|
|
||||||
Michał Górny <gentoo@mgorny.alt.pl>
|
|
||||||
Michał Górny <gentoo@mgorny.alt.pl> <mgorny@gentoo.org>
|
|
||||||
|
|
||||||
Michael Vogt <mvo@ubuntu.com> <michael.vogt@ubuntu.com>
|
|
||||||
|
|
||||||
Michel Dänzer <michel@daenzer.net>
|
|
||||||
Michel Dänzer <michel@daenzer.net> <daenzer@debian.org>
|
|
||||||
Michel Dänzer <michel@daenzer.net> <daenzer@vmware.com>
|
|
||||||
Michel Dänzer <michel@daenzer.net> <mdaenzer@redhat.com>
|
|
||||||
Michel Dänzer <michel@daenzer.net> <michel.daenzer@amd.com>
|
|
||||||
Michel Dänzer <michel@daenzer.net> <michel@tungstengraphics.com>
|
|
||||||
|
|
||||||
Michele Baldessari <michele@redhat.com> <michele@acksyn.org>
|
|
||||||
|
|
||||||
Neil Roberts <nroberts@igalia.com> <neil@linux.intel.com>
|
|
||||||
|
|
||||||
nerdopolis <bluescreen_avenger@verizon.net> nerdopolis <rbos@rbos>
|
|
||||||
|
|
||||||
Nicolai Hähnle <nicolai.haehnle@amd.com>
|
|
||||||
Nicolai Hähnle <nicolai.haehnle@amd.com> <nhaehnle@gmail.com>
|
|
||||||
|
|
||||||
Niveditha Rau <niveditha.rau@oracle.com> <niveditha.rau@sun.com>
|
|
||||||
|
|
||||||
Oliver McFadden <oliver.mcfadden@linux.intel.com> <oliver.mcfadden@nokia.com>
|
|
||||||
|
|
||||||
Olivier Fourdan <ofourdan@redhat.com> <fourdan@xfce.org>
|
|
||||||
|
|
||||||
Owen W. Taylor <otaylor@fishsoup.net>
|
|
||||||
Owen W. Taylor <otaylor@fishsoup.net> <otaylor@huygens.home.fishsoup.net>
|
|
||||||
Owen W. Taylor <otaylor@fishsoup.net> <otaylor@redhat.com>
|
|
||||||
|
|
||||||
Pauli Nieminen <pauli.nieminen@linux.intel.com> <ext-pauli.nieminen@nokia.com>
|
|
||||||
|
|
||||||
Paulo Zanoni <paulo.r.zanoni@intel.com> Paulo Ricardo Zanoni <prz05@c3sl.ufpr.br>
|
|
||||||
Paulo Zanoni <paulo.r.zanoni@intel.com> Paulo Ricardo Zanoni <pzanoni@mandriva.com>
|
|
||||||
|
|
||||||
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 Hutterer <peter.hutterer@who-t.net> <peter.hutterer@redhat.com>
|
|
||||||
Peter Hutterer <peter.hutterer@who-t.net> <peter@cs.unisa.edu.au>
|
|
||||||
Peter Hutterer <peter.hutterer@who-t.net> <whot@potoroo.wearablelab.ml.unisa.edu.au>
|
|
||||||
Peter Hutterer <peter.hutterer@who-t.net> rpm-build <rpm-build>
|
|
||||||
|
|
||||||
Pierre Willenbrock <pierre@pirsoft.de> <pierre@pirsoft.dnsalias.org>
|
|
||||||
|
|
||||||
Qiang Yu <yuq825@gmail.com> <Qiang.Yu@amd.com>
|
|
||||||
|
|
||||||
Rami Ylimaki <rami.ylimaki@vincit.fi>
|
|
||||||
Rami Ylimaki <rami.ylimaki@vincit.fi> <ext-rami.ylimaki@nokia.com>
|
|
||||||
|
|
||||||
Rémi Cardona <remi@gentoo.org>
|
|
||||||
Rémi Cardona <remi@gentoo.org> <remi.cardona@lri.fr>
|
|
||||||
|
|
||||||
Rob Clark <robclark@freedesktop.org> <robdclark@gmail.com>
|
|
||||||
|
|
||||||
Roland Bär <roland@verifysoft.de>
|
|
||||||
|
|
||||||
Roland Scheidegger <sroland@vmware.com> <rscheidegger_lists@hispeed.ch>
|
|
||||||
Roland Scheidegger <sroland@vmware.com> <sroland@tungstengraphics.com>
|
|
||||||
|
|
||||||
Roman Gilg <subdiff@gmail.com>
|
|
||||||
Roman Kapl <code@rkapl.cz>
|
|
||||||
|
|
||||||
Ross Burton <ross.burton@intel.com> <ross@burtonini.com>
|
|
||||||
Ross Burton <ross.burton@intel.com> <ross@linux.intel.com>
|
|
||||||
|
|
||||||
Sam Lau <sam.lau@oracle.com> <sam.lau@sun.com>
|
|
||||||
|
|
||||||
Simon Farnsworth <simon.farnsworth@onelan.com> <simon.farnsworth@onelan.co.uk>
|
|
||||||
|
|
||||||
Sjoerd Simons <sjoerd@collabora.com> <sjoerd.simons@collabora.co.uk>
|
|
||||||
|
|
||||||
Søren Sandmann Pedersen <sandmann@redhat.com>
|
|
||||||
Søren Sandmann Pedersen <sandmann@redhat.com> <soren.sandmann@gmail.com>
|
|
||||||
Søren Sandmann Pedersen <sandmann@redhat.com> <sandmann@daimi.au.dk>
|
|
||||||
Søren Sandmann Pedersen <sandmann@redhat.com> <ssp@l3000.localdomain>
|
|
||||||
Søren Sandmann Pedersen <sandmann@redhat.com> <ssp@redhat.com>
|
|
||||||
Søren Sandmann Pedersen <sandmann@redhat.com> <ssp@dhcp83-218.boston.redhat.com>
|
|
||||||
|
|
||||||
Stuart Kreitman <stuart.kreitman@oracle.com> <stuart.kreitman@sun.com>
|
|
||||||
|
|
||||||
Thierry Reding <treding@nvidia.com> <thierry.reding@avionic-design.de>
|
|
||||||
Thierry Reding <treding@nvidia.com> <thierry.reding@gmail.com>
|
|
||||||
|
|
||||||
Thomas Hellstrom <thellstrom@vmware.com> <thomas-at-tungstengraphics-dot-com>
|
|
||||||
Thomas Hellstrom <thellstrom@vmware.com> <thomas-at-tungstengraphics.com>
|
|
||||||
Thomas Hellstrom <thellstrom@vmware.com> <unichrome@shipmail.org>
|
|
||||||
|
|
||||||
Thomas Jaeger <thjaeger@gmail.com> <ThJaeger@gmail.com>
|
|
||||||
|
|
||||||
Tiago Vignatti <tiago.vignatti@nokia.com>
|
|
||||||
Tiago Vignatti <tiago.vignatti@nokia.com> <tiago.vignatti@Nokia.com>
|
|
||||||
Tiago Vignatti <tiago.vignatti@nokia.com> <tiagov@balalaika.(none)>
|
|
||||||
Tiago Vignatti <tiago.vignatti@nokia.com> <tv02@c3sl.ufpr.br>
|
|
||||||
Tiago Vignatti <tiago.vignatti@nokia.com> <vignatti@c3sl.ufpr.br>
|
|
||||||
|
|
||||||
Timo Aaltonen <tjaalton@debian.org> <tjaalton@cc.hut.fi>
|
|
||||||
Timo Aaltonen <tjaalton@debian.org> <tjaalton@ubuntu.com>
|
|
||||||
|
|
||||||
Tomas Carnecky <tomas.carnecky@gmail.com> <tom@dbservice.com>
|
|
||||||
|
|
||||||
Tormod Volden <debian.tormod@gmail.com> <lists.tormod@gmail.com>
|
|
||||||
Tormod Volden <debian.tormod@gmail.com> <bugzi06.fdo.tormod@xoxy.net>
|
|
||||||
|
|
||||||
Ville Syrjälä <ville.syrjala@linux.intel.com>
|
|
||||||
Ville Syrjälä <ville.syrjala@linux.intel.com> <syrjala@sci.fi>
|
|
||||||
Ville Syrjälä <ville.syrjala@linux.intel.com> <ville.syrjala@nokia.com>
|
|
||||||
|
|
||||||
Yuriy Vasilev <uuvasiliev@yandex.ru>
|
|
||||||
|
|
||||||
Zack Rusin <zackr@vmware.com> <zack@kde.org>
|
|
||||||
Zack Rusin <zackr@vmware.com> <zack@tungstengraphics.com>
|
|
||||||
|
|
||||||
Zephaniah E. Hull <warp@aehallh.com> <warp@agamemnon.b5>
|
|
||||||
|
|
||||||
Zhenyu Wang <zhenyuw@linux.intel.com> <zhenyu.z.wang@intel.com>
|
|
||||||
|
|
||||||
Zhigang Gong <zhigang.gong@intel.com> <zhigang.gong@gmail.com>
|
|
||||||
Zhigang Gong <zhigang.gong@intel.com> <zhigang.gong@linux.intel.com>
|
|
||||||
|
|
||||||
Zoltán Böszörményi <zboszor@gmail.com>
|
|
||||||
Zoltán Böszörményi <zboszor@gmail.com> <zboszor@pr.hu>
|
|
||||||
32
.travis.yml
32
.travis.yml
|
|
@ -1,27 +1,29 @@
|
||||||
language: c
|
language: c
|
||||||
cache:
|
cache: ccache
|
||||||
ccache: true
|
|
||||||
directories:
|
|
||||||
- $HOME/Library/Caches/Homebrew
|
|
||||||
branches:
|
branches:
|
||||||
except:
|
except:
|
||||||
- /appveyor.*/
|
- /appveyor.*/
|
||||||
|
|
||||||
os: osx
|
|
||||||
osx_image: xcode9.2
|
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- env: TOOL=meson
|
- os: linux
|
||||||
- env: TOOL=autotools
|
dist: trusty
|
||||||
|
services: docker
|
||||||
|
env: DISTRO=rawhide:v5
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode9.2
|
||||||
|
env: DISTRO=xcode9.2
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- brew update
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache ; fi
|
||||||
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache meson
|
|
||||||
|
before_script:
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull nwnk/xserver-travis-$DISTRO ; fi
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo FROM nwnk/xserver-travis-$DISTRO > Dockerfile ; fi
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo ADD . /root >> Dockerfile ; fi
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker build -t withgit . ; fi
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ./test/scripts/build-travis-osx.sh $TOOL
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run --volume $HOME/.ccache:/root/.ccache withgit /bin/sh -c "cd /root && ./test/scripts/build-travis-deps.sh" ; fi
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./test/scripts/build-travis-osx.sh ; fi
|
||||||
- ccache -s
|
- 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-2008 Peter Hutterer
|
||||||
Copyright © 2006 Adam Jackson
|
Copyright © 2006 Adam Jackson
|
||||||
Copyright © 2009-2010 NVIDIA Corporation
|
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 © 1999 Keith Packard
|
||||||
Copyright © 2007-2009 Red Hat, Inc.
|
Copyright © 2007-2009 Red Hat, Inc.
|
||||||
Copyright © 2005-2008 Daniel Stone
|
Copyright © 2005-2008 Daniel Stone
|
||||||
|
|
|
||||||
215
Makefile.am
Normal file
215
Makefile.am
Normal file
|
|
@ -0,0 +1,215 @@
|
||||||
|
AUTOMAKE_OPTIONS=nostdinc
|
||||||
|
|
||||||
|
# Required for automake < 1.14
|
||||||
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
|
if COMPOSITE
|
||||||
|
COMPOSITE_DIR=composite
|
||||||
|
endif
|
||||||
|
|
||||||
|
if GLX
|
||||||
|
GLX_DIR=glx
|
||||||
|
endif
|
||||||
|
|
||||||
|
if DBE
|
||||||
|
DBE_DIR=dbe
|
||||||
|
endif
|
||||||
|
|
||||||
|
if RECORD
|
||||||
|
RECORD_DIR=record
|
||||||
|
endif
|
||||||
|
|
||||||
|
if DRI3
|
||||||
|
DRI3_DIR=dri3
|
||||||
|
endif
|
||||||
|
|
||||||
|
if PRESENT
|
||||||
|
PRESENT_DIR=present
|
||||||
|
endif
|
||||||
|
|
||||||
|
if PSEUDORAMIX
|
||||||
|
PSEUDORAMIX_DIR=pseudoramiX
|
||||||
|
endif
|
||||||
|
|
||||||
|
if GLAMOR
|
||||||
|
GLAMOR_DIR=glamor
|
||||||
|
endif
|
||||||
|
|
||||||
|
SUBDIRS = \
|
||||||
|
doc \
|
||||||
|
man \
|
||||||
|
include \
|
||||||
|
dix \
|
||||||
|
fb \
|
||||||
|
mi \
|
||||||
|
Xext \
|
||||||
|
miext \
|
||||||
|
os \
|
||||||
|
randr \
|
||||||
|
render \
|
||||||
|
Xi \
|
||||||
|
xkb \
|
||||||
|
$(PSEUDORAMIX_DIR) \
|
||||||
|
$(DBE_DIR) \
|
||||||
|
$(RECORD_DIR) \
|
||||||
|
xfixes \
|
||||||
|
damageext \
|
||||||
|
$(COMPOSITE_DIR) \
|
||||||
|
$(GLX_DIR) \
|
||||||
|
$(PRESENT_DIR) \
|
||||||
|
$(DRI3_DIR) \
|
||||||
|
exa \
|
||||||
|
$(GLAMOR_DIR) \
|
||||||
|
config \
|
||||||
|
hw \
|
||||||
|
test
|
||||||
|
|
||||||
|
if XORG
|
||||||
|
aclocaldir = $(datadir)/aclocal
|
||||||
|
aclocal_DATA = xorg-server.m4
|
||||||
|
|
||||||
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
|
pkgconfig_DATA = xorg-server.pc
|
||||||
|
endif
|
||||||
|
|
||||||
|
EXTRA_DIST = xorg-server.pc.in xorg-server.m4 autogen.sh
|
||||||
|
|
||||||
|
DISTCHECK_CONFIGURE_FLAGS=\
|
||||||
|
--with-xkb-path=$(XKB_BASE_DIRECTORY) \
|
||||||
|
--with-xkb-bin-directory=$(XKB_BIN_DIRECTORY) \
|
||||||
|
--with-xkb-output='$${datadir}/X11/xkb/compiled'
|
||||||
|
|
||||||
|
.PHONY: ChangeLog INSTALL
|
||||||
|
|
||||||
|
INSTALL:
|
||||||
|
$(INSTALL_CMD)
|
||||||
|
|
||||||
|
ChangeLog:
|
||||||
|
$(CHANGELOG_CMD)
|
||||||
|
|
||||||
|
dist-hook: ChangeLog INSTALL
|
||||||
|
|
||||||
|
DIST_SUBDIRS = \
|
||||||
|
doc \
|
||||||
|
man \
|
||||||
|
include \
|
||||||
|
dix \
|
||||||
|
fb \
|
||||||
|
mi \
|
||||||
|
Xext \
|
||||||
|
miext \
|
||||||
|
os \
|
||||||
|
pseudoramiX \
|
||||||
|
randr \
|
||||||
|
render \
|
||||||
|
Xi \
|
||||||
|
xkb \
|
||||||
|
dbe \
|
||||||
|
record \
|
||||||
|
xfixes \
|
||||||
|
damageext \
|
||||||
|
composite \
|
||||||
|
glx \
|
||||||
|
exa \
|
||||||
|
glamor \
|
||||||
|
config \
|
||||||
|
dri3 \
|
||||||
|
present \
|
||||||
|
hw \
|
||||||
|
test
|
||||||
|
|
||||||
|
# gross hack
|
||||||
|
relink: all
|
||||||
|
$(AM_V_at)$(MAKE) -C hw relink
|
||||||
|
|
||||||
|
install-headers: Makefile
|
||||||
|
+find . -name Makefile | while read m; do \
|
||||||
|
if grep -q install-sdkHEADERS $$m; then \
|
||||||
|
(cd `dirname "$$m"` && make install-sdkHEADERS) \
|
||||||
|
fi \
|
||||||
|
done
|
||||||
|
|
||||||
|
distcheck-hook:
|
||||||
|
cd $(srcdir) && \
|
||||||
|
meson setup _distcheck_build && \
|
||||||
|
meson configure _distcheck_build && \
|
||||||
|
ninja -C _distcheck_build && \
|
||||||
|
rm -rf _distcheck_build && \
|
||||||
|
cd -
|
||||||
|
|
||||||
|
EXTRA_DIST += \
|
||||||
|
meson_options.txt \
|
||||||
|
include/xorg-config.h.meson.in \
|
||||||
|
include/xwin-config.h.meson.in \
|
||||||
|
hw/xfree86/loader/symbol-test.c \
|
||||||
|
hw/xfree86/common/xf86Build.sh \
|
||||||
|
composite/meson.build \
|
||||||
|
config/meson.build \
|
||||||
|
damageext/meson.build \
|
||||||
|
dbe/meson.build \
|
||||||
|
dix/meson.build \
|
||||||
|
dri3/meson.build \
|
||||||
|
exa/meson.build \
|
||||||
|
fb/meson.build \
|
||||||
|
glamor/meson.build \
|
||||||
|
glx/meson.build \
|
||||||
|
hw/dmx/config/meson.build \
|
||||||
|
hw/dmx/examples/meson.build \
|
||||||
|
hw/dmx/glxProxy/meson.build \
|
||||||
|
hw/dmx/input/meson.build \
|
||||||
|
hw/dmx/meson.build \
|
||||||
|
hw/kdrive/ephyr/meson.build \
|
||||||
|
hw/kdrive/meson.build \
|
||||||
|
hw/kdrive/src/meson.build \
|
||||||
|
hw/meson.build \
|
||||||
|
hw/vfb/meson.build \
|
||||||
|
hw/xfree86/common/meson.build \
|
||||||
|
hw/xfree86/ddc/meson.build \
|
||||||
|
hw/xfree86/dixmods/meson.build \
|
||||||
|
hw/xfree86/dri2/meson.build \
|
||||||
|
hw/xfree86/dri/meson.build \
|
||||||
|
hw/xfree86/drivers/modesetting/meson.build \
|
||||||
|
hw/xfree86/exa/meson.build \
|
||||||
|
hw/xfree86/fbdevhw/meson.build \
|
||||||
|
hw/xfree86/glamor_egl/meson.build \
|
||||||
|
hw/xfree86/i2c/meson.build \
|
||||||
|
hw/xfree86/int10/meson.build \
|
||||||
|
hw/xfree86/loader/meson.build \
|
||||||
|
hw/xfree86/meson.build \
|
||||||
|
hw/xfree86/modes/meson.build \
|
||||||
|
hw/xfree86/os-support/meson.build \
|
||||||
|
hw/xfree86/parser/meson.build \
|
||||||
|
hw/xfree86/ramdac/meson.build \
|
||||||
|
hw/xfree86/shadowfb/meson.build \
|
||||||
|
hw/xfree86/vbe/meson.build \
|
||||||
|
hw/xfree86/vgahw/meson.build \
|
||||||
|
hw/xfree86/x86emu/meson.build \
|
||||||
|
hw/xfree86/xkb/meson.build \
|
||||||
|
hw/xnest/meson.build \
|
||||||
|
hw/xquartz/meson.build \
|
||||||
|
hw/xwayland/meson.build \
|
||||||
|
hw/xwin/dri/meson.build \
|
||||||
|
hw/xwin/glx/meson.build \
|
||||||
|
hw/xwin/meson.build \
|
||||||
|
hw/xwin/winclipboard/meson.build \
|
||||||
|
include/meson.build \
|
||||||
|
meson.build \
|
||||||
|
miext/damage/meson.build \
|
||||||
|
miext/shadow/meson.build \
|
||||||
|
miext/sync/meson.build \
|
||||||
|
mi/meson.build \
|
||||||
|
os/meson.build \
|
||||||
|
present/meson.build \
|
||||||
|
pseudoramiX/meson.build \
|
||||||
|
randr/meson.build \
|
||||||
|
record/meson.build \
|
||||||
|
render/meson.build \
|
||||||
|
test/bigreq/meson.build \
|
||||||
|
test/bigreq/request-length.c \
|
||||||
|
test/meson.build \
|
||||||
|
test/sync/meson.build \
|
||||||
|
test/sync/sync.c \
|
||||||
|
Xext/meson.build \
|
||||||
|
xfixes/meson.build \
|
||||||
|
Xi/meson.build \
|
||||||
|
xkb/meson.build
|
||||||
|
|
@ -1,11 +1,4 @@
|
||||||
************************************************************************
|
X Server
|
||||||
* This is the now defunct 'master' branch of the xserver repository. *
|
|
||||||
* Ongoing development has moved to the 'main' branch instead. *
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
|
|
||||||
X Server
|
|
||||||
--------
|
|
||||||
|
|
||||||
The X server accepts requests from client applications to create windows,
|
The X server accepts requests from client applications to create windows,
|
||||||
which are (normally rectangular) "virtual screens" that the client program
|
which are (normally rectangular) "virtual screens" that the client program
|
||||||
|
|
@ -23,19 +16,29 @@ https://en.wikipedia.org/wiki/X_server
|
||||||
All questions regarding this software should be directed at the
|
All questions regarding this software should be directed at the
|
||||||
Xorg mailing list:
|
Xorg mailing list:
|
||||||
|
|
||||||
https://lists.freedesktop.org/mailman/listinfo/xorg
|
https://lists.freedesktop.org/mailman/listinfo/xorg
|
||||||
|
|
||||||
The primary development code repository can be found at:
|
Please submit bug reports to the Xorg bugzilla:
|
||||||
|
|
||||||
https://gitlab.freedesktop.org/xorg/xserver
|
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
|
||||||
|
|
||||||
|
The master development code repository can be found at:
|
||||||
|
|
||||||
|
git://anongit.freedesktop.org/git/xorg/xserver
|
||||||
|
|
||||||
|
https://cgit.freedesktop.org/xorg/xserver
|
||||||
|
|
||||||
For patch submission instructions, see:
|
For patch submission instructions, see:
|
||||||
|
|
||||||
https://www.x.org/wiki/Development/Documentation/SubmittingPatches
|
https://www.x.org/wiki/Development/Documentation/SubmittingPatches
|
||||||
|
|
||||||
|
For more information on the git code manager, see:
|
||||||
|
|
||||||
|
https://wiki.x.org/wiki/GitPage
|
||||||
|
|
||||||
As with other projects hosted on freedesktop.org, X.Org follows its
|
As with other projects hosted on freedesktop.org, X.Org follows its
|
||||||
Code of Conduct, based on the Contributor Covenant. Please conduct
|
Code of Conduct, based on the Contributor Covenant. Please conduct
|
||||||
yourself in a respectful and civilized manner when using the above
|
yourself in a respectful and civilized manner when using the above
|
||||||
mailing lists, bug trackers, etc:
|
mailing lists, bug trackers, etc:
|
||||||
|
|
||||||
https://www.freedesktop.org/wiki/CodeOfConduct
|
https://www.freedesktop.org/wiki/CodeOfConduct
|
||||||
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.
|
|
||||||
114
Xext/Makefile.am
Normal file
114
Xext/Makefile.am
Normal file
|
|
@ -0,0 +1,114 @@
|
||||||
|
noinst_LTLIBRARIES = libXext.la libXvidmode.la
|
||||||
|
|
||||||
|
AM_CFLAGS = $(DIX_CFLAGS)
|
||||||
|
|
||||||
|
if XORG
|
||||||
|
sdk_HEADERS = xvdix.h xvmcext.h geext.h geint.h shmint.h syncsdk.h
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Sources always included in libXextbuiltin.la, libXext.la
|
||||||
|
BUILTIN_SRCS = \
|
||||||
|
bigreq.c \
|
||||||
|
geext.c \
|
||||||
|
shape.c \
|
||||||
|
sleepuntil.c \
|
||||||
|
sleepuntil.h \
|
||||||
|
sync.c \
|
||||||
|
syncsdk.h \
|
||||||
|
syncsrv.h \
|
||||||
|
xcmisc.c \
|
||||||
|
xtest.c
|
||||||
|
BUILTIN_LIBS =
|
||||||
|
|
||||||
|
# Optional sources included if extension enabled by configure.ac rules
|
||||||
|
|
||||||
|
# MIT Shared Memory extension
|
||||||
|
MITSHM_SRCS = shm.c shmint.h
|
||||||
|
if MITSHM
|
||||||
|
BUILTIN_SRCS += $(MITSHM_SRCS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# XVideo extension
|
||||||
|
XV_SRCS = xvmain.c xvdisp.c xvmc.c xvdix.h xvmcext.h xvdisp.h
|
||||||
|
if XV
|
||||||
|
BUILTIN_SRCS += $(XV_SRCS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# XResource extension: lets clients get data about per-client resource usage
|
||||||
|
RES_SRCS = hashtable.c hashtable.h xres.c
|
||||||
|
if RES
|
||||||
|
BUILTIN_SRCS += $(RES_SRCS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# MIT ScreenSaver extension
|
||||||
|
SCREENSAVER_SRCS = saver.c
|
||||||
|
if SCREENSAVER
|
||||||
|
BUILTIN_SRCS += $(SCREENSAVER_SRCS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Xinerama extension: making multiple video devices act as one virtual screen
|
||||||
|
XINERAMA_SRCS = panoramiX.c panoramiX.h panoramiXh.h panoramiXsrv.h panoramiXprocs.c panoramiXSwap.c
|
||||||
|
if XINERAMA
|
||||||
|
BUILTIN_SRCS += $(XINERAMA_SRCS)
|
||||||
|
if XORG
|
||||||
|
sdk_HEADERS += panoramiXsrv.h panoramiX.h
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# X-ACE extension: provides hooks for building security policy extensions
|
||||||
|
# like XC-Security, X-SELinux & XTSol
|
||||||
|
XACE_SRCS = xace.c xace.h xacestr.h
|
||||||
|
if XACE
|
||||||
|
BUILTIN_SRCS += $(XACE_SRCS)
|
||||||
|
if XORG
|
||||||
|
sdk_HEADERS += xace.h xacestr.h
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# SELinux extension: provides SELinux policy support for X objects
|
||||||
|
# requires X-ACE extension
|
||||||
|
XSELINUX_SRCS = xselinux_ext.c xselinux_hooks.c xselinux_label.c xselinux.h xselinuxint.h
|
||||||
|
if XSELINUX
|
||||||
|
BUILTIN_SRCS += $(XSELINUX_SRCS)
|
||||||
|
BUILTIN_LIBS += $(SELINUX_LIBS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Security extension: multi-level security to protect clients from each other
|
||||||
|
XCSECURITY_SRCS = security.c securitysrv.h
|
||||||
|
if XCSECURITY
|
||||||
|
BUILTIN_SRCS += $(XCSECURITY_SRCS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# XF86 Big Font extension
|
||||||
|
BIGFONT_SRCS = xf86bigfont.c xf86bigfontsrv.h
|
||||||
|
if XF86BIGFONT
|
||||||
|
BUILTIN_SRCS += $(BIGFONT_SRCS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# DPMS extension
|
||||||
|
DPMS_SRCS = dpms.c dpmsproc.h
|
||||||
|
if DPMSExtension
|
||||||
|
BUILTIN_SRCS += $(DPMS_SRCS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Now take all of the above, mix well, bake for 10 minutes and get libXext*.la
|
||||||
|
|
||||||
|
libXext_la_SOURCES = $(BUILTIN_SRCS)
|
||||||
|
libXext_la_LIBADD = $(BUILTIN_LIBS)
|
||||||
|
|
||||||
|
# XVidMode extension
|
||||||
|
libXvidmode_la_SOURCES = vidmode.c
|
||||||
|
|
||||||
|
EXTRA_DIST = \
|
||||||
|
$(MITSHM_SRCS) \
|
||||||
|
$(XV_SRCS) \
|
||||||
|
$(RES_SRCS) \
|
||||||
|
$(SCREENSAVER_SRCS) \
|
||||||
|
$(XACE_SRCS) \
|
||||||
|
$(XCSECURITY_SRCS) \
|
||||||
|
$(XSELINUX_SRCS) \
|
||||||
|
$(XINERAMA_SRCS) \
|
||||||
|
$(BIGFONT_SRCS) \
|
||||||
|
$(DPMS_SRCS) \
|
||||||
|
$(GE_SRCS)
|
||||||
|
|
||||||
|
|
@ -26,18 +26,19 @@ from The Open Group.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "dixstruct.h"
|
#include "dixstruct.h"
|
||||||
#include "dix_priv.h"
|
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include <X11/extensions/bigreqsproto.h>
|
#include <X11/extensions/bigreqsproto.h>
|
||||||
#include "opaque.h"
|
#include "opaque.h"
|
||||||
#include "extinit_priv.h"
|
#include "extinit.h"
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcBigReqDispatch(ClientPtr client)
|
ProcBigReqDispatch(ClientPtr client)
|
||||||
|
|
@ -45,6 +46,9 @@ ProcBigReqDispatch(ClientPtr client)
|
||||||
REQUEST(xBigReqEnableReq);
|
REQUEST(xBigReqEnableReq);
|
||||||
xBigReqEnableReply rep;
|
xBigReqEnableReply rep;
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&stuff->length);
|
||||||
|
}
|
||||||
if (stuff->brReqType != X_BigReqEnable)
|
if (stuff->brReqType != X_BigReqEnable)
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
REQUEST_SIZE_MATCH(xBigReqEnableReq);
|
REQUEST_SIZE_MATCH(xBigReqEnableReq);
|
||||||
|
|
|
||||||
292
Xext/dpms.c
292
Xext/dpms.c
|
|
@ -26,14 +26,12 @@ Equipment Corporation.
|
||||||
|
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
|
|
||||||
#include "os/screensaver.h"
|
|
||||||
#include "Xext/geext.h"
|
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "dixstruct.h"
|
#include "dixstruct.h"
|
||||||
|
|
@ -41,10 +39,9 @@ Equipment Corporation.
|
||||||
#include "opaque.h"
|
#include "opaque.h"
|
||||||
#include <X11/extensions/dpmsproto.h>
|
#include <X11/extensions/dpmsproto.h>
|
||||||
#include "dpmsproc.h"
|
#include "dpmsproc.h"
|
||||||
#include "extinit_priv.h"
|
#include "extinit.h"
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include "protocol-versions.h"
|
|
||||||
|
|
||||||
CARD16 DPMSPowerLevel = 0;
|
CARD16 DPMSPowerLevel = 0;
|
||||||
Bool DPMSDisabledSwitch = FALSE;
|
Bool DPMSDisabledSwitch = FALSE;
|
||||||
|
|
@ -53,178 +50,6 @@ CARD32 DPMSSuspendTime = -1;
|
||||||
CARD32 DPMSOffTime = -1;
|
CARD32 DPMSOffTime = -1;
|
||||||
Bool DPMSEnabled;
|
Bool DPMSEnabled;
|
||||||
|
|
||||||
static int DPMSReqCode = 0;
|
|
||||||
static RESTYPE ClientType, DPMSEventType; /* resource types for event masks */
|
|
||||||
static XID eventResource;
|
|
||||||
|
|
||||||
typedef struct _DPMSEvent *DPMSEventPtr;
|
|
||||||
typedef struct _DPMSEvent {
|
|
||||||
DPMSEventPtr next;
|
|
||||||
ClientPtr client;
|
|
||||||
XID clientResource;
|
|
||||||
unsigned int mask;
|
|
||||||
} DPMSEventRec;
|
|
||||||
|
|
||||||
/*ARGSUSED*/ static int
|
|
||||||
DPMSFreeClient(void *data, XID id)
|
|
||||||
{
|
|
||||||
DPMSEventPtr pEvent;
|
|
||||||
DPMSEventPtr *pHead, pCur, pPrev;
|
|
||||||
|
|
||||||
pEvent = (DPMSEventPtr) data;
|
|
||||||
dixLookupResourceByType((void *) &pHead, eventResource, DPMSEventType,
|
|
||||||
NullClient, DixUnknownAccess);
|
|
||||||
if (pHead) {
|
|
||||||
pPrev = 0;
|
|
||||||
for (pCur = *pHead; pCur && pCur != pEvent; pCur = pCur->next)
|
|
||||||
pPrev = pCur;
|
|
||||||
if (pCur) {
|
|
||||||
if (pPrev)
|
|
||||||
pPrev->next = pEvent->next;
|
|
||||||
else
|
|
||||||
*pHead = pEvent->next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
free((void *) pEvent);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*ARGSUSED*/ static int
|
|
||||||
DPMSFreeEvents(void *data, XID id)
|
|
||||||
{
|
|
||||||
DPMSEventPtr *pHead, pCur, pNext;
|
|
||||||
|
|
||||||
pHead = (DPMSEventPtr *) data;
|
|
||||||
for (pCur = *pHead; pCur; pCur = pNext) {
|
|
||||||
pNext = pCur->next;
|
|
||||||
FreeResource(pCur->clientResource, ClientType);
|
|
||||||
free((void *) pCur);
|
|
||||||
}
|
|
||||||
free((void *) pHead);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
SDPMSInfoNotifyEvent(xGenericEvent * from,
|
|
||||||
xGenericEvent * to)
|
|
||||||
{
|
|
||||||
*to = *from;
|
|
||||||
swaps(&to->sequenceNumber);
|
|
||||||
swapl(&to->length);
|
|
||||||
swaps(&to->evtype);
|
|
||||||
if (from->evtype == DPMSInfoNotify) {
|
|
||||||
xDPMSInfoNotifyEvent *c = (xDPMSInfoNotifyEvent *) to;
|
|
||||||
swapl(&c->timestamp);
|
|
||||||
swaps(&c->power_level);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
ProcDPMSSelectInput(register ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xDPMSSelectInputReq);
|
|
||||||
DPMSEventPtr pEvent, pNewEvent, *pHead;
|
|
||||||
XID clientResource;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSSelectInputReq);
|
|
||||||
i = dixLookupResourceByType((void **)&pHead, eventResource, DPMSEventType,
|
|
||||||
client,
|
|
||||||
DixWriteAccess);
|
|
||||||
if (stuff->eventMask == DPMSInfoNotifyMask) {
|
|
||||||
if (i == Success && pHead) {
|
|
||||||
/* check for existing entry. */
|
|
||||||
for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
|
|
||||||
if (pEvent->client == client) {
|
|
||||||
pEvent->mask = stuff->eventMask;
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* build the entry */
|
|
||||||
pNewEvent = (DPMSEventPtr)malloc(sizeof(DPMSEventRec));
|
|
||||||
if (!pNewEvent)
|
|
||||||
return BadAlloc;
|
|
||||||
pNewEvent->next = 0;
|
|
||||||
pNewEvent->client = client;
|
|
||||||
pNewEvent->mask = stuff->eventMask;
|
|
||||||
/*
|
|
||||||
* add a resource that will be deleted when
|
|
||||||
* the client goes away
|
|
||||||
*/
|
|
||||||
clientResource = FakeClientID(client->index);
|
|
||||||
pNewEvent->clientResource = clientResource;
|
|
||||||
if (!AddResource(clientResource, ClientType, (void *)pNewEvent))
|
|
||||||
return BadAlloc;
|
|
||||||
/*
|
|
||||||
* create a resource to contain a pointer to the list
|
|
||||||
* of clients selecting input
|
|
||||||
*/
|
|
||||||
if (i != Success || !pHead) {
|
|
||||||
pHead = (DPMSEventPtr *)malloc(sizeof(DPMSEventPtr));
|
|
||||||
if (!pHead ||
|
|
||||||
!AddResource(eventResource, DPMSEventType, (void *)pHead)) {
|
|
||||||
FreeResource(clientResource, X11_RESTYPE_NONE);
|
|
||||||
return BadAlloc;
|
|
||||||
}
|
|
||||||
*pHead = 0;
|
|
||||||
}
|
|
||||||
pNewEvent->next = *pHead;
|
|
||||||
*pHead = pNewEvent;
|
|
||||||
}
|
|
||||||
else if (stuff->eventMask == 0) {
|
|
||||||
/* delete the interest */
|
|
||||||
if (i == Success && pHead) {
|
|
||||||
pNewEvent = 0;
|
|
||||||
for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
|
|
||||||
if (pEvent->client == client)
|
|
||||||
break;
|
|
||||||
pNewEvent = pEvent;
|
|
||||||
}
|
|
||||||
if (pEvent) {
|
|
||||||
FreeResource(pEvent->clientResource, ClientType);
|
|
||||||
if (pNewEvent)
|
|
||||||
pNewEvent->next = pEvent->next;
|
|
||||||
else
|
|
||||||
*pHead = pEvent->next;
|
|
||||||
free(pEvent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
client->errorValue = stuff->eventMask;
|
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
SendDPMSInfoNotify(void)
|
|
||||||
{
|
|
||||||
DPMSEventPtr *pHead, pEvent;
|
|
||||||
xDPMSInfoNotifyEvent se;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
i = dixLookupResourceByType((void **)&pHead, eventResource, DPMSEventType,
|
|
||||||
serverClient,
|
|
||||||
DixReadAccess);
|
|
||||||
if (i != Success || !pHead)
|
|
||||||
return;
|
|
||||||
for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
|
|
||||||
if ((pEvent->mask & DPMSInfoNotifyMask) == 0)
|
|
||||||
continue;
|
|
||||||
se.type = GenericEvent;
|
|
||||||
se.extension = DPMSReqCode;
|
|
||||||
se.length = (sizeof(xDPMSInfoNotifyEvent) - 32) >> 2;
|
|
||||||
se.evtype = DPMSInfoNotify;
|
|
||||||
se.timestamp = currentTime.milliseconds;
|
|
||||||
se.power_level = DPMSPowerLevel;
|
|
||||||
se.state = DPMSEnabled;
|
|
||||||
WriteEventsToClient(pEvent->client, 1, (xEvent *)&se);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
DPMSSupported(void)
|
DPMSSupported(void)
|
||||||
{
|
{
|
||||||
|
|
@ -261,7 +86,6 @@ int
|
||||||
DPMSSet(ClientPtr client, int level)
|
DPMSSet(ClientPtr client, int level)
|
||||||
{
|
{
|
||||||
int rc, i;
|
int rc, i;
|
||||||
int old_level = DPMSPowerLevel;
|
|
||||||
|
|
||||||
DPMSPowerLevel = level;
|
DPMSPowerLevel = level;
|
||||||
|
|
||||||
|
|
@ -285,9 +109,6 @@ DPMSSet(ClientPtr client, int level)
|
||||||
if (screenInfo.gpuscreens[i]->DPMS != NULL)
|
if (screenInfo.gpuscreens[i]->DPMS != NULL)
|
||||||
screenInfo.gpuscreens[i]->DPMS(screenInfo.gpuscreens[i], level);
|
screenInfo.gpuscreens[i]->DPMS(screenInfo.gpuscreens[i], level);
|
||||||
|
|
||||||
if (DPMSPowerLevel != old_level)
|
|
||||||
SendDPMSInfoNotify();
|
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -299,8 +120,8 @@ ProcDPMSGetVersion(ClientPtr client)
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0,
|
.length = 0,
|
||||||
.majorVersion = SERVER_DPMS_MAJOR_VERSION,
|
.majorVersion = DPMSMajorVersion,
|
||||||
.minorVersion = SERVER_DPMS_MINOR_VERSION
|
.minorVersion = DPMSMinorVersion
|
||||||
};
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
|
REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
|
||||||
|
|
@ -391,10 +212,8 @@ ProcDPMSEnable(ClientPtr client)
|
||||||
REQUEST_SIZE_MATCH(xDPMSEnableReq);
|
REQUEST_SIZE_MATCH(xDPMSEnableReq);
|
||||||
|
|
||||||
DPMSEnabled = TRUE;
|
DPMSEnabled = TRUE;
|
||||||
if (!was_enabled) {
|
if (!was_enabled)
|
||||||
SetScreenSaverTimer();
|
SetScreenSaverTimer();
|
||||||
SendDPMSInfoNotify();
|
|
||||||
}
|
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
@ -402,8 +221,6 @@ ProcDPMSEnable(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcDPMSDisable(ClientPtr client)
|
ProcDPMSDisable(ClientPtr client)
|
||||||
{
|
{
|
||||||
Bool was_enabled = DPMSEnabled;
|
|
||||||
|
|
||||||
/* REQUEST(xDPMSDisableReq); */
|
/* REQUEST(xDPMSDisableReq); */
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSDisableReq);
|
REQUEST_SIZE_MATCH(xDPMSDisableReq);
|
||||||
|
|
@ -411,8 +228,6 @@ ProcDPMSDisable(ClientPtr client)
|
||||||
DPMSSet(client, DPMSModeOn);
|
DPMSSet(client, DPMSModeOn);
|
||||||
|
|
||||||
DPMSEnabled = FALSE;
|
DPMSEnabled = FALSE;
|
||||||
if (was_enabled)
|
|
||||||
SendDPMSInfoNotify();
|
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
@ -483,8 +298,6 @@ ProcDPMSDispatch(ClientPtr client)
|
||||||
return ProcDPMSForceLevel(client);
|
return ProcDPMSForceLevel(client);
|
||||||
case X_DPMSInfo:
|
case X_DPMSInfo:
|
||||||
return ProcDPMSInfo(client);
|
return ProcDPMSInfo(client);
|
||||||
case X_DPMSSelectInput:
|
|
||||||
return ProcDPMSSelectInput(client);
|
|
||||||
default:
|
default:
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
|
|
@ -494,16 +307,42 @@ static int _X_COLD
|
||||||
SProcDPMSGetVersion(ClientPtr client)
|
SProcDPMSGetVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xDPMSGetVersionReq);
|
REQUEST(xDPMSGetVersionReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
|
REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
|
||||||
swaps(&stuff->majorVersion);
|
swaps(&stuff->majorVersion);
|
||||||
swaps(&stuff->minorVersion);
|
swaps(&stuff->minorVersion);
|
||||||
return ProcDPMSGetVersion(client);
|
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
|
static int _X_COLD
|
||||||
SProcDPMSSetTimeouts(ClientPtr client)
|
SProcDPMSSetTimeouts(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xDPMSSetTimeoutsReq);
|
REQUEST(xDPMSSetTimeoutsReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq);
|
REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq);
|
||||||
|
|
||||||
swaps(&stuff->standby);
|
swaps(&stuff->standby);
|
||||||
|
|
@ -512,10 +351,34 @@ SProcDPMSSetTimeouts(ClientPtr client)
|
||||||
return ProcDPMSSetTimeouts(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
|
static int _X_COLD
|
||||||
SProcDPMSForceLevel(ClientPtr client)
|
SProcDPMSForceLevel(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xDPMSForceLevelReq);
|
REQUEST(xDPMSForceLevelReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xDPMSForceLevelReq);
|
REQUEST_SIZE_MATCH(xDPMSForceLevelReq);
|
||||||
|
|
||||||
swaps(&stuff->level);
|
swaps(&stuff->level);
|
||||||
|
|
@ -524,16 +387,16 @@ SProcDPMSForceLevel(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int _X_COLD
|
||||||
SProcDPMSSelectInput(ClientPtr client)
|
SProcDPMSInfo(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xDPMSSelectInputReq);
|
REQUEST(xDPMSInfoReq);
|
||||||
REQUEST_SIZE_MATCH(xDPMSSelectInputReq);
|
|
||||||
swapl(&stuff->eventMask);
|
swaps(&stuff->length);
|
||||||
return ProcDPMSSelectInput(client);
|
REQUEST_SIZE_MATCH(xDPMSInfoReq);
|
||||||
|
|
||||||
|
return ProcDPMSInfo(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int _X_COLD
|
static int _X_COLD
|
||||||
SProcDPMSDispatch(ClientPtr client)
|
SProcDPMSDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
|
@ -542,21 +405,19 @@ SProcDPMSDispatch(ClientPtr client)
|
||||||
case X_DPMSGetVersion:
|
case X_DPMSGetVersion:
|
||||||
return SProcDPMSGetVersion(client);
|
return SProcDPMSGetVersion(client);
|
||||||
case X_DPMSCapable:
|
case X_DPMSCapable:
|
||||||
return ProcDPMSCapable(client);
|
return SProcDPMSCapable(client);
|
||||||
case X_DPMSGetTimeouts:
|
case X_DPMSGetTimeouts:
|
||||||
return ProcDPMSGetTimeouts(client);
|
return SProcDPMSGetTimeouts(client);
|
||||||
case X_DPMSSetTimeouts:
|
case X_DPMSSetTimeouts:
|
||||||
return SProcDPMSSetTimeouts(client);
|
return SProcDPMSSetTimeouts(client);
|
||||||
case X_DPMSEnable:
|
case X_DPMSEnable:
|
||||||
return ProcDPMSEnable(client);
|
return SProcDPMSEnable(client);
|
||||||
case X_DPMSDisable:
|
case X_DPMSDisable:
|
||||||
return ProcDPMSDisable(client);
|
return SProcDPMSDisable(client);
|
||||||
case X_DPMSForceLevel:
|
case X_DPMSForceLevel:
|
||||||
return SProcDPMSForceLevel(client);
|
return SProcDPMSForceLevel(client);
|
||||||
case X_DPMSInfo:
|
case X_DPMSInfo:
|
||||||
return ProcDPMSInfo(client);
|
return SProcDPMSInfo(client);
|
||||||
case X_DPMSSelectInput:
|
|
||||||
return SProcDPMSSelectInput(client);
|
|
||||||
default:
|
default:
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
|
|
@ -571,8 +432,6 @@ DPMSCloseDownExtension(ExtensionEntry *e)
|
||||||
void
|
void
|
||||||
DPMSExtensionInit(void)
|
DPMSExtensionInit(void)
|
||||||
{
|
{
|
||||||
ExtensionEntry *extEntry;
|
|
||||||
|
|
||||||
#define CONDITIONALLY_SET_DPMS_TIMEOUT(_timeout_value_) \
|
#define CONDITIONALLY_SET_DPMS_TIMEOUT(_timeout_value_) \
|
||||||
if (_timeout_value_ == -1) { /* not yet set from config */ \
|
if (_timeout_value_ == -1) { /* not yet set from config */ \
|
||||||
_timeout_value_ = ScreenSaverTime; \
|
_timeout_value_ = ScreenSaverTime; \
|
||||||
|
|
@ -585,15 +444,8 @@ DPMSExtensionInit(void)
|
||||||
DPMSPowerLevel = DPMSModeOn;
|
DPMSPowerLevel = DPMSModeOn;
|
||||||
DPMSEnabled = DPMSSupported();
|
DPMSEnabled = DPMSSupported();
|
||||||
|
|
||||||
ClientType = CreateNewResourceType(DPMSFreeClient, "DPMSClient");
|
if (DPMSEnabled)
|
||||||
DPMSEventType = CreateNewResourceType(DPMSFreeEvents, "DPMSEvent");
|
AddExtension(DPMSExtensionName, 0, 0,
|
||||||
eventResource = FakeClientID(0);
|
ProcDPMSDispatch, SProcDPMSDispatch,
|
||||||
|
DPMSCloseDownExtension, StandardMinorOpcode);
|
||||||
if (DPMSEnabled && ClientType && DPMSEventType &&
|
|
||||||
(extEntry = AddExtension(DPMSExtensionName, 0, 0,
|
|
||||||
ProcDPMSDispatch, SProcDPMSDispatch,
|
|
||||||
DPMSCloseDownExtension, StandardMinorOpcode))) {
|
|
||||||
DPMSReqCode = extEntry->base;
|
|
||||||
GERegisterExtension(DPMSReqCode, SDPMSInfoNotifyEvent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
83
Xext/geext.c
83
Xext/geext.c
|
|
@ -23,32 +23,26 @@
|
||||||
* Author: Peter Hutterer, University of South Australia, NICTA
|
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include <X11/extensions/ge.h>
|
#include <X11/extensions/ge.h>
|
||||||
|
|
||||||
|
#include "geint.h"
|
||||||
#include "geext.h"
|
#include "geext.h"
|
||||||
#include "protocol-versions.h"
|
#include "protocol-versions.h"
|
||||||
#include "extinit_priv.h"
|
#include "extinit.h"
|
||||||
|
|
||||||
DevPrivateKeyRec GEClientPrivateKeyRec;
|
DevPrivateKeyRec GEClientPrivateKeyRec;
|
||||||
|
|
||||||
#define GEClientPrivateKey (&GEClientPrivateKeyRec)
|
GEExtension GEExtensions[MAXEXTENSIONS];
|
||||||
|
|
||||||
/** Struct to keep information about registered extensions */
|
/* Major available requests */
|
||||||
typedef struct _GEExtension {
|
static const int version_requests[] = {
|
||||||
/** Event swapping routine */
|
X_GEQueryVersion, /* before client sends QueryVersion */
|
||||||
void (*evswap) (xGenericEvent *from, xGenericEvent *to);
|
X_GEQueryVersion, /* must be set to last request in version 1 */
|
||||||
} 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)))
|
|
||||||
|
|
||||||
/* Forward declarations */
|
/* Forward declarations */
|
||||||
static void SGEGenericEvent(xEvent *from, xEvent *to);
|
static void SGEGenericEvent(xEvent *from, xEvent *to);
|
||||||
|
|
@ -95,6 +89,11 @@ ProcGEQueryVersion(ClientPtr client)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int (*ProcGEVector[GENumberRequests]) (ClientPtr) = {
|
||||||
|
/* Version 1.0 */
|
||||||
|
ProcGEQueryVersion,
|
||||||
|
};
|
||||||
|
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
/* swapped request handlers */
|
/* swapped request handlers */
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
|
|
@ -102,12 +101,19 @@ static int _X_COLD
|
||||||
SProcGEQueryVersion(ClientPtr client)
|
SProcGEQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xGEQueryVersionReq);
|
REQUEST(xGEQueryVersionReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xGEQueryVersionReq);
|
REQUEST_SIZE_MATCH(xGEQueryVersionReq);
|
||||||
swaps(&stuff->majorVersion);
|
swaps(&stuff->majorVersion);
|
||||||
swaps(&stuff->minorVersion);
|
swaps(&stuff->minorVersion);
|
||||||
return ProcGEQueryVersion(client);
|
return (*ProcGEVector[stuff->ReqType]) (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int (*SProcGEVector[GENumberRequests]) (ClientPtr) = {
|
||||||
|
/* Version 1.0 */
|
||||||
|
SProcGEQueryVersion
|
||||||
|
};
|
||||||
|
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
/* callbacks */
|
/* callbacks */
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
|
|
@ -116,29 +122,26 @@ SProcGEQueryVersion(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcGEDispatch(ClientPtr client)
|
ProcGEDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
GEClientInfoPtr pGEClient = GEGetClient(client);
|
||||||
|
|
||||||
switch (stuff->data) {
|
REQUEST(xGEReq);
|
||||||
case X_GEQueryVersion:
|
|
||||||
return ProcGEQueryVersion(client);
|
if (pGEClient->major_version >= ARRAY_SIZE(version_requests))
|
||||||
default:
|
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
if (stuff->ReqType > version_requests[pGEClient->major_version])
|
||||||
|
return BadRequest;
|
||||||
|
|
||||||
|
return (ProcGEVector[stuff->ReqType]) (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* dispatch swapped requests */
|
/* dispatch swapped requests */
|
||||||
static int _X_COLD
|
static int _X_COLD
|
||||||
SProcGEDispatch(ClientPtr client)
|
SProcGEDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xGEReq);
|
||||||
swaps(&stuff->length);
|
if (stuff->ReqType >= GENumberRequests)
|
||||||
|
|
||||||
switch (stuff->data) {
|
|
||||||
case X_GEQueryVersion:
|
|
||||||
return SProcGEQueryVersion(client);
|
|
||||||
default:
|
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
return (*SProcGEVector[stuff->ReqType]) (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset extension. Called on server shutdown. */
|
/* Reset extension. Called on server shutdown. */
|
||||||
|
|
@ -177,16 +180,24 @@ SGEGenericEvent(xEvent *from, xEvent *to)
|
||||||
void
|
void
|
||||||
GEExtensionInit(void)
|
GEExtensionInit(void)
|
||||||
{
|
{
|
||||||
|
ExtensionEntry *extEntry;
|
||||||
|
|
||||||
if (!dixRegisterPrivateKey
|
if (!dixRegisterPrivateKey
|
||||||
(&GEClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(GEClientInfoRec)))
|
(&GEClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(GEClientInfoRec)))
|
||||||
FatalError("GEExtensionInit: GE private request failed.\n");
|
FatalError("GEExtensionInit: GE private request failed.\n");
|
||||||
|
|
||||||
if (!AddExtension(GE_NAME, 0, GENumberErrors, ProcGEDispatch, SProcGEDispatch,
|
if ((extEntry = AddExtension(GE_NAME,
|
||||||
GEResetProc, StandardMinorOpcode))
|
0, GENumberErrors,
|
||||||
FatalError("GEInit: AddExtensions failed.\n");
|
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.
|
from the author.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef _GEEXT_H_
|
#ifndef _GEEXT_H_
|
||||||
#define _GEEXT_H_
|
#define _GEEXT_H_
|
||||||
|
|
||||||
#include <X11/Xfuncproto.h>
|
|
||||||
#include <X11/extensions/geproto.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 */
|
/* Interface for other extensions */
|
||||||
extern _X_EXPORT void GERegisterExtension(int extension,
|
extern _X_EXPORT void GERegisterExtension(int extension,
|
||||||
void (*ev_dispatch) (xGenericEvent
|
void (*ev_dispatch) (xGenericEvent
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright © 2019 Red Hat, Inc.
|
* Copyright 2007-2008 Peter Hutterer
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
|
@ -20,18 +20,32 @@
|
||||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
* DEALINGS IN THE SOFTWARE.
|
* DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||||
* Adam Jackson <ajax@redhat.com>
|
|
||||||
*/
|
*/
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#ifndef XWAYLAND_GLX_H
|
|
||||||
#define XWAYLAND_GLX_H
|
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#ifdef GLXEXT
|
|
||||||
#include "glx_extinit.h"
|
|
||||||
extern _X_EXPORT __GLXprovider glamor_provider;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* XWAYLAND_GLX_H */
|
#ifndef _GEINT_H_
|
||||||
|
#define _GEINT_H_
|
||||||
|
|
||||||
|
#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>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
@ -238,7 +240,7 @@ unsigned
|
||||||
ht_generic_hash(void *cdata, const void *ptr, int numBits)
|
ht_generic_hash(void *cdata, const void *ptr, int numBits)
|
||||||
{
|
{
|
||||||
HtGenericHashSetupPtr setup = cdata;
|
HtGenericHashSetupPtr setup = cdata;
|
||||||
return one_at_a_time_hash(ptr, setup->keySize) & ~((~0U) << numBits);
|
return one_at_a_time_hash(ptr, setup->keySize) & ~((~0) << numBits);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ typedef struct {
|
||||||
int keySize;
|
int keySize;
|
||||||
} HtGenericHashSetupRec, *HtGenericHashSetupPtr;
|
} HtGenericHashSetupRec, *HtGenericHashSetupPtr;
|
||||||
|
|
||||||
/** @brief ht_create initializes a hash table for a certain hash table
|
/** @brief ht_create initalizes a hash table for a certain hash table
|
||||||
configuration
|
configuration
|
||||||
|
|
||||||
@param[out] ht The hash table structure to initialize
|
@param[out] ht The hash table structure to initialize
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ srcs_xext = [
|
||||||
|
|
||||||
hdrs_xext = [
|
hdrs_xext = [
|
||||||
'geext.h',
|
'geext.h',
|
||||||
|
'geint.h',
|
||||||
'syncsdk.h',
|
'syncsdk.h',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -36,6 +37,7 @@ endif
|
||||||
|
|
||||||
if build_xace
|
if build_xace
|
||||||
srcs_xext += 'xace.c'
|
srcs_xext += 'xace.c'
|
||||||
|
hdrs_xext += ['xace.h', 'xacestr.h']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if build_xf86bigfont
|
if build_xf86bigfont
|
||||||
|
|
@ -72,6 +74,4 @@ libxserver_xext_vidmode = static_library('libxserver_xext_vidmode',
|
||||||
dependencies: common_dep,
|
dependencies: common_dep,
|
||||||
)
|
)
|
||||||
|
|
||||||
if build_xorg
|
install_data(hdrs_xext, install_dir: xorgsdkdir)
|
||||||
install_data(hdrs_xext, install_dir: xorgsdkdir)
|
|
||||||
endif
|
|
||||||
|
|
|
||||||
|
|
@ -23,16 +23,18 @@ dealings in this Software without prior written authorization from Digital
|
||||||
Equipment Corporation.
|
Equipment Corporation.
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_DMX_CONFIG_H
|
||||||
|
#include <dmx-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
#include <X11/Xarch.h>
|
#include <X11/Xarch.h>
|
||||||
#include <X11/extensions/panoramiXproto.h>
|
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "cursor.h"
|
#include "cursor.h"
|
||||||
#include "cursorstr.h"
|
#include "cursorstr.h"
|
||||||
|
|
@ -45,17 +47,18 @@ Equipment Corporation.
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include "pixmapstr.h"
|
#include "pixmapstr.h"
|
||||||
#include "panoramiX.h"
|
#include "panoramiX.h"
|
||||||
|
#include <X11/extensions/panoramiXproto.h>
|
||||||
#include "panoramiXsrv.h"
|
#include "panoramiXsrv.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "servermd.h"
|
#include "servermd.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "picturestr_priv.h"
|
#include "picturestr.h"
|
||||||
#include "xfixesint.h"
|
#include "xfixesint.h"
|
||||||
#include "damageextint.h"
|
#include "damageextint.h"
|
||||||
#ifdef COMPOSITE
|
#ifdef COMPOSITE
|
||||||
#include "compint.h"
|
#include "compint.h"
|
||||||
#endif
|
#endif
|
||||||
#include "extinit_priv.h"
|
#include "extinit.h"
|
||||||
#include "protocol-versions.h"
|
#include "protocol-versions.h"
|
||||||
|
|
||||||
#ifdef GLXPROXY
|
#ifdef GLXPROXY
|
||||||
|
|
@ -744,8 +747,8 @@ PanoramiXMaybeAddDepth(DepthPtr pDepth)
|
||||||
|
|
||||||
j = PanoramiXNumDepths;
|
j = PanoramiXNumDepths;
|
||||||
PanoramiXNumDepths++;
|
PanoramiXNumDepths++;
|
||||||
PanoramiXDepths = XNFreallocarray(PanoramiXDepths,
|
PanoramiXDepths = reallocarray(PanoramiXDepths,
|
||||||
PanoramiXNumDepths, sizeof(DepthRec));
|
PanoramiXNumDepths, sizeof(DepthRec));
|
||||||
PanoramiXDepths[j].depth = pDepth->depth;
|
PanoramiXDepths[j].depth = pDepth->depth;
|
||||||
PanoramiXDepths[j].numVids = 0;
|
PanoramiXDepths[j].numVids = 0;
|
||||||
PanoramiXDepths[j].vids = NULL;
|
PanoramiXDepths[j].vids = NULL;
|
||||||
|
|
@ -817,11 +820,11 @@ PanoramiXConsolidate(void)
|
||||||
for (i = 0; i < pScreen->numVisuals; i++)
|
for (i = 0; i < pScreen->numVisuals; i++)
|
||||||
PanoramiXMaybeAddVisual(pVisual++);
|
PanoramiXMaybeAddVisual(pVisual++);
|
||||||
|
|
||||||
root = XNFcallocarray(1, sizeof(PanoramiXRes));
|
root = malloc(sizeof(PanoramiXRes));
|
||||||
root->type = XRT_WINDOW;
|
root->type = XRT_WINDOW;
|
||||||
defmap = XNFcallocarray(1, sizeof(PanoramiXRes));
|
defmap = malloc(sizeof(PanoramiXRes));
|
||||||
defmap->type = XRT_COLORMAP;
|
defmap->type = XRT_COLORMAP;
|
||||||
saver = XNFcallocarray(1, sizeof(PanoramiXRes));
|
saver = malloc(sizeof(PanoramiXRes));
|
||||||
saver->type = XRT_WINDOW;
|
saver->type = XRT_WINDOW;
|
||||||
|
|
||||||
FOR_NSCREENS(i) {
|
FOR_NSCREENS(i) {
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,9 @@ Equipment Corporation.
|
||||||
#ifndef _PANORAMIX_H_
|
#ifndef _PANORAMIX_H_
|
||||||
#define _PANORAMIX_H_
|
#define _PANORAMIX_H_
|
||||||
|
|
||||||
|
#define _PANORAMIX_SERVER
|
||||||
#include <X11/extensions/panoramiXproto.h>
|
#include <X11/extensions/panoramiXproto.h>
|
||||||
|
#undef _PANORAMIX_SERVER
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
#include "dixstruct.h"
|
#include "dixstruct.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,9 @@ dealings in this Software without prior written authorization from Digital
|
||||||
Equipment Corporation.
|
Equipment Corporation.
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
|
|
@ -45,10 +47,22 @@ Equipment Corporation.
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "panoramiXh.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
|
static int _X_COLD
|
||||||
SProcPanoramiXGetState(ClientPtr client)
|
SProcPanoramiXGetState(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xPanoramiXGetStateReq);
|
REQUEST(xPanoramiXGetStateReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
|
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
return ProcPanoramiXGetState(client);
|
return ProcPanoramiXGetState(client);
|
||||||
|
|
@ -58,6 +72,8 @@ static int _X_COLD
|
||||||
SProcPanoramiXGetScreenCount(ClientPtr client)
|
SProcPanoramiXGetScreenCount(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xPanoramiXGetScreenCountReq);
|
REQUEST(xPanoramiXGetScreenCountReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
|
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
return ProcPanoramiXGetScreenCount(client);
|
return ProcPanoramiXGetScreenCount(client);
|
||||||
|
|
@ -67,19 +83,41 @@ static int _X_COLD
|
||||||
SProcPanoramiXGetScreenSize(ClientPtr client)
|
SProcPanoramiXGetScreenSize(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xPanoramiXGetScreenSizeReq);
|
REQUEST(xPanoramiXGetScreenSizeReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
|
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
swapl(&stuff->screen);
|
swapl(&stuff->screen);
|
||||||
return ProcPanoramiXGetScreenSize(client);
|
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
|
int _X_COLD
|
||||||
SProcPanoramiXDispatch(ClientPtr client)
|
SProcPanoramiXDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
case X_PanoramiXQueryVersion:
|
case X_PanoramiXQueryVersion:
|
||||||
return ProcPanoramiXQueryVersion(client);
|
return SProcPanoramiXQueryVersion(client);
|
||||||
case X_PanoramiXGetState:
|
case X_PanoramiXGetState:
|
||||||
return SProcPanoramiXGetState(client);
|
return SProcPanoramiXGetState(client);
|
||||||
case X_PanoramiXGetScreenCount:
|
case X_PanoramiXGetScreenCount:
|
||||||
|
|
@ -87,9 +125,9 @@ SProcPanoramiXDispatch(ClientPtr client)
|
||||||
case X_PanoramiXGetScreenSize:
|
case X_PanoramiXGetScreenSize:
|
||||||
return SProcPanoramiXGetScreenSize(client);
|
return SProcPanoramiXGetScreenSize(client);
|
||||||
case X_XineramaIsActive:
|
case X_XineramaIsActive:
|
||||||
return ProcXineramaIsActive(client);
|
return SProcXineramaIsActive(client);
|
||||||
case X_XineramaQueryScreens:
|
case X_XineramaQueryScreens:
|
||||||
return ProcXineramaQueryScreens(client);
|
return SProcXineramaQueryScreens(client);
|
||||||
}
|
}
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,15 +25,13 @@ Equipment Corporation.
|
||||||
|
|
||||||
/* Massively rewritten by Mark Vojkovich <markv@valinux.com> */
|
/* Massively rewritten by Mark Vojkovich <markv@valinux.com> */
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
|
||||||
#include "os/osdep.h"
|
|
||||||
|
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include "dixfontstr.h"
|
#include "dixfontstr.h"
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
|
|
@ -477,7 +475,7 @@ PanoramiXConfigureWindow(ClientPtr client)
|
||||||
|
|
||||||
/* because we need the parent */
|
/* because we need the parent */
|
||||||
result = dixLookupResourceByType((void **) &pWin, stuff->window,
|
result = dixLookupResourceByType((void **) &pWin, stuff->window,
|
||||||
X11_RESTYPE_WINDOW, client, DixWriteAccess);
|
RT_WINDOW, client, DixWriteAccess);
|
||||||
if (result != Success)
|
if (result != Success)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
|
@ -1107,10 +1105,6 @@ PanoramiXCopyArea(ClientPtr client)
|
||||||
DixGetAttrAccess);
|
DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
drawables[j]->pScreen->SourceValidate(drawables[j], 0, 0,
|
|
||||||
drawables[j]->width,
|
|
||||||
drawables[j]->height,
|
|
||||||
IncludeInferiors);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pitch = PixmapBytePad(width, drawables[0]->depth);
|
pitch = PixmapBytePad(width, drawables[0]->depth);
|
||||||
|
|
@ -2013,12 +2007,6 @@ PanoramiXGetImage(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
FOR_NSCREENS_FORWARD(i) {
|
|
||||||
drawables[i]->pScreen->SourceValidate(drawables[i], 0, 0,
|
|
||||||
drawables[i]->width,
|
|
||||||
drawables[i]->height,
|
|
||||||
IncludeInferiors);
|
|
||||||
}
|
|
||||||
|
|
||||||
xgi = (xGetImageReply) {
|
xgi = (xGetImageReply) {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
|
|
|
||||||
175
Xext/saver.c
175
Xext/saver.c
|
|
@ -26,18 +26,12 @@ in this Software without prior written authorization from the X Consortium.
|
||||||
* Author: Keith Packard, MIT X Consortium
|
* Author: Keith Packard, MIT X Consortium
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.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 "misc.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
|
|
@ -47,35 +41,52 @@ in this Software without prior written authorization from the X Consortium.
|
||||||
#include "dixstruct.h"
|
#include "dixstruct.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "opaque.h"
|
#include "opaque.h"
|
||||||
|
#include <X11/extensions/saverproto.h>
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
#include "cursorstr.h"
|
#include "cursorstr.h"
|
||||||
#include "colormapst.h"
|
#include "colormapst.h"
|
||||||
#include "xace.h"
|
#include "xace.h"
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
#include "panoramiX.h"
|
#include "panoramiX.h"
|
||||||
#include "panoramiXsrv.h"
|
#include "panoramiXsrv.h"
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
#ifdef DPMSExtension
|
#ifdef DPMSExtension
|
||||||
#include <X11/extensions/dpmsconst.h>
|
#include <X11/extensions/dpmsconst.h>
|
||||||
#include "dpmsproc.h"
|
#include "dpmsproc.h"
|
||||||
#endif
|
#endif
|
||||||
#include "protocol-versions.h"
|
#include "protocol-versions.h"
|
||||||
#include "extinit_priv.h"
|
|
||||||
|
|
||||||
// temporary workaround for win32/mingw32 name clash
|
#include <stdio.h>
|
||||||
// see: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1355
|
|
||||||
#undef CreateWindow
|
#include "extinit.h"
|
||||||
|
|
||||||
static int ScreenSaverEventBase = 0;
|
static int ScreenSaverEventBase = 0;
|
||||||
|
|
||||||
static Bool ScreenSaverHandle(ScreenPtr pScreen, int xstate, Bool force);
|
static Bool ScreenSaverHandle(ScreenPtr /* pScreen */ ,
|
||||||
static Bool CreateSaverWindow(ScreenPtr pScreen);
|
int /* xstate */ ,
|
||||||
static Bool DestroySaverWindow(ScreenPtr pScreen);
|
Bool /* force */
|
||||||
static void UninstallSaverColormap(ScreenPtr pScreen);
|
);
|
||||||
static void CheckScreenPrivate(ScreenPtr pScreen);
|
|
||||||
static void SScreenSaverNotifyEvent(xScreenSaverNotifyEvent *from,
|
static Bool
|
||||||
xScreenSaverNotifyEvent *to);
|
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 */
|
static RESTYPE SuspendType; /* resource type for suspension records */
|
||||||
|
|
||||||
|
|
@ -182,6 +193,8 @@ static DevPrivateKeyRec ScreenPrivateKeyRec;
|
||||||
dixSetPrivate(&(s)->devPrivates, ScreenPrivateKey, v);
|
dixSetPrivate(&(s)->devPrivates, ScreenPrivateKey, v);
|
||||||
#define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = (s ? GetScreenPrivate(s) : NULL)
|
#define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = (s ? GetScreenPrivate(s) : NULL)
|
||||||
|
|
||||||
|
#define New(t) (malloc(sizeof (t)))
|
||||||
|
|
||||||
static void
|
static void
|
||||||
CheckScreenPrivate(ScreenPtr pScreen)
|
CheckScreenPrivate(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
|
|
@ -204,7 +217,7 @@ MakeScreenPrivate(ScreenPtr pScreen)
|
||||||
|
|
||||||
if (pPriv)
|
if (pPriv)
|
||||||
return pPriv;
|
return pPriv;
|
||||||
pPriv = calloc(1, sizeof(ScreenSaverScreenPrivateRec));
|
pPriv = New(ScreenSaverScreenPrivateRec);
|
||||||
if (!pPriv)
|
if (!pPriv)
|
||||||
return 0;
|
return 0;
|
||||||
pPriv->events = 0;
|
pPriv->events = 0;
|
||||||
|
|
@ -254,7 +267,7 @@ setEventMask(ScreenPtr pScreen, ClientPtr client, unsigned long mask)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!pEv) {
|
if (!pEv) {
|
||||||
pEv = calloc(1, sizeof(ScreenSaverEventRec));
|
pEv = New(ScreenSaverEventRec);
|
||||||
if (!pEv) {
|
if (!pEv) {
|
||||||
CheckScreenPrivate(pScreen);
|
CheckScreenPrivate(pScreen);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
@ -353,7 +366,7 @@ ScreenSaverFreeSuspend(void *value, XID id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Re-enable the screensaver if this was the last client suspending it. */
|
/* Reenable the screensaver if this was the last client suspending it. */
|
||||||
if (screenSaverSuspended && suspendingClients == NULL) {
|
if (screenSaverSuspended && suspendingClients == NULL) {
|
||||||
screenSaverSuspended = FALSE;
|
screenSaverSuspended = FALSE;
|
||||||
|
|
||||||
|
|
@ -437,7 +450,7 @@ UninstallSaverColormap(ScreenPtr pScreen)
|
||||||
|
|
||||||
if (pPriv && pPriv->installedMap != None) {
|
if (pPriv && pPriv->installedMap != None) {
|
||||||
rc = dixLookupResourceByType((void **) &pCmap, pPriv->installedMap,
|
rc = dixLookupResourceByType((void **) &pCmap, pPriv->installedMap,
|
||||||
X11_RESTYPE_COLORMAP, serverClient,
|
RT_COLORMAP, serverClient,
|
||||||
DixUninstallAccess);
|
DixUninstallAccess);
|
||||||
if (rc == Success)
|
if (rc == Success)
|
||||||
(*pCmap->pScreen->UninstallColormap) (pCmap);
|
(*pCmap->pScreen->UninstallColormap) (pCmap);
|
||||||
|
|
@ -461,7 +474,7 @@ CreateSaverWindow(ScreenPtr pScreen)
|
||||||
pSaver = &pScreen->screensaver;
|
pSaver = &pScreen->screensaver;
|
||||||
if (pSaver->pWindow) {
|
if (pSaver->pWindow) {
|
||||||
pSaver->pWindow = NullWindow;
|
pSaver->pWindow = NullWindow;
|
||||||
FreeResource(pSaver->wid, X11_RESTYPE_NONE);
|
FreeResource(pSaver->wid, RT_NONE);
|
||||||
if (pPriv) {
|
if (pPriv) {
|
||||||
UninstallSaverColormap(pScreen);
|
UninstallSaverColormap(pScreen);
|
||||||
pPriv->hasWindow = FALSE;
|
pPriv->hasWindow = FALSE;
|
||||||
|
|
@ -485,7 +498,7 @@ CreateSaverWindow(ScreenPtr pScreen)
|
||||||
if (!pWin)
|
if (!pWin)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!AddResource(pWin->drawable.id, X11_RESTYPE_WINDOW, pWin))
|
if (!AddResource(pWin->drawable.id, RT_WINDOW, pWin))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
mask = 0;
|
mask = 0;
|
||||||
|
|
@ -505,7 +518,7 @@ CreateSaverWindow(ScreenPtr pScreen)
|
||||||
CursorPtr cursor;
|
CursorPtr cursor;
|
||||||
if (!pWin->optional)
|
if (!pWin->optional)
|
||||||
if (!MakeWindowOptional(pWin)) {
|
if (!MakeWindowOptional(pWin)) {
|
||||||
FreeResource(pWin->drawable.id, X11_RESTYPE_NONE);
|
FreeResource(pWin->drawable.id, RT_NONE);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
cursor = RefCursor(pAttr->pCursor);
|
cursor = RefCursor(pAttr->pCursor);
|
||||||
|
|
@ -533,7 +546,7 @@ CreateSaverWindow(ScreenPtr pScreen)
|
||||||
if (wantMap == None || IsMapInstalled(wantMap, pWin))
|
if (wantMap == None || IsMapInstalled(wantMap, pWin))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
result = dixLookupResourceByType((void **) &pCmap, wantMap, X11_RESTYPE_COLORMAP,
|
result = dixLookupResourceByType((void **) &pCmap, wantMap, RT_COLORMAP,
|
||||||
serverClient, DixInstallAccess);
|
serverClient, DixInstallAccess);
|
||||||
if (result != Success)
|
if (result != Success)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
@ -557,7 +570,7 @@ DestroySaverWindow(ScreenPtr pScreen)
|
||||||
pSaver = &pScreen->screensaver;
|
pSaver = &pScreen->screensaver;
|
||||||
if (pSaver->pWindow) {
|
if (pSaver->pWindow) {
|
||||||
pSaver->pWindow = NullWindow;
|
pSaver->pWindow = NullWindow;
|
||||||
FreeResource(pSaver->wid, X11_RESTYPE_NONE);
|
FreeResource(pSaver->wid, RT_NONE);
|
||||||
}
|
}
|
||||||
pPriv->hasWindow = FALSE;
|
pPriv->hasWindow = FALSE;
|
||||||
CheckScreenPrivate(pScreen);
|
CheckScreenPrivate(pScreen);
|
||||||
|
|
@ -588,9 +601,9 @@ ScreenSaverHandle(ScreenPtr pScreen, int xstate, Bool force)
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
|
||||||
}
|
}
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
if (noPanoramiXExtension || !pScreen->myNum)
|
if (noPanoramiXExtension || !pScreen->myNum)
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
SendScreenSaverNotify(pScreen, state, force);
|
SendScreenSaverNotify(pScreen, state, force);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
@ -611,8 +624,6 @@ ProcScreenSaverQueryVersion(ClientPtr client)
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
swaps(&rep.majorVersion);
|
|
||||||
swaps(&rep.minorVersion);
|
|
||||||
}
|
}
|
||||||
WriteToClient(client, sizeof(xScreenSaverQueryVersionReply), &rep);
|
WriteToClient(client, sizeof(xScreenSaverQueryVersionReply), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
|
|
@ -634,7 +645,8 @@ ProcScreenSaverQueryInfo(ClientPtr client)
|
||||||
DixGetAttrAccess);
|
DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
rc = XaceHookScreensaverAccess(client, pDraw->pScreen, DixGetAttrAccess);
|
rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, pDraw->pScreen,
|
||||||
|
DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
|
@ -703,7 +715,8 @@ ProcScreenSaverSelectInput(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rc = XaceHookScreensaverAccess(client, pDraw->pScreen, DixSetAttrAccess);
|
rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, pDraw->pScreen,
|
||||||
|
DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
|
@ -713,8 +726,9 @@ ProcScreenSaverSelectInput(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
ScreenSaverSetAttributes(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST(xScreenSaverSetAttributesReq);
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
WindowPtr pParent;
|
WindowPtr pParent;
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
|
|
@ -737,6 +751,7 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
||||||
Colormap cmap;
|
Colormap cmap;
|
||||||
ColormapPtr pCmap;
|
ColormapPtr pCmap;
|
||||||
|
|
||||||
|
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
|
||||||
ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
||||||
DixGetAttrAccess);
|
DixGetAttrAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
|
|
@ -744,11 +759,11 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
||||||
pScreen = pDraw->pScreen;
|
pScreen = pDraw->pScreen;
|
||||||
pParent = pScreen->root;
|
pParent = pScreen->root;
|
||||||
|
|
||||||
ret = XaceHookScreensaverAccess(client, pScreen, DixSetAttrAccess);
|
ret = XaceHook(XACE_SCREENSAVER_ACCESS, client, pScreen, DixSetAttrAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
len = client->req_len - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
|
len = stuff->length - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
|
||||||
if (Ones(stuff->mask) != len)
|
if (Ones(stuff->mask) != len)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
if (!stuff->width || !stuff->height) {
|
if (!stuff->width || !stuff->height) {
|
||||||
|
|
@ -833,7 +848,7 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
||||||
if (!pPriv)
|
if (!pPriv)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
pAttr = calloc(1, sizeof(ScreenSaverAttrRec));
|
pAttr = New(ScreenSaverAttrRec);
|
||||||
if (!pAttr) {
|
if (!pAttr) {
|
||||||
ret = BadAlloc;
|
ret = BadAlloc;
|
||||||
goto bail;
|
goto bail;
|
||||||
|
|
@ -884,7 +899,7 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
||||||
else {
|
else {
|
||||||
ret =
|
ret =
|
||||||
dixLookupResourceByType((void **) &pPixmap, pixID,
|
dixLookupResourceByType((void **) &pPixmap, pixID,
|
||||||
X11_RESTYPE_PIXMAP, client, DixReadAccess);
|
RT_PIXMAP, client, DixReadAccess);
|
||||||
if (ret == Success) {
|
if (ret == Success) {
|
||||||
if ((pPixmap->drawable.depth != depth) ||
|
if ((pPixmap->drawable.depth != depth) ||
|
||||||
(pPixmap->drawable.pScreen != pScreen)) {
|
(pPixmap->drawable.pScreen != pScreen)) {
|
||||||
|
|
@ -916,7 +931,7 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
||||||
else {
|
else {
|
||||||
ret =
|
ret =
|
||||||
dixLookupResourceByType((void **) &pPixmap, pixID,
|
dixLookupResourceByType((void **) &pPixmap, pixID,
|
||||||
X11_RESTYPE_PIXMAP, client, DixReadAccess);
|
RT_PIXMAP, client, DixReadAccess);
|
||||||
if (ret == Success) {
|
if (ret == Success) {
|
||||||
if ((pPixmap->drawable.depth != depth) ||
|
if ((pPixmap->drawable.depth != depth) ||
|
||||||
(pPixmap->drawable.pScreen != pScreen)) {
|
(pPixmap->drawable.pScreen != pScreen)) {
|
||||||
|
|
@ -999,7 +1014,7 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
||||||
break;
|
break;
|
||||||
case CWColormap:
|
case CWColormap:
|
||||||
cmap = (Colormap) * pVlist;
|
cmap = (Colormap) * pVlist;
|
||||||
ret = dixLookupResourceByType((void **) &pCmap, cmap, X11_RESTYPE_COLORMAP,
|
ret = dixLookupResourceByType((void **) &pCmap, cmap, RT_COLORMAP,
|
||||||
client, DixUseAccess);
|
client, DixUseAccess);
|
||||||
if (ret != Success) {
|
if (ret != Success) {
|
||||||
client->errorValue = cmap;
|
client->errorValue = cmap;
|
||||||
|
|
@ -1019,7 +1034,7 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ret = dixLookupResourceByType((void **) &pCursor, cursorID,
|
ret = dixLookupResourceByType((void **) &pCursor, cursorID,
|
||||||
X11_RESTYPE_CURSOR, client, DixUseAccess);
|
RT_CURSOR, client, DixUseAccess);
|
||||||
if (ret != Success) {
|
if (ret != Success) {
|
||||||
client->errorValue = cursorID;
|
client->errorValue = cursorID;
|
||||||
goto PatchUp;
|
goto PatchUp;
|
||||||
|
|
@ -1036,7 +1051,7 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
||||||
pVlist++;
|
pVlist++;
|
||||||
}
|
}
|
||||||
if (pPriv->attr)
|
if (pPriv->attr)
|
||||||
FreeResource(pPriv->attr->resource, AttrType);
|
FreeScreenAttr(pPriv->attr);
|
||||||
pPriv->attr = pAttr;
|
pPriv->attr = pAttr;
|
||||||
pAttr->resource = FakeClientID(client->index);
|
pAttr->resource = FakeClientID(client->index);
|
||||||
if (!AddResource(pAttr->resource, AttrType, (void *) pAttr))
|
if (!AddResource(pAttr->resource, AttrType, (void *) pAttr))
|
||||||
|
|
@ -1053,13 +1068,16 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ScreenSaverUnsetAttributes(ClientPtr client, Drawable drawable)
|
ScreenSaverUnsetAttributes(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST(xScreenSaverSetAttributesReq);
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
ScreenSaverScreenPrivatePtr pPriv;
|
ScreenSaverScreenPrivatePtr pPriv;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixGetAttrAccess);
|
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
|
||||||
|
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
||||||
|
DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
pPriv = GetScreenPrivate(pDraw->pScreen);
|
pPriv = GetScreenPrivate(pDraw->pScreen);
|
||||||
|
|
@ -1075,11 +1093,9 @@ ScreenSaverUnsetAttributes(ClientPtr client, Drawable drawable)
|
||||||
static int
|
static int
|
||||||
ProcScreenSaverSetAttributes(ClientPtr client)
|
ProcScreenSaverSetAttributes(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xScreenSaverSetAttributesReq);
|
#ifdef PANORAMIX
|
||||||
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
|
|
||||||
|
|
||||||
#ifdef XINERAMA
|
|
||||||
if (!noPanoramiXExtension) {
|
if (!noPanoramiXExtension) {
|
||||||
|
REQUEST(xScreenSaverSetAttributesReq);
|
||||||
PanoramiXRes *draw;
|
PanoramiXRes *draw;
|
||||||
PanoramiXRes *backPix = NULL;
|
PanoramiXRes *backPix = NULL;
|
||||||
PanoramiXRes *bordPix = NULL;
|
PanoramiXRes *bordPix = NULL;
|
||||||
|
|
@ -1088,13 +1104,15 @@ ProcScreenSaverSetAttributes(ClientPtr client)
|
||||||
int pback_offset = 0, pbord_offset = 0, cmap_offset = 0;
|
int pback_offset = 0, pbord_offset = 0, cmap_offset = 0;
|
||||||
XID orig_visual, tmp;
|
XID orig_visual, tmp;
|
||||||
|
|
||||||
|
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
|
||||||
|
|
||||||
status = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
status = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
||||||
XRC_DRAWABLE, client, DixWriteAccess);
|
XRC_DRAWABLE, client, DixWriteAccess);
|
||||||
if (status != Success)
|
if (status != Success)
|
||||||
return (status == BadValue) ? BadDrawable : status;
|
return (status == BadValue) ? BadDrawable : status;
|
||||||
|
|
||||||
len =
|
len =
|
||||||
client->req_len -
|
stuff->length -
|
||||||
bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
|
bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
|
||||||
if (Ones(stuff->mask) != len)
|
if (Ones(stuff->mask) != len)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
@ -1149,27 +1167,26 @@ ProcScreenSaverSetAttributes(ClientPtr client)
|
||||||
if (orig_visual != CopyFromParent)
|
if (orig_visual != CopyFromParent)
|
||||||
stuff->visualID = PanoramiXTranslateVisualID(i, orig_visual);
|
stuff->visualID = PanoramiXTranslateVisualID(i, orig_visual);
|
||||||
|
|
||||||
status = ScreenSaverSetAttributes(client, stuff);
|
status = ScreenSaverSetAttributes(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
|
|
||||||
return ScreenSaverSetAttributes(client, stuff);
|
return ScreenSaverSetAttributes(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcScreenSaverUnsetAttributes(ClientPtr client)
|
ProcScreenSaverUnsetAttributes(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xScreenSaverUnsetAttributesReq);
|
#ifdef PANORAMIX
|
||||||
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
|
|
||||||
|
|
||||||
#ifdef XINERAMA
|
|
||||||
if (!noPanoramiXExtension) {
|
if (!noPanoramiXExtension) {
|
||||||
|
REQUEST(xScreenSaverUnsetAttributesReq);
|
||||||
PanoramiXRes *draw;
|
PanoramiXRes *draw;
|
||||||
int rc, i;
|
int rc, i;
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
|
||||||
|
|
||||||
rc = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
rc = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
||||||
XRC_DRAWABLE, client, DixWriteAccess);
|
XRC_DRAWABLE, client, DixWriteAccess);
|
||||||
|
|
@ -1177,14 +1194,15 @@ ProcScreenSaverUnsetAttributes(ClientPtr client)
|
||||||
return (rc == BadValue) ? BadDrawable : rc;
|
return (rc == BadValue) ? BadDrawable : rc;
|
||||||
|
|
||||||
for (i = PanoramiXNumScreens - 1; i > 0; i--) {
|
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;
|
stuff->drawable = draw->info[0].id;
|
||||||
}
|
}
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
|
|
||||||
return ScreenSaverUnsetAttributes(client, stuff->drawable);
|
return ScreenSaverUnsetAttributes(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
@ -1213,7 +1231,7 @@ ProcScreenSaverSuspend(ClientPtr client)
|
||||||
if (suspend == TRUE)
|
if (suspend == TRUE)
|
||||||
this->count++;
|
this->count++;
|
||||||
else if (--this->count == 0)
|
else if (--this->count == 0)
|
||||||
FreeResource(this->clientResource, X11_RESTYPE_NONE);
|
FreeResource(this->clientResource, RT_NONE);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
@ -1225,7 +1243,7 @@ ProcScreenSaverSuspend(ClientPtr client)
|
||||||
/*
|
/*
|
||||||
* Allocate a suspension record for the client, and stop the screensaver
|
* Allocate a suspension record for the client, and stop the screensaver
|
||||||
* if it isn't already suspended by another client. We attach a resource ID
|
* if it isn't already suspended by another client. We attach a resource ID
|
||||||
* to the record, so the screensaver will be re-enabled and the record freed
|
* to the record, so the screensaver will be reenabled and the record freed
|
||||||
* if the client disconnects without reenabling it first.
|
* if the client disconnects without reenabling it first.
|
||||||
*/
|
*/
|
||||||
this = malloc(sizeof(ScreenSaverSuspensionRec));
|
this = malloc(sizeof(ScreenSaverSuspensionRec));
|
||||||
|
|
@ -1253,13 +1271,11 @@ ProcScreenSaverSuspend(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int (*NormalVector[]) (ClientPtr /* client */ ) = {
|
static int (*NormalVector[]) (ClientPtr /* client */ ) = {
|
||||||
ProcScreenSaverQueryVersion,
|
ProcScreenSaverQueryVersion,
|
||||||
ProcScreenSaverQueryInfo,
|
ProcScreenSaverQueryInfo,
|
||||||
ProcScreenSaverSelectInput,
|
ProcScreenSaverSelectInput,
|
||||||
ProcScreenSaverSetAttributes,
|
ProcScreenSaverSetAttributes,
|
||||||
ProcScreenSaverUnsetAttributes,
|
ProcScreenSaverUnsetAttributes, ProcScreenSaverSuspend,};
|
||||||
ProcScreenSaverSuspend,
|
|
||||||
};
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcScreenSaverDispatch(ClientPtr client)
|
ProcScreenSaverDispatch(ClientPtr client)
|
||||||
|
|
@ -1271,10 +1287,20 @@ ProcScreenSaverDispatch(ClientPtr client)
|
||||||
return BadRequest;
|
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
|
static int _X_COLD
|
||||||
SProcScreenSaverQueryInfo(ClientPtr client)
|
SProcScreenSaverQueryInfo(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xScreenSaverQueryInfoReq);
|
REQUEST(xScreenSaverQueryInfoReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq);
|
REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
return ProcScreenSaverQueryInfo(client);
|
return ProcScreenSaverQueryInfo(client);
|
||||||
|
|
@ -1284,6 +1310,7 @@ static int _X_COLD
|
||||||
SProcScreenSaverSelectInput(ClientPtr client)
|
SProcScreenSaverSelectInput(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xScreenSaverSelectInputReq);
|
REQUEST(xScreenSaverSelectInputReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq);
|
REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
swapl(&stuff->eventMask);
|
swapl(&stuff->eventMask);
|
||||||
|
|
@ -1294,6 +1321,7 @@ static int _X_COLD
|
||||||
SProcScreenSaverSetAttributes(ClientPtr client)
|
SProcScreenSaverSetAttributes(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xScreenSaverSetAttributesReq);
|
REQUEST(xScreenSaverSetAttributesReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
|
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
swaps(&stuff->x);
|
swaps(&stuff->x);
|
||||||
|
|
@ -1311,6 +1339,7 @@ static int _X_COLD
|
||||||
SProcScreenSaverUnsetAttributes(ClientPtr client)
|
SProcScreenSaverUnsetAttributes(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xScreenSaverUnsetAttributesReq);
|
REQUEST(xScreenSaverUnsetAttributesReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
|
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
return ProcScreenSaverUnsetAttributes(client);
|
return ProcScreenSaverUnsetAttributes(client);
|
||||||
|
|
@ -1320,19 +1349,19 @@ static int _X_COLD
|
||||||
SProcScreenSaverSuspend(ClientPtr client)
|
SProcScreenSaverSuspend(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xScreenSaverSuspendReq);
|
REQUEST(xScreenSaverSuspendReq);
|
||||||
REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
|
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->suspend);
|
swapl(&stuff->suspend);
|
||||||
|
REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
|
||||||
return ProcScreenSaverSuspend(client);
|
return ProcScreenSaverSuspend(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int (*SwappedVector[]) (ClientPtr /* client */ ) = {
|
static int (*SwappedVector[]) (ClientPtr /* client */ ) = {
|
||||||
ProcScreenSaverQueryVersion,
|
SProcScreenSaverQueryVersion,
|
||||||
SProcScreenSaverQueryInfo,
|
SProcScreenSaverQueryInfo,
|
||||||
SProcScreenSaverSelectInput,
|
SProcScreenSaverSelectInput,
|
||||||
SProcScreenSaverSetAttributes,
|
SProcScreenSaverSetAttributes,
|
||||||
SProcScreenSaverUnsetAttributes,
|
SProcScreenSaverUnsetAttributes, SProcScreenSaverSuspend,};
|
||||||
SProcScreenSaverSuspend,
|
|
||||||
};
|
|
||||||
|
|
||||||
static int _X_COLD
|
static int _X_COLD
|
||||||
SProcScreenSaverDispatch(ClientPtr client)
|
SProcScreenSaverDispatch(ClientPtr client)
|
||||||
|
|
|
||||||
|
|
@ -24,19 +24,9 @@ in this Software without prior written authorization from The Open Group.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
#include <X11/Xmd.h>
|
|
||||||
#include <X11/extensions/securproto.h>
|
|
||||||
#include <X11/Xfuncproto.h>
|
|
||||||
|
|
||||||
#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 "scrnintstr.h"
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
|
|
@ -44,8 +34,10 @@ in this Software without prior written authorization from The Open Group.
|
||||||
#include "propertyst.h"
|
#include "propertyst.h"
|
||||||
#include "colormapst.h"
|
#include "colormapst.h"
|
||||||
#include "privates.h"
|
#include "privates.h"
|
||||||
|
#include "registry.h"
|
||||||
#include "xacestr.h"
|
#include "xacestr.h"
|
||||||
#include "securitysrv.h"
|
#include "securitysrv.h"
|
||||||
|
#include <X11/extensions/securproto.h>
|
||||||
#include "extinit.h"
|
#include "extinit.h"
|
||||||
#include "protocol-versions.h"
|
#include "protocol-versions.h"
|
||||||
|
|
||||||
|
|
@ -155,7 +147,7 @@ SecurityLabelInitial(void)
|
||||||
/*
|
/*
|
||||||
* Looks up a request name
|
* Looks up a request name
|
||||||
*/
|
*/
|
||||||
static inline const char *
|
static _X_INLINE const char *
|
||||||
SecurityLookupRequestName(ClientPtr client)
|
SecurityLookupRequestName(ClientPtr client)
|
||||||
{
|
{
|
||||||
return LookupRequestName(client->majorOp, client->minorOp);
|
return LookupRequestName(client->majorOp, client->minorOp);
|
||||||
|
|
@ -206,7 +198,7 @@ SecurityDeleteAuthorization(void *value, XID id)
|
||||||
.authId = pAuth->id
|
.authId = pAuth->id
|
||||||
};
|
};
|
||||||
WriteEventsToClient(rClient(pEventClient), 1, (xEvent *) &are);
|
WriteEventsToClient(rClient(pEventClient), 1, (xEvent *) &are);
|
||||||
FreeResource(pEventClient->resource, X11_RESTYPE_NONE);
|
FreeResource(pEventClient->resource, RT_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* kill all clients using this auth */
|
/* kill all clients using this auth */
|
||||||
|
|
@ -312,7 +304,7 @@ SecurityAuthorizationExpired(OsTimerPtr timer, CARD32 time, void *pval)
|
||||||
pAuth->secondsRemaining);
|
pAuth->secondsRemaining);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
FreeResource(pAuth->id, X11_RESTYPE_NONE);
|
FreeResource(pAuth->id, RT_NONE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} /* SecurityAuthorizationExpired */
|
} /* SecurityAuthorizationExpired */
|
||||||
|
|
@ -376,7 +368,7 @@ SecurityEventSelectForAuthorization(SecurityAuthorizationPtr pAuth,
|
||||||
pEventClient; pEventClient = pEventClient->next) {
|
pEventClient; pEventClient = pEventClient->next) {
|
||||||
if (SameClient(pEventClient, client)) {
|
if (SameClient(pEventClient, client)) {
|
||||||
if (mask == 0)
|
if (mask == 0)
|
||||||
FreeResource(pEventClient->resource, X11_RESTYPE_NONE);
|
FreeResource(pEventClient->resource, RT_NONE);
|
||||||
else
|
else
|
||||||
pEventClient->mask = mask;
|
pEventClient->mask = mask;
|
||||||
return Success;
|
return Success;
|
||||||
|
|
@ -588,7 +580,7 @@ ProcSecurityRevokeAuthorization(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
FreeResource(stuff->authId, X11_RESTYPE_NONE);
|
FreeResource(stuff->authId, RT_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
} /* ProcSecurityRevokeAuthorization */
|
} /* ProcSecurityRevokeAuthorization */
|
||||||
|
|
||||||
|
|
@ -613,6 +605,8 @@ static int _X_COLD
|
||||||
SProcSecurityQueryVersion(ClientPtr client)
|
SProcSecurityQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSecurityQueryVersionReq);
|
REQUEST(xSecurityQueryVersionReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
|
REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
|
||||||
swaps(&stuff->majorVersion);
|
swaps(&stuff->majorVersion);
|
||||||
swaps(&stuff->minorVersion);
|
swaps(&stuff->minorVersion);
|
||||||
|
|
@ -626,6 +620,8 @@ SProcSecurityGenerateAuthorization(ClientPtr client)
|
||||||
CARD32 *values;
|
CARD32 *values;
|
||||||
unsigned long nvalues;
|
unsigned long nvalues;
|
||||||
int values_offset;
|
int values_offset;
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
|
REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
|
||||||
swaps(&stuff->nbytesAuthProto);
|
swaps(&stuff->nbytesAuthProto);
|
||||||
swaps(&stuff->nbytesAuthData);
|
swaps(&stuff->nbytesAuthData);
|
||||||
|
|
@ -633,10 +629,10 @@ SProcSecurityGenerateAuthorization(ClientPtr client)
|
||||||
values_offset = bytes_to_int32(stuff->nbytesAuthProto) +
|
values_offset = bytes_to_int32(stuff->nbytesAuthProto) +
|
||||||
bytes_to_int32(stuff->nbytesAuthData);
|
bytes_to_int32(stuff->nbytesAuthData);
|
||||||
if (values_offset >
|
if (values_offset >
|
||||||
client->req_len - bytes_to_int32(sz_xSecurityGenerateAuthorizationReq))
|
stuff->length - bytes_to_int32(sz_xSecurityGenerateAuthorizationReq))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
values = (CARD32 *) (&stuff[1]) + values_offset;
|
values = (CARD32 *) (&stuff[1]) + values_offset;
|
||||||
nvalues = (((CARD32 *) stuff) + client->req_len) - values;
|
nvalues = (((CARD32 *) stuff) + stuff->length) - values;
|
||||||
SwapLongs(values, nvalues);
|
SwapLongs(values, nvalues);
|
||||||
return ProcSecurityGenerateAuthorization(client);
|
return ProcSecurityGenerateAuthorization(client);
|
||||||
} /* SProcSecurityGenerateAuthorization */
|
} /* SProcSecurityGenerateAuthorization */
|
||||||
|
|
@ -645,6 +641,8 @@ static int _X_COLD
|
||||||
SProcSecurityRevokeAuthorization(ClientPtr client)
|
SProcSecurityRevokeAuthorization(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSecurityRevokeAuthorizationReq);
|
REQUEST(xSecurityRevokeAuthorizationReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
|
REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
|
||||||
swapl(&stuff->authId);
|
swapl(&stuff->authId);
|
||||||
return ProcSecurityRevokeAuthorization(client);
|
return ProcSecurityRevokeAuthorization(client);
|
||||||
|
|
@ -749,12 +747,12 @@ SecurityResource(CallbackListPtr *pcbl, void *unused, void *calldata)
|
||||||
subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
|
subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
|
||||||
|
|
||||||
/* disable background None for untrusted windows */
|
/* 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)
|
if (subj->haveState && subj->trustLevel != XSecurityClientTrusted)
|
||||||
((WindowPtr) rec->res)->forcedBG = TRUE;
|
((WindowPtr) rec->res)->forcedBG = TRUE;
|
||||||
|
|
||||||
/* additional permissions for specific resource types */
|
/* additional permissions for specific resource types */
|
||||||
if (rec->rtype == X11_RESTYPE_WINDOW)
|
if (rec->rtype == RT_WINDOW)
|
||||||
allowed |= SecurityWindowExtraMask;
|
allowed |= SecurityWindowExtraMask;
|
||||||
|
|
||||||
/* special checks for server-owned resources */
|
/* special checks for server-owned resources */
|
||||||
|
|
@ -763,7 +761,7 @@ SecurityResource(CallbackListPtr *pcbl, void *unused, void *calldata)
|
||||||
/* additional operations allowed on root windows */
|
/* additional operations allowed on root windows */
|
||||||
allowed |= SecurityRootWindowExtraMask;
|
allowed |= SecurityRootWindowExtraMask;
|
||||||
|
|
||||||
else if (rec->rtype == X11_RESTYPE_COLORMAP)
|
else if (rec->rtype == RT_COLORMAP)
|
||||||
/* allow access to default colormaps */
|
/* allow access to default colormaps */
|
||||||
allowed = requested;
|
allowed = requested;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,27 @@ from The Open Group.
|
||||||
#ifndef _SECURITY_SRV_H
|
#ifndef _SECURITY_SRV_H
|
||||||
#define _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>
|
#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 "input.h" /* for DeviceIntPtr */
|
||||||
#include "property.h" /* for PropertyPtr */
|
#include "property.h" /* for PropertyPtr */
|
||||||
#include "pixmap.h" /* for DrawablePtr */
|
#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>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
#include <X11/extensions/shapeproto.h>
|
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
|
||||||
#include "dix/gc_priv.h"
|
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
|
|
@ -43,9 +41,10 @@ in this Software without prior written authorization from The Open Group.
|
||||||
#include "dixstruct.h"
|
#include "dixstruct.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "opaque.h"
|
#include "opaque.h"
|
||||||
|
#include <X11/extensions/shapeproto.h>
|
||||||
#include "regionstr.h"
|
#include "regionstr.h"
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
#include "extinit_priv.h"
|
#include "extinit.h"
|
||||||
#include "protocol-versions.h"
|
#include "protocol-versions.h"
|
||||||
|
|
||||||
typedef RegionPtr (*CreateDftPtr) (WindowPtr /* pWin */
|
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
|
* externally by the Xfixes extension and are now defined in window.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
#include "panoramiX.h"
|
#include "panoramiX.h"
|
||||||
#include "panoramiXsrv.h"
|
#include "panoramiXsrv.h"
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
|
|
||||||
static int ShapeEventBase = 0;
|
static int ShapeEventBase = 0;
|
||||||
static RESTYPE ClientType, ShapeEventType; /* resource types for event masks */
|
static RESTYPE ClientType, ShapeEventType; /* resource types for event masks */
|
||||||
|
|
@ -266,7 +265,7 @@ ProcShapeRectangles(ClientPtr client)
|
||||||
client->errorValue = stuff->ordering;
|
client->errorValue = stuff->ordering;
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
nrects = ((client->req_len << 2) - sizeof(xShapeRectanglesReq));
|
nrects = ((stuff->length << 2) - sizeof(xShapeRectanglesReq));
|
||||||
if (nrects & 4)
|
if (nrects & 4)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
nrects >>= 3;
|
nrects >>= 3;
|
||||||
|
|
@ -297,7 +296,7 @@ ProcShapeRectangles(ClientPtr client)
|
||||||
stuff->xOff, stuff->yOff, createDefault);
|
stuff->xOff, stuff->yOff, createDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
static int
|
static int
|
||||||
ProcPanoramiXShapeRectangles(ClientPtr client)
|
ProcPanoramiXShapeRectangles(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
|
@ -320,7 +319,7 @@ ProcPanoramiXShapeRectangles(ClientPtr client)
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
|
|
||||||
/**************
|
/**************
|
||||||
* ProcShapeMask
|
* ProcShapeMask
|
||||||
|
|
@ -363,7 +362,7 @@ ProcShapeMask(ClientPtr client)
|
||||||
srcRgn = 0;
|
srcRgn = 0;
|
||||||
else {
|
else {
|
||||||
rc = dixLookupResourceByType((void **) &pPixmap, stuff->src,
|
rc = dixLookupResourceByType((void **) &pPixmap, stuff->src,
|
||||||
X11_RESTYPE_PIXMAP, client, DixReadAccess);
|
RT_PIXMAP, client, DixReadAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
if (pPixmap->drawable.pScreen != pScreen ||
|
if (pPixmap->drawable.pScreen != pScreen ||
|
||||||
|
|
@ -395,7 +394,7 @@ ProcShapeMask(ClientPtr client)
|
||||||
stuff->xOff, stuff->yOff, createDefault);
|
stuff->xOff, stuff->yOff, createDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
static int
|
static int
|
||||||
ProcPanoramiXShapeMask(ClientPtr client)
|
ProcPanoramiXShapeMask(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
|
@ -429,7 +428,7 @@ ProcPanoramiXShapeMask(ClientPtr client)
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
|
|
||||||
/************
|
/************
|
||||||
* ProcShapeCombine
|
* ProcShapeCombine
|
||||||
|
|
@ -523,7 +522,7 @@ ProcShapeCombine(ClientPtr client)
|
||||||
stuff->xOff, stuff->yOff, createDefault);
|
stuff->xOff, stuff->yOff, createDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
static int
|
static int
|
||||||
ProcPanoramiXShapeCombine(ClientPtr client)
|
ProcPanoramiXShapeCombine(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
|
@ -552,7 +551,7 @@ ProcPanoramiXShapeCombine(ClientPtr client)
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
|
|
||||||
/*************
|
/*************
|
||||||
* ProcShapeOffset
|
* ProcShapeOffset
|
||||||
|
|
@ -594,7 +593,7 @@ ProcShapeOffset(ClientPtr client)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
static int
|
static int
|
||||||
ProcPanoramiXShapeOffset(ClientPtr client)
|
ProcPanoramiXShapeOffset(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
|
@ -617,7 +616,7 @@ ProcPanoramiXShapeOffset(ClientPtr client)
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcShapeQueryExtents(ClientPtr client)
|
ProcShapeQueryExtents(ClientPtr client)
|
||||||
|
|
@ -784,7 +783,7 @@ ProcShapeSelectInput(ClientPtr client)
|
||||||
if (!pHead ||
|
if (!pHead ||
|
||||||
!AddResource(pWin->drawable.id, ShapeEventType,
|
!AddResource(pWin->drawable.id, ShapeEventType,
|
||||||
(void *) pHead)) {
|
(void *) pHead)) {
|
||||||
FreeResource(clientResource, X11_RESTYPE_NONE);
|
FreeResource(clientResource, RT_NONE);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
*pHead = 0;
|
*pHead = 0;
|
||||||
|
|
@ -1035,32 +1034,32 @@ ProcShapeDispatch(ClientPtr client)
|
||||||
case X_ShapeQueryVersion:
|
case X_ShapeQueryVersion:
|
||||||
return ProcShapeQueryVersion(client);
|
return ProcShapeQueryVersion(client);
|
||||||
case X_ShapeRectangles:
|
case X_ShapeRectangles:
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
if (!noPanoramiXExtension)
|
if (!noPanoramiXExtension)
|
||||||
return ProcPanoramiXShapeRectangles(client);
|
return ProcPanoramiXShapeRectangles(client);
|
||||||
else
|
else
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
return ProcShapeRectangles(client);
|
return ProcShapeRectangles(client);
|
||||||
case X_ShapeMask:
|
case X_ShapeMask:
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
if (!noPanoramiXExtension)
|
if (!noPanoramiXExtension)
|
||||||
return ProcPanoramiXShapeMask(client);
|
return ProcPanoramiXShapeMask(client);
|
||||||
else
|
else
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
return ProcShapeMask(client);
|
return ProcShapeMask(client);
|
||||||
case X_ShapeCombine:
|
case X_ShapeCombine:
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
if (!noPanoramiXExtension)
|
if (!noPanoramiXExtension)
|
||||||
return ProcPanoramiXShapeCombine(client);
|
return ProcPanoramiXShapeCombine(client);
|
||||||
else
|
else
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
return ProcShapeCombine(client);
|
return ProcShapeCombine(client);
|
||||||
case X_ShapeOffset:
|
case X_ShapeOffset:
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
if (!noPanoramiXExtension)
|
if (!noPanoramiXExtension)
|
||||||
return ProcPanoramiXShapeOffset(client);
|
return ProcPanoramiXShapeOffset(client);
|
||||||
else
|
else
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
return ProcShapeOffset(client);
|
return ProcShapeOffset(client);
|
||||||
case X_ShapeQueryExtents:
|
case X_ShapeQueryExtents:
|
||||||
return ProcShapeQueryExtents(client);
|
return ProcShapeQueryExtents(client);
|
||||||
|
|
@ -1090,10 +1089,21 @@ SShapeNotifyEvent(xShapeNotifyEvent * from, xShapeNotifyEvent * to)
|
||||||
to->shaped = from->shaped;
|
to->shaped = from->shaped;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int _X_COLD
|
||||||
|
SProcShapeQueryVersion(ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xShapeQueryVersionReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
|
return ProcShapeQueryVersion(client);
|
||||||
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int _X_COLD
|
||||||
SProcShapeRectangles(ClientPtr client)
|
SProcShapeRectangles(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShapeRectanglesReq);
|
REQUEST(xShapeRectanglesReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xShapeRectanglesReq);
|
REQUEST_AT_LEAST_SIZE(xShapeRectanglesReq);
|
||||||
swapl(&stuff->dest);
|
swapl(&stuff->dest);
|
||||||
swaps(&stuff->xOff);
|
swaps(&stuff->xOff);
|
||||||
|
|
@ -1106,6 +1116,8 @@ static int _X_COLD
|
||||||
SProcShapeMask(ClientPtr client)
|
SProcShapeMask(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShapeMaskReq);
|
REQUEST(xShapeMaskReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xShapeMaskReq);
|
REQUEST_SIZE_MATCH(xShapeMaskReq);
|
||||||
swapl(&stuff->dest);
|
swapl(&stuff->dest);
|
||||||
swaps(&stuff->xOff);
|
swaps(&stuff->xOff);
|
||||||
|
|
@ -1118,6 +1130,8 @@ static int _X_COLD
|
||||||
SProcShapeCombine(ClientPtr client)
|
SProcShapeCombine(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShapeCombineReq);
|
REQUEST(xShapeCombineReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xShapeCombineReq);
|
REQUEST_SIZE_MATCH(xShapeCombineReq);
|
||||||
swapl(&stuff->dest);
|
swapl(&stuff->dest);
|
||||||
swaps(&stuff->xOff);
|
swaps(&stuff->xOff);
|
||||||
|
|
@ -1130,6 +1144,8 @@ static int _X_COLD
|
||||||
SProcShapeOffset(ClientPtr client)
|
SProcShapeOffset(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShapeOffsetReq);
|
REQUEST(xShapeOffsetReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xShapeOffsetReq);
|
REQUEST_SIZE_MATCH(xShapeOffsetReq);
|
||||||
swapl(&stuff->dest);
|
swapl(&stuff->dest);
|
||||||
swaps(&stuff->xOff);
|
swaps(&stuff->xOff);
|
||||||
|
|
@ -1141,6 +1157,8 @@ static int _X_COLD
|
||||||
SProcShapeQueryExtents(ClientPtr client)
|
SProcShapeQueryExtents(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShapeQueryExtentsReq);
|
REQUEST(xShapeQueryExtentsReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xShapeQueryExtentsReq);
|
REQUEST_SIZE_MATCH(xShapeQueryExtentsReq);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
return ProcShapeQueryExtents(client);
|
return ProcShapeQueryExtents(client);
|
||||||
|
|
@ -1150,6 +1168,8 @@ static int _X_COLD
|
||||||
SProcShapeSelectInput(ClientPtr client)
|
SProcShapeSelectInput(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShapeSelectInputReq);
|
REQUEST(xShapeSelectInputReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xShapeSelectInputReq);
|
REQUEST_SIZE_MATCH(xShapeSelectInputReq);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
return ProcShapeSelectInput(client);
|
return ProcShapeSelectInput(client);
|
||||||
|
|
@ -1159,6 +1179,8 @@ static int _X_COLD
|
||||||
SProcShapeInputSelected(ClientPtr client)
|
SProcShapeInputSelected(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShapeInputSelectedReq);
|
REQUEST(xShapeInputSelectedReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xShapeInputSelectedReq);
|
REQUEST_SIZE_MATCH(xShapeInputSelectedReq);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
return ProcShapeInputSelected(client);
|
return ProcShapeInputSelected(client);
|
||||||
|
|
@ -1168,6 +1190,7 @@ static int _X_COLD
|
||||||
SProcShapeGetRectangles(ClientPtr client)
|
SProcShapeGetRectangles(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShapeGetRectanglesReq);
|
REQUEST(xShapeGetRectanglesReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
|
REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
return ProcShapeGetRectangles(client);
|
return ProcShapeGetRectangles(client);
|
||||||
|
|
@ -1179,7 +1202,7 @@ SProcShapeDispatch(ClientPtr client)
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
case X_ShapeQueryVersion:
|
case X_ShapeQueryVersion:
|
||||||
return ProcShapeQueryVersion(client);
|
return SProcShapeQueryVersion(client);
|
||||||
case X_ShapeRectangles:
|
case X_ShapeRectangles:
|
||||||
return SProcShapeRectangles(client);
|
return SProcShapeRectangles(client);
|
||||||
case X_ShapeMask:
|
case X_ShapeMask:
|
||||||
|
|
|
||||||
168
Xext/shm.c
168
Xext/shm.c
|
|
@ -28,29 +28,21 @@ in this Software without prior written authorization from The Open Group.
|
||||||
|
|
||||||
#define SHM
|
#define SHM
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/ipc.h>
|
#include <sys/ipc.h>
|
||||||
#include <sys/shm.h>
|
#include <sys/shm.h>
|
||||||
#include <sys/mman.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.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 "misc.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "dixstruct_priv.h"
|
#include "dixstruct.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
|
|
@ -60,8 +52,11 @@ in this Software without prior written authorization from The Open Group.
|
||||||
#include "servermd.h"
|
#include "servermd.h"
|
||||||
#include "shmint.h"
|
#include "shmint.h"
|
||||||
#include "xace.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 "protocol-versions.h"
|
||||||
|
#include "busfault.h"
|
||||||
|
|
||||||
/* Needed for Solaris cross-zone shared memory extension */
|
/* Needed for Solaris cross-zone shared memory extension */
|
||||||
#ifdef HAVE_SHMCTL64
|
#ifdef HAVE_SHMCTL64
|
||||||
|
|
@ -90,10 +85,12 @@ in this Software without prior written authorization from The Open Group.
|
||||||
#define SHMPERM_MODE(p) p->mode
|
#define SHMPERM_MODE(p) p->mode
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
#include "panoramiX.h"
|
#include "panoramiX.h"
|
||||||
#include "panoramiXsrv.h"
|
#include "panoramiXsrv.h"
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
|
|
||||||
|
#include "extinit.h"
|
||||||
|
|
||||||
typedef struct _ShmScrPrivateRec {
|
typedef struct _ShmScrPrivateRec {
|
||||||
CloseScreenProcPtr CloseScreen;
|
CloseScreenProcPtr CloseScreen;
|
||||||
|
|
@ -210,7 +207,7 @@ ShmInitScreenPriv(ScreenPtr pScreen)
|
||||||
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
|
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
|
||||||
|
|
||||||
if (!screen_priv) {
|
if (!screen_priv) {
|
||||||
screen_priv = XNFcallocarray(1, sizeof(ShmScrPrivateRec));
|
screen_priv = calloc(1, sizeof(ShmScrPrivateRec));
|
||||||
screen_priv->CloseScreen = pScreen->CloseScreen;
|
screen_priv->CloseScreen = pScreen->CloseScreen;
|
||||||
dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, screen_priv);
|
dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, screen_priv);
|
||||||
pScreen->CloseScreen = ShmCloseScreen;
|
pScreen->CloseScreen = ShmCloseScreen;
|
||||||
|
|
@ -251,14 +248,13 @@ ShmDestroyPixmap(PixmapPtr pPixmap)
|
||||||
ScreenPtr pScreen = pPixmap->drawable.pScreen;
|
ScreenPtr pScreen = pPixmap->drawable.pScreen;
|
||||||
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
|
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
|
||||||
void *shmdesc = NULL;
|
void *shmdesc = NULL;
|
||||||
Bool ret = TRUE;
|
Bool ret;
|
||||||
|
|
||||||
if (pPixmap->refcnt == 1)
|
if (pPixmap->refcnt == 1)
|
||||||
shmdesc = dixLookupPrivate(&pPixmap->devPrivates, shmPixmapPrivateKey);
|
shmdesc = dixLookupPrivate(&pPixmap->devPrivates, shmPixmapPrivateKey);
|
||||||
|
|
||||||
pScreen->DestroyPixmap = screen_priv->destroyPixmap;
|
pScreen->DestroyPixmap = screen_priv->destroyPixmap;
|
||||||
if (pScreen->DestroyPixmap)
|
ret = (*pScreen->DestroyPixmap) (pPixmap);
|
||||||
ret = pScreen->DestroyPixmap(pPixmap);
|
|
||||||
screen_priv->destroyPixmap = pScreen->DestroyPixmap;
|
screen_priv->destroyPixmap = pScreen->DestroyPixmap;
|
||||||
pScreen->DestroyPixmap = ShmDestroyPixmap;
|
pScreen->DestroyPixmap = ShmDestroyPixmap;
|
||||||
|
|
||||||
|
|
@ -304,8 +300,8 @@ ProcShmQueryVersion(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Simulate the access() system call for a shared memory segment,
|
* Simulate the access() system call for a shared memory segement,
|
||||||
* using the credentials from the client if available.
|
* using the credentials from the client if available
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
shm_access(ClientPtr client, SHMPERM_TYPE * perm, int readonly)
|
shm_access(ClientPtr client, SHMPERM_TYPE * perm, int readonly)
|
||||||
|
|
@ -460,7 +456,7 @@ ProcShmDetach(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShmDetachReq);
|
REQUEST_SIZE_MATCH(xShmDetachReq);
|
||||||
VERIFY_SHMSEG(stuff->shmseg, shmdesc, client);
|
VERIFY_SHMSEG(stuff->shmseg, shmdesc, client);
|
||||||
FreeResource(stuff->shmseg, X11_RESTYPE_NONE);
|
FreeResource(stuff->shmseg, RT_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -482,8 +478,8 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
|
||||||
PixmapBytePad(w, depth), data);
|
PixmapBytePad(w, depth), data);
|
||||||
if (!pPixmap)
|
if (!pPixmap)
|
||||||
return;
|
return;
|
||||||
(void) pGC->ops->CopyArea((DrawablePtr) pPixmap, dst, pGC,
|
pGC->ops->CopyArea((DrawablePtr) pPixmap, dst, pGC, sx, sy, sw, sh, dx,
|
||||||
sx, sy, sw, sh, dx, dy);
|
dy);
|
||||||
FreeScratchPixmapHeader(pPixmap);
|
FreeScratchPixmapHeader(pPixmap);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -656,9 +652,6 @@ ProcShmGetImage(ClientPtr client)
|
||||||
visual = wVisual(((WindowPtr) pDraw));
|
visual = wVisual(((WindowPtr) pDraw));
|
||||||
if (pDraw->type == DRAWABLE_WINDOW)
|
if (pDraw->type == DRAWABLE_WINDOW)
|
||||||
pVisibleRegion = &((WindowPtr) pDraw)->borderClip;
|
pVisibleRegion = &((WindowPtr) pDraw)->borderClip;
|
||||||
pDraw->pScreen->SourceValidate(pDraw, stuff->x, stuff->y,
|
|
||||||
stuff->width, stuff->height,
|
|
||||||
IncludeInferiors);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (stuff->x < 0 ||
|
if (stuff->x < 0 ||
|
||||||
|
|
@ -732,7 +725,7 @@ ProcShmGetImage(ClientPtr client)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
static int
|
static int
|
||||||
ProcPanoramiXShmPutImage(ClientPtr client)
|
ProcPanoramiXShmPutImage(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
|
@ -867,12 +860,6 @@ ProcPanoramiXShmGetImage(ClientPtr client)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FOR_NSCREENS_FORWARD(i) {
|
|
||||||
drawables[i]->pScreen->SourceValidate(drawables[i], 0, 0,
|
|
||||||
drawables[i]->width,
|
|
||||||
drawables[i]->height,
|
|
||||||
IncludeInferiors);
|
|
||||||
}
|
|
||||||
|
|
||||||
xgi = (xShmGetImageReply) {
|
xgi = (xShmGetImageReply) {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
|
|
@ -997,8 +984,8 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
|
||||||
stuff->offset);
|
stuff->offset);
|
||||||
|
|
||||||
if (pMap) {
|
if (pMap) {
|
||||||
result = XaceHookResourceAccess(client, stuff->pid,
|
result = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid,
|
||||||
X11_RESTYPE_PIXMAP, pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
RT_PIXMAP, pMap, RT_NONE, NULL, DixCreateAccess);
|
||||||
if (result != Success) {
|
if (result != Success) {
|
||||||
pDraw->pScreen->DestroyPixmap(pMap);
|
pDraw->pScreen->DestroyPixmap(pMap);
|
||||||
break;
|
break;
|
||||||
|
|
@ -1007,7 +994,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
|
||||||
shmdesc->refcnt++;
|
shmdesc->refcnt++;
|
||||||
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
||||||
pMap->drawable.id = newPix->info[j].id;
|
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;
|
result = BadAlloc;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1020,7 +1007,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
|
||||||
|
|
||||||
if (result != Success) {
|
if (result != Success) {
|
||||||
while (j--)
|
while (j--)
|
||||||
FreeResource(newPix->info[j].id, X11_RESTYPE_NONE);
|
FreeResource(newPix->info[j].id, RT_NONE);
|
||||||
free(newPix);
|
free(newPix);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1028,7 +1015,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
|
|
||||||
static PixmapPtr
|
static PixmapPtr
|
||||||
fbShmCreatePixmap(ScreenPtr pScreen,
|
fbShmCreatePixmap(ScreenPtr pScreen,
|
||||||
|
|
@ -1112,8 +1099,8 @@ ProcShmCreatePixmap(ClientPtr client)
|
||||||
shmdesc->addr +
|
shmdesc->addr +
|
||||||
stuff->offset);
|
stuff->offset);
|
||||||
if (pMap) {
|
if (pMap) {
|
||||||
rc = XaceHookResourceAccess(client, stuff->pid, X11_RESTYPE_PIXMAP,
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, RT_PIXMAP,
|
||||||
pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
pMap, RT_NONE, NULL, DixCreateAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
pDraw->pScreen->DestroyPixmap(pMap);
|
pDraw->pScreen->DestroyPixmap(pMap);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
@ -1122,7 +1109,7 @@ ProcShmCreatePixmap(ClientPtr client)
|
||||||
shmdesc->refcnt++;
|
shmdesc->refcnt++;
|
||||||
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
||||||
pMap->drawable.id = stuff->pid;
|
pMap->drawable.id = stuff->pid;
|
||||||
if (AddResource(stuff->pid, X11_RESTYPE_PIXMAP, (void *) pMap)) {
|
if (AddResource(stuff->pid, RT_PIXMAP, (void *) pMap)) {
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1140,7 +1127,7 @@ ShmBusfaultNotify(void *context)
|
||||||
(unsigned int) shmdesc->resource);
|
(unsigned int) shmdesc->resource);
|
||||||
busfault_unregister(shmdesc->busfault);
|
busfault_unregister(shmdesc->busfault);
|
||||||
shmdesc->busfault = NULL;
|
shmdesc->busfault = NULL;
|
||||||
FreeResource (shmdesc->resource, X11_RESTYPE_NONE);
|
FreeResource (shmdesc->resource, RT_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
@ -1207,55 +1194,36 @@ ProcShmAttachFd(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
shm_tmpfile(void)
|
shm_tmpfile(void)
|
||||||
{
|
{
|
||||||
const char *shmdirs[] = {
|
#ifdef SHMDIR
|
||||||
"/run/shm",
|
int fd;
|
||||||
"/var/tmp",
|
char template[] = SHMDIR "/shmfd-XXXXXX";
|
||||||
"/tmp",
|
|
||||||
};
|
|
||||||
int fd;
|
|
||||||
|
|
||||||
#ifdef HAVE_MEMFD_CREATE
|
|
||||||
fd = memfd_create("xorg", MFD_CLOEXEC|MFD_ALLOW_SEALING);
|
|
||||||
if (fd != -1) {
|
|
||||||
fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK);
|
|
||||||
DebugF ("Using memfd_create\n");
|
|
||||||
return fd;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef O_TMPFILE
|
#ifdef O_TMPFILE
|
||||||
for (int i = 0; i < ARRAY_SIZE(shmdirs); i++) {
|
fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666);
|
||||||
fd = open(shmdirs[i], O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666);
|
if (fd >= 0) {
|
||||||
if (fd >= 0) {
|
DebugF ("Using O_TMPFILE\n");
|
||||||
DebugF ("Using O_TMPFILE\n");
|
return fd;
|
||||||
return fd;
|
}
|
||||||
}
|
ErrorF ("Not using O_TMPFILE\n");
|
||||||
}
|
|
||||||
ErrorF ("Not using O_TMPFILE\n");
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (int i = 0; i < ARRAY_SIZE(shmdirs); i++) {
|
|
||||||
char template[PATH_MAX];
|
|
||||||
snprintf(template, ARRAY_SIZE(template), "%s/shmfd-XXXXXX", shmdirs[i]);
|
|
||||||
#ifdef HAVE_MKOSTEMP
|
#ifdef HAVE_MKOSTEMP
|
||||||
fd = mkostemp(template, O_CLOEXEC);
|
fd = mkostemp(template, O_CLOEXEC);
|
||||||
#else
|
#else
|
||||||
fd = mkstemp(template);
|
fd = mkstemp(template);
|
||||||
#endif
|
#endif
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
continue;
|
return -1;
|
||||||
unlink(template);
|
unlink(template);
|
||||||
#ifndef HAVE_MKOSTEMP
|
#ifndef HAVE_MKOSTEMP
|
||||||
int flags = fcntl(fd, F_GETFD);
|
int flags = fcntl(fd, F_GETFD);
|
||||||
if (flags != -1) {
|
if (flags != -1) {
|
||||||
flags |= FD_CLOEXEC;
|
flags |= FD_CLOEXEC;
|
||||||
(void) fcntl(fd, F_SETFD, flags);
|
(void) fcntl(fd, F_SETFD, &flags);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
return fd;
|
||||||
|
#else
|
||||||
|
return -1;
|
||||||
#endif
|
#endif
|
||||||
return fd;
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
@ -1322,7 +1290,7 @@ ProcShmCreateSegment(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WriteFdToClient(client, fd, TRUE) < 0) {
|
if (WriteFdToClient(client, fd, TRUE) < 0) {
|
||||||
FreeResource(stuff->shmseg, X11_RESTYPE_NONE);
|
FreeResource(stuff->shmseg, RT_NONE);
|
||||||
close(fd);
|
close(fd);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
@ -1348,22 +1316,22 @@ ProcShmDispatch(ClientPtr client)
|
||||||
case X_ShmDetach:
|
case X_ShmDetach:
|
||||||
return ProcShmDetach(client);
|
return ProcShmDetach(client);
|
||||||
case X_ShmPutImage:
|
case X_ShmPutImage:
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
if (!noPanoramiXExtension)
|
if (!noPanoramiXExtension)
|
||||||
return ProcPanoramiXShmPutImage(client);
|
return ProcPanoramiXShmPutImage(client);
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
return ProcShmPutImage(client);
|
return ProcShmPutImage(client);
|
||||||
case X_ShmGetImage:
|
case X_ShmGetImage:
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
if (!noPanoramiXExtension)
|
if (!noPanoramiXExtension)
|
||||||
return ProcPanoramiXShmGetImage(client);
|
return ProcPanoramiXShmGetImage(client);
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
return ProcShmGetImage(client);
|
return ProcShmGetImage(client);
|
||||||
case X_ShmCreatePixmap:
|
case X_ShmCreatePixmap:
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
if (!noPanoramiXExtension)
|
if (!noPanoramiXExtension)
|
||||||
return ProcPanoramiXShmCreatePixmap(client);
|
return ProcPanoramiXShmCreatePixmap(client);
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
return ProcShmCreatePixmap(client);
|
return ProcShmCreatePixmap(client);
|
||||||
#ifdef SHM_FD_PASSING
|
#ifdef SHM_FD_PASSING
|
||||||
case X_ShmAttachFd:
|
case X_ShmAttachFd:
|
||||||
|
|
@ -1388,10 +1356,20 @@ SShmCompletionEvent(xShmCompletionEvent * from, xShmCompletionEvent * to)
|
||||||
cpswapl(from->offset, to->offset);
|
cpswapl(from->offset, to->offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int _X_COLD
|
||||||
|
SProcShmQueryVersion(ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xShmQueryVersionReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
|
return ProcShmQueryVersion(client);
|
||||||
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int _X_COLD
|
||||||
SProcShmAttach(ClientPtr client)
|
SProcShmAttach(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShmAttachReq);
|
REQUEST(xShmAttachReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xShmAttachReq);
|
REQUEST_SIZE_MATCH(xShmAttachReq);
|
||||||
swapl(&stuff->shmseg);
|
swapl(&stuff->shmseg);
|
||||||
swapl(&stuff->shmid);
|
swapl(&stuff->shmid);
|
||||||
|
|
@ -1402,6 +1380,7 @@ static int _X_COLD
|
||||||
SProcShmDetach(ClientPtr client)
|
SProcShmDetach(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShmDetachReq);
|
REQUEST(xShmDetachReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xShmDetachReq);
|
REQUEST_SIZE_MATCH(xShmDetachReq);
|
||||||
swapl(&stuff->shmseg);
|
swapl(&stuff->shmseg);
|
||||||
return ProcShmDetach(client);
|
return ProcShmDetach(client);
|
||||||
|
|
@ -1411,6 +1390,7 @@ static int _X_COLD
|
||||||
SProcShmPutImage(ClientPtr client)
|
SProcShmPutImage(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShmPutImageReq);
|
REQUEST(xShmPutImageReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xShmPutImageReq);
|
REQUEST_SIZE_MATCH(xShmPutImageReq);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
swapl(&stuff->gc);
|
swapl(&stuff->gc);
|
||||||
|
|
@ -1431,6 +1411,7 @@ static int _X_COLD
|
||||||
SProcShmGetImage(ClientPtr client)
|
SProcShmGetImage(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShmGetImageReq);
|
REQUEST(xShmGetImageReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xShmGetImageReq);
|
REQUEST_SIZE_MATCH(xShmGetImageReq);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
swaps(&stuff->x);
|
swaps(&stuff->x);
|
||||||
|
|
@ -1447,6 +1428,7 @@ static int _X_COLD
|
||||||
SProcShmCreatePixmap(ClientPtr client)
|
SProcShmCreatePixmap(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShmCreatePixmapReq);
|
REQUEST(xShmCreatePixmapReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
|
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
|
||||||
swapl(&stuff->pid);
|
swapl(&stuff->pid);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
|
|
@ -1463,6 +1445,7 @@ SProcShmAttachFd(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShmAttachFdReq);
|
REQUEST(xShmAttachFdReq);
|
||||||
SetReqFds(client, 1);
|
SetReqFds(client, 1);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xShmAttachFdReq);
|
REQUEST_SIZE_MATCH(xShmAttachFdReq);
|
||||||
swapl(&stuff->shmseg);
|
swapl(&stuff->shmseg);
|
||||||
return ProcShmAttachFd(client);
|
return ProcShmAttachFd(client);
|
||||||
|
|
@ -1472,6 +1455,7 @@ static int _X_COLD
|
||||||
SProcShmCreateSegment(ClientPtr client)
|
SProcShmCreateSegment(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShmCreateSegmentReq);
|
REQUEST(xShmCreateSegmentReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xShmCreateSegmentReq);
|
REQUEST_SIZE_MATCH(xShmCreateSegmentReq);
|
||||||
swapl(&stuff->shmseg);
|
swapl(&stuff->shmseg);
|
||||||
swapl(&stuff->size);
|
swapl(&stuff->size);
|
||||||
|
|
@ -1485,7 +1469,7 @@ SProcShmDispatch(ClientPtr client)
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
|
||||||
if (stuff->data == X_ShmQueryVersion)
|
if (stuff->data == X_ShmQueryVersion)
|
||||||
return ProcShmQueryVersion(client);
|
return SProcShmQueryVersion(client);
|
||||||
|
|
||||||
if (!client->local)
|
if (!client->local)
|
||||||
return BadRequest;
|
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 */
|
/* dixsleep.c - implement millisecond timeouts for X clients */
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "sleepuntil.h"
|
#include "sleepuntil.h"
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
|
|
@ -123,7 +125,8 @@ ClientSleepUntil(ClientPtr client,
|
||||||
static void
|
static void
|
||||||
ClientAwaken(ClientPtr client, void *closure)
|
ClientAwaken(ClientPtr client, void *closure)
|
||||||
{
|
{
|
||||||
AttendClient(client);
|
if (!client->clientGone)
|
||||||
|
AttendClient(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
@ -164,7 +167,7 @@ SertafiedBlockHandler(void *data, void *wt)
|
||||||
pNext = pReq->next;
|
pNext = pReq->next;
|
||||||
if (CompareTimeStamps(pReq->revive, now) == LATER)
|
if (CompareTimeStamps(pReq->revive, now) == LATER)
|
||||||
break;
|
break;
|
||||||
FreeResource(pReq->id, X11_RESTYPE_NONE);
|
FreeResource(pReq->id, RT_NONE);
|
||||||
|
|
||||||
/* AttendClient() may have been called via the resource delete
|
/* AttendClient() may have been called via the resource delete
|
||||||
* function so a client may have input to be processed and so
|
* function so a client may have input to be processed and so
|
||||||
|
|
@ -193,7 +196,7 @@ SertafiedWakeupHandler(void *data, int i)
|
||||||
pNext = pReq->next;
|
pNext = pReq->next;
|
||||||
if (CompareTimeStamps(pReq->revive, now) == LATER)
|
if (CompareTimeStamps(pReq->revive, now) == LATER)
|
||||||
break;
|
break;
|
||||||
FreeResource(pReq->id, X11_RESTYPE_NONE);
|
FreeResource(pReq->id, RT_NONE);
|
||||||
}
|
}
|
||||||
if (!pPending) {
|
if (!pPending) {
|
||||||
RemoveBlockAndWakeupHandlers(SertafiedBlockHandler,
|
RemoveBlockAndWakeupHandlers(SertafiedBlockHandler,
|
||||||
|
|
|
||||||
238
Xext/sync.c
238
Xext/sync.c
|
|
@ -49,18 +49,15 @@ PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
#include <X11/Xmd.h>
|
#include <X11/Xmd.h>
|
||||||
#include <X11/extensions/syncproto.h>
|
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
|
||||||
#include "os/osdep.h"
|
|
||||||
|
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
|
|
@ -68,17 +65,18 @@ PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include "pixmapstr.h"
|
#include "pixmapstr.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "opaque.h"
|
#include "opaque.h"
|
||||||
|
#include <X11/extensions/syncproto.h>
|
||||||
#include "syncsrv.h"
|
#include "syncsrv.h"
|
||||||
#include "syncsdk.h"
|
#include "syncsdk.h"
|
||||||
#include "protocol-versions.h"
|
#include "protocol-versions.h"
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
#include "misync_priv.h"
|
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "extinit_priv.h"
|
#include "extinit.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Local Global Variables
|
* Local Global Variables
|
||||||
|
|
@ -201,8 +199,8 @@ SyncAddTriggerToSyncObject(SyncTrigger * pTrigger)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Failure is not an option, it's succeed or burst! */
|
if (!(pCur = malloc(sizeof(SyncTriggerList))))
|
||||||
pCur = XNFalloc(sizeof(SyncTriggerList));
|
return BadAlloc;
|
||||||
|
|
||||||
pCur->pTrigger = pTrigger;
|
pCur->pTrigger = pTrigger;
|
||||||
pCur->next = pTrigger->pSync->pTriglist;
|
pCur->next = pTrigger->pSync->pTriglist;
|
||||||
|
|
@ -331,6 +329,11 @@ SyncInitTrigger(ClientPtr client, SyncTrigger * pTrigger, XID syncObject,
|
||||||
client->errorValue = syncObject;
|
client->errorValue = syncObject;
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
if (pSync != pTrigger->pSync) { /* new counter for trigger */
|
||||||
|
SyncDeleteTriggerFromSyncObject(pTrigger);
|
||||||
|
pTrigger->pSync = pSync;
|
||||||
|
newSyncObject = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if system counter, ask it what the current value is */
|
/* if system counter, ask it what the current value is */
|
||||||
|
|
@ -352,24 +355,6 @@ SyncInitTrigger(ClientPtr client, SyncTrigger * pTrigger, XID syncObject,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changes & (XSyncCAValueType | XSyncCAValue)) {
|
|
||||||
if (pTrigger->value_type == XSyncAbsolute)
|
|
||||||
pTrigger->test_value = pTrigger->wait_value;
|
|
||||||
else { /* relative */
|
|
||||||
Bool overflow;
|
|
||||||
|
|
||||||
if (pCounter == NULL)
|
|
||||||
return BadMatch;
|
|
||||||
|
|
||||||
overflow = checked_int64_add(&pTrigger->test_value,
|
|
||||||
pCounter->value, pTrigger->wait_value);
|
|
||||||
if (overflow) {
|
|
||||||
client->errorValue = pTrigger->wait_value >> 32;
|
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (changes & XSyncCATestType) {
|
if (changes & XSyncCATestType) {
|
||||||
|
|
||||||
if (pSync && SYNC_FENCE == pSync->type) {
|
if (pSync && SYNC_FENCE == pSync->type) {
|
||||||
|
|
@ -398,11 +383,21 @@ SyncInitTrigger(ClientPtr client, SyncTrigger * pTrigger, XID syncObject,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changes & XSyncCACounter) {
|
if (changes & (XSyncCAValueType | XSyncCAValue)) {
|
||||||
if (pSync != pTrigger->pSync) { /* new counter for trigger */
|
if (pTrigger->value_type == XSyncAbsolute)
|
||||||
SyncDeleteTriggerFromSyncObject(pTrigger);
|
pTrigger->test_value = pTrigger->wait_value;
|
||||||
pTrigger->pSync = pSync;
|
else { /* relative */
|
||||||
newSyncObject = TRUE;
|
Bool overflow;
|
||||||
|
|
||||||
|
if (pCounter == NULL)
|
||||||
|
return BadMatch;
|
||||||
|
|
||||||
|
overflow = checked_int64_add(&pTrigger->test_value,
|
||||||
|
pCounter->value, pTrigger->wait_value);
|
||||||
|
if (overflow) {
|
||||||
|
client->errorValue = pTrigger->wait_value >> 32;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -410,7 +405,8 @@ SyncInitTrigger(ClientPtr client, SyncTrigger * pTrigger, XID syncObject,
|
||||||
* a new counter on a trigger
|
* a new counter on a trigger
|
||||||
*/
|
*/
|
||||||
if (newSyncObject) {
|
if (newSyncObject) {
|
||||||
SyncAddTriggerToSyncObject(pTrigger);
|
if ((rc = SyncAddTriggerToSyncObject(pTrigger)) != Success)
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
else if (pCounter && IsSystemCounter(pCounter)) {
|
else if (pCounter && IsSystemCounter(pCounter)) {
|
||||||
SyncComputeBracketValues(pCounter);
|
SyncComputeBracketValues(pCounter);
|
||||||
|
|
@ -697,7 +693,7 @@ SyncAwaitTriggerFired(SyncTrigger * pTrigger)
|
||||||
/* unblock the client */
|
/* unblock the client */
|
||||||
AttendClient(pAwaitUnion->header.client);
|
AttendClient(pAwaitUnion->header.client);
|
||||||
/* delete the await */
|
/* delete the await */
|
||||||
FreeResource(pAwaitUnion->header.delete_id, X11_RESTYPE_NONE);
|
FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int64_t
|
static int64_t
|
||||||
|
|
@ -752,7 +748,7 @@ SyncEventSelectForAlarm(SyncAlarm * pAlarm, ClientPtr client, Bool wantevents)
|
||||||
* nothing, since it's already got them.
|
* nothing, since it's already got them.
|
||||||
*/
|
*/
|
||||||
if (!wantevents) {
|
if (!wantevents) {
|
||||||
FreeResource(pClients->delete_id, X11_RESTYPE_NONE);
|
FreeResource(pClients->delete_id, RT_NONE);
|
||||||
}
|
}
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
@ -801,14 +797,8 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm * pAlarm, Mask mask,
|
||||||
int status;
|
int status;
|
||||||
XSyncCounter counter;
|
XSyncCounter counter;
|
||||||
Mask origmask = mask;
|
Mask origmask = mask;
|
||||||
SyncTrigger trigger;
|
|
||||||
Bool select_events_changed = FALSE;
|
|
||||||
Bool select_events_value = FALSE;
|
|
||||||
int64_t delta;
|
|
||||||
|
|
||||||
trigger = pAlarm->trigger;
|
counter = pAlarm->trigger.pSync ? pAlarm->trigger.pSync->id : None;
|
||||||
delta = pAlarm->delta;
|
|
||||||
counter = trigger.pSync ? trigger.pSync->id : None;
|
|
||||||
|
|
||||||
while (mask) {
|
while (mask) {
|
||||||
int index2 = lowbit(mask);
|
int index2 = lowbit(mask);
|
||||||
|
|
@ -824,24 +814,24 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm * pAlarm, Mask mask,
|
||||||
case XSyncCAValueType:
|
case XSyncCAValueType:
|
||||||
mask &= ~XSyncCAValueType;
|
mask &= ~XSyncCAValueType;
|
||||||
/* sanity check in SyncInitTrigger */
|
/* sanity check in SyncInitTrigger */
|
||||||
trigger.value_type = *values++;
|
pAlarm->trigger.value_type = *values++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XSyncCAValue:
|
case XSyncCAValue:
|
||||||
mask &= ~XSyncCAValue;
|
mask &= ~XSyncCAValue;
|
||||||
trigger.wait_value = ((int64_t)values[0] << 32) | values[1];
|
pAlarm->trigger.wait_value = ((int64_t)values[0] << 32) | values[1];
|
||||||
values += 2;
|
values += 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XSyncCATestType:
|
case XSyncCATestType:
|
||||||
mask &= ~XSyncCATestType;
|
mask &= ~XSyncCATestType;
|
||||||
/* sanity check in SyncInitTrigger */
|
/* sanity check in SyncInitTrigger */
|
||||||
trigger.test_type = *values++;
|
pAlarm->trigger.test_type = *values++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XSyncCADelta:
|
case XSyncCADelta:
|
||||||
mask &= ~XSyncCADelta;
|
mask &= ~XSyncCADelta;
|
||||||
delta = ((int64_t)values[0] << 32) | values[1];
|
pAlarm->delta = ((int64_t)values[0] << 32) | values[1];
|
||||||
values += 2;
|
values += 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -851,8 +841,10 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm * pAlarm, Mask mask,
|
||||||
client->errorValue = *values;
|
client->errorValue = *values;
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
select_events_value = (Bool) (*values++);
|
status = SyncEventSelectForAlarm(pAlarm, client,
|
||||||
select_events_changed = TRUE;
|
(Bool) (*values++));
|
||||||
|
if (status != Success)
|
||||||
|
return status;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
@ -861,33 +853,25 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm * pAlarm, Mask mask,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (select_events_changed) {
|
|
||||||
status = SyncEventSelectForAlarm(pAlarm, client, select_events_value);
|
|
||||||
if (status != Success)
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* "If the test-type is PositiveComparison or PositiveTransition
|
/* "If the test-type is PositiveComparison or PositiveTransition
|
||||||
* and delta is less than zero, or if the test-type is
|
* and delta is less than zero, or if the test-type is
|
||||||
* NegativeComparison or NegativeTransition and delta is
|
* NegativeComparison or NegativeTransition and delta is
|
||||||
* greater than zero, a Match error is generated."
|
* greater than zero, a Match error is generated."
|
||||||
*/
|
*/
|
||||||
if (origmask & (XSyncCADelta | XSyncCATestType)) {
|
if (origmask & (XSyncCADelta | XSyncCATestType)) {
|
||||||
if ((((trigger.test_type == XSyncPositiveComparison) ||
|
if ((((pAlarm->trigger.test_type == XSyncPositiveComparison) ||
|
||||||
(trigger.test_type == XSyncPositiveTransition))
|
(pAlarm->trigger.test_type == XSyncPositiveTransition))
|
||||||
&& delta < 0)
|
&& pAlarm->delta < 0)
|
||||||
||
|
||
|
||||||
(((trigger.test_type == XSyncNegativeComparison) ||
|
(((pAlarm->trigger.test_type == XSyncNegativeComparison) ||
|
||||||
(trigger.test_type == XSyncNegativeTransition))
|
(pAlarm->trigger.test_type == XSyncNegativeTransition))
|
||||||
&& delta > 0)
|
&& pAlarm->delta > 0)
|
||||||
) {
|
) {
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* postpone this until now, when we're sure nothing else can go wrong */
|
/* postpone this until now, when we're sure nothing else can go wrong */
|
||||||
pAlarm->delta = delta;
|
|
||||||
pAlarm->trigger = trigger;
|
|
||||||
if ((status = SyncInitTrigger(client, &pAlarm->trigger, counter, RTCounter,
|
if ((status = SyncInitTrigger(client, &pAlarm->trigger, counter, RTCounter,
|
||||||
origmask & XSyncCAAllTrigger)) != Success)
|
origmask & XSyncCAAllTrigger)) != Success)
|
||||||
return status;
|
return status;
|
||||||
|
|
@ -897,21 +881,18 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm * pAlarm, Mask mask,
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
SyncObject *
|
static SyncObject *
|
||||||
SyncCreate(ClientPtr client, XID id, unsigned char type)
|
SyncCreate(ClientPtr client, XID id, unsigned char type)
|
||||||
{
|
{
|
||||||
SyncObject *pSync;
|
SyncObject *pSync;
|
||||||
RESTYPE resType;
|
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case SYNC_COUNTER:
|
case SYNC_COUNTER:
|
||||||
pSync = malloc(sizeof(SyncCounter));
|
pSync = malloc(sizeof(SyncCounter));
|
||||||
resType = RTCounter;
|
|
||||||
break;
|
break;
|
||||||
case SYNC_FENCE:
|
case SYNC_FENCE:
|
||||||
pSync = (SyncObject *) dixAllocateObjectWithPrivates(SyncFence,
|
pSync = (SyncObject *) dixAllocateObjectWithPrivates(SyncFence,
|
||||||
PRIVATE_SYNC_FENCE);
|
PRIVATE_SYNC_FENCE);
|
||||||
resType = RTFence;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -920,11 +901,6 @@ SyncCreate(ClientPtr client, XID id, unsigned char type)
|
||||||
if (!pSync)
|
if (!pSync)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
pSync->initialized = FALSE;
|
|
||||||
|
|
||||||
if (!AddResource(id, resType, (void *) pSync))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
pSync->client = client;
|
pSync->client = client;
|
||||||
pSync->id = id;
|
pSync->id = id;
|
||||||
pSync->pTriglist = NULL;
|
pSync->pTriglist = NULL;
|
||||||
|
|
@ -947,10 +923,13 @@ SyncCreateFenceFromFD(ClientPtr client, DrawablePtr pDraw, XID id, int fd, BOOL
|
||||||
|
|
||||||
status = miSyncInitFenceFromFD(pDraw, pFence, fd, initially_triggered);
|
status = miSyncInitFenceFromFD(pDraw, pFence, fd, initially_triggered);
|
||||||
if (status != Success) {
|
if (status != Success) {
|
||||||
FreeResource(pFence->sync.id, X11_RESTYPE_NONE);
|
dixFreeObjectWithPrivates(pFence, PRIVATE_SYNC_FENCE);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!AddResource(id, RTFence, (void *) pFence))
|
||||||
|
return BadAlloc;
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
#else
|
#else
|
||||||
return BadImplementation;
|
return BadImplementation;
|
||||||
|
|
@ -978,7 +957,8 @@ SyncCreateCounter(ClientPtr client, XSyncCounter id, int64_t initialvalue)
|
||||||
pCounter->value = initialvalue;
|
pCounter->value = initialvalue;
|
||||||
pCounter->pSysCounterInfo = NULL;
|
pCounter->pSysCounterInfo = NULL;
|
||||||
|
|
||||||
pCounter->sync.initialized = TRUE;
|
if (!AddResource(id, RTCounter, (void *) pCounter))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
return pCounter;
|
return pCounter;
|
||||||
}
|
}
|
||||||
|
|
@ -1005,8 +985,8 @@ SyncCreateSystemCounter(const char *name,
|
||||||
|
|
||||||
psci = malloc(sizeof(SysCounterInfo));
|
psci = malloc(sizeof(SysCounterInfo));
|
||||||
if (!psci) {
|
if (!psci) {
|
||||||
FreeResource(pCounter->sync.id, X11_RESTYPE_NONE);
|
FreeResource(pCounter->sync.id, RT_NONE);
|
||||||
return NULL;
|
return pCounter;
|
||||||
}
|
}
|
||||||
pCounter->pSysCounterInfo = psci;
|
pCounter->pSysCounterInfo = psci;
|
||||||
psci->pCounter = pCounter;
|
psci->pCounter = pCounter;
|
||||||
|
|
@ -1028,7 +1008,7 @@ SyncDestroySystemCounter(void *pSysCounter)
|
||||||
{
|
{
|
||||||
SyncCounter *pCounter = (SyncCounter *) pSysCounter;
|
SyncCounter *pCounter = (SyncCounter *) pSysCounter;
|
||||||
|
|
||||||
FreeResource(pCounter->sync.id, X11_RESTYPE_NONE);
|
FreeResource(pCounter->sync.id, RT_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -1141,7 +1121,7 @@ FreeAlarm(void *addr, XID id)
|
||||||
/* delete event selections */
|
/* delete event selections */
|
||||||
|
|
||||||
while (pAlarm->pEventClients)
|
while (pAlarm->pEventClients)
|
||||||
FreeResource(pAlarm->pEventClients->delete_id, X11_RESTYPE_NONE);
|
FreeResource(pAlarm->pEventClients->delete_id, RT_NONE);
|
||||||
|
|
||||||
SyncDeleteTriggerFromSyncObject(&pAlarm->trigger);
|
SyncDeleteTriggerFromSyncObject(&pAlarm->trigger);
|
||||||
|
|
||||||
|
|
@ -1157,26 +1137,21 @@ static int
|
||||||
FreeCounter(void *env, XID id)
|
FreeCounter(void *env, XID id)
|
||||||
{
|
{
|
||||||
SyncCounter *pCounter = (SyncCounter *) env;
|
SyncCounter *pCounter = (SyncCounter *) env;
|
||||||
|
SyncTriggerList *ptl, *pnext;
|
||||||
|
|
||||||
pCounter->sync.beingDestroyed = TRUE;
|
pCounter->sync.beingDestroyed = TRUE;
|
||||||
|
/* tell all the counter's triggers that the counter has been destroyed */
|
||||||
if (pCounter->sync.initialized) {
|
for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext) {
|
||||||
SyncTriggerList *ptl, *pnext;
|
(*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger);
|
||||||
|
pnext = ptl->next;
|
||||||
/* tell all the counter's triggers that counter has been destroyed */
|
free(ptl); /* destroy the trigger list as we go */
|
||||||
for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext) {
|
}
|
||||||
(*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger);
|
if (IsSystemCounter(pCounter)) {
|
||||||
pnext = ptl->next;
|
xorg_list_del(&pCounter->pSysCounterInfo->entry);
|
||||||
free(ptl); /* destroy the trigger list as we go */
|
free(pCounter->pSysCounterInfo->name);
|
||||||
}
|
free(pCounter->pSysCounterInfo->private);
|
||||||
if (IsSystemCounter(pCounter)) {
|
free(pCounter->pSysCounterInfo);
|
||||||
xorg_list_del(&pCounter->pSysCounterInfo->entry);
|
|
||||||
free(pCounter->pSysCounterInfo->name);
|
|
||||||
free(pCounter->pSysCounterInfo->private);
|
|
||||||
free(pCounter->pSysCounterInfo);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
free(pCounter);
|
free(pCounter);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
@ -1506,7 +1481,7 @@ ProcSyncDestroyCounter(ClientPtr client)
|
||||||
client->errorValue = stuff->counter;
|
client->errorValue = stuff->counter;
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
}
|
}
|
||||||
FreeResource(pCounter->sync.id, X11_RESTYPE_NONE);
|
FreeResource(pCounter->sync.id, RT_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1607,7 +1582,7 @@ ProcSyncAwait(ClientPtr client)
|
||||||
/* this should take care of removing any triggers created by
|
/* this should take care of removing any triggers created by
|
||||||
* this request that have already been registered on sync objects
|
* 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;
|
client->errorValue = pProtocolWaitConds->counter;
|
||||||
return SyncErrorBase + XSyncBadCounter;
|
return SyncErrorBase + XSyncBadCounter;
|
||||||
}
|
}
|
||||||
|
|
@ -1627,7 +1602,7 @@ ProcSyncAwait(ClientPtr client)
|
||||||
/* this should take care of removing any triggers created by
|
/* this should take care of removing any triggers created by
|
||||||
* this request that have already been registered on sync objects
|
* 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;
|
return status;
|
||||||
}
|
}
|
||||||
/* this is not a mistake -- same function works for both cases */
|
/* this is not a mistake -- same function works for both cases */
|
||||||
|
|
@ -1758,7 +1733,7 @@ ProcSyncCreateAlarm(ClientPtr client)
|
||||||
|
|
||||||
if (!SyncCheckWarnIsCounter(pTrigger->pSync,
|
if (!SyncCheckWarnIsCounter(pTrigger->pSync,
|
||||||
WARN_INVALID_COUNTER_ALARM)) {
|
WARN_INVALID_COUNTER_ALARM)) {
|
||||||
FreeResource(stuff->id, X11_RESTYPE_NONE);
|
FreeResource(stuff->id, RT_NONE);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1889,7 +1864,7 @@ ProcSyncDestroyAlarm(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
FreeResource(stuff->alarm, X11_RESTYPE_NONE);
|
FreeResource(stuff->alarm, RT_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1914,6 +1889,9 @@ ProcSyncCreateFence(ClientPtr client)
|
||||||
|
|
||||||
miSyncInitFence(pDraw->pScreen, pFence, stuff->initially_triggered);
|
miSyncInitFence(pDraw->pScreen, pFence, stuff->initially_triggered);
|
||||||
|
|
||||||
|
if (!AddResource(stuff->fid, RTFence, (void *) pFence))
|
||||||
|
return BadAlloc;
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1994,7 +1972,7 @@ ProcSyncDestroyFence(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
FreeResource(stuff->fid, X11_RESTYPE_NONE);
|
FreeResource(stuff->fid, RT_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2072,7 +2050,7 @@ ProcSyncAwaitFence(ClientPtr client)
|
||||||
/* this should take care of removing any triggers created by
|
/* this should take care of removing any triggers created by
|
||||||
* this request that have already been registered on sync objects
|
* 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;
|
client->errorValue = *pProtocolFences;
|
||||||
return SyncErrorBase + XSyncBadFence;
|
return SyncErrorBase + XSyncBadFence;
|
||||||
}
|
}
|
||||||
|
|
@ -2091,7 +2069,7 @@ ProcSyncAwaitFence(ClientPtr client)
|
||||||
/* this should take care of removing any triggers created by
|
/* this should take care of removing any triggers created by
|
||||||
* this request that have already been registered on sync objects
|
* 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;
|
return status;
|
||||||
}
|
}
|
||||||
/* this is not a mistake -- same function works for both cases */
|
/* this is not a mistake -- same function works for both cases */
|
||||||
|
|
@ -2166,10 +2144,31 @@ ProcSyncDispatch(ClientPtr client)
|
||||||
* Boring Swapping stuff ...
|
* 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
|
static int _X_COLD
|
||||||
SProcSyncCreateCounter(ClientPtr client)
|
SProcSyncCreateCounter(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncCreateCounterReq);
|
REQUEST(xSyncCreateCounterReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xSyncCreateCounterReq);
|
REQUEST_SIZE_MATCH(xSyncCreateCounterReq);
|
||||||
swapl(&stuff->cid);
|
swapl(&stuff->cid);
|
||||||
swapl(&stuff->initial_value_lo);
|
swapl(&stuff->initial_value_lo);
|
||||||
|
|
@ -2182,6 +2181,7 @@ static int _X_COLD
|
||||||
SProcSyncSetCounter(ClientPtr client)
|
SProcSyncSetCounter(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncSetCounterReq);
|
REQUEST(xSyncSetCounterReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xSyncSetCounterReq);
|
REQUEST_SIZE_MATCH(xSyncSetCounterReq);
|
||||||
swapl(&stuff->cid);
|
swapl(&stuff->cid);
|
||||||
swapl(&stuff->value_lo);
|
swapl(&stuff->value_lo);
|
||||||
|
|
@ -2194,6 +2194,7 @@ static int _X_COLD
|
||||||
SProcSyncChangeCounter(ClientPtr client)
|
SProcSyncChangeCounter(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncChangeCounterReq);
|
REQUEST(xSyncChangeCounterReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xSyncChangeCounterReq);
|
REQUEST_SIZE_MATCH(xSyncChangeCounterReq);
|
||||||
swapl(&stuff->cid);
|
swapl(&stuff->cid);
|
||||||
swapl(&stuff->value_lo);
|
swapl(&stuff->value_lo);
|
||||||
|
|
@ -2206,6 +2207,7 @@ static int _X_COLD
|
||||||
SProcSyncQueryCounter(ClientPtr client)
|
SProcSyncQueryCounter(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncQueryCounterReq);
|
REQUEST(xSyncQueryCounterReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xSyncQueryCounterReq);
|
REQUEST_SIZE_MATCH(xSyncQueryCounterReq);
|
||||||
swapl(&stuff->counter);
|
swapl(&stuff->counter);
|
||||||
|
|
||||||
|
|
@ -2216,6 +2218,7 @@ static int _X_COLD
|
||||||
SProcSyncDestroyCounter(ClientPtr client)
|
SProcSyncDestroyCounter(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncDestroyCounterReq);
|
REQUEST(xSyncDestroyCounterReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xSyncDestroyCounterReq);
|
REQUEST_SIZE_MATCH(xSyncDestroyCounterReq);
|
||||||
swapl(&stuff->counter);
|
swapl(&stuff->counter);
|
||||||
|
|
||||||
|
|
@ -2226,6 +2229,7 @@ static int _X_COLD
|
||||||
SProcSyncAwait(ClientPtr client)
|
SProcSyncAwait(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncAwaitReq);
|
REQUEST(xSyncAwaitReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xSyncAwaitReq);
|
REQUEST_AT_LEAST_SIZE(xSyncAwaitReq);
|
||||||
SwapRestL(stuff);
|
SwapRestL(stuff);
|
||||||
|
|
||||||
|
|
@ -2236,6 +2240,7 @@ static int _X_COLD
|
||||||
SProcSyncCreateAlarm(ClientPtr client)
|
SProcSyncCreateAlarm(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncCreateAlarmReq);
|
REQUEST(xSyncCreateAlarmReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq);
|
REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq);
|
||||||
swapl(&stuff->id);
|
swapl(&stuff->id);
|
||||||
swapl(&stuff->valueMask);
|
swapl(&stuff->valueMask);
|
||||||
|
|
@ -2248,6 +2253,7 @@ static int _X_COLD
|
||||||
SProcSyncChangeAlarm(ClientPtr client)
|
SProcSyncChangeAlarm(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncChangeAlarmReq);
|
REQUEST(xSyncChangeAlarmReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq);
|
REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq);
|
||||||
swapl(&stuff->alarm);
|
swapl(&stuff->alarm);
|
||||||
swapl(&stuff->valueMask);
|
swapl(&stuff->valueMask);
|
||||||
|
|
@ -2259,6 +2265,7 @@ static int _X_COLD
|
||||||
SProcSyncQueryAlarm(ClientPtr client)
|
SProcSyncQueryAlarm(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncQueryAlarmReq);
|
REQUEST(xSyncQueryAlarmReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xSyncQueryAlarmReq);
|
REQUEST_SIZE_MATCH(xSyncQueryAlarmReq);
|
||||||
swapl(&stuff->alarm);
|
swapl(&stuff->alarm);
|
||||||
|
|
||||||
|
|
@ -2269,6 +2276,7 @@ static int _X_COLD
|
||||||
SProcSyncDestroyAlarm(ClientPtr client)
|
SProcSyncDestroyAlarm(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncDestroyAlarmReq);
|
REQUEST(xSyncDestroyAlarmReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq);
|
REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq);
|
||||||
swapl(&stuff->alarm);
|
swapl(&stuff->alarm);
|
||||||
|
|
||||||
|
|
@ -2279,6 +2287,7 @@ static int _X_COLD
|
||||||
SProcSyncSetPriority(ClientPtr client)
|
SProcSyncSetPriority(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncSetPriorityReq);
|
REQUEST(xSyncSetPriorityReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xSyncSetPriorityReq);
|
REQUEST_SIZE_MATCH(xSyncSetPriorityReq);
|
||||||
swapl(&stuff->id);
|
swapl(&stuff->id);
|
||||||
swapl(&stuff->priority);
|
swapl(&stuff->priority);
|
||||||
|
|
@ -2290,6 +2299,7 @@ static int _X_COLD
|
||||||
SProcSyncGetPriority(ClientPtr client)
|
SProcSyncGetPriority(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncGetPriorityReq);
|
REQUEST(xSyncGetPriorityReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xSyncGetPriorityReq);
|
REQUEST_SIZE_MATCH(xSyncGetPriorityReq);
|
||||||
swapl(&stuff->id);
|
swapl(&stuff->id);
|
||||||
|
|
||||||
|
|
@ -2300,8 +2310,8 @@ static int _X_COLD
|
||||||
SProcSyncCreateFence(ClientPtr client)
|
SProcSyncCreateFence(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncCreateFenceReq);
|
REQUEST(xSyncCreateFenceReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xSyncCreateFenceReq);
|
REQUEST_SIZE_MATCH(xSyncCreateFenceReq);
|
||||||
swapl(&stuff->d);
|
|
||||||
swapl(&stuff->fid);
|
swapl(&stuff->fid);
|
||||||
|
|
||||||
return ProcSyncCreateFence(client);
|
return ProcSyncCreateFence(client);
|
||||||
|
|
@ -2311,6 +2321,7 @@ static int _X_COLD
|
||||||
SProcSyncTriggerFence(ClientPtr client)
|
SProcSyncTriggerFence(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncTriggerFenceReq);
|
REQUEST(xSyncTriggerFenceReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xSyncTriggerFenceReq);
|
REQUEST_SIZE_MATCH(xSyncTriggerFenceReq);
|
||||||
swapl(&stuff->fid);
|
swapl(&stuff->fid);
|
||||||
|
|
||||||
|
|
@ -2321,6 +2332,7 @@ static int _X_COLD
|
||||||
SProcSyncResetFence(ClientPtr client)
|
SProcSyncResetFence(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncResetFenceReq);
|
REQUEST(xSyncResetFenceReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xSyncResetFenceReq);
|
REQUEST_SIZE_MATCH(xSyncResetFenceReq);
|
||||||
swapl(&stuff->fid);
|
swapl(&stuff->fid);
|
||||||
|
|
||||||
|
|
@ -2331,6 +2343,7 @@ static int _X_COLD
|
||||||
SProcSyncDestroyFence(ClientPtr client)
|
SProcSyncDestroyFence(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncDestroyFenceReq);
|
REQUEST(xSyncDestroyFenceReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xSyncDestroyFenceReq);
|
REQUEST_SIZE_MATCH(xSyncDestroyFenceReq);
|
||||||
swapl(&stuff->fid);
|
swapl(&stuff->fid);
|
||||||
|
|
||||||
|
|
@ -2341,6 +2354,7 @@ static int _X_COLD
|
||||||
SProcSyncQueryFence(ClientPtr client)
|
SProcSyncQueryFence(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncQueryFenceReq);
|
REQUEST(xSyncQueryFenceReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xSyncQueryFenceReq);
|
REQUEST_SIZE_MATCH(xSyncQueryFenceReq);
|
||||||
swapl(&stuff->fid);
|
swapl(&stuff->fid);
|
||||||
|
|
||||||
|
|
@ -2351,6 +2365,7 @@ static int _X_COLD
|
||||||
SProcSyncAwaitFence(ClientPtr client)
|
SProcSyncAwaitFence(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncAwaitFenceReq);
|
REQUEST(xSyncAwaitFenceReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xSyncAwaitFenceReq);
|
REQUEST_AT_LEAST_SIZE(xSyncAwaitFenceReq);
|
||||||
SwapRestL(stuff);
|
SwapRestL(stuff);
|
||||||
|
|
||||||
|
|
@ -2364,9 +2379,9 @@ SProcSyncDispatch(ClientPtr client)
|
||||||
|
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
case X_SyncInitialize:
|
case X_SyncInitialize:
|
||||||
return ProcSyncInitialize(client);
|
return SProcSyncInitialize(client);
|
||||||
case X_SyncListSystemCounters:
|
case X_SyncListSystemCounters:
|
||||||
return ProcSyncListSystemCounters(client);
|
return SProcSyncListSystemCounters(client);
|
||||||
case X_SyncCreateCounter:
|
case X_SyncCreateCounter:
|
||||||
return SProcSyncCreateCounter(client);
|
return SProcSyncCreateCounter(client);
|
||||||
case X_SyncSetCounter:
|
case X_SyncSetCounter:
|
||||||
|
|
@ -2621,11 +2636,9 @@ IdleTimeQueryValue(void *pCounter, int64_t *pValue_return)
|
||||||
int deviceid;
|
int deviceid;
|
||||||
CARD32 idle;
|
CARD32 idle;
|
||||||
|
|
||||||
*pValue_return = 0;
|
|
||||||
if (pCounter) {
|
if (pCounter) {
|
||||||
SyncCounter *counter = pCounter;
|
SyncCounter *counter = pCounter;
|
||||||
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
|
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
|
||||||
BUG_RETURN(priv == NULL);
|
|
||||||
deviceid = priv->deviceid;
|
deviceid = priv->deviceid;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -2639,7 +2652,6 @@ IdleTimeBlockHandler(void *pCounter, void *wt)
|
||||||
{
|
{
|
||||||
SyncCounter *counter = pCounter;
|
SyncCounter *counter = pCounter;
|
||||||
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
|
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
|
||||||
BUG_RETURN(priv == NULL);
|
|
||||||
int64_t *less = priv->value_less;
|
int64_t *less = priv->value_less;
|
||||||
int64_t *greater = priv->value_greater;
|
int64_t *greater = priv->value_greater;
|
||||||
int64_t idle, old_idle;
|
int64_t idle, old_idle;
|
||||||
|
|
@ -2730,7 +2742,6 @@ IdleTimeWakeupHandler(void *pCounter, int rc)
|
||||||
{
|
{
|
||||||
SyncCounter *counter = pCounter;
|
SyncCounter *counter = pCounter;
|
||||||
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
|
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
|
||||||
BUG_RETURN(priv == NULL);
|
|
||||||
int64_t *less = priv->value_less;
|
int64_t *less = priv->value_less;
|
||||||
int64_t *greater = priv->value_greater;
|
int64_t *greater = priv->value_greater;
|
||||||
int64_t idle;
|
int64_t idle;
|
||||||
|
|
@ -2764,7 +2775,6 @@ IdleTimeBracketValues(void *pCounter, int64_t *pbracket_less,
|
||||||
{
|
{
|
||||||
SyncCounter *counter = pCounter;
|
SyncCounter *counter = pCounter;
|
||||||
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
|
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
|
||||||
BUG_RETURN(priv == NULL);
|
|
||||||
int64_t *less = priv->value_less;
|
int64_t *less = priv->value_less;
|
||||||
int64_t *greater = priv->value_greater;
|
int64_t *greater = priv->value_greater;
|
||||||
Bool registered = (less || greater);
|
Bool registered = (less || greater);
|
||||||
|
|
@ -2802,10 +2812,8 @@ init_system_idle_counter(const char *name, int deviceid)
|
||||||
if (idle_time_counter != NULL) {
|
if (idle_time_counter != NULL) {
|
||||||
IdleCounterPriv *priv = malloc(sizeof(IdleCounterPriv));
|
IdleCounterPriv *priv = malloc(sizeof(IdleCounterPriv));
|
||||||
|
|
||||||
if (priv) {
|
priv->value_less = priv->value_greater = NULL;
|
||||||
priv->value_less = priv->value_greater = NULL;
|
priv->deviceid = deviceid;
|
||||||
priv->deviceid = deviceid;
|
|
||||||
}
|
|
||||||
|
|
||||||
idle_time_counter->pSysCounterInfo->private = priv;
|
idle_time_counter->pSysCounterInfo->private = priv;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,6 @@
|
||||||
extern _X_EXPORT int
|
extern _X_EXPORT int
|
||||||
SyncVerifyFence(SyncFence ** ppFence, XID fid, ClientPtr client, Mask mode);
|
SyncVerifyFence(SyncFence ** ppFence, XID fid, ClientPtr client, Mask mode);
|
||||||
|
|
||||||
extern _X_EXPORT SyncObject*
|
|
||||||
SyncCreate(ClientPtr client, XID id, unsigned char type);
|
|
||||||
|
|
||||||
#define VERIFY_SYNC_FENCE(pFence, fid, client, mode) \
|
#define VERIFY_SYNC_FENCE(pFence, fid, client, mode) \
|
||||||
do { \
|
do { \
|
||||||
int rc; \
|
int rc; \
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,9 @@ from Kaleb S. KEITHLEY
|
||||||
*/
|
*/
|
||||||
/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
|
/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef XF86VIDMODE
|
#ifdef XF86VIDMODE
|
||||||
|
|
||||||
|
|
@ -275,8 +277,8 @@ ProcVidModeGetModeLine(ClientPtr client)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Older servers sometimes had server privates that the VidMode
|
* Older servers sometimes had server privates that the VidMode
|
||||||
* extension made available. So to be compatible pretend that
|
* extention made available. So to be compatiable pretend that
|
||||||
* there are no server privates to pass to the client.
|
* there are no server privates to pass to the client
|
||||||
*/
|
*/
|
||||||
rep.privsize = 0;
|
rep.privsize = 0;
|
||||||
|
|
||||||
|
|
@ -469,7 +471,7 @@ ProcVidModeAddModeLine(ClientPtr client)
|
||||||
if (ver < 2) {
|
if (ver < 2) {
|
||||||
/* convert from old format */
|
/* convert from old format */
|
||||||
stuff = &newstuff;
|
stuff = &newstuff;
|
||||||
stuff->length = client->req_len;
|
stuff->length = oldstuff->length;
|
||||||
stuff->screen = oldstuff->screen;
|
stuff->screen = oldstuff->screen;
|
||||||
stuff->dotclock = oldstuff->dotclock;
|
stuff->dotclock = oldstuff->dotclock;
|
||||||
stuff->hdisplay = oldstuff->hdisplay;
|
stuff->hdisplay = oldstuff->hdisplay;
|
||||||
|
|
@ -639,7 +641,7 @@ ProcVidModeDeleteModeLine(ClientPtr client)
|
||||||
if (ver < 2) {
|
if (ver < 2) {
|
||||||
/* convert from old format */
|
/* convert from old format */
|
||||||
stuff = &newstuff;
|
stuff = &newstuff;
|
||||||
stuff->length = client->req_len;
|
stuff->length = oldstuff->length;
|
||||||
stuff->screen = oldstuff->screen;
|
stuff->screen = oldstuff->screen;
|
||||||
stuff->dotclock = oldstuff->dotclock;
|
stuff->dotclock = oldstuff->dotclock;
|
||||||
stuff->hdisplay = oldstuff->hdisplay;
|
stuff->hdisplay = oldstuff->hdisplay;
|
||||||
|
|
@ -668,7 +670,7 @@ ProcVidModeDeleteModeLine(ClientPtr client)
|
||||||
"len = %d, length = %d\n",
|
"len = %d, length = %d\n",
|
||||||
(unsigned long) client->req_len,
|
(unsigned long) client->req_len,
|
||||||
(int) sizeof(xXF86VidModeDeleteModeLineReq) >> 2,
|
(int) sizeof(xXF86VidModeDeleteModeLineReq) >> 2,
|
||||||
(unsigned long) stuff->privsize, len, client->req_len);
|
(unsigned long) stuff->privsize, len, stuff->length);
|
||||||
return BadLength;
|
return BadLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -763,7 +765,7 @@ ProcVidModeModModeLine(ClientPtr client)
|
||||||
if (ver < 2) {
|
if (ver < 2) {
|
||||||
/* convert from old format */
|
/* convert from old format */
|
||||||
stuff = &newstuff;
|
stuff = &newstuff;
|
||||||
stuff->length = client->req_len;
|
stuff->length = oldstuff->length;
|
||||||
stuff->screen = oldstuff->screen;
|
stuff->screen = oldstuff->screen;
|
||||||
stuff->hdisplay = oldstuff->hdisplay;
|
stuff->hdisplay = oldstuff->hdisplay;
|
||||||
stuff->hsyncstart = oldstuff->hsyncstart;
|
stuff->hsyncstart = oldstuff->hsyncstart;
|
||||||
|
|
@ -806,8 +808,6 @@ ProcVidModeModModeLine(ClientPtr client)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
modetmp = VidModeCreateMode();
|
modetmp = VidModeCreateMode();
|
||||||
if (modetmp == NULL)
|
|
||||||
return BadAlloc;
|
|
||||||
VidModeCopyMode(mode, modetmp);
|
VidModeCopyMode(mode, modetmp);
|
||||||
|
|
||||||
VidModeSetModeValue(modetmp, VIDMODE_H_DISPLAY, stuff->hdisplay);
|
VidModeSetModeValue(modetmp, VIDMODE_H_DISPLAY, stuff->hdisplay);
|
||||||
|
|
@ -899,7 +899,7 @@ ProcVidModeValidateModeLine(ClientPtr client)
|
||||||
if (ver < 2) {
|
if (ver < 2) {
|
||||||
/* convert from old format */
|
/* convert from old format */
|
||||||
stuff = &newstuff;
|
stuff = &newstuff;
|
||||||
stuff->length = client->req_len;
|
stuff->length = oldstuff->length;
|
||||||
stuff->screen = oldstuff->screen;
|
stuff->screen = oldstuff->screen;
|
||||||
stuff->dotclock = oldstuff->dotclock;
|
stuff->dotclock = oldstuff->dotclock;
|
||||||
stuff->hdisplay = oldstuff->hdisplay;
|
stuff->hdisplay = oldstuff->hdisplay;
|
||||||
|
|
@ -951,8 +951,6 @@ ProcVidModeValidateModeLine(ClientPtr client)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
modetmp = VidModeCreateMode();
|
modetmp = VidModeCreateMode();
|
||||||
if (modetmp == NULL)
|
|
||||||
return BadAlloc;
|
|
||||||
VidModeCopyMode(mode, modetmp);
|
VidModeCopyMode(mode, modetmp);
|
||||||
|
|
||||||
VidModeSetModeValue(modetmp, VIDMODE_H_DISPLAY, stuff->hdisplay);
|
VidModeSetModeValue(modetmp, VIDMODE_H_DISPLAY, stuff->hdisplay);
|
||||||
|
|
@ -1054,7 +1052,7 @@ ProcVidModeSwitchToMode(ClientPtr client)
|
||||||
if (ver < 2) {
|
if (ver < 2) {
|
||||||
/* convert from old format */
|
/* convert from old format */
|
||||||
stuff = &newstuff;
|
stuff = &newstuff;
|
||||||
stuff->length = client->req_len;
|
stuff->length = oldstuff->length;
|
||||||
stuff->screen = oldstuff->screen;
|
stuff->screen = oldstuff->screen;
|
||||||
stuff->dotclock = oldstuff->dotclock;
|
stuff->dotclock = oldstuff->dotclock;
|
||||||
stuff->hdisplay = oldstuff->hdisplay;
|
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
|
static int _X_COLD
|
||||||
SProcVidModeGetModeLine(ClientPtr client)
|
SProcVidModeGetModeLine(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXF86VidModeGetModeLineReq);
|
REQUEST(xXF86VidModeGetModeLineReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xXF86VidModeGetModeLineReq);
|
REQUEST_SIZE_MATCH(xXF86VidModeGetModeLineReq);
|
||||||
swaps(&stuff->screen);
|
swaps(&stuff->screen);
|
||||||
return ProcVidModeGetModeLine(client);
|
return ProcVidModeGetModeLine(client);
|
||||||
|
|
@ -1718,6 +1725,7 @@ static int _X_COLD
|
||||||
SProcVidModeGetAllModeLines(ClientPtr client)
|
SProcVidModeGetAllModeLines(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXF86VidModeGetAllModeLinesReq);
|
REQUEST(xXF86VidModeGetAllModeLinesReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq);
|
REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq);
|
||||||
swaps(&stuff->screen);
|
swaps(&stuff->screen);
|
||||||
return ProcVidModeGetAllModeLines(client);
|
return ProcVidModeGetAllModeLines(client);
|
||||||
|
|
@ -1733,6 +1741,7 @@ SProcVidModeAddModeLine(ClientPtr client)
|
||||||
REQUEST(xXF86VidModeAddModeLineReq);
|
REQUEST(xXF86VidModeAddModeLineReq);
|
||||||
ver = ClientMajorVersion(client);
|
ver = ClientMajorVersion(client);
|
||||||
if (ver < 2) {
|
if (ver < 2) {
|
||||||
|
swaps(&oldstuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeAddModeLineReq);
|
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeAddModeLineReq);
|
||||||
swapl(&oldstuff->screen);
|
swapl(&oldstuff->screen);
|
||||||
swaps(&oldstuff->hdisplay);
|
swaps(&oldstuff->hdisplay);
|
||||||
|
|
@ -1748,6 +1757,7 @@ SProcVidModeAddModeLine(ClientPtr client)
|
||||||
SwapRestL(oldstuff);
|
SwapRestL(oldstuff);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xXF86VidModeAddModeLineReq);
|
REQUEST_AT_LEAST_SIZE(xXF86VidModeAddModeLineReq);
|
||||||
swapl(&stuff->screen);
|
swapl(&stuff->screen);
|
||||||
swaps(&stuff->hdisplay);
|
swaps(&stuff->hdisplay);
|
||||||
|
|
@ -1776,6 +1786,7 @@ SProcVidModeDeleteModeLine(ClientPtr client)
|
||||||
REQUEST(xXF86VidModeDeleteModeLineReq);
|
REQUEST(xXF86VidModeDeleteModeLineReq);
|
||||||
ver = ClientMajorVersion(client);
|
ver = ClientMajorVersion(client);
|
||||||
if (ver < 2) {
|
if (ver < 2) {
|
||||||
|
swaps(&oldstuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeDeleteModeLineReq);
|
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeDeleteModeLineReq);
|
||||||
swapl(&oldstuff->screen);
|
swapl(&oldstuff->screen);
|
||||||
swaps(&oldstuff->hdisplay);
|
swaps(&oldstuff->hdisplay);
|
||||||
|
|
@ -1791,6 +1802,7 @@ SProcVidModeDeleteModeLine(ClientPtr client)
|
||||||
SwapRestL(oldstuff);
|
SwapRestL(oldstuff);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xXF86VidModeDeleteModeLineReq);
|
REQUEST_AT_LEAST_SIZE(xXF86VidModeDeleteModeLineReq);
|
||||||
swapl(&stuff->screen);
|
swapl(&stuff->screen);
|
||||||
swaps(&stuff->hdisplay);
|
swaps(&stuff->hdisplay);
|
||||||
|
|
@ -1819,6 +1831,7 @@ SProcVidModeModModeLine(ClientPtr client)
|
||||||
REQUEST(xXF86VidModeModModeLineReq);
|
REQUEST(xXF86VidModeModModeLineReq);
|
||||||
ver = ClientMajorVersion(client);
|
ver = ClientMajorVersion(client);
|
||||||
if (ver < 2) {
|
if (ver < 2) {
|
||||||
|
swaps(&oldstuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeModModeLineReq);
|
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeModModeLineReq);
|
||||||
swapl(&oldstuff->screen);
|
swapl(&oldstuff->screen);
|
||||||
swaps(&oldstuff->hdisplay);
|
swaps(&oldstuff->hdisplay);
|
||||||
|
|
@ -1834,6 +1847,7 @@ SProcVidModeModModeLine(ClientPtr client)
|
||||||
SwapRestL(oldstuff);
|
SwapRestL(oldstuff);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xXF86VidModeModModeLineReq);
|
REQUEST_AT_LEAST_SIZE(xXF86VidModeModModeLineReq);
|
||||||
swapl(&stuff->screen);
|
swapl(&stuff->screen);
|
||||||
swaps(&stuff->hdisplay);
|
swaps(&stuff->hdisplay);
|
||||||
|
|
@ -1862,6 +1876,7 @@ SProcVidModeValidateModeLine(ClientPtr client)
|
||||||
REQUEST(xXF86VidModeValidateModeLineReq);
|
REQUEST(xXF86VidModeValidateModeLineReq);
|
||||||
ver = ClientMajorVersion(client);
|
ver = ClientMajorVersion(client);
|
||||||
if (ver < 2) {
|
if (ver < 2) {
|
||||||
|
swaps(&oldstuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeValidateModeLineReq);
|
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeValidateModeLineReq);
|
||||||
swapl(&oldstuff->screen);
|
swapl(&oldstuff->screen);
|
||||||
swaps(&oldstuff->hdisplay);
|
swaps(&oldstuff->hdisplay);
|
||||||
|
|
@ -1877,6 +1892,7 @@ SProcVidModeValidateModeLine(ClientPtr client)
|
||||||
SwapRestL(oldstuff);
|
SwapRestL(oldstuff);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xXF86VidModeValidateModeLineReq);
|
REQUEST_AT_LEAST_SIZE(xXF86VidModeValidateModeLineReq);
|
||||||
swapl(&stuff->screen);
|
swapl(&stuff->screen);
|
||||||
swaps(&stuff->hdisplay);
|
swaps(&stuff->hdisplay);
|
||||||
|
|
@ -1899,6 +1915,7 @@ static int _X_COLD
|
||||||
SProcVidModeSwitchMode(ClientPtr client)
|
SProcVidModeSwitchMode(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXF86VidModeSwitchModeReq);
|
REQUEST(xXF86VidModeSwitchModeReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xXF86VidModeSwitchModeReq);
|
REQUEST_SIZE_MATCH(xXF86VidModeSwitchModeReq);
|
||||||
swaps(&stuff->screen);
|
swaps(&stuff->screen);
|
||||||
swaps(&stuff->zoom);
|
swaps(&stuff->zoom);
|
||||||
|
|
@ -1909,6 +1926,7 @@ static int _X_COLD
|
||||||
SProcVidModeSwitchToMode(ClientPtr client)
|
SProcVidModeSwitchToMode(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXF86VidModeSwitchToModeReq);
|
REQUEST(xXF86VidModeSwitchToModeReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xXF86VidModeSwitchToModeReq);
|
REQUEST_SIZE_MATCH(xXF86VidModeSwitchToModeReq);
|
||||||
swapl(&stuff->screen);
|
swapl(&stuff->screen);
|
||||||
return ProcVidModeSwitchToMode(client);
|
return ProcVidModeSwitchToMode(client);
|
||||||
|
|
@ -1918,6 +1936,7 @@ static int _X_COLD
|
||||||
SProcVidModeLockModeSwitch(ClientPtr client)
|
SProcVidModeLockModeSwitch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXF86VidModeLockModeSwitchReq);
|
REQUEST(xXF86VidModeLockModeSwitchReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xXF86VidModeLockModeSwitchReq);
|
REQUEST_SIZE_MATCH(xXF86VidModeLockModeSwitchReq);
|
||||||
swaps(&stuff->screen);
|
swaps(&stuff->screen);
|
||||||
swaps(&stuff->lock);
|
swaps(&stuff->lock);
|
||||||
|
|
@ -1928,6 +1947,7 @@ static int _X_COLD
|
||||||
SProcVidModeGetMonitor(ClientPtr client)
|
SProcVidModeGetMonitor(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXF86VidModeGetMonitorReq);
|
REQUEST(xXF86VidModeGetMonitorReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq);
|
REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq);
|
||||||
swaps(&stuff->screen);
|
swaps(&stuff->screen);
|
||||||
return ProcVidModeGetMonitor(client);
|
return ProcVidModeGetMonitor(client);
|
||||||
|
|
@ -1937,6 +1957,7 @@ static int _X_COLD
|
||||||
SProcVidModeGetViewPort(ClientPtr client)
|
SProcVidModeGetViewPort(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXF86VidModeGetViewPortReq);
|
REQUEST(xXF86VidModeGetViewPortReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xXF86VidModeGetViewPortReq);
|
REQUEST_SIZE_MATCH(xXF86VidModeGetViewPortReq);
|
||||||
swaps(&stuff->screen);
|
swaps(&stuff->screen);
|
||||||
return ProcVidModeGetViewPort(client);
|
return ProcVidModeGetViewPort(client);
|
||||||
|
|
@ -1946,6 +1967,7 @@ static int _X_COLD
|
||||||
SProcVidModeSetViewPort(ClientPtr client)
|
SProcVidModeSetViewPort(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXF86VidModeSetViewPortReq);
|
REQUEST(xXF86VidModeSetViewPortReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xXF86VidModeSetViewPortReq);
|
REQUEST_SIZE_MATCH(xXF86VidModeSetViewPortReq);
|
||||||
swaps(&stuff->screen);
|
swaps(&stuff->screen);
|
||||||
swapl(&stuff->x);
|
swapl(&stuff->x);
|
||||||
|
|
@ -1957,6 +1979,7 @@ static int _X_COLD
|
||||||
SProcVidModeGetDotClocks(ClientPtr client)
|
SProcVidModeGetDotClocks(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXF86VidModeGetDotClocksReq);
|
REQUEST(xXF86VidModeGetDotClocksReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq);
|
REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq);
|
||||||
swaps(&stuff->screen);
|
swaps(&stuff->screen);
|
||||||
return ProcVidModeGetDotClocks(client);
|
return ProcVidModeGetDotClocks(client);
|
||||||
|
|
@ -1966,6 +1989,7 @@ static int _X_COLD
|
||||||
SProcVidModeSetClientVersion(ClientPtr client)
|
SProcVidModeSetClientVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXF86VidModeSetClientVersionReq);
|
REQUEST(xXF86VidModeSetClientVersionReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xXF86VidModeSetClientVersionReq);
|
REQUEST_SIZE_MATCH(xXF86VidModeSetClientVersionReq);
|
||||||
swaps(&stuff->major);
|
swaps(&stuff->major);
|
||||||
swaps(&stuff->minor);
|
swaps(&stuff->minor);
|
||||||
|
|
@ -1976,6 +2000,7 @@ static int _X_COLD
|
||||||
SProcVidModeSetGamma(ClientPtr client)
|
SProcVidModeSetGamma(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXF86VidModeSetGammaReq);
|
REQUEST(xXF86VidModeSetGammaReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xXF86VidModeSetGammaReq);
|
REQUEST_SIZE_MATCH(xXF86VidModeSetGammaReq);
|
||||||
swaps(&stuff->screen);
|
swaps(&stuff->screen);
|
||||||
swapl(&stuff->red);
|
swapl(&stuff->red);
|
||||||
|
|
@ -1988,6 +2013,7 @@ static int _X_COLD
|
||||||
SProcVidModeGetGamma(ClientPtr client)
|
SProcVidModeGetGamma(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXF86VidModeGetGammaReq);
|
REQUEST(xXF86VidModeGetGammaReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaReq);
|
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaReq);
|
||||||
swaps(&stuff->screen);
|
swaps(&stuff->screen);
|
||||||
return ProcVidModeGetGamma(client);
|
return ProcVidModeGetGamma(client);
|
||||||
|
|
@ -1999,6 +2025,7 @@ SProcVidModeSetGammaRamp(ClientPtr client)
|
||||||
int length;
|
int length;
|
||||||
|
|
||||||
REQUEST(xXF86VidModeSetGammaRampReq);
|
REQUEST(xXF86VidModeSetGammaRampReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xXF86VidModeSetGammaRampReq);
|
REQUEST_AT_LEAST_SIZE(xXF86VidModeSetGammaRampReq);
|
||||||
swaps(&stuff->size);
|
swaps(&stuff->size);
|
||||||
swaps(&stuff->screen);
|
swaps(&stuff->screen);
|
||||||
|
|
@ -2012,6 +2039,7 @@ static int _X_COLD
|
||||||
SProcVidModeGetGammaRamp(ClientPtr client)
|
SProcVidModeGetGammaRamp(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXF86VidModeGetGammaRampReq);
|
REQUEST(xXF86VidModeGetGammaRampReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
|
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
|
||||||
swaps(&stuff->size);
|
swaps(&stuff->size);
|
||||||
swaps(&stuff->screen);
|
swaps(&stuff->screen);
|
||||||
|
|
@ -2022,6 +2050,7 @@ static int _X_COLD
|
||||||
SProcVidModeGetGammaRampSize(ClientPtr client)
|
SProcVidModeGetGammaRampSize(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXF86VidModeGetGammaRampSizeReq);
|
REQUEST(xXF86VidModeGetGammaRampSizeReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq);
|
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq);
|
||||||
swaps(&stuff->screen);
|
swaps(&stuff->screen);
|
||||||
return ProcVidModeGetGammaRampSize(client);
|
return ProcVidModeGetGammaRampSize(client);
|
||||||
|
|
@ -2031,6 +2060,7 @@ static int _X_COLD
|
||||||
SProcVidModeGetPermissions(ClientPtr client)
|
SProcVidModeGetPermissions(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXF86VidModeGetPermissionsReq);
|
REQUEST(xXF86VidModeGetPermissionsReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq);
|
REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq);
|
||||||
swaps(&stuff->screen);
|
swaps(&stuff->screen);
|
||||||
return ProcVidModeGetPermissions(client);
|
return ProcVidModeGetPermissions(client);
|
||||||
|
|
@ -2042,7 +2072,7 @@ SProcVidModeDispatch(ClientPtr client)
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
case X_XF86VidModeQueryVersion:
|
case X_XF86VidModeQueryVersion:
|
||||||
return ProcVidModeQueryVersion(client);
|
return SProcVidModeQueryVersion(client);
|
||||||
case X_XF86VidModeGetModeLine:
|
case X_XF86VidModeGetModeLine:
|
||||||
return SProcVidModeGetModeLine(client);
|
return SProcVidModeGetModeLine(client);
|
||||||
case X_XF86VidModeGetMonitor:
|
case X_XF86VidModeGetMonitor:
|
||||||
|
|
|
||||||
191
Xext/xace.c
191
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>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include "os/client_priv.h"
|
|
||||||
|
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "pixmapstr.h"
|
#include "pixmapstr.h"
|
||||||
|
|
@ -30,12 +29,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
#include "xacestr.h"
|
#include "xacestr.h"
|
||||||
|
|
||||||
CallbackListPtr XaceHooks[XACE_NUM_HOOKS] = { 0 };
|
_X_EXPORT CallbackListPtr XaceHooks[XACE_NUM_HOOKS] = { 0 };
|
||||||
|
|
||||||
/* Special-cased hook functions. Called by Xserver.
|
/* Special-cased hook functions. Called by Xserver.
|
||||||
*/
|
*/
|
||||||
|
#undef XaceHookDispatch
|
||||||
int
|
int
|
||||||
XaceHookDispatch0(ClientPtr client, int major)
|
XaceHookDispatch(ClientPtr client, int major)
|
||||||
{
|
{
|
||||||
/* Call the extension dispatch hook */
|
/* Call the extension dispatch hook */
|
||||||
ExtensionEntry *ext = GetExtensionEntry(major);
|
ExtensionEntry *ext = GetExtensionEntry(major);
|
||||||
|
|
@ -63,85 +63,130 @@ XaceHookSelectionAccess(ClientPtr client, Selection ** ppSel, Mask access_mode)
|
||||||
return rec.status;
|
return rec.status;
|
||||||
}
|
}
|
||||||
|
|
||||||
int XaceHookResourceAccess(ClientPtr client, XID id, RESTYPE rtype, void *res,
|
/* Entry point for hook functions. Called by Xserver.
|
||||||
RESTYPE ptype, void *parent, Mask access_mode)
|
*/
|
||||||
|
int
|
||||||
|
XaceHook(int hook, ...)
|
||||||
{
|
{
|
||||||
XaceResourceAccessRec rec = { client, id, rtype, res, ptype, parent,
|
union {
|
||||||
access_mode, Success };
|
XaceResourceAccessRec res;
|
||||||
CallCallbacks(&XaceHooks[XACE_RESOURCE_ACCESS], &rec);
|
XaceDeviceAccessRec dev;
|
||||||
return rec.status;
|
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)
|
if (!XaceHooks[hook])
|
||||||
{
|
return Success;
|
||||||
XaceDeviceAccessRec rec = { client, dev, access_mode, Success };
|
|
||||||
CallCallbacks(&XaceHooks[XACE_DEVICE_ACCESS], &rec);
|
|
||||||
return rec.status;
|
|
||||||
}
|
|
||||||
|
|
||||||
int XaceHookSendAccess(ClientPtr client, DeviceIntPtr dev, WindowPtr win,
|
va_start(ap, hook);
|
||||||
xEventPtr ev, int count)
|
|
||||||
{
|
|
||||||
XaceSendAccessRec rec = { client, dev, win, ev, count, Success };
|
|
||||||
CallCallbacks(&XaceHooks[XACE_SEND_ACCESS], &rec);
|
|
||||||
return rec.status;
|
|
||||||
}
|
|
||||||
|
|
||||||
int XaceHookReceiveAccess(ClientPtr client, WindowPtr win,
|
/* Marshal arguments for passing to callback.
|
||||||
xEventPtr ev, int count)
|
* Each callback has its own case, which sets up a structure to hold
|
||||||
{
|
* the arguments and integer return parameter, or in some cases just
|
||||||
XaceReceiveAccessRec rec = { client, win, ev, count, Success };
|
* sets calldata directly to a single argument (with no return result)
|
||||||
CallCallbacks(&XaceHooks[XACE_RECEIVE_ACCESS], &rec);
|
*/
|
||||||
return rec.status;
|
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)
|
u.res.status = Success; /* default allow */
|
||||||
{
|
prv = &u.res.status;
|
||||||
XaceClientAccessRec rec = { client, target, access_mode, Success };
|
break;
|
||||||
CallCallbacks(&XaceHooks[XACE_CLIENT_ACCESS], &rec);
|
case XACE_DEVICE_ACCESS:
|
||||||
return rec.status;
|
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)
|
u.dev.status = Success; /* default allow */
|
||||||
{
|
prv = &u.dev.status;
|
||||||
XaceExtAccessRec rec = { client, ext, DixGetAttrAccess, Success };
|
break;
|
||||||
CallCallbacks(&XaceHooks[XACE_EXT_ACCESS], &rec);
|
case XACE_SEND_ACCESS:
|
||||||
return rec.status;
|
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)
|
u.send.events = va_arg(ap, xEventPtr);
|
||||||
{
|
u.send.count = va_arg(ap, int);
|
||||||
XaceServerAccessRec rec = { client, access_mode, Success };
|
|
||||||
CallCallbacks(&XaceHooks[XACE_SERVER_ACCESS], &rec);
|
|
||||||
return rec.status;
|
|
||||||
}
|
|
||||||
|
|
||||||
int XaceHookScreenAccess(ClientPtr client, ScreenPtr screen, Mask access_mode)
|
u.send.status = Success; /* default allow */
|
||||||
{
|
prv = &u.send.status;
|
||||||
XaceScreenAccessRec rec = { client, screen, access_mode, Success };
|
break;
|
||||||
CallCallbacks(&XaceHooks[XACE_SCREEN_ACCESS], &rec);
|
case XACE_RECEIVE_ACCESS:
|
||||||
return rec.status;
|
u.recv.client = va_arg(ap, ClientPtr);
|
||||||
}
|
u.recv.pWin = va_arg(ap, WindowPtr);
|
||||||
|
|
||||||
int XaceHookScreensaverAccess(ClientPtr client, ScreenPtr screen, Mask access_mode)
|
u.recv.events = va_arg(ap, xEventPtr);
|
||||||
{
|
u.recv.count = va_arg(ap, int);
|
||||||
XaceScreenAccessRec rec = { client, screen, access_mode, Success };
|
|
||||||
CallCallbacks(&XaceHooks[XACE_SCREENSAVER_ACCESS], &rec);
|
|
||||||
return rec.status;
|
|
||||||
}
|
|
||||||
|
|
||||||
int XaceHookAuthAvail(ClientPtr client, XID authId)
|
u.recv.status = Success; /* default allow */
|
||||||
{
|
prv = &u.recv.status;
|
||||||
XaceAuthAvailRec rec = { client, authId };
|
break;
|
||||||
CallCallbacks(&XaceHooks[XACE_AUTH_AVAIL], &rec);
|
case XACE_CLIENT_ACCESS:
|
||||||
return Success;
|
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)
|
u.client.status = Success; /* default allow */
|
||||||
{
|
prv = &u.client.status;
|
||||||
XaceKeyAvailRec rec = { ev, dev, count };
|
break;
|
||||||
CallCallbacks(&XaceHooks[XACE_KEY_AVAIL], &rec);
|
case XACE_EXT_ACCESS:
|
||||||
return Success;
|
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
|
/* XaceHookIsSet
|
||||||
|
|
|
||||||
47
Xext/xace.h
47
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_MAJOR_VERSION 2
|
||||||
#define XACE_MINOR_VERSION 0
|
#define XACE_MINOR_VERSION 0
|
||||||
|
|
||||||
#include "extnsionst.h"
|
|
||||||
#include "pixmap.h"
|
#include "pixmap.h"
|
||||||
#include "region.h"
|
#include "region.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
@ -69,10 +68,10 @@ extern _X_EXPORT int XaceHookIsSet(int hook);
|
||||||
|
|
||||||
/* Special-cased hook functions
|
/* Special-cased hook functions
|
||||||
*/
|
*/
|
||||||
int XaceHookDispatch0(ClientPtr client, int major);
|
extern _X_EXPORT int XaceHookDispatch(ClientPtr ptr, int major);
|
||||||
#define XaceHookDispatch(c, m) \
|
#define XaceHookDispatch(c, m) \
|
||||||
((XaceHooks[XACE_EXT_DISPATCH] && (m) >= EXTENSION_BASE) ? \
|
((XaceHooks[XACE_EXT_DISPATCH] && (m) >= EXTENSION_BASE) ? \
|
||||||
XaceHookDispatch0((c), (m)) : \
|
XaceHookDispatch((c), (m)) : \
|
||||||
Success)
|
Success)
|
||||||
|
|
||||||
extern _X_EXPORT int XaceHookPropertyAccess(ClientPtr ptr, WindowPtr pWin,
|
extern _X_EXPORT int XaceHookPropertyAccess(ClientPtr ptr, WindowPtr pWin,
|
||||||
|
|
@ -81,24 +80,6 @@ extern _X_EXPORT int XaceHookPropertyAccess(ClientPtr ptr, WindowPtr pWin,
|
||||||
extern _X_EXPORT int XaceHookSelectionAccess(ClientPtr ptr, Selection ** ppSel,
|
extern _X_EXPORT int XaceHookSelectionAccess(ClientPtr ptr, Selection ** ppSel,
|
||||||
Mask access_mode);
|
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);
|
|
||||||
|
|
||||||
|
|
||||||
/* Register a callback for a given hook.
|
/* Register a callback for a given hook.
|
||||||
*/
|
*/
|
||||||
#define XaceRegisterCallback(hook,callback,data) \
|
#define XaceRegisterCallback(hook,callback,data) \
|
||||||
|
|
@ -132,38 +113,18 @@ extern _X_EXPORT void XaceCensorImage(ClientPtr client,
|
||||||
/* Define calls away when XACE is not being built. */
|
/* Define calls away when XACE is not being built. */
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
|
#define XaceHook(args...) Success
|
||||||
#define XaceHookIsSet(args...) 0
|
#define XaceHookIsSet(args...) 0
|
||||||
#define XaceHookDispatch(args...) Success
|
#define XaceHookDispatch(args...) Success
|
||||||
#define XaceHookPropertyAccess(args...) Success
|
#define XaceHookPropertyAccess(args...) Success
|
||||||
#define XaceHookSelectionAccess(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...) { ; }
|
#define XaceCensorImage(args...) { ; }
|
||||||
#else
|
#else
|
||||||
|
#define XaceHook(...) Success
|
||||||
#define XaceHookIsSet(...) 0
|
#define XaceHookIsSet(...) 0
|
||||||
#define XaceHookDispatch(...) Success
|
#define XaceHookDispatch(...) Success
|
||||||
#define XaceHookPropertyAccess(...) Success
|
#define XaceHookPropertyAccess(...) Success
|
||||||
#define XaceHookSelectionAccess(...) 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(...) { ; }
|
#define XaceCensorImage(...) { ; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,9 @@ from The Open Group.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
|
|
@ -36,7 +38,7 @@ from The Open Group.
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "swaprep.h"
|
#include "swaprep.h"
|
||||||
#include <X11/extensions/xcmiscproto.h>
|
#include <X11/extensions/xcmiscproto.h>
|
||||||
#include "extinit_priv.h"
|
#include "extinit.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
|
@ -144,18 +146,30 @@ static int _X_COLD
|
||||||
SProcXCMiscGetVersion(ClientPtr client)
|
SProcXCMiscGetVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXCMiscGetVersionReq);
|
REQUEST(xXCMiscGetVersionReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
|
REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
|
||||||
swaps(&stuff->majorVersion);
|
swaps(&stuff->majorVersion);
|
||||||
swaps(&stuff->minorVersion);
|
swaps(&stuff->minorVersion);
|
||||||
return ProcXCMiscGetVersion(client);
|
return ProcXCMiscGetVersion(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int _X_COLD
|
||||||
|
SProcXCMiscGetXIDRange(ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
|
return ProcXCMiscGetXIDRange(client);
|
||||||
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int _X_COLD
|
||||||
SProcXCMiscGetXIDList(ClientPtr client)
|
SProcXCMiscGetXIDList(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXCMiscGetXIDListReq);
|
REQUEST(xXCMiscGetXIDListReq);
|
||||||
REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq);
|
REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->count);
|
swapl(&stuff->count);
|
||||||
return ProcXCMiscGetXIDList(client);
|
return ProcXCMiscGetXIDList(client);
|
||||||
}
|
}
|
||||||
|
|
@ -168,7 +182,7 @@ SProcXCMiscDispatch(ClientPtr client)
|
||||||
case X_XCMiscGetVersion:
|
case X_XCMiscGetVersion:
|
||||||
return SProcXCMiscGetVersion(client);
|
return SProcXCMiscGetVersion(client);
|
||||||
case X_XCMiscGetXIDRange:
|
case X_XCMiscGetXIDRange:
|
||||||
return ProcXCMiscGetXIDRange(client);
|
return SProcXCMiscGetXIDRange(client);
|
||||||
case X_XCMiscGetXIDList:
|
case X_XCMiscGetXIDList:
|
||||||
return SProcXCMiscGetXIDList(client);
|
return SProcXCMiscGetXIDList(client);
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -34,10 +34,12 @@
|
||||||
* XLoadQueryFont).
|
* XLoadQueryFont).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef MITSHM
|
#ifdef HAS_SHM
|
||||||
#ifdef SVR4
|
#ifdef SVR4
|
||||||
#include <sys/sysmacros.h>
|
#include <sys/sysmacros.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -56,24 +58,22 @@
|
||||||
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
#include <X11/extensions/xf86bigfproto.h>
|
|
||||||
#include <X11/fonts/fontstruct.h>
|
|
||||||
#include <X11/fonts/libxfont2.h>
|
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "dixstruct.h"
|
#include "dixstruct.h"
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
#include "dixfontstr.h"
|
#include "dixfontstr.h"
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "extinit_priv.h"
|
#include "extinit.h"
|
||||||
#include "protocol-versions.h"
|
#include "protocol-versions.h"
|
||||||
|
|
||||||
|
#include <X11/extensions/xf86bigfproto.h>
|
||||||
#include "xf86bigfontsrv.h"
|
#include "xf86bigfontsrv.h"
|
||||||
|
|
||||||
static void XF86BigfontResetProc(ExtensionEntry *extEntry );
|
static void XF86BigfontResetProc(ExtensionEntry * /* extEntry */
|
||||||
|
);
|
||||||
|
|
||||||
#ifdef MITSHM
|
#ifdef HAS_SHM
|
||||||
|
|
||||||
/* A random signature, transmitted to the clients so they can verify that the
|
/* A random signature, transmitted to the clients so they can verify that the
|
||||||
shared memory segment they are attaching to was really established by the
|
shared memory segment they are attaching to was really established by the
|
||||||
|
|
@ -126,7 +126,7 @@ CheckForShmSyscall(void)
|
||||||
|
|
||||||
/* ========== Management of shared memory segments ========== */
|
/* ========== Management of shared memory segments ========== */
|
||||||
|
|
||||||
#ifdef MITSHM
|
#ifdef HAS_SHM
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
/* On Linux, shared memory marked as "removed" can still be attached.
|
/* On Linux, shared memory marked as "removed" can still be attached.
|
||||||
|
|
@ -221,7 +221,7 @@ shmdealloc(ShmDescPtr pDesc)
|
||||||
void
|
void
|
||||||
XF86BigfontFreeFontShm(FontPtr pFont)
|
XF86BigfontFreeFontShm(FontPtr pFont)
|
||||||
{
|
{
|
||||||
#ifdef MITSHM
|
#ifdef HAS_SHM
|
||||||
ShmDescPtr pDesc;
|
ShmDescPtr pDesc;
|
||||||
|
|
||||||
/* If during shutdown of the server, XF86BigfontCleanup() has already
|
/* If during shutdown of the server, XF86BigfontCleanup() has already
|
||||||
|
|
@ -240,7 +240,7 @@ XF86BigfontFreeFontShm(FontPtr pFont)
|
||||||
void
|
void
|
||||||
XF86BigfontCleanup(void)
|
XF86BigfontCleanup(void)
|
||||||
{
|
{
|
||||||
#ifdef MITSHM
|
#ifdef HAS_SHM
|
||||||
while (ShmList)
|
while (ShmList)
|
||||||
shmdealloc(ShmList);
|
shmdealloc(ShmList);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -277,7 +277,7 @@ ProcXF86BigfontQueryVersion(ClientPtr client)
|
||||||
.minorVersion = SERVER_XF86BIGFONT_MINOR_VERSION,
|
.minorVersion = SERVER_XF86BIGFONT_MINOR_VERSION,
|
||||||
.uid = geteuid(),
|
.uid = geteuid(),
|
||||||
.gid = getegid(),
|
.gid = getegid(),
|
||||||
#ifdef MITSHM
|
#ifdef HAS_SHM
|
||||||
.signature = signature,
|
.signature = signature,
|
||||||
.capabilities = (client->local && !client->swapped)
|
.capabilities = (client->local && !client->swapped)
|
||||||
? XF86Bigfont_CAP_LocalShm : 0
|
? XF86Bigfont_CAP_LocalShm : 0
|
||||||
|
|
@ -329,7 +329,7 @@ ProcXF86BigfontQueryFont(ClientPtr client)
|
||||||
int nCharInfos;
|
int nCharInfos;
|
||||||
int shmid;
|
int shmid;
|
||||||
|
|
||||||
#ifdef MITSHM
|
#ifdef HAS_SHM
|
||||||
ShmDescPtr pDesc = NULL;
|
ShmDescPtr pDesc = NULL;
|
||||||
#else
|
#else
|
||||||
#define pDesc 0
|
#define pDesc 0
|
||||||
|
|
@ -339,7 +339,9 @@ ProcXF86BigfontQueryFont(ClientPtr client)
|
||||||
CARD16 *pUniqIndex2Index;
|
CARD16 *pUniqIndex2Index;
|
||||||
CARD32 nUniqCharInfos;
|
CARD32 nUniqCharInfos;
|
||||||
|
|
||||||
/* protocol version is decided based on request packet size */
|
#if 0
|
||||||
|
REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq);
|
||||||
|
#else
|
||||||
switch (client->req_len) {
|
switch (client->req_len) {
|
||||||
case 2: /* client with version 1.0 libX11 */
|
case 2: /* client with version 1.0 libX11 */
|
||||||
stuff_flags = (client->local &&
|
stuff_flags = (client->local &&
|
||||||
|
|
@ -351,7 +353,7 @@ ProcXF86BigfontQueryFont(ClientPtr client)
|
||||||
default:
|
default:
|
||||||
return BadLength;
|
return BadLength;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (dixLookupFontable(&pFont, stuff->id, client, DixGetAttrAccess) !=
|
if (dixLookupFontable(&pFont, stuff->id, client, DixGetAttrAccess) !=
|
||||||
Success)
|
Success)
|
||||||
return BadFont; /* procotol spec says only error is BadFont */
|
return BadFont; /* procotol spec says only error is BadFont */
|
||||||
|
|
@ -372,7 +374,7 @@ ProcXF86BigfontQueryFont(ClientPtr client)
|
||||||
nUniqCharInfos = 0;
|
nUniqCharInfos = 0;
|
||||||
|
|
||||||
if (nCharInfos > 0) {
|
if (nCharInfos > 0) {
|
||||||
#ifdef MITSHM
|
#ifdef HAS_SHM
|
||||||
if (!badSysCall)
|
if (!badSysCall)
|
||||||
pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex);
|
pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex);
|
||||||
if (pDesc) {
|
if (pDesc) {
|
||||||
|
|
@ -393,7 +395,7 @@ ProcXF86BigfontQueryFont(ClientPtr client)
|
||||||
pCI = xallocarray(nCharInfos, sizeof(xCharInfo));
|
pCI = xallocarray(nCharInfos, sizeof(xCharInfo));
|
||||||
if (!pCI)
|
if (!pCI)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
#ifdef MITSHM
|
#ifdef HAS_SHM
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Fill nCharInfos starting at pCI. */
|
/* Fill nCharInfos starting at pCI. */
|
||||||
|
|
@ -425,7 +427,7 @@ ProcXF86BigfontQueryFont(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef MITSHM
|
#ifdef HAS_SHM
|
||||||
if (pDesc && !badSysCall) {
|
if (pDesc && !badSysCall) {
|
||||||
*(CARD32 *) (pCI + nCharInfos) = signature;
|
*(CARD32 *) (pCI + nCharInfos) = signature;
|
||||||
if (!xfont2_font_set_private(pFont, FontShmdescIndex, pDesc)) {
|
if (!xfont2_font_set_private(pFont, FontShmdescIndex, pDesc)) {
|
||||||
|
|
@ -651,7 +653,9 @@ ProcXF86BigfontDispatch(ClientPtr client)
|
||||||
static int _X_COLD
|
static int _X_COLD
|
||||||
SProcXF86BigfontQueryVersion(ClientPtr client)
|
SProcXF86BigfontQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xXF86BigfontQueryVersionReq); */
|
REQUEST(xXF86BigfontQueryVersionReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
return ProcXF86BigfontQueryVersion(client);
|
return ProcXF86BigfontQueryVersion(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -659,6 +663,8 @@ static int _X_COLD
|
||||||
SProcXF86BigfontQueryFont(ClientPtr client)
|
SProcXF86BigfontQueryFont(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXF86BigfontQueryFontReq);
|
REQUEST(xXF86BigfontQueryFontReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq);
|
REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq);
|
||||||
swapl(&stuff->id);
|
swapl(&stuff->id);
|
||||||
return ProcXF86BigfontQueryFont(client);
|
return ProcXF86BigfontQueryFont(client);
|
||||||
|
|
@ -688,7 +694,7 @@ XFree86BigfontExtensionInit(void)
|
||||||
ProcXF86BigfontDispatch,
|
ProcXF86BigfontDispatch,
|
||||||
SProcXF86BigfontDispatch,
|
SProcXF86BigfontDispatch,
|
||||||
XF86BigfontResetProc, StandardMinorOpcode)) {
|
XF86BigfontResetProc, StandardMinorOpcode)) {
|
||||||
#ifdef MITSHM
|
#ifdef HAS_SHM
|
||||||
#ifdef MUST_CHECK_FOR_SHM_SYSCALL
|
#ifdef MUST_CHECK_FOR_SHM_SYSCALL
|
||||||
/*
|
/*
|
||||||
* Note: Local-clients will not be optimized without shared memory
|
* Note: Local-clients will not be optimized without shared memory
|
||||||
|
|
|
||||||
27
Xext/xres.c
27
Xext/xres.c
|
|
@ -2,28 +2,28 @@
|
||||||
Copyright (c) 2002 XFree86 Inc
|
Copyright (c) 2002 XFree86 Inc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.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 "misc.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "dixstruct.h"
|
#include "dixstruct.h"
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "swaprep.h"
|
#include "swaprep.h"
|
||||||
|
#include "registry.h"
|
||||||
|
#include <X11/extensions/XResproto.h>
|
||||||
#include "pixmapstr.h"
|
#include "pixmapstr.h"
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
#include "extinit_priv.h"
|
#include "extinit.h"
|
||||||
#include "protocol-versions.h"
|
#include "protocol-versions.h"
|
||||||
|
#include "client.h"
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
@ -72,7 +72,7 @@ typedef struct {
|
||||||
HashTable visitedResources;
|
HashTable visitedResources;
|
||||||
|
|
||||||
/* Used by AddSubResourceSizeSpec when AddResourceSizeValue is
|
/* Used by AddSubResourceSizeSpec when AddResourceSizeValue is
|
||||||
handling cross-references */
|
handling crossreferences */
|
||||||
HashTable visitedSubResources;
|
HashTable visitedSubResources;
|
||||||
|
|
||||||
/* used when ConstructResourceBytesCtx is passed to
|
/* used when ConstructResourceBytesCtx is passed to
|
||||||
|
|
@ -224,8 +224,6 @@ ProcXResQueryClients(ClientPtr client)
|
||||||
REQUEST_SIZE_MATCH(xXResQueryClientsReq);
|
REQUEST_SIZE_MATCH(xXResQueryClientsReq);
|
||||||
|
|
||||||
current_clients = xallocarray(currentMaxClients, sizeof(int));
|
current_clients = xallocarray(currentMaxClients, sizeof(int));
|
||||||
if (current_clients == NULL)
|
|
||||||
return BadAlloc;
|
|
||||||
|
|
||||||
num_clients = 0;
|
num_clients = 0;
|
||||||
for (i = 0; i < currentMaxClients; i++) {
|
for (i = 0; i < currentMaxClients; i++) {
|
||||||
|
|
@ -444,7 +442,7 @@ WillConstructMask(ClientPtr client, CARD32 mask,
|
||||||
client id spec
|
client id spec
|
||||||
|
|
||||||
@param sendClient Which client wishes to receive this answer. Used for
|
@param sendClient Which client wishes to receive this answer. Used for
|
||||||
byte endianness.
|
byte endianess.
|
||||||
@param client Which client are we considering.
|
@param client Which client are we considering.
|
||||||
@param mask The client id spec mask indicating which information
|
@param mask The client id spec mask indicating which information
|
||||||
we want about this client.
|
we want about this client.
|
||||||
|
|
@ -611,7 +609,7 @@ ProcXResQueryClientIds (ClientPtr client)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @brief Swaps xXResResourceIdSpec endianness */
|
/** @brief Swaps xXResResourceIdSpec endianess */
|
||||||
static void
|
static void
|
||||||
SwapXResResourceIdSpec(xXResResourceIdSpec *spec)
|
SwapXResResourceIdSpec(xXResResourceIdSpec *spec)
|
||||||
{
|
{
|
||||||
|
|
@ -619,7 +617,7 @@ SwapXResResourceIdSpec(xXResResourceIdSpec *spec)
|
||||||
swapl(&spec->type);
|
swapl(&spec->type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @brief Swaps xXResResourceSizeSpec endianness */
|
/** @brief Swaps xXResResourceSizeSpec endianess */
|
||||||
static void
|
static void
|
||||||
SwapXResResourceSizeSpec(xXResResourceSizeSpec *size)
|
SwapXResResourceSizeSpec(xXResResourceSizeSpec *size)
|
||||||
{
|
{
|
||||||
|
|
@ -629,7 +627,7 @@ SwapXResResourceSizeSpec(xXResResourceSizeSpec *size)
|
||||||
swapl(&size->useCount);
|
swapl(&size->useCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @brief Swaps xXResResourceSizeValue endianness */
|
/** @brief Swaps xXResResourceSizeValue endianess */
|
||||||
static void
|
static void
|
||||||
SwapXResResourceSizeValue(xXResResourceSizeValue *rep)
|
SwapXResResourceSizeValue(xXResResourceSizeValue *rep)
|
||||||
{
|
{
|
||||||
|
|
@ -1080,6 +1078,7 @@ static int _X_COLD
|
||||||
SProcResDispatch (ClientPtr client)
|
SProcResDispatch (ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
|
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
case X_XResQueryVersion:
|
case X_XResQueryVersion:
|
||||||
|
|
|
||||||
|
|
@ -136,12 +136,4 @@ typedef struct {
|
||||||
CARD32 pad6;
|
CARD32 pad6;
|
||||||
} SELinuxListItemsReply;
|
} SELinuxListItemsReply;
|
||||||
|
|
||||||
#ifdef XSELINUX
|
|
||||||
#define SELINUX_MODE_DEFAULT 0
|
|
||||||
#define SELINUX_MODE_DISABLED 1
|
|
||||||
#define SELINUX_MODE_PERMISSIVE 2
|
|
||||||
#define SELINUX_MODE_ENFORCING 3
|
|
||||||
extern int selinuxEnforcingState;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _XSELINUX_H */
|
#endif /* _XSELINUX_H */
|
||||||
|
|
|
||||||
|
|
@ -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-config.h>
|
||||||
|
#endif
|
||||||
#include "dix/dix_priv.h"
|
|
||||||
|
|
||||||
#include "selection.h"
|
#include "selection.h"
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include "propertyst.h"
|
#include "propertyst.h"
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "extinit_priv.h"
|
#include "extinit.h"
|
||||||
#include "xselinuxint.h"
|
#include "xselinuxint.h"
|
||||||
|
|
||||||
#define CTX_DEV offsetof(SELinuxSubjectRec, dev_create_sid)
|
#define CTX_DEV offsetof(SELinuxSubjectRec, dev_create_sid)
|
||||||
|
|
@ -37,24 +37,21 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#define USE_SEL offsetof(SELinuxSubjectRec, sel_use_sid)
|
#define USE_SEL offsetof(SELinuxSubjectRec, sel_use_sid)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *octx;
|
security_context_t octx;
|
||||||
char *dctx;
|
security_context_t dctx;
|
||||||
CARD32 octx_len;
|
CARD32 octx_len;
|
||||||
CARD32 dctx_len;
|
CARD32 dctx_len;
|
||||||
CARD32 id;
|
CARD32 id;
|
||||||
} SELinuxListItemRec;
|
} SELinuxListItemRec;
|
||||||
|
|
||||||
Bool noSELinuxExtension = FALSE;
|
|
||||||
int selinuxEnforcingState = SELINUX_MODE_DEFAULT;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Extension Dispatch
|
* Extension Dispatch
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static char *
|
static security_context_t
|
||||||
SELinuxCopyContext(char *ptr, unsigned len)
|
SELinuxCopyContext(char *ptr, unsigned len)
|
||||||
{
|
{
|
||||||
char *copy = malloc(len + 1);
|
security_context_t copy = malloc(len + 1);
|
||||||
|
|
||||||
if (!copy)
|
if (!copy)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -69,6 +66,7 @@ ProcSELinuxQueryVersion(ClientPtr client)
|
||||||
SELinuxQueryVersionReply rep = {
|
SELinuxQueryVersionReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
.server_major = SELINUX_MAJOR_VERSION,
|
.server_major = SELINUX_MAJOR_VERSION,
|
||||||
.server_minor = SELINUX_MINOR_VERSION
|
.server_minor = SELINUX_MINOR_VERSION
|
||||||
};
|
};
|
||||||
|
|
@ -85,7 +83,8 @@ ProcSELinuxQueryVersion(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
SELinuxSendContextReply(ClientPtr client, security_id_t sid)
|
SELinuxSendContextReply(ClientPtr client, security_id_t sid)
|
||||||
{
|
{
|
||||||
char *ctx = NULL;
|
SELinuxGetContextReply rep;
|
||||||
|
security_context_t ctx = NULL;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
if (sid) {
|
if (sid) {
|
||||||
|
|
@ -94,7 +93,7 @@ SELinuxSendContextReply(ClientPtr client, security_id_t sid)
|
||||||
len = strlen(ctx) + 1;
|
len = strlen(ctx) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
SELinuxGetContextReply rep = {
|
rep = (SELinuxGetContextReply) {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = bytes_to_int32(len),
|
.length = bytes_to_int32(len),
|
||||||
|
|
@ -118,7 +117,7 @@ ProcSELinuxSetCreateContext(ClientPtr client, unsigned offset)
|
||||||
{
|
{
|
||||||
PrivateRec **privPtr = &client->devPrivates;
|
PrivateRec **privPtr = &client->devPrivates;
|
||||||
security_id_t *pSid;
|
security_id_t *pSid;
|
||||||
char *ctx = NULL;
|
security_context_t ctx = NULL;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
|
@ -166,7 +165,7 @@ ProcSELinuxGetCreateContext(ClientPtr client, unsigned offset)
|
||||||
static int
|
static int
|
||||||
ProcSELinuxSetDeviceContext(ClientPtr client)
|
ProcSELinuxSetDeviceContext(ClientPtr client)
|
||||||
{
|
{
|
||||||
char *ctx;
|
security_context_t ctx;
|
||||||
security_id_t sid;
|
security_id_t sid;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
SELinuxSubjectRec *subj;
|
SELinuxSubjectRec *subj;
|
||||||
|
|
@ -341,9 +340,13 @@ static int
|
||||||
SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec * items,
|
SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec * items,
|
||||||
int size, int count)
|
int size, int count)
|
||||||
{
|
{
|
||||||
int rc = BadAlloc, k, pos = 0;
|
int rc, k, pos = 0;
|
||||||
CARD32 *buf = calloc(size, sizeof(CARD32));
|
SELinuxListItemsReply rep;
|
||||||
|
CARD32 *buf;
|
||||||
|
|
||||||
|
buf = calloc(size, sizeof(CARD32));
|
||||||
if (size && !buf) {
|
if (size && !buf) {
|
||||||
|
rc = BadAlloc;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -371,7 +374,7 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec * items,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Send reply to client */
|
/* Send reply to client */
|
||||||
SELinuxListItemsReply rep = {
|
rep = (SELinuxListItemsReply) {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = size,
|
.length = size,
|
||||||
|
|
@ -449,10 +452,8 @@ ProcSELinuxListSelections(ClientPtr client)
|
||||||
count = 0;
|
count = 0;
|
||||||
for (pSel = CurrentSelections; pSel; pSel = pSel->next)
|
for (pSel = CurrentSelections; pSel; pSel = pSel->next)
|
||||||
count++;
|
count++;
|
||||||
if (count == 0)
|
|
||||||
return SELinuxSendItemsToClient(client, NULL, 0, 0);
|
|
||||||
items = calloc(count, sizeof(SELinuxListItemRec));
|
items = calloc(count, sizeof(SELinuxListItemRec));
|
||||||
if (!items)
|
if (count && !items)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
/* Fill in the items and calculate size */
|
/* Fill in the items and calculate size */
|
||||||
|
|
@ -620,6 +621,8 @@ SProcSELinuxDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
|
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
case X_SELinuxQueryVersion:
|
case X_SELinuxQueryVersion:
|
||||||
return SProcSELinuxQueryVersion(client);
|
return SProcSELinuxQueryVersion(client);
|
||||||
|
|
@ -686,6 +689,8 @@ SELinuxResetProc(ExtensionEntry * extEntry)
|
||||||
void
|
void
|
||||||
SELinuxExtensionInit(void)
|
SELinuxExtensionInit(void)
|
||||||
{
|
{
|
||||||
|
ExtensionEntry *extEntry;
|
||||||
|
|
||||||
/* Check SELinux mode on system, configuration file, and boolean */
|
/* Check SELinux mode on system, configuration file, and boolean */
|
||||||
if (!is_selinux_enabled()) {
|
if (!is_selinux_enabled()) {
|
||||||
LogMessage(X_INFO, "SELinux: Disabled on system\n");
|
LogMessage(X_INFO, "SELinux: Disabled on system\n");
|
||||||
|
|
@ -705,7 +710,8 @@ SELinuxExtensionInit(void)
|
||||||
SELinuxFlaskInit();
|
SELinuxFlaskInit();
|
||||||
|
|
||||||
/* Add extension to server */
|
/* Add extension to server */
|
||||||
AddExtension(SELINUX_EXTENSION_NAME, SELinuxNumberEvents,
|
extEntry = AddExtension(SELINUX_EXTENSION_NAME,
|
||||||
SELinuxNumberErrors, ProcSELinuxDispatch,
|
SELinuxNumberEvents, SELinuxNumberErrors,
|
||||||
SProcSELinuxDispatch, SELinuxResetProc, StandardMinorOpcode);
|
ProcSELinuxDispatch, SProcSELinuxDispatch,
|
||||||
|
SELinuxResetProc, StandardMinorOpcode);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,19 +22,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include <libaudit.h>
|
#include <libaudit.h>
|
||||||
|
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
#include <X11/Xfuncproto.h>
|
|
||||||
|
|
||||||
#include "dix/registry_priv.h"
|
|
||||||
#include "os/client_priv.h"
|
|
||||||
|
|
||||||
#include "selection.h"
|
#include "selection.h"
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
|
|
@ -42,6 +40,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include "propertyst.h"
|
#include "propertyst.h"
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "xacestr.h"
|
#include "xacestr.h"
|
||||||
|
#include "client.h"
|
||||||
#define _XSELINUX_NEED_FLASK_MAP
|
#define _XSELINUX_NEED_FLASK_MAP
|
||||||
#include "xselinuxint.h"
|
#include "xselinuxint.h"
|
||||||
|
|
||||||
|
|
@ -115,7 +114,7 @@ SELinuxLabelClient(ClientPtr client)
|
||||||
int fd = XaceGetConnectionNumber(client);
|
int fd = XaceGetConnectionNumber(client);
|
||||||
SELinuxSubjectRec *subj;
|
SELinuxSubjectRec *subj;
|
||||||
SELinuxObjectRec *obj;
|
SELinuxObjectRec *obj;
|
||||||
char *ctx;
|
security_context_t ctx;
|
||||||
|
|
||||||
subj = dixLookupPrivate(&client->devPrivates, subjectKey);
|
subj = dixLookupPrivate(&client->devPrivates, subjectKey);
|
||||||
obj = dixLookupPrivate(&client->devPrivates, objectKey);
|
obj = dixLookupPrivate(&client->devPrivates, objectKey);
|
||||||
|
|
@ -170,7 +169,7 @@ SELinuxLabelInitial(void)
|
||||||
XaceScreenAccessRec srec;
|
XaceScreenAccessRec srec;
|
||||||
SELinuxSubjectRec *subj;
|
SELinuxSubjectRec *subj;
|
||||||
SELinuxObjectRec *obj;
|
SELinuxObjectRec *obj;
|
||||||
char *ctx;
|
security_context_t ctx;
|
||||||
void *unused;
|
void *unused;
|
||||||
|
|
||||||
/* Do the serverClient */
|
/* Do the serverClient */
|
||||||
|
|
@ -200,7 +199,7 @@ SELinuxLabelInitial(void)
|
||||||
|
|
||||||
/* Do the default colormap */
|
/* Do the default colormap */
|
||||||
dixLookupResourceByType(&unused, screenInfo.screens[i]->defColormap,
|
dixLookupResourceByType(&unused, screenInfo.screens[i]->defColormap,
|
||||||
X11_RESTYPE_COLORMAP, serverClient, DixCreateAccess);
|
RT_COLORMAP, serverClient, DixCreateAccess);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -663,7 +662,7 @@ SELinuxResource(CallbackListPtr *pcbl, void *unused, void *calldata)
|
||||||
rec->status = rc;
|
rec->status = rc;
|
||||||
|
|
||||||
/* Perform the background none check on windows */
|
/* 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);
|
rc = SELinuxDoCheck(subj, obj, class, DixBlendAccess, &auditdata);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
((WindowPtr) rec->res)->forcedBG = TRUE;
|
((WindowPtr) rec->res)->forcedBG = TRUE;
|
||||||
|
|
@ -765,7 +764,7 @@ SELinuxResourceState(CallbackListPtr *pcbl, void *unused, void *calldata)
|
||||||
SELinuxObjectRec *obj;
|
SELinuxObjectRec *obj;
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
|
|
||||||
if (rec->type != X11_RESTYPE_WINDOW)
|
if (rec->type != RT_WINDOW)
|
||||||
return;
|
return;
|
||||||
if (rec->state != ResourceStateAdding)
|
if (rec->state != ResourceStateAdding)
|
||||||
return;
|
return;
|
||||||
|
|
@ -774,7 +773,7 @@ SELinuxResourceState(CallbackListPtr *pcbl, void *unused, void *calldata)
|
||||||
subj = dixLookupPrivate(&wClient(pWin)->devPrivates, subjectKey);
|
subj = dixLookupPrivate(&wClient(pWin)->devPrivates, subjectKey);
|
||||||
|
|
||||||
if (subj->sid) {
|
if (subj->sid) {
|
||||||
char *ctx;
|
security_context_t ctx;
|
||||||
int rc = avc_sid_to_context_raw(subj->sid, &ctx);
|
int rc = avc_sid_to_context_raw(subj->sid, &ctx);
|
||||||
|
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
|
|
@ -792,7 +791,7 @@ SELinuxResourceState(CallbackListPtr *pcbl, void *unused, void *calldata)
|
||||||
obj = dixLookupPrivate(&pWin->devPrivates, objectKey);
|
obj = dixLookupPrivate(&pWin->devPrivates, objectKey);
|
||||||
|
|
||||||
if (obj->sid) {
|
if (obj->sid) {
|
||||||
char *ctx;
|
security_context_t ctx;
|
||||||
int rc = avc_sid_to_context_raw(obj->sid, &ctx);
|
int rc = avc_sid_to_context_raw(obj->sid, &ctx);
|
||||||
|
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
|
|
@ -848,7 +847,7 @@ void
|
||||||
SELinuxFlaskInit(void)
|
SELinuxFlaskInit(void)
|
||||||
{
|
{
|
||||||
struct selinux_opt avc_option = { AVC_OPT_SETENFORCE, (char *) 0 };
|
struct selinux_opt avc_option = { AVC_OPT_SETENFORCE, (char *) 0 };
|
||||||
char *ctx;
|
security_context_t ctx;
|
||||||
int ret = TRUE;
|
int ret = TRUE;
|
||||||
|
|
||||||
switch (selinuxEnforcingState) {
|
switch (selinuxEnforcingState) {
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
********************************************************/
|
********************************************************/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <selinux/label.h>
|
#include <selinux/label.h>
|
||||||
|
|
||||||
#include "dix/registry_priv.h"
|
#include "registry.h"
|
||||||
|
|
||||||
#include "xselinuxint.h"
|
#include "xselinuxint.h"
|
||||||
|
|
||||||
/* selection and property atom cache */
|
/* selection and property atom cache */
|
||||||
|
|
@ -96,7 +97,7 @@ static int
|
||||||
SELinuxAtomToSIDLookup(Atom atom, SELinuxObjectRec * obj, int map, int polymap)
|
SELinuxAtomToSIDLookup(Atom atom, SELinuxObjectRec * obj, int map, int polymap)
|
||||||
{
|
{
|
||||||
const char *name = NameForAtom(atom);
|
const char *name = NameForAtom(atom);
|
||||||
char *ctx;
|
security_context_t ctx;
|
||||||
int rc = Success;
|
int rc = Success;
|
||||||
|
|
||||||
obj->poly = 1;
|
obj->poly = 1;
|
||||||
|
|
@ -137,12 +138,8 @@ SELinuxAtomToSID(Atom atom, int prop, SELinuxObjectRec ** obj_rtn)
|
||||||
rec = SELinuxArrayGet(&arr_atoms, atom);
|
rec = SELinuxArrayGet(&arr_atoms, atom);
|
||||||
if (!rec) {
|
if (!rec) {
|
||||||
rec = calloc(1, sizeof(SELinuxAtomRec));
|
rec = calloc(1, sizeof(SELinuxAtomRec));
|
||||||
if (!rec)
|
if (!rec || !SELinuxArraySet(&arr_atoms, atom, rec))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
if (!SELinuxArraySet(&arr_atoms, atom, rec)) {
|
|
||||||
free(rec);
|
|
||||||
return BadAlloc;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prop) {
|
if (prop) {
|
||||||
|
|
@ -258,7 +255,7 @@ SELinuxEventToSID(unsigned type, security_id_t sid_of_window,
|
||||||
{
|
{
|
||||||
const char *name = LookupEventName(type);
|
const char *name = LookupEventName(type);
|
||||||
security_id_t sid;
|
security_id_t sid;
|
||||||
char *ctx;
|
security_context_t ctx;
|
||||||
|
|
||||||
type &= 127;
|
type &= 127;
|
||||||
|
|
||||||
|
|
@ -294,7 +291,7 @@ SELinuxEventToSID(unsigned type, security_id_t sid_of_window,
|
||||||
int
|
int
|
||||||
SELinuxExtensionToSID(const char *name, security_id_t * sid_rtn)
|
SELinuxExtensionToSID(const char *name, security_id_t * sid_rtn)
|
||||||
{
|
{
|
||||||
char *ctx;
|
security_context_t ctx;
|
||||||
|
|
||||||
/* Look in the mappings of extension names to contexts */
|
/* Look in the mappings of extension names to contexts */
|
||||||
if (selabel_lookup_raw(label_hnd, &ctx, name, SELABEL_X_EXT) < 0) {
|
if (selabel_lookup_raw(label_hnd, &ctx, name, SELABEL_X_EXT) < 0) {
|
||||||
|
|
@ -325,13 +322,13 @@ SELinuxTypeToClass(RESTYPE type)
|
||||||
|
|
||||||
if (type & RC_DRAWABLE)
|
if (type & RC_DRAWABLE)
|
||||||
class = SECCLASS_X_DRAWABLE;
|
class = SECCLASS_X_DRAWABLE;
|
||||||
else if (type == X11_RESTYPE_GC)
|
else if (type == RT_GC)
|
||||||
class = SECCLASS_X_GC;
|
class = SECCLASS_X_GC;
|
||||||
else if (type == X11_RESTYPE_FONT)
|
else if (type == RT_FONT)
|
||||||
class = SECCLASS_X_FONT;
|
class = SECCLASS_X_FONT;
|
||||||
else if (type == X11_RESTYPE_CURSOR)
|
else if (type == RT_CURSOR)
|
||||||
class = SECCLASS_X_CURSOR;
|
class = SECCLASS_X_CURSOR;
|
||||||
else if (type == X11_RESTYPE_COLORMAP)
|
else if (type == RT_COLORMAP)
|
||||||
class = SECCLASS_X_COLORMAP;
|
class = SECCLASS_X_COLORMAP;
|
||||||
else {
|
else {
|
||||||
/* Need to do a string lookup */
|
/* Need to do a string lookup */
|
||||||
|
|
@ -350,10 +347,10 @@ SELinuxTypeToClass(RESTYPE type)
|
||||||
return (security_class_t) (unsigned long) tmp;
|
return (security_class_t) (unsigned long) tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
security_context_t
|
||||||
SELinuxDefaultClientLabel(void)
|
SELinuxDefaultClientLabel(void)
|
||||||
{
|
{
|
||||||
char *ctx;
|
security_context_t ctx;
|
||||||
|
|
||||||
if (selabel_lookup_raw(label_hnd, &ctx, "remote", SELABEL_X_CLIENT) < 0)
|
if (selabel_lookup_raw(label_hnd, &ctx, "remote", SELABEL_X_CLIENT) < 0)
|
||||||
FatalError("SELinux: failed to look up remote-client context\n");
|
FatalError("SELinux: failed to look up remote-client context\n");
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include "dixstruct.h"
|
#include "dixstruct.h"
|
||||||
#include "privates.h"
|
#include "privates.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
#include "registry.h"
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
#include "xselinux.h"
|
#include "xselinux.h"
|
||||||
|
|
||||||
|
|
@ -98,7 +99,7 @@ int
|
||||||
|
|
||||||
security_class_t SELinuxTypeToClass(RESTYPE type);
|
security_class_t SELinuxTypeToClass(RESTYPE type);
|
||||||
|
|
||||||
char *SELinuxDefaultClientLabel(void);
|
security_context_t SELinuxDefaultClientLabel(void);
|
||||||
|
|
||||||
void
|
void
|
||||||
SELinuxLabelInit(void);
|
SELinuxLabelInit(void);
|
||||||
|
|
|
||||||
117
Xext/xtest.c
117
Xext/xtest.c
|
|
@ -26,22 +26,13 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
#include <X11/Xatom.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/mipointer_priv.h"
|
|
||||||
#include "os/client_priv.h"
|
|
||||||
#include "os/osdep.h"
|
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "dixstruct.h"
|
#include "dixstruct.h"
|
||||||
|
|
@ -54,17 +45,21 @@
|
||||||
#include "mi.h"
|
#include "mi.h"
|
||||||
#include "xkbsrv.h"
|
#include "xkbsrv.h"
|
||||||
#include "xkbstr.h"
|
#include "xkbstr.h"
|
||||||
|
#include <X11/extensions/xtestproto.h>
|
||||||
|
#include <X11/extensions/XI.h>
|
||||||
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "mipointer.h"
|
#include "mipointer.h"
|
||||||
#include "xserver-properties.h"
|
#include "xserver-properties.h"
|
||||||
|
#include "exevents.h"
|
||||||
#include "eventstr.h"
|
#include "eventstr.h"
|
||||||
#include "inpututils.h"
|
#include "inpututils.h"
|
||||||
#include "extinit_priv.h"
|
|
||||||
|
|
||||||
/* XTest events are sent during request processing and may be interrupted by
|
#include "extinit.h"
|
||||||
|
|
||||||
|
/* XTest events are sent during request processing and may be interruped by
|
||||||
* a SIGIO. We need a separate event list to avoid events overwriting each
|
* a SIGIO. We need a separate event list to avoid events overwriting each
|
||||||
* other's memory.
|
* other's memory */
|
||||||
*/
|
|
||||||
static InternalEvent *xtest_evlist;
|
static InternalEvent *xtest_evlist;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -79,10 +74,10 @@ static InternalEvent *xtest_evlist;
|
||||||
*/
|
*/
|
||||||
DeviceIntPtr xtestpointer, xtestkeyboard;
|
DeviceIntPtr xtestpointer, xtestkeyboard;
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
#include "panoramiX.h"
|
#include "panoramiX.h"
|
||||||
#include "panoramiXsrv.h"
|
#include "panoramiXsrv.h"
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
|
|
||||||
static int XTestSwapFakeInput(ClientPtr /* client */ ,
|
static int XTestSwapFakeInput(ClientPtr /* client */ ,
|
||||||
xReq * /* req */
|
xReq * /* req */
|
||||||
|
|
@ -133,7 +128,7 @@ ProcXTestCompareCursor(ClientPtr client)
|
||||||
pCursor = GetSpriteCursor(ptr);
|
pCursor = GetSpriteCursor(ptr);
|
||||||
else {
|
else {
|
||||||
rc = dixLookupResourceByType((void **) &pCursor, stuff->cursor,
|
rc = dixLookupResourceByType((void **) &pCursor, stuff->cursor,
|
||||||
X11_RESTYPE_CURSOR, client, DixReadAccess);
|
RT_CURSOR, client, DixReadAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
client->errorValue = stuff->cursor;
|
client->errorValue = stuff->cursor;
|
||||||
return rc;
|
return rc;
|
||||||
|
|
@ -152,35 +147,6 @@ ProcXTestCompareCursor(ClientPtr client)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
XTestDeviceSendEvents(DeviceIntPtr dev,
|
|
||||||
int type,
|
|
||||||
int detail,
|
|
||||||
int flags,
|
|
||||||
const ValuatorMask *mask)
|
|
||||||
{
|
|
||||||
int nevents = 0;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
switch (type) {
|
|
||||||
case MotionNotify:
|
|
||||||
nevents = GetPointerEvents(xtest_evlist, dev, type, 0, flags, mask);
|
|
||||||
break;
|
|
||||||
case ButtonPress:
|
|
||||||
case ButtonRelease:
|
|
||||||
nevents = GetPointerEvents(xtest_evlist, dev, type, detail, flags, mask);
|
|
||||||
break;
|
|
||||||
case KeyPress:
|
|
||||||
case KeyRelease:
|
|
||||||
nevents =
|
|
||||||
GetKeyboardEvents(xtest_evlist, dev, type, detail);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < nevents; i++)
|
|
||||||
mieqProcessDeviceEvent(dev, &xtest_evlist[i], miPointerGetScreen(inputInfo.pointer));
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcXTestFakeInput(ClientPtr client)
|
ProcXTestFakeInput(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
|
@ -194,11 +160,13 @@ ProcXTestFakeInput(ClientPtr client)
|
||||||
int valuators[MAX_VALUATORS] = { 0 };
|
int valuators[MAX_VALUATORS] = { 0 };
|
||||||
int numValuators = 0;
|
int numValuators = 0;
|
||||||
int firstValuator = 0;
|
int firstValuator = 0;
|
||||||
|
int nevents = 0;
|
||||||
|
int i;
|
||||||
int base = 0;
|
int base = 0;
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
int need_ptr_update = 1;
|
int need_ptr_update = 1;
|
||||||
|
|
||||||
nev = (client->req_len << 2) - sizeof(xReq);
|
nev = (stuff->length << 2) - sizeof(xReq);
|
||||||
if ((nev % sizeof(xEvent)) || !nev)
|
if ((nev % sizeof(xEvent)) || !nev)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
nev /= sizeof(xEvent);
|
nev /= sizeof(xEvent);
|
||||||
|
|
@ -350,10 +318,6 @@ ProcXTestFakeInput(ClientPtr client)
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
dev = GetXTestDevice(dev);
|
dev = GetXTestDevice(dev);
|
||||||
|
|
||||||
/* This can only happen if we passed a slave to GetXTestDevice() */
|
|
||||||
if (!dev)
|
|
||||||
return BadAccess;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -378,6 +342,7 @@ ProcXTestFakeInput(ClientPtr client)
|
||||||
/* swap the request back so we can simply re-execute it */
|
/* swap the request back so we can simply re-execute it */
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
(void) XTestSwapFakeInput(client, (xReq *) stuff);
|
(void) XTestSwapFakeInput(client, (xReq *) stuff);
|
||||||
|
swaps(&stuff->length);
|
||||||
}
|
}
|
||||||
ResetCurrentRequest(client);
|
ResetCurrentRequest(client);
|
||||||
client->sequence--;
|
client->sequence--;
|
||||||
|
|
@ -416,7 +381,7 @@ ProcXTestFakeInput(ClientPtr client)
|
||||||
if ((flags & POINTER_ABSOLUTE) && firstValuator <= 1 && numValuators > 0) {
|
if ((flags & POINTER_ABSOLUTE) && firstValuator <= 1 && numValuators > 0) {
|
||||||
if (firstValuator == 0)
|
if (firstValuator == 0)
|
||||||
valuators[0] += root->drawable.pScreen->x;
|
valuators[0] += root->drawable.pScreen->x;
|
||||||
if (firstValuator + numValuators > 1)
|
if (firstValuator < 2 && firstValuator + numValuators > 1)
|
||||||
valuators[1 - firstValuator] += root->drawable.pScreen->y;
|
valuators[1 - firstValuator] += root->drawable.pScreen->y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -442,10 +407,26 @@ ProcXTestFakeInput(ClientPtr client)
|
||||||
if (screenIsSaved == SCREEN_SAVER_ON)
|
if (screenIsSaved == SCREEN_SAVER_ON)
|
||||||
dixSaveScreens(serverClient, SCREEN_SAVER_OFF, ScreenSaverReset);
|
dixSaveScreens(serverClient, SCREEN_SAVER_OFF, ScreenSaverReset);
|
||||||
|
|
||||||
valuator_mask_set_range(&mask, firstValuator, numValuators, valuators);
|
switch (type) {
|
||||||
|
case MotionNotify:
|
||||||
|
valuator_mask_set_range(&mask, firstValuator, numValuators, valuators);
|
||||||
|
nevents = GetPointerEvents(xtest_evlist, dev, type, 0, flags, &mask);
|
||||||
|
break;
|
||||||
|
case ButtonPress:
|
||||||
|
case ButtonRelease:
|
||||||
|
valuator_mask_set_range(&mask, firstValuator, numValuators, valuators);
|
||||||
|
nevents = GetPointerEvents(xtest_evlist, dev, type, ev->u.u.detail,
|
||||||
|
flags, &mask);
|
||||||
|
break;
|
||||||
|
case KeyPress:
|
||||||
|
case KeyRelease:
|
||||||
|
nevents =
|
||||||
|
GetKeyboardEvents(xtest_evlist, dev, type, ev->u.u.detail);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (dev->sendEventsProc)
|
for (i = 0; i < nevents; i++)
|
||||||
(*dev->sendEventsProc) (dev, type, ev->u.u.detail, flags, &mask);
|
mieqProcessDeviceEvent(dev, &xtest_evlist[i], miPointerGetScreen(inputInfo.pointer));
|
||||||
|
|
||||||
if (need_ptr_update)
|
if (need_ptr_update)
|
||||||
miPointerUpdateSprite(dev);
|
miPointerUpdateSprite(dev);
|
||||||
|
|
@ -491,6 +472,8 @@ static int _X_COLD
|
||||||
SProcXTestGetVersion(ClientPtr client)
|
SProcXTestGetVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXTestGetVersionReq);
|
REQUEST(xXTestGetVersionReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xXTestGetVersionReq);
|
REQUEST_SIZE_MATCH(xXTestGetVersionReq);
|
||||||
swaps(&stuff->minorVersion);
|
swaps(&stuff->minorVersion);
|
||||||
return ProcXTestGetVersion(client);
|
return ProcXTestGetVersion(client);
|
||||||
|
|
@ -500,6 +483,8 @@ static int _X_COLD
|
||||||
SProcXTestCompareCursor(ClientPtr client)
|
SProcXTestCompareCursor(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXTestCompareCursorReq);
|
REQUEST(xXTestCompareCursorReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
|
REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
swapl(&stuff->cursor);
|
swapl(&stuff->cursor);
|
||||||
|
|
@ -514,13 +499,12 @@ XTestSwapFakeInput(ClientPtr client, xReq * req)
|
||||||
xEvent sev;
|
xEvent sev;
|
||||||
EventSwapPtr proc;
|
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++) {
|
for (ev = (xEvent *) &req[1]; --nev >= 0; ev++) {
|
||||||
int evtype = ev->u.u.type & 0177;
|
|
||||||
/* Swap event */
|
/* Swap event */
|
||||||
proc = EventSwapVector[evtype];
|
proc = EventSwapVector[ev->u.u.type & 0177];
|
||||||
/* no swapping proc; invalid event type? */
|
/* no swapping proc; invalid event type? */
|
||||||
if (!proc || proc == NotImplemented || evtype == GenericEvent) {
|
if (!proc || proc == NotImplemented) {
|
||||||
client->errorValue = ev->u.u.type;
|
client->errorValue = ev->u.u.type;
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
|
|
@ -537,12 +521,23 @@ SProcXTestFakeInput(ClientPtr client)
|
||||||
|
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
n = XTestSwapFakeInput(client, stuff);
|
n = XTestSwapFakeInput(client, stuff);
|
||||||
if (n != Success)
|
if (n != Success)
|
||||||
return n;
|
return n;
|
||||||
return ProcXTestFakeInput(client);
|
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
|
static int _X_COLD
|
||||||
SProcXTestDispatch(ClientPtr client)
|
SProcXTestDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
|
@ -555,7 +550,7 @@ SProcXTestDispatch(ClientPtr client)
|
||||||
case X_XTestFakeInput:
|
case X_XTestFakeInput:
|
||||||
return SProcXTestFakeInput(client);
|
return SProcXTestFakeInput(client);
|
||||||
case X_XTestGrabControl:
|
case X_XTestGrabControl:
|
||||||
return ProcXTestGrabControl(client);
|
return SProcXTestGrabControl(client);
|
||||||
default:
|
default:
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,18 +21,14 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.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 "misc.h"
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
|
|
@ -41,6 +37,10 @@ SOFTWARE.
|
||||||
#include "dixstruct.h"
|
#include "dixstruct.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "opaque.h"
|
#include "opaque.h"
|
||||||
|
|
||||||
|
#include <X11/extensions/Xv.h>
|
||||||
|
#include <X11/extensions/Xvproto.h>
|
||||||
|
#include "xvdix.h"
|
||||||
#ifdef MITSHM
|
#ifdef MITSHM
|
||||||
#include <X11/extensions/shmproto.h>
|
#include <X11/extensions/shmproto.h>
|
||||||
#include "shmint.h"
|
#include "shmint.h"
|
||||||
|
|
@ -48,12 +48,12 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "xvdisp.h"
|
#include "xvdisp.h"
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
#include "panoramiX.h"
|
#include "panoramiX.h"
|
||||||
#include "panoramiXsrv.h"
|
#include "panoramiXsrv.h"
|
||||||
|
|
||||||
unsigned long XvXRTPort;
|
unsigned long XvXRTPort;
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
SWriteQueryExtensionReply(ClientPtr client, xvQueryExtensionReply * rep)
|
SWriteQueryExtensionReply(ClientPtr client, xvQueryExtensionReply * rep)
|
||||||
|
|
@ -1115,11 +1115,21 @@ ProcXvDispatch(ClientPtr client)
|
||||||
|
|
||||||
/* Swapped Procs */
|
/* 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
|
static int _X_COLD
|
||||||
SProcXvQueryAdaptors(ClientPtr client)
|
SProcXvQueryAdaptors(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvQueryAdaptorsReq);
|
REQUEST(xvQueryAdaptorsReq);
|
||||||
REQUEST_SIZE_MATCH(xvQueryAdaptorsReq);
|
REQUEST_SIZE_MATCH(xvQueryAdaptorsReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
return XvProcVector[xv_QueryAdaptors] (client);
|
return XvProcVector[xv_QueryAdaptors] (client);
|
||||||
}
|
}
|
||||||
|
|
@ -1129,6 +1139,7 @@ SProcXvQueryEncodings(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvQueryEncodingsReq);
|
REQUEST(xvQueryEncodingsReq);
|
||||||
REQUEST_SIZE_MATCH(xvQueryEncodingsReq);
|
REQUEST_SIZE_MATCH(xvQueryEncodingsReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
return XvProcVector[xv_QueryEncodings] (client);
|
return XvProcVector[xv_QueryEncodings] (client);
|
||||||
}
|
}
|
||||||
|
|
@ -1138,6 +1149,7 @@ SProcXvGrabPort(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvGrabPortReq);
|
REQUEST(xvGrabPortReq);
|
||||||
REQUEST_SIZE_MATCH(xvGrabPortReq);
|
REQUEST_SIZE_MATCH(xvGrabPortReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->time);
|
swapl(&stuff->time);
|
||||||
return XvProcVector[xv_GrabPort] (client);
|
return XvProcVector[xv_GrabPort] (client);
|
||||||
|
|
@ -1148,6 +1160,7 @@ SProcXvUngrabPort(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvUngrabPortReq);
|
REQUEST(xvUngrabPortReq);
|
||||||
REQUEST_SIZE_MATCH(xvUngrabPortReq);
|
REQUEST_SIZE_MATCH(xvUngrabPortReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->time);
|
swapl(&stuff->time);
|
||||||
return XvProcVector[xv_UngrabPort] (client);
|
return XvProcVector[xv_UngrabPort] (client);
|
||||||
|
|
@ -1158,6 +1171,7 @@ SProcXvPutVideo(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvPutVideoReq);
|
REQUEST(xvPutVideoReq);
|
||||||
REQUEST_SIZE_MATCH(xvPutVideoReq);
|
REQUEST_SIZE_MATCH(xvPutVideoReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
swapl(&stuff->gc);
|
swapl(&stuff->gc);
|
||||||
|
|
@ -1177,6 +1191,7 @@ SProcXvPutStill(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvPutStillReq);
|
REQUEST(xvPutStillReq);
|
||||||
REQUEST_SIZE_MATCH(xvPutStillReq);
|
REQUEST_SIZE_MATCH(xvPutStillReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
swapl(&stuff->gc);
|
swapl(&stuff->gc);
|
||||||
|
|
@ -1196,6 +1211,7 @@ SProcXvGetVideo(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvGetVideoReq);
|
REQUEST(xvGetVideoReq);
|
||||||
REQUEST_SIZE_MATCH(xvGetVideoReq);
|
REQUEST_SIZE_MATCH(xvGetVideoReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
swapl(&stuff->gc);
|
swapl(&stuff->gc);
|
||||||
|
|
@ -1215,6 +1231,7 @@ SProcXvGetStill(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvGetStillReq);
|
REQUEST(xvGetStillReq);
|
||||||
REQUEST_SIZE_MATCH(xvGetStillReq);
|
REQUEST_SIZE_MATCH(xvGetStillReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
swapl(&stuff->gc);
|
swapl(&stuff->gc);
|
||||||
|
|
@ -1234,6 +1251,7 @@ SProcXvPutImage(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvPutImageReq);
|
REQUEST(xvPutImageReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xvPutImageReq);
|
REQUEST_AT_LEAST_SIZE(xvPutImageReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
swapl(&stuff->gc);
|
swapl(&stuff->gc);
|
||||||
|
|
@ -1257,6 +1275,7 @@ SProcXvShmPutImage(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvShmPutImageReq);
|
REQUEST(xvShmPutImageReq);
|
||||||
REQUEST_SIZE_MATCH(xvShmPutImageReq);
|
REQUEST_SIZE_MATCH(xvShmPutImageReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
swapl(&stuff->gc);
|
swapl(&stuff->gc);
|
||||||
|
|
@ -1284,6 +1303,7 @@ SProcXvSelectVideoNotify(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvSelectVideoNotifyReq);
|
REQUEST(xvSelectVideoNotifyReq);
|
||||||
REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq);
|
REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
return XvProcVector[xv_SelectVideoNotify] (client);
|
return XvProcVector[xv_SelectVideoNotify] (client);
|
||||||
}
|
}
|
||||||
|
|
@ -1293,6 +1313,7 @@ SProcXvSelectPortNotify(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvSelectPortNotifyReq);
|
REQUEST(xvSelectPortNotifyReq);
|
||||||
REQUEST_SIZE_MATCH(xvSelectPortNotifyReq);
|
REQUEST_SIZE_MATCH(xvSelectPortNotifyReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
return XvProcVector[xv_SelectPortNotify] (client);
|
return XvProcVector[xv_SelectPortNotify] (client);
|
||||||
}
|
}
|
||||||
|
|
@ -1302,6 +1323,7 @@ SProcXvStopVideo(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvStopVideoReq);
|
REQUEST(xvStopVideoReq);
|
||||||
REQUEST_SIZE_MATCH(xvStopVideoReq);
|
REQUEST_SIZE_MATCH(xvStopVideoReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
return XvProcVector[xv_StopVideo] (client);
|
return XvProcVector[xv_StopVideo] (client);
|
||||||
|
|
@ -1312,6 +1334,7 @@ SProcXvSetPortAttribute(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvSetPortAttributeReq);
|
REQUEST(xvSetPortAttributeReq);
|
||||||
REQUEST_SIZE_MATCH(xvSetPortAttributeReq);
|
REQUEST_SIZE_MATCH(xvSetPortAttributeReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->attribute);
|
swapl(&stuff->attribute);
|
||||||
swapl(&stuff->value);
|
swapl(&stuff->value);
|
||||||
|
|
@ -1323,6 +1346,7 @@ SProcXvGetPortAttribute(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvGetPortAttributeReq);
|
REQUEST(xvGetPortAttributeReq);
|
||||||
REQUEST_SIZE_MATCH(xvGetPortAttributeReq);
|
REQUEST_SIZE_MATCH(xvGetPortAttributeReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->attribute);
|
swapl(&stuff->attribute);
|
||||||
return XvProcVector[xv_GetPortAttribute] (client);
|
return XvProcVector[xv_GetPortAttribute] (client);
|
||||||
|
|
@ -1333,6 +1357,7 @@ SProcXvQueryBestSize(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvQueryBestSizeReq);
|
REQUEST(xvQueryBestSizeReq);
|
||||||
REQUEST_SIZE_MATCH(xvQueryBestSizeReq);
|
REQUEST_SIZE_MATCH(xvQueryBestSizeReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swaps(&stuff->vid_w);
|
swaps(&stuff->vid_w);
|
||||||
swaps(&stuff->vid_h);
|
swaps(&stuff->vid_h);
|
||||||
|
|
@ -1346,6 +1371,7 @@ SProcXvQueryPortAttributes(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvQueryPortAttributesReq);
|
REQUEST(xvQueryPortAttributesReq);
|
||||||
REQUEST_SIZE_MATCH(xvQueryPortAttributesReq);
|
REQUEST_SIZE_MATCH(xvQueryPortAttributesReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
return XvProcVector[xv_QueryPortAttributes] (client);
|
return XvProcVector[xv_QueryPortAttributes] (client);
|
||||||
}
|
}
|
||||||
|
|
@ -1355,6 +1381,7 @@ SProcXvQueryImageAttributes(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvQueryImageAttributesReq);
|
REQUEST(xvQueryImageAttributesReq);
|
||||||
REQUEST_SIZE_MATCH(xvQueryImageAttributesReq);
|
REQUEST_SIZE_MATCH(xvQueryImageAttributesReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->id);
|
swapl(&stuff->id);
|
||||||
swaps(&stuff->width);
|
swaps(&stuff->width);
|
||||||
|
|
@ -1367,12 +1394,13 @@ SProcXvListImageFormats(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvListImageFormatsReq);
|
REQUEST(xvListImageFormatsReq);
|
||||||
REQUEST_SIZE_MATCH(xvListImageFormatsReq);
|
REQUEST_SIZE_MATCH(xvListImageFormatsReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
return XvProcVector[xv_ListImageFormats] (client);
|
return XvProcVector[xv_ListImageFormats] (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int (*SXvProcVector[xvNumRequests]) (ClientPtr) = {
|
static int (*SXvProcVector[xvNumRequests]) (ClientPtr) = {
|
||||||
ProcXvQueryExtension,
|
SProcXvQueryExtension,
|
||||||
SProcXvQueryAdaptors,
|
SProcXvQueryAdaptors,
|
||||||
SProcXvQueryEncodings,
|
SProcXvQueryEncodings,
|
||||||
SProcXvGrabPort,
|
SProcXvGrabPort,
|
||||||
|
|
@ -1405,7 +1433,7 @@ SProcXvDispatch(ClientPtr client)
|
||||||
return SXvProcVector[stuff->data] (client);
|
return SXvProcVector[stuff->data] (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
static int
|
static int
|
||||||
XineramaXvStopVideo(ClientPtr client)
|
XineramaXvStopVideo(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
|
@ -1513,7 +1541,7 @@ XineramaXvShmPutImage(ClientPtr client)
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define XineramaXvShmPutImage ProcXvShmPutImage
|
#define XineramaXvShmPutImage ProcXvShmPutImage
|
||||||
#endif /* MITSHM */
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
XineramaXvPutImage(ClientPtr client)
|
XineramaXvPutImage(ClientPtr client)
|
||||||
|
|
@ -1768,17 +1796,17 @@ XineramifyXv(void)
|
||||||
XvProcVector[xv_PutImage] = XineramaXvPutImage;
|
XvProcVector[xv_PutImage] = XineramaXvPutImage;
|
||||||
XvProcVector[xv_ShmPutImage] = XineramaXvShmPutImage;
|
XvProcVector[xv_ShmPutImage] = XineramaXvShmPutImage;
|
||||||
}
|
}
|
||||||
#endif /* XINERAMA */
|
#endif /* PANORAMIX */
|
||||||
|
|
||||||
void
|
void
|
||||||
XvResetProcVector(void)
|
XvResetProcVector(void)
|
||||||
{
|
{
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
XvProcVector[xv_PutVideo] = ProcXvPutVideo;
|
XvProcVector[xv_PutVideo] = ProcXvPutVideo;
|
||||||
XvProcVector[xv_PutStill] = ProcXvPutStill;
|
XvProcVector[xv_PutStill] = ProcXvPutStill;
|
||||||
XvProcVector[xv_StopVideo] = ProcXvStopVideo;
|
XvProcVector[xv_StopVideo] = ProcXvStopVideo;
|
||||||
XvProcVector[xv_SetPortAttribute] = ProcXvSetPortAttribute;
|
XvProcVector[xv_SetPortAttribute] = ProcXvSetPortAttribute;
|
||||||
XvProcVector[xv_PutImage] = ProcXvPutImage;
|
XvProcVector[xv_PutImage] = ProcXvPutImage;
|
||||||
XvProcVector[xv_ShmPutImage] = ProcXvShmPutImage;
|
XvProcVector[xv_ShmPutImage] = ProcXvShmPutImage;
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
79
Xext/xvdix.h
79
Xext/xvdix.h
|
|
@ -55,6 +55,21 @@ SOFTWARE.
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
#include <X11/extensions/Xvproto.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 {
|
typedef struct {
|
||||||
int numerator;
|
int numerator;
|
||||||
int denominator;
|
int denominator;
|
||||||
|
|
@ -70,7 +85,18 @@ typedef struct {
|
||||||
ClientPtr client;
|
ClientPtr client;
|
||||||
} XvGrabRec, *XvGrabPtr;
|
} 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 {
|
typedef struct {
|
||||||
int id;
|
int id;
|
||||||
|
|
@ -169,6 +195,14 @@ typedef struct _XvPortRec {
|
||||||
DevUnion devPriv;
|
DevUnion devPriv;
|
||||||
} XvPortRec, *XvPortPtr;
|
} 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 {
|
typedef struct {
|
||||||
int version, revision;
|
int version, revision;
|
||||||
int nAdaptors;
|
int nAdaptors;
|
||||||
|
|
@ -178,8 +212,51 @@ typedef struct {
|
||||||
CloseScreenProcPtr CloseScreen;
|
CloseScreenProcPtr CloseScreen;
|
||||||
} XvScreenRec, *XvScreenPtr;
|
} 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 int XvScreenInit(ScreenPtr);
|
||||||
extern _X_EXPORT DevPrivateKey XvGetScreenKey(void);
|
extern _X_EXPORT DevPrivateKey XvGetScreenKey(void);
|
||||||
extern _X_EXPORT unsigned long XvGetRTPort(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 */
|
#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>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
#include <X11/extensions/Xv.h>
|
|
||||||
#include <X11/extensions/Xvproto.h>
|
|
||||||
|
|
||||||
#include "Xext/xvdix_priv.h"
|
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
|
|
@ -90,50 +88,41 @@ SOFTWARE.
|
||||||
#include "pixmapstr.h"
|
#include "pixmapstr.h"
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "extinit_priv.h"
|
#include "extinit.h"
|
||||||
#include "dixstruct.h"
|
#include "dixstruct.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "opaque.h"
|
#include "opaque.h"
|
||||||
#include "input.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 "panoramiX.h"
|
||||||
#include "panoramiXsrv.h"
|
#include "panoramiXsrv.h"
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
#include "xvdisp.h"
|
#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;
|
static DevPrivateKeyRec XvScreenKeyRec;
|
||||||
|
|
||||||
Bool noXvExtension = FALSE;
|
|
||||||
|
|
||||||
#define XvScreenKey (&XvScreenKeyRec)
|
#define XvScreenKey (&XvScreenKeyRec)
|
||||||
static unsigned long XvExtensionGeneration = 0;
|
unsigned long XvExtensionGeneration = 0;
|
||||||
static unsigned long XvScreenGeneration = 0;
|
unsigned long XvScreenGeneration = 0;
|
||||||
static unsigned long XvResourceGeneration = 0;
|
unsigned long XvResourceGeneration = 0;
|
||||||
|
|
||||||
int XvReqCode;
|
int XvReqCode;
|
||||||
static int XvEventBase;
|
int XvEventBase;
|
||||||
int XvErrorBase;
|
int XvErrorBase;
|
||||||
|
|
||||||
RESTYPE XvRTPort;
|
RESTYPE XvRTPort;
|
||||||
static RESTYPE XvRTEncoding;
|
RESTYPE XvRTEncoding;
|
||||||
static RESTYPE XvRTGrab;
|
RESTYPE XvRTGrab;
|
||||||
static RESTYPE XvRTVideoNotify;
|
RESTYPE XvRTVideoNotify;
|
||||||
static RESTYPE XvRTVideoNotifyList;
|
RESTYPE XvRTVideoNotifyList;
|
||||||
static RESTYPE XvRTPortNotify;
|
RESTYPE XvRTPortNotify;
|
||||||
|
|
||||||
/* EXTERNAL */
|
/* EXTERNAL */
|
||||||
|
|
||||||
|
|
@ -174,9 +163,9 @@ XvExtensionInit(void)
|
||||||
ErrorF("XvExtensionInit: Unable to allocate resource types\n");
|
ErrorF("XvExtensionInit: Unable to allocate resource types\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
XineramaRegisterConnectionBlockCallback(XineramifyXv);
|
XineramaRegisterConnectionBlockCallback(XineramifyXv);
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
XvScreenGeneration = serverGeneration;
|
XvScreenGeneration = serverGeneration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -267,9 +256,9 @@ XvScreenInit(ScreenPtr pScreen)
|
||||||
ErrorF("XvScreenInit: Unable to allocate resource types\n");
|
ErrorF("XvScreenInit: Unable to allocate resource types\n");
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
XineramaRegisterConnectionBlockCallback(XineramifyXv);
|
XineramaRegisterConnectionBlockCallback(XineramifyXv);
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
XvScreenGeneration = serverGeneration;
|
XvScreenGeneration = serverGeneration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -371,14 +360,13 @@ static Bool
|
||||||
XvDestroyPixmap(PixmapPtr pPix)
|
XvDestroyPixmap(PixmapPtr pPix)
|
||||||
{
|
{
|
||||||
ScreenPtr pScreen = pPix->drawable.pScreen;
|
ScreenPtr pScreen = pPix->drawable.pScreen;
|
||||||
Bool status = TRUE;
|
Bool status;
|
||||||
|
|
||||||
if (pPix->refcnt == 1)
|
if (pPix->refcnt == 1)
|
||||||
XvStopAdaptors(&pPix->drawable);
|
XvStopAdaptors(&pPix->drawable);
|
||||||
|
|
||||||
SCREEN_PROLOGUE(pScreen, DestroyPixmap);
|
SCREEN_PROLOGUE(pScreen, DestroyPixmap);
|
||||||
if (pScreen->DestroyPixmap)
|
status = (*pScreen->DestroyPixmap) (pPix);
|
||||||
status = pScreen->DestroyPixmap(pPix);
|
|
||||||
SCREEN_EPILOGUE(pScreen, DestroyPixmap, XvDestroyPixmap);
|
SCREEN_EPILOGUE(pScreen, DestroyPixmap, XvDestroyPixmap);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
|
@ -437,7 +425,7 @@ XvdiDestroyVideoNotifyList(void *pn, XID id)
|
||||||
{
|
{
|
||||||
XvVideoNotifyPtr npn, cpn;
|
XvVideoNotifyPtr npn, cpn;
|
||||||
|
|
||||||
/* ACTUALLY DESTROY THE NOTIFY LIST */
|
/* ACTUALLY DESTROY THE NOTITY LIST */
|
||||||
|
|
||||||
cpn = (XvVideoNotifyPtr) pn;
|
cpn = (XvVideoNotifyPtr) pn;
|
||||||
|
|
||||||
|
|
@ -481,7 +469,7 @@ XvdiSendVideoNotify(XvPortPtr pPort, DrawablePtr pDraw, int reason)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
int
|
||||||
XvdiSendPortNotify(XvPortPtr pPort, Atom attribute, INT32 value)
|
XvdiSendPortNotify(XvPortPtr pPort, Atom attribute, INT32 value)
|
||||||
{
|
{
|
||||||
XvPortNotifyPtr pn;
|
XvPortNotifyPtr pn;
|
||||||
|
|
@ -823,10 +811,8 @@ XvdiSelectVideoNotify(ClientPtr client, DrawablePtr pDraw, BOOL onoff)
|
||||||
tpn = pn;
|
tpn = pn;
|
||||||
while (tpn) {
|
while (tpn) {
|
||||||
if (tpn->client == client) {
|
if (tpn->client == client) {
|
||||||
if (!onoff) {
|
if (!onoff)
|
||||||
tpn->client = NULL;
|
tpn->client = NULL;
|
||||||
FreeResource(tpn->id, XvRTVideoNotify);
|
|
||||||
}
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
if (!tpn->client)
|
if (!tpn->client)
|
||||||
|
|
@ -834,7 +820,7 @@ XvdiSelectVideoNotify(ClientPtr client, DrawablePtr pDraw, BOOL onoff)
|
||||||
tpn = tpn->next;
|
tpn = tpn->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* IF TURNING OFF, THEN JUST RETURN */
|
/* IF TUNNING OFF, THEN JUST RETURN */
|
||||||
|
|
||||||
if (!onoff)
|
if (!onoff)
|
||||||
return Success;
|
return Success;
|
||||||
|
|
|
||||||
17
Xext/xvmc.c
17
Xext/xvmc.c
|
|
@ -1,21 +1,22 @@
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
|
|
||||||
#include "Xext/xvdix_priv.h"
|
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "dixstruct.h"
|
#include "dixstruct.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "extinit_priv.h"
|
#include "extinit.h"
|
||||||
#include "servermd.h"
|
#include "servermd.h"
|
||||||
#include <X11/Xfuncproto.h>
|
#include <X11/Xfuncproto.h>
|
||||||
|
#include "xvdix.h"
|
||||||
#include <X11/extensions/XvMC.h>
|
#include <X11/extensions/XvMC.h>
|
||||||
#include <X11/extensions/Xvproto.h>
|
#include <X11/extensions/Xvproto.h>
|
||||||
#include <X11/extensions/XvMCproto.h>
|
#include <X11/extensions/XvMCproto.h>
|
||||||
|
|
@ -43,6 +44,8 @@ static RESTYPE XvMCRTContext;
|
||||||
static RESTYPE XvMCRTSurface;
|
static RESTYPE XvMCRTSurface;
|
||||||
static RESTYPE XvMCRTSubpicture;
|
static RESTYPE XvMCRTSubpicture;
|
||||||
|
|
||||||
|
int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr) = NULL;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int num_adaptors;
|
int num_adaptors;
|
||||||
XvMCAdaptorPtr adaptors;
|
XvMCAdaptorPtr adaptors;
|
||||||
|
|
@ -287,7 +290,7 @@ ProcXvMCDestroyContext(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
FreeResource(stuff->context_id, X11_RESTYPE_NONE);
|
FreeResource(stuff->context_id, RT_NONE);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
@ -365,7 +368,7 @@ ProcXvMCDestroySurface(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
FreeResource(stuff->surface_id, X11_RESTYPE_NONE);
|
FreeResource(stuff->surface_id, RT_NONE);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
@ -493,7 +496,7 @@ ProcXvMCDestroySubpicture(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
FreeResource(stuff->subpicture_id, X11_RESTYPE_NONE);
|
FreeResource(stuff->subpicture_id, RT_NONE);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,9 +84,13 @@ typedef struct {
|
||||||
XvMCDestroySubpictureProcPtr DestroySubpicture;
|
XvMCDestroySubpictureProcPtr DestroySubpicture;
|
||||||
} XvMCAdaptorRec, *XvMCAdaptorPtr;
|
} XvMCAdaptorRec, *XvMCAdaptorPtr;
|
||||||
|
|
||||||
|
extern int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr);
|
||||||
|
|
||||||
extern _X_EXPORT int XvMCScreenInit(ScreenPtr pScreen,
|
extern _X_EXPORT int XvMCScreenInit(ScreenPtr pScreen,
|
||||||
int num, XvMCAdaptorPtr adapt);
|
int num, XvMCAdaptorPtr adapt);
|
||||||
|
|
||||||
|
extern _X_EXPORT XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id);
|
||||||
|
|
||||||
extern _X_EXPORT int xf86XvMCRegisterDRInfo(ScreenPtr pScreen, const char *name,
|
extern _X_EXPORT int xf86XvMCRegisterDRInfo(ScreenPtr pScreen, const char *name,
|
||||||
const char *busID, int major, int minor,
|
const char *busID, int major, int minor,
|
||||||
int patchLevel);
|
int patchLevel);
|
||||||
|
|
|
||||||
111
Xi/Makefile.am
Normal file
111
Xi/Makefile.am
Normal file
|
|
@ -0,0 +1,111 @@
|
||||||
|
noinst_LTLIBRARIES = libXi.la libXistubs.la
|
||||||
|
|
||||||
|
AM_CFLAGS = $(DIX_CFLAGS)
|
||||||
|
|
||||||
|
libXi_la_SOURCES = \
|
||||||
|
allowev.c \
|
||||||
|
allowev.h \
|
||||||
|
chgdctl.c \
|
||||||
|
chgdctl.h \
|
||||||
|
chgfctl.c \
|
||||||
|
chgfctl.h \
|
||||||
|
chgkbd.c \
|
||||||
|
chgkbd.h \
|
||||||
|
chgkmap.c \
|
||||||
|
chgkmap.h \
|
||||||
|
chgprop.c \
|
||||||
|
chgprop.h \
|
||||||
|
chgptr.c \
|
||||||
|
chgptr.h \
|
||||||
|
closedev.c \
|
||||||
|
closedev.h \
|
||||||
|
devbell.c \
|
||||||
|
devbell.h \
|
||||||
|
exevents.c \
|
||||||
|
exglobals.h \
|
||||||
|
extinit.c \
|
||||||
|
getbmap.c \
|
||||||
|
getbmap.h \
|
||||||
|
getdctl.c \
|
||||||
|
getdctl.h \
|
||||||
|
getfctl.c \
|
||||||
|
getfctl.h \
|
||||||
|
getfocus.c \
|
||||||
|
getfocus.h \
|
||||||
|
getkmap.c \
|
||||||
|
getkmap.h \
|
||||||
|
getmmap.c \
|
||||||
|
getmmap.h \
|
||||||
|
getprop.c \
|
||||||
|
getprop.h \
|
||||||
|
getselev.c \
|
||||||
|
getselev.h \
|
||||||
|
getvers.c \
|
||||||
|
getvers.h \
|
||||||
|
grabdev.c \
|
||||||
|
grabdev.h \
|
||||||
|
grabdevb.c \
|
||||||
|
grabdevb.h \
|
||||||
|
grabdevk.c \
|
||||||
|
grabdevk.h \
|
||||||
|
gtmotion.c \
|
||||||
|
gtmotion.h \
|
||||||
|
listdev.c \
|
||||||
|
listdev.h \
|
||||||
|
opendev.c \
|
||||||
|
opendev.h \
|
||||||
|
queryst.c \
|
||||||
|
queryst.h \
|
||||||
|
selectev.c \
|
||||||
|
selectev.h \
|
||||||
|
sendexev.c \
|
||||||
|
sendexev.h \
|
||||||
|
setbmap.c \
|
||||||
|
setbmap.h \
|
||||||
|
setdval.c \
|
||||||
|
setdval.h \
|
||||||
|
setfocus.c \
|
||||||
|
setfocus.h \
|
||||||
|
setmmap.c \
|
||||||
|
setmmap.h \
|
||||||
|
setmode.c \
|
||||||
|
setmode.h \
|
||||||
|
ungrdev.c \
|
||||||
|
ungrdev.h \
|
||||||
|
ungrdevb.c \
|
||||||
|
ungrdevb.h \
|
||||||
|
ungrdevk.c \
|
||||||
|
ungrdevk.h \
|
||||||
|
xiallowev.c \
|
||||||
|
xiallowev.h \
|
||||||
|
xibarriers.c \
|
||||||
|
xibarriers.h \
|
||||||
|
xichangecursor.c \
|
||||||
|
xichangecursor.h \
|
||||||
|
xichangehierarchy.c \
|
||||||
|
xichangehierarchy.h \
|
||||||
|
xigetclientpointer.c \
|
||||||
|
xigetclientpointer.h \
|
||||||
|
xigrabdev.c \
|
||||||
|
xigrabdev.h \
|
||||||
|
xipassivegrab.h \
|
||||||
|
xipassivegrab.c \
|
||||||
|
xiproperty.c \
|
||||||
|
xiproperty.h \
|
||||||
|
xiquerydevice.c \
|
||||||
|
xiquerydevice.h \
|
||||||
|
xiquerypointer.c \
|
||||||
|
xiquerypointer.h \
|
||||||
|
xiqueryversion.c \
|
||||||
|
xiqueryversion.h \
|
||||||
|
xiselectev.c \
|
||||||
|
xiselectev.h \
|
||||||
|
xisetclientpointer.c \
|
||||||
|
xisetclientpointer.h \
|
||||||
|
xisetdevfocus.c \
|
||||||
|
xisetdevfocus.h \
|
||||||
|
xiwarppointer.c \
|
||||||
|
xiwarppointer.h
|
||||||
|
|
||||||
|
libXistubs_la_SOURCES = \
|
||||||
|
stubs.c
|
||||||
18
Xi/allowev.c
18
Xi/allowev.c
|
|
@ -50,15 +50,14 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
|
||||||
#include "dix/input_priv.h"
|
|
||||||
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "allowev.h"
|
#include "allowev.h"
|
||||||
|
|
@ -74,6 +73,7 @@ int _X_COLD
|
||||||
SProcXAllowDeviceEvents(ClientPtr client)
|
SProcXAllowDeviceEvents(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xAllowDeviceEventsReq);
|
REQUEST(xAllowDeviceEventsReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
|
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
|
||||||
swapl(&stuff->time);
|
swapl(&stuff->time);
|
||||||
return (ProcXAllowDeviceEvents(client));
|
return (ProcXAllowDeviceEvents(client));
|
||||||
|
|
@ -102,22 +102,22 @@ ProcXAllowDeviceEvents(ClientPtr client)
|
||||||
|
|
||||||
switch (stuff->mode) {
|
switch (stuff->mode) {
|
||||||
case ReplayThisDevice:
|
case ReplayThisDevice:
|
||||||
AllowSome(client, time, thisdev, GRAB_STATE_NOT_GRABBED);
|
AllowSome(client, time, thisdev, NOT_GRABBED);
|
||||||
break;
|
break;
|
||||||
case SyncThisDevice:
|
case SyncThisDevice:
|
||||||
AllowSome(client, time, thisdev, GRAB_STATE_FREEZE_NEXT_EVENT);
|
AllowSome(client, time, thisdev, FREEZE_NEXT_EVENT);
|
||||||
break;
|
break;
|
||||||
case AsyncThisDevice:
|
case AsyncThisDevice:
|
||||||
AllowSome(client, time, thisdev, GRAB_STATE_THAWED);
|
AllowSome(client, time, thisdev, THAWED);
|
||||||
break;
|
break;
|
||||||
case AsyncOtherDevices:
|
case AsyncOtherDevices:
|
||||||
AllowSome(client, time, thisdev, GRAB_STATE_THAW_OTHERS);
|
AllowSome(client, time, thisdev, THAW_OTHERS);
|
||||||
break;
|
break;
|
||||||
case SyncAll:
|
case SyncAll:
|
||||||
AllowSome(client, time, thisdev, GRAB_STATE_FREEZE_BOTH_NEXT_EVENT);
|
AllowSome(client, time, thisdev, FREEZE_BOTH_NEXT_EVENT);
|
||||||
break;
|
break;
|
||||||
case AsyncAll:
|
case AsyncAll:
|
||||||
AllowSome(client, time, thisdev, GRAB_STATE_THAWED_BOTH);
|
AllowSome(client, time, thisdev, THAWED_BOTH);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
client->errorValue = stuff->mode;
|
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 <dix-config.h>
|
||||||
|
#endif
|
||||||
#include <X11/extensions/XI.h>
|
|
||||||
#include <X11/extensions/XIproto.h> /* control constants */
|
|
||||||
|
|
||||||
#include "dix/exevents_priv.h"
|
|
||||||
#include "dix/input_priv.h"
|
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
|
#include <X11/extensions/XI.h>
|
||||||
|
#include <X11/extensions/XIproto.h> /* control constants */
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
#include "exevents.h"
|
||||||
|
|
||||||
#include "chgdctl.h"
|
#include "chgdctl.h"
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
@ -76,6 +77,7 @@ SProcXChangeDeviceControl(ClientPtr client)
|
||||||
xDeviceCtl *ctl;
|
xDeviceCtl *ctl;
|
||||||
|
|
||||||
REQUEST(xChangeDeviceControlReq);
|
REQUEST(xChangeDeviceControlReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
|
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
|
||||||
swaps(&stuff->control);
|
swaps(&stuff->control);
|
||||||
ctl = (xDeviceCtl *) &stuff[1];
|
ctl = (xDeviceCtl *) &stuff[1];
|
||||||
|
|
@ -115,7 +117,7 @@ ProcXChangeDeviceControl(ClientPtr client)
|
||||||
REQUEST(xChangeDeviceControlReq);
|
REQUEST(xChangeDeviceControlReq);
|
||||||
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
|
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);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
||||||
10
Xi/chgfctl.c
10
Xi/chgfctl.c
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
|
|
@ -73,6 +75,7 @@ int _X_COLD
|
||||||
SProcXChangeFeedbackControl(ClientPtr client)
|
SProcXChangeFeedbackControl(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xChangeFeedbackControlReq);
|
REQUEST(xChangeFeedbackControlReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
|
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
|
||||||
swapl(&stuff->mask);
|
swapl(&stuff->mask);
|
||||||
return (ProcXChangeFeedbackControl(client));
|
return (ProcXChangeFeedbackControl(client));
|
||||||
|
|
@ -435,7 +438,7 @@ ProcXChangeFeedbackControl(ClientPtr client)
|
||||||
REQUEST(xChangeFeedbackControlReq);
|
REQUEST(xChangeFeedbackControlReq);
|
||||||
REQUEST_AT_LEAST_SIZE(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);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
@ -461,11 +464,8 @@ ProcXChangeFeedbackControl(ClientPtr client)
|
||||||
break;
|
break;
|
||||||
case StringFeedbackClass:
|
case StringFeedbackClass:
|
||||||
{
|
{
|
||||||
xStringFeedbackCtl *f;
|
xStringFeedbackCtl *f = ((xStringFeedbackCtl *) &stuff[1]);
|
||||||
|
|
||||||
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeFeedbackControlReq,
|
|
||||||
sizeof(xStringFeedbackCtl));
|
|
||||||
f = ((xStringFeedbackCtl *) &stuff[1]);
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
if (len < bytes_to_int32(sizeof(xStringFeedbackCtl)))
|
if (len < bytes_to_int32(sizeof(xStringFeedbackCtl)))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
|
||||||
19
Xi/chgkbd.c
19
Xi/chgkbd.c
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
|
|
@ -69,6 +71,23 @@ SOFTWARE.
|
||||||
* This procedure changes the keyboard device.
|
* 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
|
int
|
||||||
ProcXChangeKeyboardDevice(ClientPtr client)
|
ProcXChangeKeyboardDevice(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef CHGKBD_H
|
#ifndef CHGKBD_H
|
||||||
#define CHGKBD_H 1
|
#define CHGKBD_H 1
|
||||||
|
|
||||||
|
int SProcXChangeKeyboardDevice(ClientPtr /* client */
|
||||||
|
);
|
||||||
|
|
||||||
int ProcXChangeKeyboardDevice(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 <dix-config.h>
|
||||||
|
#endif
|
||||||
#include <X11/extensions/XI.h>
|
|
||||||
#include <X11/extensions/XIproto.h>
|
|
||||||
|
|
||||||
#include "dix/exevents_priv.h"
|
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
|
#include <X11/extensions/XI.h>
|
||||||
|
#include <X11/extensions/XIproto.h>
|
||||||
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "chgkmap.h"
|
#include "chgkmap.h"
|
||||||
|
|
@ -75,6 +75,7 @@ SProcXChangeDeviceKeyMapping(ClientPtr client)
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
|
|
||||||
REQUEST(xChangeDeviceKeyMappingReq);
|
REQUEST(xChangeDeviceKeyMappingReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
|
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
|
||||||
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
|
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
|
||||||
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
|
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
|
||||||
|
|
@ -105,7 +106,7 @@ ProcXChangeDeviceKeyMapping(ClientPtr client)
|
||||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
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,
|
ret = ChangeKeyMapping(client, dev, len, DeviceMappingNotify,
|
||||||
stuff->firstKeyCode, stuff->keyCodes,
|
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 <dix-config.h>
|
||||||
|
#endif
|
||||||
#include <X11/extensions/XI.h>
|
|
||||||
#include <X11/extensions/XIproto.h>
|
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
|
||||||
#include "dix/exevents_priv.h"
|
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
|
#include <X11/extensions/XI.h>
|
||||||
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "chgprop.h"
|
#include "chgprop.h"
|
||||||
#include "grabdev.h"
|
#include "grabdev.h"
|
||||||
|
|
||||||
|
|
@ -75,6 +75,7 @@ int _X_COLD
|
||||||
SProcXChangeDeviceDontPropagateList(ClientPtr client)
|
SProcXChangeDeviceDontPropagateList(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xChangeDeviceDontPropagateListReq);
|
REQUEST(xChangeDeviceDontPropagateListReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
|
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
swaps(&stuff->count);
|
swaps(&stuff->count);
|
||||||
|
|
@ -101,7 +102,7 @@ ProcXChangeDeviceDontPropagateList(ClientPtr client)
|
||||||
REQUEST(xChangeDeviceDontPropagateListReq);
|
REQUEST(xChangeDeviceDontPropagateListReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
|
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
|
||||||
|
|
||||||
if (client->req_len !=
|
if (stuff->length !=
|
||||||
bytes_to_int32(sizeof(xChangeDeviceDontPropagateListReq)) +
|
bytes_to_int32(sizeof(xChangeDeviceDontPropagateListReq)) +
|
||||||
stuff->count)
|
stuff->count)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
|
||||||
18
Xi/chgptr.c
18
Xi/chgptr.c
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
|
|
@ -65,6 +67,22 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "chgptr.h"
|
#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.
|
* 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
|
#ifndef CHGPTR_H
|
||||||
#define CHGPTR_H 1
|
#define CHGPTR_H 1
|
||||||
|
|
||||||
|
int SProcXChangePointerDevice(ClientPtr /* client */
|
||||||
|
);
|
||||||
|
|
||||||
int ProcXChangePointerDevice(ClientPtr /* client */
|
int ProcXChangePointerDevice(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
|
|
@ -62,6 +64,21 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "closedev.h"
|
#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
|
* Clear out event selections and passive grabs from a window for the
|
||||||
|
|
@ -85,13 +102,13 @@ DeleteDeviceEvents(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
|
||||||
next = grab->next;
|
next = grab->next;
|
||||||
if ((grab->device == dev) &&
|
if ((grab->device == dev) &&
|
||||||
(client->clientAsMask == CLIENT_BITS(grab->resource)))
|
(client->clientAsMask == CLIENT_BITS(grab->resource)))
|
||||||
FreeResource(grab->resource, X11_RESTYPE_NONE);
|
FreeResource(grab->resource, RT_NONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* Walk through the window tree, deleting event selections for this client
|
* Walk througth the window tree, deleting event selections for this client
|
||||||
* from this device from all windows.
|
* from this device from all windows.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef CLOSEDEV_H
|
#ifndef CLOSEDEV_H
|
||||||
#define CLOSEDEV_H 1
|
#define CLOSEDEV_H 1
|
||||||
|
|
||||||
|
int SProcXCloseDevice(ClientPtr /* client */
|
||||||
|
);
|
||||||
|
|
||||||
int ProcXCloseDevice(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>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
|
|
@ -59,6 +61,21 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "devbell.h"
|
#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.
|
* 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
|
#ifndef DEVBELL_H
|
||||||
#define DEVBELL_H 1
|
#define DEVBELL_H 1
|
||||||
|
|
||||||
|
int SProcXDeviceBell(ClientPtr /* client */
|
||||||
|
);
|
||||||
|
|
||||||
int ProcXDeviceBell(ClientPtr /* client */
|
int ProcXDeviceBell(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
476
Xi/exevents.c
476
Xi/exevents.c
|
|
@ -78,37 +78,35 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "inputstr.h"
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
#include <X11/extensions/geproto.h>
|
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include <X11/extensions/XI2proto.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 "inputstr.h"
|
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include "miscstruct.h"
|
#include "miscstruct.h"
|
||||||
#include "region.h"
|
#include "region.h"
|
||||||
|
#include "exevents.h"
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "eventstr.h"
|
|
||||||
#include "dixevents.h" /* DeliverFocusedEvent */
|
#include "dixevents.h" /* DeliverFocusedEvent */
|
||||||
|
#include "dixgrabs.h" /* CreateGrab() */
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
#include "listdev.h" /* for CopySwapXXXClass */
|
#include "listdev.h" /* for CopySwapXXXClass */
|
||||||
#include "xace.h"
|
#include "xace.h"
|
||||||
#include "xiquerydevice.h" /* For List*Info */
|
#include "xiquerydevice.h" /* For List*Info */
|
||||||
|
#include "eventconvert.h"
|
||||||
#include "eventstr.h"
|
#include "eventstr.h"
|
||||||
#include "inpututils.h"
|
#include "inpututils.h"
|
||||||
#include "mi.h"
|
#include "mi.h"
|
||||||
|
|
||||||
|
#include <X11/extensions/XKBproto.h>
|
||||||
#include "xkbsrv.h"
|
#include "xkbsrv.h"
|
||||||
|
|
||||||
#define WID(w) ((w) ? ((w)->drawable.id) : 0)
|
#define WID(w) ((w) ? ((w)->drawable.id) : 0)
|
||||||
|
|
@ -170,49 +168,6 @@ IsTouchEvent(InternalEvent *event)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool
|
|
||||||
IsGestureEvent(InternalEvent *event)
|
|
||||||
{
|
|
||||||
switch (event->any.type) {
|
|
||||||
case ET_GesturePinchBegin:
|
|
||||||
case ET_GesturePinchUpdate:
|
|
||||||
case ET_GesturePinchEnd:
|
|
||||||
case ET_GestureSwipeBegin:
|
|
||||||
case ET_GestureSwipeUpdate:
|
|
||||||
case ET_GestureSwipeEnd:
|
|
||||||
return TRUE;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool
|
|
||||||
IsGestureBeginEvent(InternalEvent *event)
|
|
||||||
{
|
|
||||||
switch (event->any.type) {
|
|
||||||
case ET_GesturePinchBegin:
|
|
||||||
case ET_GestureSwipeBegin:
|
|
||||||
return TRUE;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool
|
|
||||||
IsGestureEndEvent(InternalEvent *event)
|
|
||||||
{
|
|
||||||
switch (event->any.type) {
|
|
||||||
case ET_GesturePinchEnd:
|
|
||||||
case ET_GestureSwipeEnd:
|
|
||||||
return TRUE;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the device matching the deviceid of the device set in the event, or
|
* @return the device matching the deviceid of the device set in the event, or
|
||||||
* NULL if the event is not an XInput event.
|
* NULL if the event is not an XInput event.
|
||||||
|
|
@ -606,25 +561,22 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
|
||||||
to->button = calloc(1, sizeof(ButtonClassRec));
|
to->button = calloc(1, sizeof(ButtonClassRec));
|
||||||
if (!to->button)
|
if (!to->button)
|
||||||
FatalError("[Xi] no memory for class shift.\n");
|
FatalError("[Xi] no memory for class shift.\n");
|
||||||
to->button->numButtons = from->button->numButtons;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
classes->button = NULL;
|
classes->button = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (from->button->xkb_acts) {
|
if (from->button->xkb_acts) {
|
||||||
size_t maxbuttons = max(to->button->numButtons, from->button->numButtons);
|
if (!to->button->xkb_acts) {
|
||||||
to->button->xkb_acts = XNFreallocarray(to->button->xkb_acts,
|
to->button->xkb_acts = calloc(1, sizeof(XkbAction));
|
||||||
maxbuttons,
|
if (!to->button->xkb_acts)
|
||||||
sizeof(XkbAction));
|
FatalError("[Xi] not enough memory for xkb_acts.\n");
|
||||||
memset(to->button->xkb_acts, 0, maxbuttons * sizeof(XkbAction));
|
}
|
||||||
memcpy(to->button->xkb_acts, from->button->xkb_acts,
|
memcpy(to->button->xkb_acts, from->button->xkb_acts,
|
||||||
from->button->numButtons * sizeof(XkbAction));
|
sizeof(XkbAction));
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
free(to->button->xkb_acts);
|
free(to->button->xkb_acts);
|
||||||
to->button->xkb_acts = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(to->button->labels, from->button->labels,
|
memcpy(to->button->labels, from->button->labels,
|
||||||
from->button->numButtons * sizeof(Atom));
|
from->button->numButtons * sizeof(Atom));
|
||||||
|
|
@ -695,32 +647,13 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
|
||||||
/* Don't remove touch class if from->touch is non-existent. The to device
|
/* Don't remove touch class if from->touch is non-existent. The to device
|
||||||
* may have an active touch grab, so we need to keep the touch class record
|
* may have an active touch grab, so we need to keep the touch class record
|
||||||
* around. */
|
* around. */
|
||||||
|
|
||||||
if (from->gesture) {
|
|
||||||
if (!to->gesture) {
|
|
||||||
classes = to->unused_classes;
|
|
||||||
to->gesture = classes->gesture;
|
|
||||||
if (!to->gesture) {
|
|
||||||
if (!InitGestureClassDeviceStruct(to, from->gesture->max_touches))
|
|
||||||
FatalError("[Xi] no memory for class shift.\n");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
classes->gesture = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
to->gesture->sourceid = from->gesture->sourceid;
|
|
||||||
/* to->gesture->gesture is separate on the master, don't copy */
|
|
||||||
}
|
|
||||||
/* Don't remove gesture class if from->gesture is non-existent. The to device
|
|
||||||
* may have an active gesture grab, so we need to keep the gesture class record
|
|
||||||
* around. */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copies the CONTENT of the classes of device from into the classes in device
|
* Copies the CONTENT of the classes of device from into the classes in device
|
||||||
* to. From and to are identical after finishing.
|
* to. From and to are identical after finishing.
|
||||||
*
|
*
|
||||||
* If to does not have classes from currently has, the classes are stored in
|
* If to does not have classes from currenly has, the classes are stored in
|
||||||
* to's devPrivates system. Later, we recover it again from there if needed.
|
* to's devPrivates system. Later, we recover it again from there if needed.
|
||||||
* Saves a few memory allocations.
|
* Saves a few memory allocations.
|
||||||
*/
|
*/
|
||||||
|
|
@ -813,8 +746,9 @@ UpdateDeviceMotionMask(DeviceIntPtr device, unsigned short state,
|
||||||
{
|
{
|
||||||
Mask mask;
|
Mask mask;
|
||||||
|
|
||||||
mask = PointerMotionMask | state | motion_mask;
|
mask = DevicePointerMotionMask | state | motion_mask;
|
||||||
SetMaskForEvent(device->id, mask, DeviceMotionNotify);
|
SetMaskForEvent(device->id, mask, DeviceMotionNotify);
|
||||||
|
mask = PointerMotionMask | state | motion_mask;
|
||||||
SetMaskForEvent(device->id, mask, MotionNotify);
|
SetMaskForEvent(device->id, mask, MotionNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1093,7 +1027,7 @@ DeliverOneTouchEvent(ClientPtr client, DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
|
|
||||||
FixUpEventFromWindow(&ti->sprite, xi2, win, child, FALSE);
|
FixUpEventFromWindow(&ti->sprite, xi2, win, child, FALSE);
|
||||||
filter = GetEventFilter(dev, xi2);
|
filter = GetEventFilter(dev, xi2);
|
||||||
if (XaceHookReceiveAccess(client, win, xi2, 1) != Success)
|
if (XaceHook(XACE_RECEIVE_ACCESS, client, win, xi2, 1) != Success)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
err = TryClientEvents(client, dev, xi2, 1, filter, filter, NullGrab);
|
err = TryClientEvents(client, dev, xi2, 1, filter, filter, NullGrab);
|
||||||
free(xi2);
|
free(xi2);
|
||||||
|
|
@ -1110,8 +1044,8 @@ ActivateEarlyAccept(DeviceIntPtr dev, TouchPointInfoPtr ti)
|
||||||
XID error;
|
XID error;
|
||||||
GrabPtr grab = ti->listeners[0].grab;
|
GrabPtr grab = ti->listeners[0].grab;
|
||||||
|
|
||||||
BUG_RETURN(ti->listeners[0].type != TOUCH_LISTENER_GRAB &&
|
BUG_RETURN(ti->listeners[0].type != LISTENER_GRAB &&
|
||||||
ti->listeners[0].type != TOUCH_LISTENER_POINTER_GRAB);
|
ti->listeners[0].type != LISTENER_POINTER_GRAB);
|
||||||
BUG_RETURN(!grab);
|
BUG_RETURN(!grab);
|
||||||
|
|
||||||
client = rClient(grab);
|
client = rClient(grab);
|
||||||
|
|
@ -1144,8 +1078,8 @@ FindOldestPointerEmulatedTouch(DeviceIntPtr dev)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
for (j = 0; j < ti->num_listeners; j++) {
|
for (j = 0; j < ti->num_listeners; j++) {
|
||||||
if (ti->listeners[j].type == TOUCH_LISTENER_POINTER_GRAB ||
|
if (ti->listeners[j].type == LISTENER_POINTER_GRAB ||
|
||||||
ti->listeners[j].type == TOUCH_LISTENER_POINTER_REGULAR)
|
ti->listeners[j].type == LISTENER_POINTER_REGULAR)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (j == ti->num_listeners)
|
if (j == ti->num_listeners)
|
||||||
|
|
@ -1172,17 +1106,17 @@ TouchPuntToNextOwner(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
TouchOwnershipEvent *ev)
|
TouchOwnershipEvent *ev)
|
||||||
{
|
{
|
||||||
TouchListener *listener = &ti->listeners[0]; /* new owner */
|
TouchListener *listener = &ti->listeners[0]; /* new owner */
|
||||||
int accepted_early = listener->state == TOUCH_LISTENER_EARLY_ACCEPT;
|
int accepted_early = listener->state == LISTENER_EARLY_ACCEPT;
|
||||||
|
|
||||||
/* Deliver the ownership */
|
/* Deliver the ownership */
|
||||||
if (listener->state == TOUCH_LISTENER_AWAITING_OWNER || accepted_early)
|
if (listener->state == LISTENER_AWAITING_OWNER || accepted_early)
|
||||||
DeliverTouchEvents(dev, ti, (InternalEvent *) ev,
|
DeliverTouchEvents(dev, ti, (InternalEvent *) ev,
|
||||||
listener->listener);
|
listener->listener);
|
||||||
else if (listener->state == TOUCH_LISTENER_AWAITING_BEGIN) {
|
else if (listener->state == LISTENER_AWAITING_BEGIN) {
|
||||||
/* We can't punt to a pointer listener unless all older pointer
|
/* We can't punt to a pointer listener unless all older pointer
|
||||||
* emulated touches have been seen already. */
|
* emulated touches have been seen already. */
|
||||||
if ((listener->type == TOUCH_LISTENER_POINTER_GRAB ||
|
if ((listener->type == LISTENER_POINTER_GRAB ||
|
||||||
listener->type == TOUCH_LISTENER_POINTER_REGULAR) &&
|
listener->type == LISTENER_POINTER_REGULAR) &&
|
||||||
ti != FindOldestPointerEmulatedTouch(dev))
|
ti != FindOldestPointerEmulatedTouch(dev))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -1225,7 +1159,7 @@ CheckOldestTouch(DeviceIntPtr dev)
|
||||||
{
|
{
|
||||||
TouchPointInfoPtr oldest = FindOldestPointerEmulatedTouch(dev);
|
TouchPointInfoPtr oldest = FindOldestPointerEmulatedTouch(dev);
|
||||||
|
|
||||||
if (oldest && oldest->listeners[0].state == TOUCH_LISTENER_AWAITING_BEGIN)
|
if (oldest && oldest->listeners[0].state == LISTENER_AWAITING_BEGIN)
|
||||||
TouchPuntToNextOwner(dev, oldest, NULL);
|
TouchPuntToNextOwner(dev, oldest, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1249,7 +1183,7 @@ TouchRejected(DeviceIntPtr sourcedev, TouchPointInfoPtr ti, XID resource,
|
||||||
* haven't received one yet already */
|
* haven't received one yet already */
|
||||||
for (i = 0; i < ti->num_listeners; i++) {
|
for (i = 0; i < ti->num_listeners; i++) {
|
||||||
if (ti->listeners[i].listener == resource) {
|
if (ti->listeners[i].listener == resource) {
|
||||||
if (ti->listeners[i].state != TOUCH_LISTENER_HAS_END)
|
if (ti->listeners[i].state != LISTENER_HAS_END)
|
||||||
TouchEmitTouchEnd(sourcedev, ti, TOUCH_REJECT, resource);
|
TouchEmitTouchEnd(sourcedev, ti, TOUCH_REJECT, resource);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1295,12 +1229,12 @@ ProcessTouchOwnershipEvent(TouchOwnershipEvent *ev,
|
||||||
|
|
||||||
|
|
||||||
/* For pointer-emulated listeners that ungrabbed the active grab,
|
/* For pointer-emulated listeners that ungrabbed the active grab,
|
||||||
* the state was forced to TOUCH_LISTENER_HAS_END. Still go
|
* the state was forced to LISTENER_HAS_END. Still go
|
||||||
* through the motions of ending the touch if the listener has
|
* through the motions of ending the touch if the listener has
|
||||||
* already seen the end. This ensures that the touch record is ended in
|
* already seen the end. This ensures that the touch record is ended in
|
||||||
* the server.
|
* the server.
|
||||||
*/
|
*/
|
||||||
if (ti->listeners[0].state == TOUCH_LISTENER_HAS_END)
|
if (ti->listeners[0].state == LISTENER_HAS_END)
|
||||||
TouchEmitTouchEnd(dev, ti, TOUCH_ACCEPT, ti->listeners[0].listener);
|
TouchEmitTouchEnd(dev, ti, TOUCH_ACCEPT, ti->listeners[0].listener);
|
||||||
|
|
||||||
/* The touch owner has accepted the touch. Send TouchEnd events to
|
/* The touch owner has accepted the touch. Send TouchEnd events to
|
||||||
|
|
@ -1311,10 +1245,10 @@ ProcessTouchOwnershipEvent(TouchOwnershipEvent *ev,
|
||||||
while (ti->num_listeners > 1)
|
while (ti->num_listeners > 1)
|
||||||
TouchRemoveListener(ti, ti->listeners[1].listener);
|
TouchRemoveListener(ti, ti->listeners[1].listener);
|
||||||
/* Owner accepted after receiving end */
|
/* Owner accepted after receiving end */
|
||||||
if (ti->listeners[0].state == TOUCH_LISTENER_HAS_END)
|
if (ti->listeners[0].state == LISTENER_HAS_END)
|
||||||
TouchEndTouch(dev, ti);
|
TouchEndTouch(dev, ti);
|
||||||
else
|
else
|
||||||
ti->listeners[0].state = TOUCH_LISTENER_HAS_ACCEPTED;
|
ti->listeners[0].state = LISTENER_HAS_ACCEPTED;
|
||||||
}
|
}
|
||||||
else { /* this is the very first ownership event for a grab */
|
else { /* this is the very first ownership event for a grab */
|
||||||
DeliverTouchEvents(dev, ti, (InternalEvent *) ev, ev->resource);
|
DeliverTouchEvents(dev, ti, (InternalEvent *) ev, ev->resource);
|
||||||
|
|
@ -1360,8 +1294,9 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
InputClients *iclients = NULL;
|
InputClients *iclients = NULL;
|
||||||
*mask = NULL;
|
*mask = NULL;
|
||||||
|
|
||||||
if (listener->type == TOUCH_LISTENER_GRAB ||
|
if (listener->type == LISTENER_GRAB ||
|
||||||
listener->type == TOUCH_LISTENER_POINTER_GRAB) {
|
listener->type == LISTENER_POINTER_GRAB) {
|
||||||
|
|
||||||
*grab = listener->grab;
|
*grab = listener->grab;
|
||||||
|
|
||||||
BUG_RETURN_VAL(!*grab, FALSE);
|
BUG_RETURN_VAL(!*grab, FALSE);
|
||||||
|
|
@ -1381,12 +1316,11 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
int evtype;
|
int evtype;
|
||||||
|
|
||||||
if (ti->emulate_pointer &&
|
if (ti->emulate_pointer &&
|
||||||
listener->type == TOUCH_LISTENER_POINTER_REGULAR)
|
listener->type == LISTENER_POINTER_REGULAR)
|
||||||
evtype = GetXI2Type(TouchGetPointerEventType(ev));
|
evtype = GetXI2Type(TouchGetPointerEventType(ev));
|
||||||
else
|
else
|
||||||
evtype = GetXI2Type(ev->any.type);
|
evtype = GetXI2Type(ev->any.type);
|
||||||
|
|
||||||
BUG_RETURN_VAL(!wOtherInputMasks(*win), FALSE);
|
|
||||||
nt_list_for_each_entry(iclients,
|
nt_list_for_each_entry(iclients,
|
||||||
wOtherInputMasks(*win)->inputClients, next)
|
wOtherInputMasks(*win)->inputClients, next)
|
||||||
if (xi2mask_isset(iclients->xi2mask, dev, evtype))
|
if (xi2mask_isset(iclients->xi2mask, dev, evtype))
|
||||||
|
|
@ -1401,7 +1335,6 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
int xi_type = GetXIType(TouchGetPointerEventType(ev));
|
int xi_type = GetXIType(TouchGetPointerEventType(ev));
|
||||||
Mask xi_filter = event_get_filter_from_type(dev, xi_type);
|
Mask xi_filter = event_get_filter_from_type(dev, xi_type);
|
||||||
|
|
||||||
BUG_RETURN_VAL(!wOtherInputMasks(*win), FALSE);
|
|
||||||
nt_list_for_each_entry(iclients,
|
nt_list_for_each_entry(iclients,
|
||||||
wOtherInputMasks(*win)->inputClients, next)
|
wOtherInputMasks(*win)->inputClients, next)
|
||||||
if (iclients->mask[dev->id] & xi_filter)
|
if (iclients->mask[dev->id] & xi_filter)
|
||||||
|
|
@ -1442,16 +1375,6 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
int nevents;
|
int nevents;
|
||||||
DeviceIntPtr kbd;
|
DeviceIntPtr kbd;
|
||||||
|
|
||||||
/* There may be a pointer grab on the device */
|
|
||||||
if (!grab) {
|
|
||||||
grab = dev->deviceGrab.grab;
|
|
||||||
if (grab) {
|
|
||||||
win = grab->window;
|
|
||||||
xi2mask = grab->xi2mask;
|
|
||||||
client = rClient(grab);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* We don't deliver pointer events to non-owners */
|
/* We don't deliver pointer events to non-owners */
|
||||||
if (!TouchResourceIsOwner(ti, listener->listener))
|
if (!TouchResourceIsOwner(ti, listener->listener))
|
||||||
return !Success;
|
return !Success;
|
||||||
|
|
@ -1462,12 +1385,6 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
nevents = TouchConvertToPointerEvent(ev, &motion, &button);
|
nevents = TouchConvertToPointerEvent(ev, &motion, &button);
|
||||||
BUG_RETURN_VAL(nevents == 0, BadValue);
|
BUG_RETURN_VAL(nevents == 0, BadValue);
|
||||||
|
|
||||||
/* Note that here we deliver only part of the events that are generated by the touch event:
|
|
||||||
*
|
|
||||||
* TouchBegin results in ButtonPress (motion is handled in DeliverEmulatedMotionEvent)
|
|
||||||
* TouchUpdate results in Motion
|
|
||||||
* TouchEnd results in ButtonRelease (motion is handled in DeliverEmulatedMotionEvent)
|
|
||||||
*/
|
|
||||||
if (nevents > 1)
|
if (nevents > 1)
|
||||||
ptrev = &button;
|
ptrev = &button;
|
||||||
|
|
||||||
|
|
@ -1530,7 +1447,7 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
g = AllocGrab(devgrab);
|
g = AllocGrab(devgrab);
|
||||||
BUG_WARN(!g);
|
BUG_WARN(!g);
|
||||||
|
|
||||||
CopyPartialInternalEvent(dev->deviceGrab.sync.event, ev);
|
*dev->deviceGrab.sync.event = ev->device_event;
|
||||||
|
|
||||||
/* The listener array has a sequence of grabs and then one event
|
/* The listener array has a sequence of grabs and then one event
|
||||||
* selection. Implicit grab activation occurs through delivering an
|
* selection. Implicit grab activation occurs through delivering an
|
||||||
|
|
@ -1539,19 +1456,19 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
l = &ti->listeners[ti->num_listeners - 1];
|
l = &ti->listeners[ti->num_listeners - 1];
|
||||||
l->listener = g->resource;
|
l->listener = g->resource;
|
||||||
l->grab = g;
|
l->grab = g;
|
||||||
//l->resource_type = X11_RESTYPE_NONE;
|
//l->resource_type = RT_NONE;
|
||||||
|
|
||||||
if (devgrab->grabtype != XI2 || devgrab->type != XI_TouchBegin)
|
if (devgrab->grabtype != XI2 || devgrab->type != XI_TouchBegin)
|
||||||
l->type = TOUCH_LISTENER_POINTER_GRAB;
|
l->type = LISTENER_POINTER_GRAB;
|
||||||
else
|
else
|
||||||
l->type = TOUCH_LISTENER_GRAB;
|
l->type = LISTENER_GRAB;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (ev->any.type == ET_TouchBegin)
|
if (ev->any.type == ET_TouchBegin)
|
||||||
listener->state = TOUCH_LISTENER_IS_OWNER;
|
listener->state = LISTENER_IS_OWNER;
|
||||||
else if (ev->any.type == ET_TouchEnd)
|
else if (ev->any.type == ET_TouchEnd)
|
||||||
listener->state = TOUCH_LISTENER_HAS_END;
|
listener->state = LISTENER_HAS_END;
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
@ -1568,8 +1485,8 @@ DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
GrabPtr grab;
|
GrabPtr grab;
|
||||||
XI2Mask *mask;
|
XI2Mask *mask;
|
||||||
|
|
||||||
if (ti->listeners[0].type != TOUCH_LISTENER_POINTER_REGULAR &&
|
if (ti->listeners[0].type != LISTENER_POINTER_REGULAR &&
|
||||||
ti->listeners[0].type != TOUCH_LISTENER_POINTER_GRAB)
|
ti->listeners[0].type != LISTENER_POINTER_GRAB)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
motion = ev->device_event;
|
motion = ev->device_event;
|
||||||
|
|
@ -1581,6 +1498,16 @@ DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
&mask))
|
&mask))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* There may be a pointer grab on the device */
|
||||||
|
if (!grab) {
|
||||||
|
grab = dev->deviceGrab.grab;
|
||||||
|
if (grab) {
|
||||||
|
win = grab->window;
|
||||||
|
mask = grab->xi2mask;
|
||||||
|
client = rClient(grab);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DeliverTouchEmulatedEvent(dev, ti, (InternalEvent*)&motion, &ti->listeners[0], client,
|
DeliverTouchEmulatedEvent(dev, ti, (InternalEvent*)&motion, &ti->listeners[0], client,
|
||||||
win, grab, mask);
|
win, grab, mask);
|
||||||
}
|
}
|
||||||
|
|
@ -1672,8 +1599,7 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
|
||||||
/* if emulate_pointer is set, emulate the motion event right
|
/* if emulate_pointer is set, emulate the motion event right
|
||||||
* here, so we can ignore it for button event emulation. TouchUpdate
|
* here, so we can ignore it for button event emulation. TouchUpdate
|
||||||
* events which _only_ emulate motion just work normally */
|
* events which _only_ emulate motion just work normally */
|
||||||
if (emulate_pointer && (ev->any.type == ET_TouchBegin ||
|
if (emulate_pointer && ev->any.type != ET_TouchUpdate)
|
||||||
(ev->any.type == ET_TouchEnd && ti->num_listeners > 0)))
|
|
||||||
DeliverEmulatedMotionEvent(dev, ti, ev);
|
DeliverEmulatedMotionEvent(dev, ti, ev);
|
||||||
|
|
||||||
if (emulate_pointer && IsMaster(dev))
|
if (emulate_pointer && IsMaster(dev))
|
||||||
|
|
@ -1749,72 +1675,6 @@ ProcessBarrierEvent(InternalEvent *e, DeviceIntPtr dev)
|
||||||
free(ev);
|
free(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL
|
|
||||||
IsAnotherGestureActiveOnMaster(DeviceIntPtr dev, InternalEvent* ev)
|
|
||||||
{
|
|
||||||
GestureClassPtr g = dev->gesture;
|
|
||||||
if (g->gesture.active && g->gesture.sourceid != ev->gesture_event.sourceid) {
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Processes and delivers a Gesture{Pinch,Swipe}{Begin,Update,End}.
|
|
||||||
*
|
|
||||||
* Due to having rather different delivery semantics (see the Xi 2.4 protocol
|
|
||||||
* spec for more information), this implements its own grab and event-selection
|
|
||||||
* delivery logic.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
ProcessGestureEvent(InternalEvent *ev, DeviceIntPtr dev)
|
|
||||||
{
|
|
||||||
GestureInfoPtr gi;
|
|
||||||
DeviceIntPtr kbd;
|
|
||||||
Bool deactivateGestureGrab = FALSE;
|
|
||||||
Bool delivered = FALSE;
|
|
||||||
|
|
||||||
if (!dev->gesture)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (IsMaster(dev) && IsAnotherGestureActiveOnMaster(dev, ev))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (IsGestureBeginEvent(ev))
|
|
||||||
gi = GestureBeginGesture(dev, ev);
|
|
||||||
else
|
|
||||||
gi = GestureFindActiveByEventType(dev, ev->any.type);
|
|
||||||
|
|
||||||
if (!gi) {
|
|
||||||
/* This may happen if gesture is no longer active or was never started. */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
kbd = GetMaster(dev, KEYBOARD_OR_FLOAT);
|
|
||||||
event_set_state_gesture(kbd, &ev->gesture_event);
|
|
||||||
|
|
||||||
if (IsGestureBeginEvent(ev))
|
|
||||||
GestureSetupListener(dev, gi, ev);
|
|
||||||
|
|
||||||
if (IsGestureEndEvent(ev) &&
|
|
||||||
dev->deviceGrab.grab &&
|
|
||||||
dev->deviceGrab.fromPassiveGrab &&
|
|
||||||
GrabIsGestureGrab(dev->deviceGrab.grab))
|
|
||||||
deactivateGestureGrab = TRUE;
|
|
||||||
|
|
||||||
delivered = DeliverGestureEventToOwner(dev, gi, ev);
|
|
||||||
|
|
||||||
if (delivered && !deactivateGestureGrab &&
|
|
||||||
(IsGestureBeginEvent(ev) || IsGestureEndEvent(ev)))
|
|
||||||
FreezeThisEventIfNeededForSyncGrab(dev, ev);
|
|
||||||
|
|
||||||
if (IsGestureEndEvent(ev))
|
|
||||||
GestureEndGesture(gi);
|
|
||||||
|
|
||||||
if (deactivateGestureGrab)
|
|
||||||
(*dev->deviceGrab.DeactivateGrab) (dev);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process DeviceEvents and DeviceChangedEvents.
|
* Process DeviceEvents and DeviceChangedEvents.
|
||||||
*/
|
*/
|
||||||
|
|
@ -1881,7 +1741,7 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
if (EventToCore(ev, &core, &count) == Success && count > 0) {
|
if (EventToCore(ev, &core, &count) == Success && count > 0) {
|
||||||
XaceHookKeyAvail(core, device, 0);
|
XaceHook(XACE_KEY_AVAIL, core, device, 0);
|
||||||
free(core);
|
free(core);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1907,7 +1767,7 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
|
||||||
* nested) to clients. */
|
* nested) to clients. */
|
||||||
if (event->source_type == EVENT_SOURCE_FOCUS)
|
if (event->source_type == EVENT_SOURCE_FOCUS)
|
||||||
return;
|
return;
|
||||||
if (!grab && CheckDeviceGrabs(device, ev, 0))
|
if (!grab && CheckDeviceGrabs(device, event, 0))
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case ET_KeyRelease:
|
case ET_KeyRelease:
|
||||||
|
|
@ -1920,7 +1780,7 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
|
||||||
if (b->map[key] == 0) /* there's no button 0 */
|
if (b->map[key] == 0) /* there's no button 0 */
|
||||||
return;
|
return;
|
||||||
event->detail.button = b->map[key];
|
event->detail.button = b->map[key];
|
||||||
if (!grab && CheckDeviceGrabs(device, ev, 0)) {
|
if (!grab && CheckDeviceGrabs(device, event, 0)) {
|
||||||
/* if a passive grab was activated, the event has been sent
|
/* if a passive grab was activated, the event has been sent
|
||||||
* already */
|
* already */
|
||||||
return;
|
return;
|
||||||
|
|
@ -2009,14 +1869,6 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
|
||||||
case ET_BarrierLeave:
|
case ET_BarrierLeave:
|
||||||
ProcessBarrierEvent(ev, device);
|
ProcessBarrierEvent(ev, device);
|
||||||
break;
|
break;
|
||||||
case ET_GesturePinchBegin:
|
|
||||||
case ET_GesturePinchUpdate:
|
|
||||||
case ET_GesturePinchEnd:
|
|
||||||
case ET_GestureSwipeBegin:
|
|
||||||
case ET_GestureSwipeUpdate:
|
|
||||||
case ET_GestureSwipeEnd:
|
|
||||||
ProcessGestureEvent(ev, device);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
ProcessDeviceEvent(ev, device);
|
ProcessDeviceEvent(ev, device);
|
||||||
break;
|
break;
|
||||||
|
|
@ -2033,14 +1885,14 @@ DeliverTouchBeginEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
int rc = Success;
|
int rc = Success;
|
||||||
Bool has_ownershipmask;
|
Bool has_ownershipmask;
|
||||||
|
|
||||||
if (listener->type == TOUCH_LISTENER_POINTER_REGULAR ||
|
if (listener->type == LISTENER_POINTER_REGULAR ||
|
||||||
listener->type == TOUCH_LISTENER_POINTER_GRAB) {
|
listener->type == LISTENER_POINTER_GRAB) {
|
||||||
rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win,
|
rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win,
|
||||||
grab, xi2mask);
|
grab, xi2mask);
|
||||||
if (rc == Success) {
|
if (rc == Success) {
|
||||||
listener->state = TOUCH_LISTENER_IS_OWNER;
|
listener->state = LISTENER_IS_OWNER;
|
||||||
/* async grabs cannot replay, so automatically accept this touch */
|
/* async grabs cannot replay, so automatically accept this touch */
|
||||||
if (listener->type == TOUCH_LISTENER_POINTER_GRAB &&
|
if (listener->type == LISTENER_POINTER_GRAB &&
|
||||||
dev->deviceGrab.grab &&
|
dev->deviceGrab.grab &&
|
||||||
dev->deviceGrab.fromPassiveGrab &&
|
dev->deviceGrab.fromPassiveGrab &&
|
||||||
dev->deviceGrab.grab->pointerMode == GrabModeAsync)
|
dev->deviceGrab.grab->pointerMode == GrabModeAsync)
|
||||||
|
|
@ -2055,18 +1907,18 @@ DeliverTouchBeginEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
|
rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
|
||||||
if (!TouchResourceIsOwner(ti, listener->listener)) {
|
if (!TouchResourceIsOwner(ti, listener->listener)) {
|
||||||
if (has_ownershipmask)
|
if (has_ownershipmask)
|
||||||
state = TOUCH_LISTENER_AWAITING_OWNER;
|
state = LISTENER_AWAITING_OWNER;
|
||||||
else
|
else
|
||||||
state = TOUCH_LISTENER_AWAITING_BEGIN;
|
state = LISTENER_AWAITING_BEGIN;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (has_ownershipmask)
|
if (has_ownershipmask)
|
||||||
TouchSendOwnershipEvent(dev, ti, 0, listener->listener);
|
TouchSendOwnershipEvent(dev, ti, 0, listener->listener);
|
||||||
|
|
||||||
if (listener->type == TOUCH_LISTENER_REGULAR)
|
if (listener->type == LISTENER_REGULAR)
|
||||||
state = TOUCH_LISTENER_HAS_ACCEPTED;
|
state = LISTENER_HAS_ACCEPTED;
|
||||||
else
|
else
|
||||||
state = TOUCH_LISTENER_IS_OWNER;
|
state = LISTENER_IS_OWNER;
|
||||||
}
|
}
|
||||||
listener->state = state;
|
listener->state = state;
|
||||||
|
|
||||||
|
|
@ -2081,14 +1933,14 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
|
||||||
{
|
{
|
||||||
int rc = Success;
|
int rc = Success;
|
||||||
|
|
||||||
if (listener->type == TOUCH_LISTENER_POINTER_REGULAR ||
|
if (listener->type == LISTENER_POINTER_REGULAR ||
|
||||||
listener->type == TOUCH_LISTENER_POINTER_GRAB) {
|
listener->type == LISTENER_POINTER_GRAB) {
|
||||||
/* Note: If the active grab was ungrabbed, we already changed the
|
/* Note: If the active grab was ungrabbed, we already changed the
|
||||||
* state to TOUCH_LISTENER_HAS_END but still get here. So we mustn't
|
* state to LISTENER_HAS_END but still get here. So we mustn't
|
||||||
* actually send the event.
|
* actually send the event.
|
||||||
* This is part two of the hack in DeactivatePointerGrab
|
* This is part two of the hack in DeactivatePointerGrab
|
||||||
*/
|
*/
|
||||||
if (listener->state != TOUCH_LISTENER_HAS_END) {
|
if (listener->state != LISTENER_HAS_END) {
|
||||||
rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win,
|
rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win,
|
||||||
grab, xi2mask);
|
grab, xi2mask);
|
||||||
|
|
||||||
|
|
@ -2098,14 +1950,14 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
|
||||||
* and we can continue.
|
* and we can continue.
|
||||||
*/
|
*/
|
||||||
if (rc == Success)
|
if (rc == Success)
|
||||||
listener->state = TOUCH_LISTENER_HAS_END;
|
listener->state = LISTENER_HAS_END;
|
||||||
}
|
}
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A client is waiting for the begin, don't give it a TouchEnd */
|
/* A client is waiting for the begin, don't give it a TouchEnd */
|
||||||
if (listener->state == TOUCH_LISTENER_AWAITING_BEGIN) {
|
if (listener->state == LISTENER_AWAITING_BEGIN) {
|
||||||
listener->state = TOUCH_LISTENER_HAS_END;
|
listener->state = LISTENER_HAS_END;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2113,19 +1965,19 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
|
||||||
if (ev->device_event.flags & TOUCH_REJECT ||
|
if (ev->device_event.flags & TOUCH_REJECT ||
|
||||||
(ev->device_event.flags & TOUCH_ACCEPT && !TouchResourceIsOwner(ti, listener->listener))) {
|
(ev->device_event.flags & TOUCH_ACCEPT && !TouchResourceIsOwner(ti, listener->listener))) {
|
||||||
/* Touch has been rejected, or accepted by its owner which is not this listener */
|
/* Touch has been rejected, or accepted by its owner which is not this listener */
|
||||||
if (listener->state != TOUCH_LISTENER_HAS_END)
|
if (listener->state != LISTENER_HAS_END)
|
||||||
rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
|
rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
|
||||||
listener->state = TOUCH_LISTENER_HAS_END;
|
listener->state = LISTENER_HAS_END;
|
||||||
}
|
}
|
||||||
else if (TouchResourceIsOwner(ti, listener->listener)) {
|
else if (TouchResourceIsOwner(ti, listener->listener)) {
|
||||||
Bool normal_end = !(ev->device_event.flags & TOUCH_ACCEPT);
|
Bool normal_end = !(ev->device_event.flags & TOUCH_ACCEPT);
|
||||||
|
|
||||||
/* FIXME: what about early acceptance */
|
/* FIXME: what about early acceptance */
|
||||||
if (normal_end && listener->state != TOUCH_LISTENER_HAS_END)
|
if (normal_end && listener->state != LISTENER_HAS_END)
|
||||||
rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
|
rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
|
||||||
|
|
||||||
if ((ti->num_listeners > 1 ||
|
if ((ti->num_listeners > 1 ||
|
||||||
(ti->num_grabs > 0 && listener->state != TOUCH_LISTENER_HAS_ACCEPTED)) &&
|
(ti->num_grabs > 0 && listener->state != LISTENER_HAS_ACCEPTED)) &&
|
||||||
(ev->device_event.flags & (TOUCH_ACCEPT | TOUCH_REJECT)) == 0) {
|
(ev->device_event.flags & (TOUCH_ACCEPT | TOUCH_REJECT)) == 0) {
|
||||||
ev->any.type = ET_TouchUpdate;
|
ev->any.type = ET_TouchUpdate;
|
||||||
ev->device_event.flags |= TOUCH_PENDING_END;
|
ev->device_event.flags |= TOUCH_PENDING_END;
|
||||||
|
|
@ -2133,7 +1985,7 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (normal_end)
|
if (normal_end)
|
||||||
listener->state = TOUCH_LISTENER_HAS_END;
|
listener->state = LISTENER_HAS_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
|
@ -2156,7 +2008,7 @@ DeliverTouchEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
|
||||||
if (!TouchResourceIsOwner(ti, listener->listener))
|
if (!TouchResourceIsOwner(ti, listener->listener))
|
||||||
goto out;
|
goto out;
|
||||||
rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
|
rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
|
||||||
listener->state = TOUCH_LISTENER_IS_OWNER;
|
listener->state = LISTENER_IS_OWNER;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ev->device_event.deviceid = dev->id;
|
ev->device_event.deviceid = dev->id;
|
||||||
|
|
@ -2166,8 +2018,8 @@ DeliverTouchEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
|
||||||
xi2mask);
|
xi2mask);
|
||||||
}
|
}
|
||||||
else if (ev->any.type == ET_TouchUpdate) {
|
else if (ev->any.type == ET_TouchUpdate) {
|
||||||
if (listener->type == TOUCH_LISTENER_POINTER_REGULAR ||
|
if (listener->type == LISTENER_POINTER_REGULAR ||
|
||||||
listener->type == TOUCH_LISTENER_POINTER_GRAB)
|
listener->type == LISTENER_POINTER_GRAB)
|
||||||
DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win, grab,
|
DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win, grab,
|
||||||
xi2mask);
|
xi2mask);
|
||||||
else if (TouchResourceIsOwner(ti, listener->listener) ||
|
else if (TouchResourceIsOwner(ti, listener->listener) ||
|
||||||
|
|
@ -2221,112 +2073,6 @@ DeliverTouchEvents(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Attempts to deliver a gesture event to the given client.
|
|
||||||
*/
|
|
||||||
static Bool
|
|
||||||
DeliverOneGestureEvent(ClientPtr client, DeviceIntPtr dev, GestureInfoPtr gi,
|
|
||||||
GrabPtr grab, WindowPtr win, InternalEvent *ev)
|
|
||||||
{
|
|
||||||
int err;
|
|
||||||
xEvent *xi2;
|
|
||||||
Mask filter;
|
|
||||||
Window child = DeepestSpriteWin(&gi->sprite)->drawable.id;
|
|
||||||
|
|
||||||
/* If we fail here, we're going to leave a client hanging. */
|
|
||||||
err = EventToXI2(ev, &xi2);
|
|
||||||
if (err != Success)
|
|
||||||
FatalError("[Xi] %s: XI2 conversion failed in %s"
|
|
||||||
" (%d)\n", dev->name, __func__, err);
|
|
||||||
|
|
||||||
FixUpEventFromWindow(&gi->sprite, xi2, win, child, FALSE);
|
|
||||||
filter = GetEventFilter(dev, xi2);
|
|
||||||
if (XaceHookReceiveAccess(client, win, xi2, 1) != Success)
|
|
||||||
return FALSE;
|
|
||||||
err = TryClientEvents(client, dev, xi2, 1, filter, filter, NullGrab);
|
|
||||||
free(xi2);
|
|
||||||
|
|
||||||
/* Returning the value from TryClientEvents isn't useful, since all our
|
|
||||||
* resource-gone cleanups will update the delivery list anyway. */
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Given a gesture event and a potential listener, retrieve info needed for processing the event.
|
|
||||||
*
|
|
||||||
* @param dev The device generating the gesture event.
|
|
||||||
* @param ev The gesture event to process.
|
|
||||||
* @param listener The gesture event listener that may receive the gesture event.
|
|
||||||
* @param[out] client The client that should receive the gesture event.
|
|
||||||
* @param[out] win The window to deliver the event on.
|
|
||||||
* @param[out] grab The grab to deliver the event through, if any.
|
|
||||||
* @return TRUE if an event should be delivered to the listener, FALSE
|
|
||||||
* otherwise.
|
|
||||||
*/
|
|
||||||
static Bool
|
|
||||||
RetrieveGestureDeliveryData(DeviceIntPtr dev, InternalEvent *ev, GestureListener* listener,
|
|
||||||
ClientPtr *client, WindowPtr *win, GrabPtr *grab)
|
|
||||||
{
|
|
||||||
int rc;
|
|
||||||
int evtype;
|
|
||||||
InputClients *iclients = NULL;
|
|
||||||
*grab = NULL;
|
|
||||||
|
|
||||||
if (listener->type == GESTURE_LISTENER_GRAB ||
|
|
||||||
listener->type == GESTURE_LISTENER_NONGESTURE_GRAB) {
|
|
||||||
*grab = listener->grab;
|
|
||||||
|
|
||||||
BUG_RETURN_VAL(!*grab, FALSE);
|
|
||||||
|
|
||||||
*client = rClient(*grab);
|
|
||||||
*win = (*grab)->window;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
rc = dixLookupResourceByType((void **) win, listener->listener, listener->resource_type,
|
|
||||||
serverClient, DixSendAccess);
|
|
||||||
if (rc != Success)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
/* note that we only will have XI2 listeners as
|
|
||||||
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;
|
|
||||||
|
|
||||||
BUG_RETURN_VAL(!iclients, FALSE);
|
|
||||||
|
|
||||||
*client = rClient(iclients);
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Delivers a gesture to the owner, if possible and needed. Returns whether
|
|
||||||
* an event was delivered.
|
|
||||||
*/
|
|
||||||
Bool
|
|
||||||
DeliverGestureEventToOwner(DeviceIntPtr dev, GestureInfoPtr gi, InternalEvent *ev)
|
|
||||||
{
|
|
||||||
GrabPtr grab = NULL;
|
|
||||||
ClientPtr client;
|
|
||||||
WindowPtr win;
|
|
||||||
|
|
||||||
if (!gi->has_listener || gi->listener.type == GESTURE_LISTENER_NONGESTURE_GRAB) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!RetrieveGestureDeliveryData(dev, ev, &gi->listener, &client, &win, &grab))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
ev->gesture_event.deviceid = dev->id;
|
|
||||||
|
|
||||||
return DeliverOneGestureEvent(client, dev, gi, grab, win, ev);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
InitProximityClassDeviceStruct(DeviceIntPtr dev)
|
InitProximityClassDeviceStruct(DeviceIntPtr dev)
|
||||||
{
|
{
|
||||||
|
|
@ -2506,7 +2252,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
|
||||||
cursor = NullCursor;
|
cursor = NullCursor;
|
||||||
else {
|
else {
|
||||||
rc = dixLookupResourceByType((void **) &cursor, param->cursor,
|
rc = dixLookupResourceByType((void **) &cursor, param->cursor,
|
||||||
X11_RESTYPE_CURSOR, client, DixUseAccess);
|
RT_CURSOR, client, DixUseAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
client->errorValue = param->cursor;
|
client->errorValue = param->cursor;
|
||||||
return rc;
|
return rc;
|
||||||
|
|
@ -2516,7 +2262,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
|
||||||
if (param->this_device_mode == GrabModeSync ||
|
if (param->this_device_mode == GrabModeSync ||
|
||||||
param->other_devices_mode == GrabModeSync)
|
param->other_devices_mode == GrabModeSync)
|
||||||
access_mode |= DixFreezeAccess;
|
access_mode |= DixFreezeAccess;
|
||||||
rc = XaceHookDeviceAccess(client, dev, access_mode);
|
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess);
|
rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess);
|
||||||
|
|
@ -2572,7 +2318,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
|
||||||
if (param->this_device_mode == GrabModeSync ||
|
if (param->this_device_mode == GrabModeSync ||
|
||||||
param->other_devices_mode == GrabModeSync)
|
param->other_devices_mode == GrabModeSync)
|
||||||
access_mode |= DixFreezeAccess;
|
access_mode |= DixFreezeAccess;
|
||||||
rc = XaceHookDeviceAccess(client, dev, access_mode);
|
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
|
@ -2605,7 +2351,7 @@ GrabWindow(ClientPtr client, DeviceIntPtr dev, int type,
|
||||||
cursor = NullCursor;
|
cursor = NullCursor;
|
||||||
else {
|
else {
|
||||||
rc = dixLookupResourceByType((void **) &cursor, param->cursor,
|
rc = dixLookupResourceByType((void **) &cursor, param->cursor,
|
||||||
X11_RESTYPE_CURSOR, client, DixUseAccess);
|
RT_CURSOR, client, DixUseAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
client->errorValue = param->cursor;
|
client->errorValue = param->cursor;
|
||||||
return rc;
|
return rc;
|
||||||
|
|
@ -2615,7 +2361,7 @@ GrabWindow(ClientPtr client, DeviceIntPtr dev, int type,
|
||||||
if (param->this_device_mode == GrabModeSync ||
|
if (param->this_device_mode == GrabModeSync ||
|
||||||
param->other_devices_mode == GrabModeSync)
|
param->other_devices_mode == GrabModeSync)
|
||||||
access_mode |= DixFreezeAccess;
|
access_mode |= DixFreezeAccess;
|
||||||
rc = XaceHookDeviceAccess(client, dev, access_mode);
|
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
|
@ -2632,8 +2378,8 @@ GrabWindow(ClientPtr client, DeviceIntPtr dev, int type,
|
||||||
|
|
||||||
/* Touch grab */
|
/* Touch grab */
|
||||||
int
|
int
|
||||||
GrabTouchOrGesture(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr mod_dev,
|
GrabTouch(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr mod_dev,
|
||||||
int type, GrabParameters *param, GrabMask *mask)
|
GrabParameters *param, GrabMask *mask)
|
||||||
{
|
{
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
GrabPtr grab;
|
GrabPtr grab;
|
||||||
|
|
@ -2646,12 +2392,12 @@ GrabTouchOrGesture(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr mod_dev,
|
||||||
rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess);
|
rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
rc = XaceHookDeviceAccess(client, dev, DixGrabAccess);
|
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixGrabAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
grab = CreateGrab(client->index, dev, mod_dev, pWin, XI2,
|
grab = CreateGrab(client->index, dev, mod_dev, pWin, XI2,
|
||||||
mask, param, type, 0, NullWindow, NullCursor);
|
mask, param, XI_TouchBegin, 0, NullWindow, NullCursor);
|
||||||
if (!grab)
|
if (!grab)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
|
|
@ -2693,7 +2439,7 @@ SelectForWindow(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client,
|
||||||
if (i == EMASKSIZE) {
|
if (i == EMASKSIZE) {
|
||||||
RecalculateDeviceDeliverableEvents(pWin);
|
RecalculateDeviceDeliverableEvents(pWin);
|
||||||
if (ShouldFreeInputMasks(pWin, FALSE))
|
if (ShouldFreeInputMasks(pWin, FALSE))
|
||||||
FreeResource(others->resource, X11_RESTYPE_NONE);
|
FreeResource(others->resource, RT_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2781,12 +2527,6 @@ FreeInputMask(OtherInputMasks ** imask)
|
||||||
*imask = NULL;
|
*imask = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define XIPropagateMask (KeyPressMask | \
|
|
||||||
KeyReleaseMask | \
|
|
||||||
ButtonPressMask | \
|
|
||||||
ButtonReleaseMask | \
|
|
||||||
PointerMotionMask)
|
|
||||||
|
|
||||||
void
|
void
|
||||||
RecalculateDeviceDeliverableEvents(WindowPtr pWin)
|
RecalculateDeviceDeliverableEvents(WindowPtr pWin)
|
||||||
{
|
{
|
||||||
|
|
@ -2813,7 +2553,7 @@ RecalculateDeviceDeliverableEvents(WindowPtr pWin)
|
||||||
inputMasks->deliverableEvents[i] |=
|
inputMasks->deliverableEvents[i] |=
|
||||||
(wOtherInputMasks(tmp)->deliverableEvents[i]
|
(wOtherInputMasks(tmp)->deliverableEvents[i]
|
||||||
& ~inputMasks->dontPropagateMask[i] &
|
& ~inputMasks->dontPropagateMask[i] &
|
||||||
XIPropagateMask);
|
PropagateMask[i]);
|
||||||
}
|
}
|
||||||
if (pChild->firstChild) {
|
if (pChild->firstChild) {
|
||||||
pChild = pChild->firstChild;
|
pChild = pChild->firstChild;
|
||||||
|
|
@ -2927,7 +2667,7 @@ SendEvent(ClientPtr client, DeviceIntPtr d, Window dest, Bool propagate,
|
||||||
return Success;
|
return Success;
|
||||||
|
|
||||||
/* If the input focus is PointerRootWin, send the event to where
|
/* If the input focus is PointerRootWin, send the event to where
|
||||||
* the pointer is if possible, then perhaps propagate up to root. */
|
* the pointer is if possible, then perhaps propogate up to root. */
|
||||||
if (inputFocus == PointerRootWin)
|
if (inputFocus == PointerRootWin)
|
||||||
inputFocus = GetCurrentRootWindow(d);
|
inputFocus = GetCurrentRootWindow(d);
|
||||||
|
|
||||||
|
|
@ -2959,7 +2699,7 @@ SendEvent(ClientPtr client, DeviceIntPtr d, Window dest, Bool propagate,
|
||||||
break;
|
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);
|
DeliverEventsToWindow(d, pWin, ev, count, mask, NullGrab);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
@ -3120,7 +2860,7 @@ DeleteWindowFromAnyExtEvents(WindowPtr pWin, Bool freeResources)
|
||||||
ic = inputMasks->inputClients;
|
ic = inputMasks->inputClients;
|
||||||
for (i = 0; i < EMASKSIZE; i++)
|
for (i = 0; i < EMASKSIZE; i++)
|
||||||
inputMasks->dontPropagateMask[i] = 0;
|
inputMasks->dontPropagateMask[i] = 0;
|
||||||
FreeResource(ic->resource, X11_RESTYPE_NONE);
|
FreeResource(ic->resource, RT_NONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3226,7 +2966,7 @@ DeviceEventSuppressForWindow(WindowPtr pWin, ClientPtr client, Mask mask,
|
||||||
{
|
{
|
||||||
struct _OtherInputMasks *inputMasks = wOtherInputMasks(pWin);
|
struct _OtherInputMasks *inputMasks = wOtherInputMasks(pWin);
|
||||||
|
|
||||||
if (mask & ~XIPropagateMask) {
|
if (mask & ~PropagateMask[maskndx]) {
|
||||||
client->errorValue = mask;
|
client->errorValue = mask;
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
|
|
@ -3236,19 +2976,14 @@ DeviceEventSuppressForWindow(WindowPtr pWin, ClientPtr client, Mask mask,
|
||||||
inputMasks->dontPropagateMask[maskndx] = mask;
|
inputMasks->dontPropagateMask[maskndx] = mask;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!inputMasks) {
|
if (!inputMasks)
|
||||||
int ret = AddExtensionClient(pWin, client, 0, 0);
|
AddExtensionClient(pWin, client, 0, 0);
|
||||||
|
inputMasks = wOtherInputMasks(pWin);
|
||||||
if (ret != Success)
|
|
||||||
return ret;
|
|
||||||
inputMasks = wOtherInputMasks(pWin);
|
|
||||||
BUG_RETURN_VAL(!inputMasks, BadAlloc);
|
|
||||||
}
|
|
||||||
inputMasks->dontPropagateMask[maskndx] = mask;
|
inputMasks->dontPropagateMask[maskndx] = mask;
|
||||||
}
|
}
|
||||||
RecalculateDeviceDeliverableEvents(pWin);
|
RecalculateDeviceDeliverableEvents(pWin);
|
||||||
if (inputMasks && ShouldFreeInputMasks(pWin, FALSE))
|
if (ShouldFreeInputMasks(pWin, FALSE))
|
||||||
FreeResource(inputMasks->inputClients->resource, X11_RESTYPE_NONE);
|
FreeResource(inputMasks->inputClients->resource, RT_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3342,7 +3077,6 @@ XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client,
|
||||||
if (len && !others) {
|
if (len && !others) {
|
||||||
if (AddExtensionClient(win, client, 0, 0) != Success)
|
if (AddExtensionClient(win, client, 0, 0) != Success)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
BUG_RETURN_VAL(!wOtherInputMasks(win), BadAlloc);
|
|
||||||
others = wOtherInputMasks(win)->inputClients;
|
others = wOtherInputMasks(win)->inputClients;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ extern int DeviceBusy;
|
||||||
extern int BadClass;
|
extern int BadClass;
|
||||||
|
|
||||||
/* Note: only the ones needed in files other than extinit.c are declared */
|
/* Note: only the ones needed in files other than extinit.c are declared */
|
||||||
|
extern const Mask DevicePointerMotionMask;
|
||||||
extern const Mask DevicePointerMotionHintMask;
|
extern const Mask DevicePointerMotionHintMask;
|
||||||
extern const Mask DeviceFocusChangeMask;
|
extern const Mask DeviceFocusChangeMask;
|
||||||
extern const Mask DeviceStateNotifyMask;
|
extern const Mask DeviceStateNotifyMask;
|
||||||
|
|
@ -55,6 +56,8 @@ extern const Mask DevicePresenceNotifyMask;
|
||||||
extern const Mask DevicePropertyNotifyMask;
|
extern const Mask DevicePropertyNotifyMask;
|
||||||
extern const Mask XIAllMasks;
|
extern const Mask XIAllMasks;
|
||||||
|
|
||||||
|
extern Mask PropagateMask[];
|
||||||
|
|
||||||
extern int DeviceValuator;
|
extern int DeviceValuator;
|
||||||
extern int DeviceKeyPress;
|
extern int DeviceKeyPress;
|
||||||
extern int DeviceKeyRelease;
|
extern int DeviceKeyRelease;
|
||||||
|
|
|
||||||
192
Xi/extinit.c
192
Xi/extinit.c
|
|
@ -51,7 +51,9 @@ SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#define NUMTYPES 15
|
#define NUMTYPES 15
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
#include "gcstruct.h" /* pointer for extnsionst.h */
|
#include "gcstruct.h" /* pointer for extnsionst.h */
|
||||||
|
|
@ -60,17 +62,11 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include <X11/extensions/XI2proto.h>
|
#include <X11/extensions/XI2proto.h>
|
||||||
#include <X11/extensions/geproto.h>
|
#include <X11/extensions/geproto.h>
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
|
||||||
#include "dix/exevents_priv.h"
|
|
||||||
|
|
||||||
#include "inputstr.h"
|
|
||||||
#include "gcstruct.h" /* pointer for extnsionst.h */
|
|
||||||
#include "extnsionst.h" /* extension entry */
|
|
||||||
#include "geext.h" /* extension interfaces for ge */
|
#include "geext.h" /* extension interfaces for ge */
|
||||||
|
|
||||||
#include "dixevents.h"
|
#include "dixevents.h"
|
||||||
#include "extinit_priv.h"
|
#include "exevents.h"
|
||||||
|
#include "extinit.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "swaprep.h"
|
#include "swaprep.h"
|
||||||
#include "privates.h"
|
#include "privates.h"
|
||||||
|
|
@ -133,8 +129,13 @@ SOFTWARE.
|
||||||
* breaks down. The device needs the dev->button->motionMask. If DBMM is
|
* breaks down. The device needs the dev->button->motionMask. If DBMM is
|
||||||
* the same as BMM, we can ensure that both core and device events can be
|
* the same as BMM, we can ensure that both core and device events can be
|
||||||
* delivered, without the need for extra structures in the DeviceIntRec. */
|
* delivered, without the need for extra structures in the DeviceIntRec. */
|
||||||
|
const Mask DeviceKeyPressMask = KeyPressMask;
|
||||||
|
const Mask DeviceKeyReleaseMask = KeyReleaseMask;
|
||||||
|
const Mask DeviceButtonPressMask = ButtonPressMask;
|
||||||
|
const Mask DeviceButtonReleaseMask = ButtonReleaseMask;
|
||||||
const Mask DeviceProximityMask = (1L << 4);
|
const Mask DeviceProximityMask = (1L << 4);
|
||||||
const Mask DeviceStateNotifyMask = (1L << 5);
|
const Mask DeviceStateNotifyMask = (1L << 5);
|
||||||
|
const Mask DevicePointerMotionMask = PointerMotionMask;
|
||||||
const Mask DevicePointerMotionHintMask = PointerMotionHintMask;
|
const Mask DevicePointerMotionHintMask = PointerMotionHintMask;
|
||||||
const Mask DeviceButton1MotionMask = Button1MotionMask;
|
const Mask DeviceButton1MotionMask = Button1MotionMask;
|
||||||
const Mask DeviceButton2MotionMask = Button2MotionMask;
|
const Mask DeviceButton2MotionMask = Button2MotionMask;
|
||||||
|
|
@ -152,6 +153,7 @@ const Mask DevicePropertyNotifyMask = (1L << 19);
|
||||||
const Mask XIAllMasks = (1L << 20) - 1;
|
const Mask XIAllMasks = (1L << 20) - 1;
|
||||||
|
|
||||||
int ExtEventIndex;
|
int ExtEventIndex;
|
||||||
|
Mask ExtExclusiveMasks[EMASKSIZE];
|
||||||
|
|
||||||
static struct dev_type {
|
static struct dev_type {
|
||||||
Atom type;
|
Atom type;
|
||||||
|
|
@ -256,19 +258,19 @@ static int (*ProcIVector[]) (ClientPtr) = {
|
||||||
|
|
||||||
/* For swapped clients */
|
/* For swapped clients */
|
||||||
static int (*SProcIVector[]) (ClientPtr) = {
|
static int (*SProcIVector[]) (ClientPtr) = {
|
||||||
NULL, /* 0 */
|
NULL, /* 0 */
|
||||||
SProcXGetExtensionVersion, /* 1 */
|
SProcXGetExtensionVersion, /* 1 */
|
||||||
ProcXListInputDevices, /* 2 */
|
SProcXListInputDevices, /* 2 */
|
||||||
ProcXOpenDevice, /* 3 */
|
SProcXOpenDevice, /* 3 */
|
||||||
ProcXCloseDevice, /* 4 */
|
SProcXCloseDevice, /* 4 */
|
||||||
ProcXSetDeviceMode, /* 5 */
|
SProcXSetDeviceMode, /* 5 */
|
||||||
SProcXSelectExtensionEvent, /* 6 */
|
SProcXSelectExtensionEvent, /* 6 */
|
||||||
SProcXGetSelectedExtensionEvents, /* 7 */
|
SProcXGetSelectedExtensionEvents, /* 7 */
|
||||||
SProcXChangeDeviceDontPropagateList, /* 8 */
|
SProcXChangeDeviceDontPropagateList, /* 8 */
|
||||||
SProcXGetDeviceDontPropagateList, /* 9 */
|
SProcXGetDeviceDontPropagateList, /* 9 */
|
||||||
SProcXGetDeviceMotionEvents, /* 10 */
|
SProcXGetDeviceMotionEvents, /* 10 */
|
||||||
ProcXChangeKeyboardDevice, /* 11 */
|
SProcXChangeKeyboardDevice, /* 11 */
|
||||||
ProcXChangePointerDevice, /* 12 */
|
SProcXChangePointerDevice, /* 12 */
|
||||||
SProcXGrabDevice, /* 13 */
|
SProcXGrabDevice, /* 13 */
|
||||||
SProcXUngrabDevice, /* 14 */
|
SProcXUngrabDevice, /* 14 */
|
||||||
SProcXGrabDeviceKey, /* 15 */
|
SProcXGrabDeviceKey, /* 15 */
|
||||||
|
|
@ -276,30 +278,30 @@ static int (*SProcIVector[]) (ClientPtr) = {
|
||||||
SProcXGrabDeviceButton, /* 17 */
|
SProcXGrabDeviceButton, /* 17 */
|
||||||
SProcXUngrabDeviceButton, /* 18 */
|
SProcXUngrabDeviceButton, /* 18 */
|
||||||
SProcXAllowDeviceEvents, /* 19 */
|
SProcXAllowDeviceEvents, /* 19 */
|
||||||
ProcXGetDeviceFocus, /* 20 */
|
SProcXGetDeviceFocus, /* 20 */
|
||||||
SProcXSetDeviceFocus, /* 21 */
|
SProcXSetDeviceFocus, /* 21 */
|
||||||
ProcXGetFeedbackControl, /* 22 */
|
SProcXGetFeedbackControl, /* 22 */
|
||||||
SProcXChangeFeedbackControl, /* 23 */
|
SProcXChangeFeedbackControl, /* 23 */
|
||||||
ProcXGetDeviceKeyMapping, /* 24 */
|
SProcXGetDeviceKeyMapping, /* 24 */
|
||||||
SProcXChangeDeviceKeyMapping, /* 25 */
|
SProcXChangeDeviceKeyMapping, /* 25 */
|
||||||
ProcXGetDeviceModifierMapping, /* 26 */
|
SProcXGetDeviceModifierMapping, /* 26 */
|
||||||
ProcXSetDeviceModifierMapping, /* 27 */
|
SProcXSetDeviceModifierMapping, /* 27 */
|
||||||
ProcXGetDeviceButtonMapping, /* 28 */
|
SProcXGetDeviceButtonMapping, /* 28 */
|
||||||
ProcXSetDeviceButtonMapping, /* 29 */
|
SProcXSetDeviceButtonMapping, /* 29 */
|
||||||
ProcXQueryDeviceState, /* 30 */
|
SProcXQueryDeviceState, /* 30 */
|
||||||
SProcXSendExtensionEvent, /* 31 */
|
SProcXSendExtensionEvent, /* 31 */
|
||||||
ProcXDeviceBell, /* 32 */
|
SProcXDeviceBell, /* 32 */
|
||||||
ProcXSetDeviceValuators, /* 33 */
|
SProcXSetDeviceValuators, /* 33 */
|
||||||
SProcXGetDeviceControl, /* 34 */
|
SProcXGetDeviceControl, /* 34 */
|
||||||
SProcXChangeDeviceControl, /* 35 */
|
SProcXChangeDeviceControl, /* 35 */
|
||||||
ProcXListDeviceProperties, /* 36 */
|
SProcXListDeviceProperties, /* 36 */
|
||||||
SProcXChangeDeviceProperty, /* 37 */
|
SProcXChangeDeviceProperty, /* 37 */
|
||||||
SProcXDeleteDeviceProperty, /* 38 */
|
SProcXDeleteDeviceProperty, /* 38 */
|
||||||
SProcXGetDeviceProperty, /* 39 */
|
SProcXGetDeviceProperty, /* 39 */
|
||||||
SProcXIQueryPointer, /* 40 */
|
SProcXIQueryPointer, /* 40 */
|
||||||
SProcXIWarpPointer, /* 41 */
|
SProcXIWarpPointer, /* 41 */
|
||||||
SProcXIChangeCursor, /* 42 */
|
SProcXIChangeCursor, /* 42 */
|
||||||
ProcXIChangeHierarchy, /* 43 */
|
SProcXIChangeHierarchy, /* 43 */
|
||||||
SProcXISetClientPointer, /* 44 */
|
SProcXISetClientPointer, /* 44 */
|
||||||
SProcXIGetClientPointer, /* 45 */
|
SProcXIGetClientPointer, /* 45 */
|
||||||
SProcXISelectEvents, /* 46 */
|
SProcXISelectEvents, /* 46 */
|
||||||
|
|
@ -362,6 +364,8 @@ RESTYPE RT_INPUTCLIENT;
|
||||||
|
|
||||||
extern XExtensionVersion XIVersion;
|
extern XExtensionVersion XIVersion;
|
||||||
|
|
||||||
|
Mask PropagateMask[EMASKSIZE];
|
||||||
|
|
||||||
/*****************************************************************
|
/*****************************************************************
|
||||||
*
|
*
|
||||||
* Versioning support
|
* Versioning support
|
||||||
|
|
@ -516,7 +520,7 @@ static void
|
||||||
SEventDeviceValuator(deviceValuator * from, deviceValuator * to)
|
SEventDeviceValuator(deviceValuator * from, deviceValuator * to)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
INT32 *ip;
|
INT32 *ip B32;
|
||||||
|
|
||||||
*to = *from;
|
*to = *from;
|
||||||
swaps(&to->sequenceNumber);
|
swaps(&to->sequenceNumber);
|
||||||
|
|
@ -540,7 +544,7 @@ static void
|
||||||
SDeviceStateNotifyEvent(deviceStateNotify * from, deviceStateNotify * to)
|
SDeviceStateNotifyEvent(deviceStateNotify * from, deviceStateNotify * to)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
INT32 *ip;
|
INT32 *ip B32;
|
||||||
|
|
||||||
*to = *from;
|
*to = *from;
|
||||||
swaps(&to->sequenceNumber);
|
swaps(&to->sequenceNumber);
|
||||||
|
|
@ -854,74 +858,6 @@ SBarrierEvent(xXIBarrierEvent * from,
|
||||||
swapl(&to->eventid);
|
swapl(&to->eventid);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
SGesturePinchEvent(xXIGesturePinchEvent* from,
|
|
||||||
xXIGesturePinchEvent* to)
|
|
||||||
{
|
|
||||||
*to = *from;
|
|
||||||
|
|
||||||
swaps(&to->sequenceNumber);
|
|
||||||
swapl(&to->length);
|
|
||||||
swaps(&to->evtype);
|
|
||||||
swaps(&to->deviceid);
|
|
||||||
swapl(&to->time);
|
|
||||||
swapl(&to->detail);
|
|
||||||
swapl(&to->root);
|
|
||||||
swapl(&to->event);
|
|
||||||
swapl(&to->child);
|
|
||||||
swapl(&to->root_x);
|
|
||||||
swapl(&to->root_y);
|
|
||||||
swapl(&to->event_x);
|
|
||||||
swapl(&to->event_y);
|
|
||||||
|
|
||||||
swapl(&to->delta_x);
|
|
||||||
swapl(&to->delta_y);
|
|
||||||
swapl(&to->delta_unaccel_x);
|
|
||||||
swapl(&to->delta_unaccel_y);
|
|
||||||
swapl(&to->scale);
|
|
||||||
swapl(&to->delta_angle);
|
|
||||||
swaps(&to->sourceid);
|
|
||||||
|
|
||||||
swapl(&to->mods.base_mods);
|
|
||||||
swapl(&to->mods.latched_mods);
|
|
||||||
swapl(&to->mods.locked_mods);
|
|
||||||
swapl(&to->mods.effective_mods);
|
|
||||||
swapl(&to->flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
SGestureSwipeEvent(xXIGestureSwipeEvent* from,
|
|
||||||
xXIGestureSwipeEvent* to)
|
|
||||||
{
|
|
||||||
*to = *from;
|
|
||||||
|
|
||||||
swaps(&to->sequenceNumber);
|
|
||||||
swapl(&to->length);
|
|
||||||
swaps(&to->evtype);
|
|
||||||
swaps(&to->deviceid);
|
|
||||||
swapl(&to->time);
|
|
||||||
swapl(&to->detail);
|
|
||||||
swapl(&to->root);
|
|
||||||
swapl(&to->event);
|
|
||||||
swapl(&to->child);
|
|
||||||
swapl(&to->root_x);
|
|
||||||
swapl(&to->root_y);
|
|
||||||
swapl(&to->event_x);
|
|
||||||
swapl(&to->event_y);
|
|
||||||
|
|
||||||
swapl(&to->delta_x);
|
|
||||||
swapl(&to->delta_y);
|
|
||||||
swapl(&to->delta_unaccel_x);
|
|
||||||
swapl(&to->delta_unaccel_y);
|
|
||||||
swaps(&to->sourceid);
|
|
||||||
|
|
||||||
swapl(&to->mods.base_mods);
|
|
||||||
swapl(&to->mods.latched_mods);
|
|
||||||
swapl(&to->mods.locked_mods);
|
|
||||||
swapl(&to->mods.effective_mods);
|
|
||||||
swapl(&to->flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Event swapping function for XI2 events. */
|
/** Event swapping function for XI2 events. */
|
||||||
void _X_COLD
|
void _X_COLD
|
||||||
XI2EventSwap(xGenericEvent *from, xGenericEvent *to)
|
XI2EventSwap(xGenericEvent *from, xGenericEvent *to)
|
||||||
|
|
@ -973,24 +909,28 @@ XI2EventSwap(xGenericEvent *from, xGenericEvent *to)
|
||||||
SBarrierEvent((xXIBarrierEvent *) from,
|
SBarrierEvent((xXIBarrierEvent *) from,
|
||||||
(xXIBarrierEvent *) to);
|
(xXIBarrierEvent *) to);
|
||||||
break;
|
break;
|
||||||
case XI_GesturePinchBegin:
|
|
||||||
case XI_GesturePinchUpdate:
|
|
||||||
case XI_GesturePinchEnd:
|
|
||||||
SGesturePinchEvent((xXIGesturePinchEvent*) from,
|
|
||||||
(xXIGesturePinchEvent*) to);
|
|
||||||
break;
|
|
||||||
case XI_GestureSwipeBegin:
|
|
||||||
case XI_GestureSwipeUpdate:
|
|
||||||
case XI_GestureSwipeEnd:
|
|
||||||
SGestureSwipeEvent((xXIGestureSwipeEvent*) from,
|
|
||||||
(xXIGestureSwipeEvent*) to);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
ErrorF("[Xi] Unknown event type to swap. This is a bug.\n");
|
ErrorF("[Xi] Unknown event type to swap. This is a bug.\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* Allow the specified event to have its propagation suppressed.
|
||||||
|
* The default is to not allow suppression of propagation.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
static void
|
||||||
|
AllowPropagateSuppress(Mask mask)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < MAXDEVICES; i++)
|
||||||
|
PropagateMask[i] |= mask;
|
||||||
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* Record an event mask where there is no unique corresponding event type.
|
* Record an event mask where there is no unique corresponding event type.
|
||||||
|
|
@ -1011,6 +951,23 @@ SetEventInfo(Mask mask, int constant)
|
||||||
EventInfo[ExtEventIndex++].type = constant;
|
EventInfo[ExtEventIndex++].type = constant;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* Allow the specified event to be restricted to being selected by one
|
||||||
|
* client at a time.
|
||||||
|
* The default is to allow more than one client to select the event.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
static void
|
||||||
|
SetExclusiveAccess(Mask mask)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < MAXDEVICES; i++)
|
||||||
|
ExtExclusiveMasks[i] |= mask;
|
||||||
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* Assign the specified mask to the specified event.
|
* Assign the specified mask to the specified event.
|
||||||
|
|
@ -1072,16 +1029,20 @@ FixExtensionEvents(ExtensionEntry * extEntry)
|
||||||
DeviceBusy += extEntry->errorBase;
|
DeviceBusy += extEntry->errorBase;
|
||||||
BadClass += extEntry->errorBase;
|
BadClass += extEntry->errorBase;
|
||||||
|
|
||||||
SetMaskForExtEvent(KeyPressMask, DeviceKeyPress);
|
SetMaskForExtEvent(DeviceKeyPressMask, DeviceKeyPress);
|
||||||
|
AllowPropagateSuppress(DeviceKeyPressMask);
|
||||||
SetCriticalEvent(DeviceKeyPress);
|
SetCriticalEvent(DeviceKeyPress);
|
||||||
|
|
||||||
SetMaskForExtEvent(KeyReleaseMask, DeviceKeyRelease);
|
SetMaskForExtEvent(DeviceKeyReleaseMask, DeviceKeyRelease);
|
||||||
|
AllowPropagateSuppress(DeviceKeyReleaseMask);
|
||||||
SetCriticalEvent(DeviceKeyRelease);
|
SetCriticalEvent(DeviceKeyRelease);
|
||||||
|
|
||||||
SetMaskForExtEvent(ButtonPressMask, DeviceButtonPress);
|
SetMaskForExtEvent(DeviceButtonPressMask, DeviceButtonPress);
|
||||||
|
AllowPropagateSuppress(DeviceButtonPressMask);
|
||||||
SetCriticalEvent(DeviceButtonPress);
|
SetCriticalEvent(DeviceButtonPress);
|
||||||
|
|
||||||
SetMaskForExtEvent(ButtonReleaseMask, DeviceButtonRelease);
|
SetMaskForExtEvent(DeviceButtonReleaseMask, DeviceButtonRelease);
|
||||||
|
AllowPropagateSuppress(DeviceButtonReleaseMask);
|
||||||
SetCriticalEvent(DeviceButtonRelease);
|
SetCriticalEvent(DeviceButtonRelease);
|
||||||
|
|
||||||
SetMaskForExtEvent(DeviceProximityMask, ProximityIn);
|
SetMaskForExtEvent(DeviceProximityMask, ProximityIn);
|
||||||
|
|
@ -1089,7 +1050,8 @@ FixExtensionEvents(ExtensionEntry * extEntry)
|
||||||
|
|
||||||
SetMaskForExtEvent(DeviceStateNotifyMask, DeviceStateNotify);
|
SetMaskForExtEvent(DeviceStateNotifyMask, DeviceStateNotify);
|
||||||
|
|
||||||
SetMaskForExtEvent(PointerMotionMask, DeviceMotionNotify);
|
SetMaskForExtEvent(DevicePointerMotionMask, DeviceMotionNotify);
|
||||||
|
AllowPropagateSuppress(DevicePointerMotionMask);
|
||||||
SetCriticalEvent(DeviceMotionNotify);
|
SetCriticalEvent(DeviceMotionNotify);
|
||||||
|
|
||||||
SetEventInfo(DevicePointerMotionHintMask, _devicePointerMotionHint);
|
SetEventInfo(DevicePointerMotionHintMask, _devicePointerMotionHint);
|
||||||
|
|
@ -1107,6 +1069,8 @@ FixExtensionEvents(ExtensionEntry * extEntry)
|
||||||
SetMaskForExtEvent(ChangeDeviceNotifyMask, ChangeDeviceNotify);
|
SetMaskForExtEvent(ChangeDeviceNotifyMask, ChangeDeviceNotify);
|
||||||
|
|
||||||
SetEventInfo(DeviceButtonGrabMask, _deviceButtonGrab);
|
SetEventInfo(DeviceButtonGrabMask, _deviceButtonGrab);
|
||||||
|
SetExclusiveAccess(DeviceButtonGrabMask);
|
||||||
|
|
||||||
SetEventInfo(DeviceOwnerGrabButtonMask, _deviceOwnerGrabButton);
|
SetEventInfo(DeviceOwnerGrabButtonMask, _deviceOwnerGrabButton);
|
||||||
SetEventInfo(DevicePresenceNotifyMask, _devicePresence);
|
SetEventInfo(DevicePresenceNotifyMask, _devicePresence);
|
||||||
SetMaskForExtEvent(DevicePropertyNotifyMask, DevicePropertyNotify);
|
SetMaskForExtEvent(DevicePropertyNotifyMask, DevicePropertyNotify);
|
||||||
|
|
|
||||||
16
Xi/getbmap.c
16
Xi/getbmap.c
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
|
|
@ -59,6 +61,20 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "getbmap.h"
|
#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.
|
* 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
|
#ifndef GETBMAP_H
|
||||||
#define GETBMAP_H 1
|
#define GETBMAP_H 1
|
||||||
|
|
||||||
|
int SProcXGetDeviceButtonMapping(ClientPtr /* client */
|
||||||
|
);
|
||||||
|
|
||||||
int ProcXGetDeviceButtonMapping(ClientPtr /* client */
|
int ProcXGetDeviceButtonMapping(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
|
|
@ -70,6 +72,7 @@ int _X_COLD
|
||||||
SProcXGetDeviceControl(ClientPtr client)
|
SProcXGetDeviceControl(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xGetDeviceControlReq);
|
REQUEST(xGetDeviceControlReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
|
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
|
||||||
swaps(&stuff->control);
|
swaps(&stuff->control);
|
||||||
return (ProcXGetDeviceControl(client));
|
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>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
|
|
@ -59,6 +61,21 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "getfctl.h"
|
#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.
|
* 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->pitch = k->ctrl.bell_pitch;
|
||||||
k2->duration = k->ctrl.bell_duration;
|
k2->duration = k->ctrl.bell_duration;
|
||||||
k2->led_mask = k->ctrl.leds;
|
k2->led_mask = k->ctrl.leds;
|
||||||
k2->led_values = k->ctrl.leds;
|
|
||||||
k2->global_auto_repeat = k->ctrl.autoRepeat;
|
k2->global_auto_repeat = k->ctrl.autoRepeat;
|
||||||
for (i = 0; i < 32; i++)
|
for (i = 0; i < 32; i++)
|
||||||
k2->auto_repeats[i] = k->ctrl.autoRepeats[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
|
#ifndef GETFCTL_H
|
||||||
#define GETFCTL_H 1
|
#define GETFCTL_H 1
|
||||||
|
|
||||||
|
int SProcXGetFeedbackControl(ClientPtr /* client */
|
||||||
|
);
|
||||||
|
|
||||||
int ProcXGetFeedbackControl(ClientPtr /* client */
|
int ProcXGetFeedbackControl(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "windowstr.h" /* focus struct */
|
#include "windowstr.h" /* focus struct */
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
|
|
@ -60,6 +62,20 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "getfocus.h"
|
#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.
|
* 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
|
#ifndef GETFOCUS_H
|
||||||
#define GETFOCUS_H 1
|
#define GETFOCUS_H 1
|
||||||
|
|
||||||
|
int SProcXGetDeviceFocus(ClientPtr /* client */
|
||||||
|
);
|
||||||
|
|
||||||
int ProcXGetDeviceFocus(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>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
|
|
@ -62,6 +64,21 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "getkmap.h"
|
#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.
|
* Get the device key mapping.
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef GETKMAP_H
|
#ifndef GETKMAP_H
|
||||||
#define GETKMAP_H 1
|
#define GETKMAP_H 1
|
||||||
|
|
||||||
|
int SProcXGetDeviceKeyMapping(ClientPtr /* client */
|
||||||
|
);
|
||||||
|
|
||||||
int ProcXGetDeviceKeyMapping(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>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
|
|
@ -59,6 +61,21 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "getmmap.h"
|
#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.
|
* Get the device Modifier mapping.
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef GETMMAP_H
|
#ifndef GETMMAP_H
|
||||||
#define GETMMAP_H 1
|
#define GETMMAP_H 1
|
||||||
|
|
||||||
|
int SProcXGetDeviceModifierMapping(ClientPtr /* client */
|
||||||
|
);
|
||||||
|
|
||||||
int ProcXGetDeviceModifierMapping(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 <dix-config.h>
|
||||||
|
#endif
|
||||||
#include <X11/extensions/XI.h>
|
|
||||||
#include <X11/extensions/XIproto.h>
|
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structs */
|
#include "windowstr.h" /* window structs */
|
||||||
|
#include <X11/extensions/XI.h>
|
||||||
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "swaprep.h"
|
#include "swaprep.h"
|
||||||
|
|
||||||
#include "getprop.h"
|
#include "getprop.h"
|
||||||
|
|
||||||
extern XExtEventInfo EventInfo[];
|
extern XExtEventInfo EventInfo[];
|
||||||
|
|
@ -76,6 +76,7 @@ int _X_COLD
|
||||||
SProcXGetDeviceDontPropagateList(ClientPtr client)
|
SProcXGetDeviceDontPropagateList(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xGetDeviceDontPropagateListReq);
|
REQUEST(xGetDeviceDontPropagateListReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
|
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
return (ProcXGetDeviceDontPropagateList(client));
|
return (ProcXGetDeviceDontPropagateList(client));
|
||||||
|
|
@ -118,8 +119,6 @@ ProcXGetDeviceDontPropagateList(ClientPtr client)
|
||||||
if (count) {
|
if (count) {
|
||||||
rep.count = count;
|
rep.count = count;
|
||||||
buf = xallocarray(rep.count, sizeof(XEventClass));
|
buf = xallocarray(rep.count, sizeof(XEventClass));
|
||||||
if (buf == NULL)
|
|
||||||
return BadAlloc;
|
|
||||||
rep.length = bytes_to_int32(rep.count * sizeof(XEventClass));
|
rep.length = bytes_to_int32(rep.count * sizeof(XEventClass));
|
||||||
|
|
||||||
tbuf = buf;
|
tbuf = buf;
|
||||||
|
|
|
||||||
|
|
@ -50,17 +50,17 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window struct */
|
#include "windowstr.h" /* window struct */
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "swaprep.h"
|
#include "swaprep.h"
|
||||||
|
|
||||||
#include "getprop.h"
|
#include "getprop.h"
|
||||||
#include "getselev.h"
|
#include "getselev.h"
|
||||||
|
|
||||||
|
|
@ -74,6 +74,7 @@ int _X_COLD
|
||||||
SProcXGetSelectedExtensionEvents(ClientPtr client)
|
SProcXGetSelectedExtensionEvents(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xGetSelectedExtensionEventsReq);
|
REQUEST(xGetSelectedExtensionEventsReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
|
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
return (ProcXGetSelectedExtensionEvents(client));
|
return (ProcXGetSelectedExtensionEvents(client));
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
|
|
@ -72,6 +74,7 @@ int _X_COLD
|
||||||
SProcXGetExtensionVersion(ClientPtr client)
|
SProcXGetExtensionVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xGetExtensionVersionReq);
|
REQUEST(xGetExtensionVersionReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
|
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
|
||||||
swaps(&stuff->nbytes);
|
swaps(&stuff->nbytes);
|
||||||
return (ProcXGetExtensionVersion(client));
|
return (ProcXGetExtensionVersion(client));
|
||||||
|
|
@ -91,7 +94,7 @@ ProcXGetExtensionVersion(ClientPtr client)
|
||||||
REQUEST(xGetExtensionVersionReq);
|
REQUEST(xGetExtensionVersionReq);
|
||||||
REQUEST_AT_LEAST_SIZE(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))
|
stuff->nbytes))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
|
|
|
||||||
10
Xi/grabdev.c
10
Xi/grabdev.c
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
|
|
@ -74,13 +76,13 @@ int _X_COLD
|
||||||
SProcXGrabDevice(ClientPtr client)
|
SProcXGrabDevice(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xGrabDeviceReq);
|
REQUEST(xGrabDeviceReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
|
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
|
||||||
|
|
||||||
swapl(&stuff->grabWindow);
|
swapl(&stuff->grabWindow);
|
||||||
swapl(&stuff->time);
|
swapl(&stuff->time);
|
||||||
swaps(&stuff->event_count);
|
swaps(&stuff->event_count);
|
||||||
|
|
||||||
if (client->req_len !=
|
if (stuff->length !=
|
||||||
bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
|
bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
|
|
@ -107,7 +109,7 @@ ProcXGrabDevice(ClientPtr client)
|
||||||
REQUEST(xGrabDeviceReq);
|
REQUEST(xGrabDeviceReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
|
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
|
||||||
|
|
||||||
if (client->req_len !=
|
if (stuff->length !=
|
||||||
bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
|
bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
|
|
@ -151,7 +153,7 @@ ProcXGrabDevice(ClientPtr client)
|
||||||
* set when XI starts up) and binary OR's the device's mask to whatever the
|
* set when XI starts up) and binary OR's the device's mask to whatever the
|
||||||
* event mask for the given event type was.
|
* event mask for the given event type was.
|
||||||
* If an error occurs, it is sent to the client. Errors are generated if
|
* If an error occurs, it is sent to the client. Errors are generated if
|
||||||
* - if the device given in the event class is invalid
|
* - if the device given in the event classs is invalid
|
||||||
* - if the device in the class list is not the device given as parameter (no
|
* - if the device in the class list is not the device given as parameter (no
|
||||||
* error if parameter is NULL)
|
* error if parameter is NULL)
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -50,17 +50,18 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
#include <X11/extensions/XI.h>
|
|
||||||
#include <X11/extensions/XIproto.h>
|
|
||||||
|
|
||||||
#include "dix/exevents_priv.h"
|
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
|
#include <X11/extensions/XI.h>
|
||||||
|
#include <X11/extensions/XIproto.h>
|
||||||
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "xace.h"
|
#include "xace.h"
|
||||||
|
|
||||||
#include "grabdev.h"
|
#include "grabdev.h"
|
||||||
#include "grabdevb.h"
|
#include "grabdevb.h"
|
||||||
|
|
||||||
|
|
@ -74,6 +75,7 @@ int _X_COLD
|
||||||
SProcXGrabDeviceButton(ClientPtr client)
|
SProcXGrabDeviceButton(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xGrabDeviceButtonReq);
|
REQUEST(xGrabDeviceButtonReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
|
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
|
||||||
swapl(&stuff->grabWindow);
|
swapl(&stuff->grabWindow);
|
||||||
swaps(&stuff->modifiers);
|
swaps(&stuff->modifiers);
|
||||||
|
|
@ -105,7 +107,7 @@ ProcXGrabDeviceButton(ClientPtr client)
|
||||||
REQUEST(xGrabDeviceButtonReq);
|
REQUEST(xGrabDeviceButtonReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
|
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
|
||||||
|
|
||||||
if (client->req_len !=
|
if (stuff->length !=
|
||||||
bytes_to_int32(sizeof(xGrabDeviceButtonReq)) + stuff->event_count)
|
bytes_to_int32(sizeof(xGrabDeviceButtonReq)) + stuff->event_count)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
|
|
@ -123,7 +125,7 @@ ProcXGrabDeviceButton(ClientPtr client)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mdev = PickKeyboard(client);
|
mdev = PickKeyboard(client);
|
||||||
ret = XaceHookDeviceAccess(client, mdev, DixUseAccess);
|
ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixUseAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,17 +50,18 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
#include <X11/extensions/XI.h>
|
|
||||||
#include <X11/extensions/XIproto.h>
|
|
||||||
|
|
||||||
#include "dix/exevents_priv.h"
|
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
|
#include <X11/extensions/XI.h>
|
||||||
|
#include <X11/extensions/XIproto.h>
|
||||||
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "xace.h"
|
#include "xace.h"
|
||||||
|
|
||||||
#include "grabdev.h"
|
#include "grabdev.h"
|
||||||
#include "grabdevk.h"
|
#include "grabdevk.h"
|
||||||
|
|
||||||
|
|
@ -74,6 +75,7 @@ int _X_COLD
|
||||||
SProcXGrabDeviceKey(ClientPtr client)
|
SProcXGrabDeviceKey(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xGrabDeviceKeyReq);
|
REQUEST(xGrabDeviceKeyReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
|
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
|
||||||
swapl(&stuff->grabWindow);
|
swapl(&stuff->grabWindow);
|
||||||
swaps(&stuff->modifiers);
|
swaps(&stuff->modifiers);
|
||||||
|
|
@ -103,7 +105,7 @@ ProcXGrabDeviceKey(ClientPtr client)
|
||||||
REQUEST(xGrabDeviceKeyReq);
|
REQUEST(xGrabDeviceKeyReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
|
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
|
||||||
|
|
||||||
if (client->req_len !=
|
if (stuff->length !=
|
||||||
bytes_to_int32(sizeof(xGrabDeviceKeyReq)) + stuff->event_count)
|
bytes_to_int32(sizeof(xGrabDeviceKeyReq)) + stuff->event_count)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
|
|
@ -121,7 +123,7 @@ ProcXGrabDeviceKey(ClientPtr client)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mdev = PickKeyboard(client);
|
mdev = PickKeyboard(client);
|
||||||
ret = XaceHookDeviceAccess(client, mdev, DixUseAccess);
|
ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixUseAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,15 +50,16 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
#include <X11/extensions/XI.h>
|
|
||||||
#include <X11/extensions/XIproto.h>
|
|
||||||
|
|
||||||
#include "dix/exevents_priv.h"
|
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
|
#include <X11/extensions/XI.h>
|
||||||
|
#include <X11/extensions/XIproto.h>
|
||||||
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "gtmotion.h"
|
#include "gtmotion.h"
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
@ -71,6 +72,7 @@ int _X_COLD
|
||||||
SProcXGetDeviceMotionEvents(ClientPtr client)
|
SProcXGetDeviceMotionEvents(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xGetDeviceMotionEventsReq);
|
REQUEST(xGetDeviceMotionEventsReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
|
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
|
||||||
swapl(&stuff->start);
|
swapl(&stuff->start);
|
||||||
swapl(&stuff->stop);
|
swapl(&stuff->stop);
|
||||||
|
|
|
||||||
30
Xi/listdev.c
30
Xi/listdev.c
|
|
@ -50,24 +50,38 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <X11/X.h> /* for inputstr.h */
|
#include <X11/X.h> /* for inputstr.h */
|
||||||
#include <X11/Xproto.h> /* Request macro */
|
#include <X11/Xproto.h> /* Request macro */
|
||||||
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "dix/input_priv.h"
|
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "xace.h"
|
#include "xace.h"
|
||||||
#include "xkbsrv.h"
|
#include "xkbsrv.h"
|
||||||
#include "xkbstr.h"
|
#include "xkbstr.h"
|
||||||
|
|
||||||
#include "listdev.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
|
* 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 */
|
/* don't send master devices other than VCP/VCK */
|
||||||
if (!IsMaster(d) || d == inputInfo.pointer ||d == inputInfo.keyboard) {
|
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)
|
if (rc == Success)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
@ -336,7 +350,7 @@ ProcXListInputDevices(ClientPtr client)
|
||||||
};
|
};
|
||||||
|
|
||||||
/* allocate space for saving skip value */
|
/* allocate space for saving skip value */
|
||||||
skip = calloc(inputInfo.numDevices, sizeof(Bool));
|
skip = calloc(sizeof(Bool), inputInfo.numDevices);
|
||||||
if (!skip)
|
if (!skip)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
|
|
@ -363,10 +377,6 @@ ProcXListInputDevices(ClientPtr client)
|
||||||
/* allocate space for reply */
|
/* allocate space for reply */
|
||||||
total_length = numdevs * sizeof(xDeviceInfo) + size + namesize;
|
total_length = numdevs * sizeof(xDeviceInfo) + size + namesize;
|
||||||
devbuf = (char *) calloc(1, total_length);
|
devbuf = (char *) calloc(1, total_length);
|
||||||
if (!devbuf) {
|
|
||||||
free(skip);
|
|
||||||
return BadAlloc;
|
|
||||||
}
|
|
||||||
classbuf = devbuf + (numdevs * sizeof(xDeviceInfo));
|
classbuf = devbuf + (numdevs * sizeof(xDeviceInfo));
|
||||||
namebuf = classbuf + size;
|
namebuf = classbuf + size;
|
||||||
savbuf = devbuf;
|
savbuf = devbuf;
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
#define VPC 20 /* Max # valuators per chunk */
|
#define VPC 20 /* Max # valuators per chunk */
|
||||||
|
|
||||||
|
int SProcXListInputDevices(ClientPtr /* client */
|
||||||
|
);
|
||||||
|
|
||||||
int ProcXListInputDevices(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>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
|
|
@ -64,6 +66,21 @@ SOFTWARE.
|
||||||
|
|
||||||
extern CARD8 event_base[];
|
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.
|
* 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
|
#ifndef OPENDEV_H
|
||||||
#define OPENDEV_H 1
|
#define OPENDEV_H 1
|
||||||
|
|
||||||
|
int SProcXOpenDevice(ClientPtr /* client */
|
||||||
|
);
|
||||||
|
|
||||||
int ProcXOpenDevice(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 <dix-config.h>
|
||||||
|
#endif
|
||||||
#include <X11/extensions/XI.h>
|
|
||||||
#include <X11/extensions/XIproto.h>
|
|
||||||
|
|
||||||
#include "dix/exevents_priv.h"
|
|
||||||
#include "dix/input_priv.h"
|
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
|
#include <X11/extensions/XI.h>
|
||||||
|
#include <X11/extensions/XIproto.h>
|
||||||
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "xkbsrv.h"
|
#include "xkbsrv.h"
|
||||||
#include "xkbstr.h"
|
#include "xkbstr.h"
|
||||||
|
|
||||||
#include "queryst.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.
|
* 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
|
#ifndef QUERYST_H
|
||||||
#define QUERYST_H 1
|
#define QUERYST_H 1
|
||||||
|
|
||||||
|
int SProcXQueryDeviceState(ClientPtr /* client */
|
||||||
|
);
|
||||||
|
|
||||||
int ProcXQueryDeviceState(ClientPtr /* client */
|
int ProcXQueryDeviceState(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,21 +50,23 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
#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"
|
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structure */
|
#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 "exglobals.h"
|
||||||
|
|
||||||
#include "grabdev.h"
|
#include "grabdev.h"
|
||||||
#include "selectev.h"
|
#include "selectev.h"
|
||||||
|
|
||||||
|
extern Mask ExtExclusiveMasks[];
|
||||||
|
|
||||||
static int
|
static int
|
||||||
HandleDevicePresenceMask(ClientPtr client, WindowPtr win,
|
HandleDevicePresenceMask(ClientPtr client, WindowPtr win,
|
||||||
XEventClass * cls, CARD16 *count)
|
XEventClass * cls, CARD16 *count)
|
||||||
|
|
@ -121,6 +123,7 @@ int _X_COLD
|
||||||
SProcXSelectExtensionEvent(ClientPtr client)
|
SProcXSelectExtensionEvent(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSelectExtensionEventReq);
|
REQUEST(xSelectExtensionEventReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
|
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
swaps(&stuff->count);
|
swaps(&stuff->count);
|
||||||
|
|
@ -147,7 +150,7 @@ ProcXSelectExtensionEvent(ClientPtr client)
|
||||||
REQUEST(xSelectExtensionEventReq);
|
REQUEST(xSelectExtensionEventReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
|
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
|
||||||
|
|
||||||
if (client->req_len !=
|
if (stuff->length !=
|
||||||
bytes_to_int32(sizeof(xSelectExtensionEventReq)) + stuff->count)
|
bytes_to_int32(sizeof(xSelectExtensionEventReq)) + stuff->count)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
|
|
@ -172,7 +175,7 @@ ProcXSelectExtensionEvent(ClientPtr client)
|
||||||
}
|
}
|
||||||
if ((ret =
|
if ((ret =
|
||||||
SelectForWindow((DeviceIntPtr) tmp[i].dev, pWin, client,
|
SelectForWindow((DeviceIntPtr) tmp[i].dev, pWin, client,
|
||||||
tmp[i].mask, DeviceButtonGrabMask)) != Success)
|
tmp[i].mask, ExtExclusiveMasks[i])) != Success)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,17 +50,18 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
#include <X11/extensions/XI.h>
|
|
||||||
#include <X11/extensions/XIproto.h>
|
|
||||||
|
|
||||||
#include "dix/exevents_priv.h"
|
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* Window */
|
#include "windowstr.h" /* Window */
|
||||||
#include "extnsionst.h" /* EventSwapPtr */
|
#include "extnsionst.h" /* EventSwapPtr */
|
||||||
|
#include <X11/extensions/XI.h>
|
||||||
|
#include <X11/extensions/XIproto.h>
|
||||||
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "grabdev.h"
|
#include "grabdev.h"
|
||||||
#include "sendexev.h"
|
#include "sendexev.h"
|
||||||
|
|
||||||
|
|
@ -82,11 +83,12 @@ SProcXSendExtensionEvent(ClientPtr client)
|
||||||
EventSwapPtr proc;
|
EventSwapPtr proc;
|
||||||
|
|
||||||
REQUEST(xSendExtensionEventReq);
|
REQUEST(xSendExtensionEventReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
|
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
|
||||||
swapl(&stuff->destination);
|
swapl(&stuff->destination);
|
||||||
swaps(&stuff->count);
|
swaps(&stuff->count);
|
||||||
|
|
||||||
if (client->req_len !=
|
if (stuff->length !=
|
||||||
bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
|
bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
|
||||||
bytes_to_int32(stuff->num_events * sizeof(xEvent)))
|
bytes_to_int32(stuff->num_events * sizeof(xEvent)))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
@ -132,7 +134,7 @@ ProcXSendExtensionEvent(ClientPtr client)
|
||||||
REQUEST(xSendExtensionEventReq);
|
REQUEST(xSendExtensionEventReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
|
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
|
||||||
|
|
||||||
if (client->req_len !=
|
if (stuff->length !=
|
||||||
bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
|
bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
|
||||||
(stuff->num_events * bytes_to_int32(sizeof(xEvent))))
|
(stuff->num_events * bytes_to_int32(sizeof(xEvent))))
|
||||||
return BadLength;
|
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 <dix-config.h>
|
||||||
|
#endif
|
||||||
#include <X11/extensions/XI.h>
|
|
||||||
#include <X11/extensions/XIproto.h>
|
|
||||||
|
|
||||||
#include "dix/input_priv.h"
|
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
|
#include <X11/extensions/XI.h>
|
||||||
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "setbmap.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.
|
* This procedure lists the input devices available to the server.
|
||||||
|
|
@ -78,7 +92,7 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
|
||||||
REQUEST(xSetDeviceButtonMappingReq);
|
REQUEST(xSetDeviceButtonMappingReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xSetDeviceButtonMappingReq);
|
REQUEST_AT_LEAST_SIZE(xSetDeviceButtonMappingReq);
|
||||||
|
|
||||||
if (client->req_len !=
|
if (stuff->length !=
|
||||||
bytes_to_int32(sizeof(xSetDeviceButtonMappingReq) + stuff->map_length))
|
bytes_to_int32(sizeof(xSetDeviceButtonMappingReq) + stuff->map_length))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef SETBMAP_H
|
#ifndef SETBMAP_H
|
||||||
#define SETBMAP_H 1
|
#define SETBMAP_H 1
|
||||||
|
|
||||||
|
int SProcXSetDeviceButtonMapping(ClientPtr /* client */
|
||||||
|
);
|
||||||
|
|
||||||
int ProcXSetDeviceButtonMapping(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 <dix-config.h>
|
||||||
|
#endif
|
||||||
#include <X11/extensions/XI.h>
|
|
||||||
#include <X11/extensions/XIproto.h>
|
|
||||||
|
|
||||||
#include "dix/input_priv.h"
|
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
|
#include <X11/extensions/XI.h>
|
||||||
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "setdval.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.
|
* This procedure sets the value of valuators on an extension input device.
|
||||||
|
|
@ -86,7 +100,7 @@ ProcXSetDeviceValuators(ClientPtr client)
|
||||||
.status = Success
|
.status = Success
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->req_len != bytes_to_int32(sizeof(xSetDeviceValuatorsReq)) +
|
if (stuff->length != bytes_to_int32(sizeof(xSetDeviceValuatorsReq)) +
|
||||||
stuff->num_valuators)
|
stuff->num_valuators)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef SETDVAL_H
|
#ifndef SETDVAL_H
|
||||||
#define SETDVAL_H 1
|
#define SETDVAL_H 1
|
||||||
|
|
||||||
|
int SProcXSetDeviceValuators(ClientPtr /* client */
|
||||||
|
);
|
||||||
|
|
||||||
int ProcXSetDeviceValuators(ClientPtr /* client */
|
int ProcXSetDeviceValuators(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,9 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "windowstr.h" /* focus struct */
|
#include "windowstr.h" /* focus struct */
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
|
|
@ -73,6 +75,7 @@ int _X_COLD
|
||||||
SProcXSetDeviceFocus(ClientPtr client)
|
SProcXSetDeviceFocus(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSetDeviceFocusReq);
|
REQUEST(xSetDeviceFocusReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
|
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
|
||||||
swapl(&stuff->focus);
|
swapl(&stuff->focus);
|
||||||
swapl(&stuff->time);
|
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>
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XI2.h>
|
#include <X11/extensions/XI2.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "dix/input_priv.h"
|
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "setmmap.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.
|
* Set the device Modifier mapping.
|
||||||
|
|
@ -79,7 +94,7 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
|
||||||
REQUEST(xSetDeviceModifierMappingReq);
|
REQUEST(xSetDeviceModifierMappingReq);
|
||||||
REQUEST_AT_LEAST_SIZE(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))
|
(stuff->numKeyPerModifier << 1))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef SETMMAP_H
|
#ifndef SETMMAP_H
|
||||||
#define SETMMAP_H 1
|
#define SETMMAP_H 1
|
||||||
|
|
||||||
|
int SProcXSetDeviceModifierMapping(ClientPtr /* client */
|
||||||
|
);
|
||||||
|
|
||||||
int ProcXSetDeviceModifierMapping(ClientPtr /* client */
|
int ProcXSetDeviceModifierMapping(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue