mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-06-01 23:28:23 +02:00
Compare commits
62 commits
master
...
xorg-serve
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16f157cbf6 | ||
|
|
9b037af041 | ||
|
|
f7ff55a374 | ||
|
|
8e7c4380a5 | ||
|
|
1069ca9929 | ||
|
|
044764b5c6 | ||
|
|
73b1880eb3 | ||
|
|
912df16404 | ||
|
|
92de7a90a1 | ||
|
|
44ed4a6547 | ||
|
|
fe9672204a | ||
|
|
525db4433b | ||
|
|
cbf197e1c9 | ||
|
|
7590915c9d | ||
|
|
20bc891f76 | ||
|
|
233429c1d8 | ||
|
|
e7dc700de9 | ||
|
|
25e0fe2b59 | ||
|
|
de17ad13eb | ||
|
|
1d496e046e | ||
|
|
5a4760babd | ||
|
|
efacb60e01 | ||
|
|
3b4aa58d56 | ||
|
|
4f30f4dd47 | ||
|
|
18c7f1e49b | ||
|
|
0ad9121071 | ||
|
|
df64ac7206 | ||
|
|
ea45001614 | ||
|
|
e3a1255a72 | ||
|
|
c092c31c83 | ||
|
|
3d8e2731b5 | ||
|
|
4d3d93c68b | ||
|
|
d88c66541e | ||
|
|
db386cd6a1 | ||
|
|
2883994f9f | ||
|
|
c2515e9dfd | ||
|
|
cbfdb284c9 | ||
|
|
b022d4ef9d | ||
|
|
f1365eb0ec | ||
|
|
07b01bb5bd | ||
|
|
d1bd02fb67 | ||
|
|
77ef968c86 | ||
|
|
f1fc86d61e | ||
|
|
386329ec72 | ||
|
|
a471a15c77 | ||
|
|
4393c7f1ba | ||
|
|
151ec89574 | ||
|
|
a4d9637504 | ||
|
|
a7c207cc8e | ||
|
|
27600a6b20 | ||
|
|
0e62f275aa | ||
|
|
f7ca20cacf | ||
|
|
0e0951ce3e | ||
|
|
b501462e5d | ||
|
|
3ce47886c5 | ||
|
|
c48d07cf0e | ||
|
|
fbe977941a | ||
|
|
484b881ecd | ||
|
|
af2e9e3bb1 | ||
|
|
b7a24467f7 | ||
|
|
a793483e38 | ||
|
|
3c0431b891 |
1826 changed files with 269798 additions and 123477 deletions
|
|
@ -1,84 +0,0 @@
|
||||||
branches:
|
|
||||||
except:
|
|
||||||
- /travis.*/
|
|
||||||
version: '{build}'
|
|
||||||
skip_tags: true
|
|
||||||
clone_depth: 8
|
|
||||||
environment:
|
|
||||||
APPVEYOR_SAVE_CACHE_ON_ERROR: true
|
|
||||||
CYGWIN_MIRROR: http://cygwin.mirror.constant.com
|
|
||||||
CACHE: C:\cache
|
|
||||||
matrix:
|
|
||||||
- BUILD: i686-pc-cygwin
|
|
||||||
CYGWIN_ROOT: C:\cygwin
|
|
||||||
SETUP: setup-x86.exe
|
|
||||||
- BUILD: x86_64-pc-cygwin
|
|
||||||
CYGWIN_ROOT: C:\cygwin64
|
|
||||||
SETUP: setup-x86_64.exe
|
|
||||||
install:
|
|
||||||
- echo Updating Cygwin and installing build prerequisites
|
|
||||||
- "%CYGWIN_ROOT%\\%SETUP% -qnNdO -R %CYGWIN_ROOT% -s %CYGWIN_MIRROR% -l %CACHE% -g -P \
|
|
||||||
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
|
|
||||||
- "%CYGWIN_ROOT%\\%SETUP% -qnNdO -R %CYGWIN_ROOT% -s %CYGWIN_MIRROR% -l %CACHE% -g"
|
|
||||||
cache:
|
|
||||||
- C:\cache
|
|
||||||
- '%CYGWIN_ROOT%\home\%USERNAME%\.ccache'
|
|
||||||
build_script:
|
|
||||||
- SET PATH=%CYGWIN_ROOT%/bin
|
|
||||||
- '%CYGWIN_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; meson setup --prefix=/usr -Dxv=false -Dxf86bigfont=true -Dxephyr=true -Dxnest=true -Dxvfb=true -Dxwin=true -Dxorg=true -Dpciaccess=false -Dint10=false -Dglamor=false build"'
|
|
||||||
- '%CYGWIN_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; meson configure build"'
|
|
||||||
- '%CYGWIN_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; ninja -C build"'
|
|
||||||
- '%CYGWIN_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; ccache -s"'
|
|
||||||
test_script:
|
|
||||||
- '%CYGWIN_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; ninja -C build test"'
|
|
||||||
after_test:
|
|
||||||
- '%CYGWIN_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; ninja -C build install"'
|
|
||||||
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
|
||||||
|
|
|
||||||
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>
|
|
||||||
27
.travis.yml
27
.travis.yml
|
|
@ -1,27 +0,0 @@
|
||||||
language: c
|
|
||||||
cache:
|
|
||||||
ccache: true
|
|
||||||
directories:
|
|
||||||
- $HOME/Library/Caches/Homebrew
|
|
||||||
branches:
|
|
||||||
except:
|
|
||||||
- /appveyor.*/
|
|
||||||
|
|
||||||
os: osx
|
|
||||||
osx_image: xcode9.2
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- env: TOOL=meson
|
|
||||||
- env: TOOL=autotools
|
|
||||||
|
|
||||||
install:
|
|
||||||
- brew update
|
|
||||||
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache meson
|
|
||||||
|
|
||||||
script:
|
|
||||||
- ./test/scripts/build-travis-osx.sh $TOOL
|
|
||||||
- ccache -s
|
|
||||||
|
|
||||||
before_cache:
|
|
||||||
- brew cleanup
|
|
||||||
26
COPYING
26
COPYING
|
|
@ -8,7 +8,6 @@ possible, and insert their name to this list. Please sort by surname
|
||||||
for people, and by the full name for other entities (e.g. Juliusz
|
for people, and by the full name for other entities (e.g. Juliusz
|
||||||
Chroboczek sorts before Intel Corporation sorts before Daniel Stone).
|
Chroboczek sorts before Intel Corporation sorts before Daniel Stone).
|
||||||
|
|
||||||
Copyright © 2011 Dave Airlie
|
|
||||||
Copyright © 2000-2001 Juliusz Chroboczek
|
Copyright © 2000-2001 Juliusz Chroboczek
|
||||||
Copyright © 1998 Egbert Eich
|
Copyright © 1998 Egbert Eich
|
||||||
Copyright © 2006-2007 Intel Corporation
|
Copyright © 2006-2007 Intel Corporation
|
||||||
|
|
@ -16,7 +15,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
|
||||||
|
|
@ -146,29 +145,6 @@ used in advertising or otherwise to promote the sale, use or other dealings
|
||||||
in this Software without prior written authorization from the X Consortium.
|
in this Software without prior written authorization from the X Consortium.
|
||||||
|
|
||||||
|
|
||||||
Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a
|
|
||||||
copy of this software and associated documentation files (the
|
|
||||||
"Software"), to deal in the Software without restriction, including
|
|
||||||
without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
distribute, sub license, and/or sell copies of the Software, and to
|
|
||||||
permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice (including the
|
|
||||||
next paragraph) shall be included in all copies or substantial portions
|
|
||||||
of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
||||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
|
||||||
IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
|
|
||||||
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
||||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
||||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
Copyright © 1999-2000 SuSE, Inc.
|
Copyright © 1999-2000 SuSE, Inc.
|
||||||
Copyright © 2007 Red Hat, Inc.
|
Copyright © 2007 Red Hat, Inc.
|
||||||
|
|
||||||
|
|
|
||||||
130
Makefile.am
Normal file
130
Makefile.am
Normal file
|
|
@ -0,0 +1,130 @@
|
||||||
|
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
|
||||||
38
README
Normal file
38
README
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
X Server
|
||||||
|
|
||||||
|
The X server accepts requests from client applications to create windows,
|
||||||
|
which are (normally rectangular) "virtual screens" that the client program
|
||||||
|
can draw into.
|
||||||
|
|
||||||
|
Windows are then composed on the actual screen by the X server
|
||||||
|
(or by a separate composite manager) as directed by the window manager,
|
||||||
|
which usually communicates with the user via graphical controls such as buttons
|
||||||
|
and draggable titlebars and borders.
|
||||||
|
|
||||||
|
For a comprehensive overview of X Server and X Window System, consult the
|
||||||
|
following article:
|
||||||
|
http://en.wikipedia.org/wiki/X_server
|
||||||
|
|
||||||
|
All questions regarding this software should be directed at the
|
||||||
|
Xorg mailing list:
|
||||||
|
|
||||||
|
http://lists.freedesktop.org/mailman/listinfo/xorg
|
||||||
|
|
||||||
|
Please submit bug reports to the Xorg bugzilla:
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
http://cgit.freedesktop.org/xorg/xserver
|
||||||
|
|
||||||
|
For patch submission instructions, see:
|
||||||
|
|
||||||
|
http://www.x.org/wiki/Development/Documentation/SubmittingPatches
|
||||||
|
|
||||||
|
For more information on the git code manager, see:
|
||||||
|
|
||||||
|
http://wiki.x.org/wiki/GitPage
|
||||||
|
|
||||||
41
README.md
41
README.md
|
|
@ -1,41 +0,0 @@
|
||||||
************************************************************************
|
|
||||||
* 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,
|
|
||||||
which are (normally rectangular) "virtual screens" that the client program
|
|
||||||
can draw into.
|
|
||||||
|
|
||||||
Windows are then composed on the actual screen by the X server
|
|
||||||
(or by a separate composite manager) as directed by the window manager,
|
|
||||||
which usually communicates with the user via graphical controls such as buttons
|
|
||||||
and draggable titlebars and borders.
|
|
||||||
|
|
||||||
For a comprehensive overview of X Server and X Window System, consult the
|
|
||||||
following article:
|
|
||||||
https://en.wikipedia.org/wiki/X_server
|
|
||||||
|
|
||||||
All questions regarding this software should be directed at the
|
|
||||||
Xorg mailing list:
|
|
||||||
|
|
||||||
https://lists.freedesktop.org/mailman/listinfo/xorg
|
|
||||||
|
|
||||||
The primary development code repository can be found at:
|
|
||||||
|
|
||||||
https://gitlab.freedesktop.org/xorg/xserver
|
|
||||||
|
|
||||||
For patch submission instructions, see:
|
|
||||||
|
|
||||||
https://www.x.org/wiki/Development/Documentation/SubmittingPatches
|
|
||||||
|
|
||||||
As with other projects hosted on freedesktop.org, X.Org follows its
|
|
||||||
Code of Conduct, based on the Contributor Covenant. Please conduct
|
|
||||||
yourself in a respectful and civilized manner when using the above
|
|
||||||
mailing lists, bug trackers, etc:
|
|
||||||
|
|
||||||
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.
|
|
||||||
113
Xext/Makefile.am
Normal file
113
Xext/Makefile.am
Normal file
|
|
@ -0,0 +1,113 @@
|
||||||
|
noinst_LTLIBRARIES = libXext.la libXextdpmsstubs.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)
|
||||||
|
|
||||||
|
libXextdpmsstubs_la_SOURCES = dpmsstubs.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);
|
||||||
|
|
|
||||||
406
Xext/dpms.c
406
Xext/dpms.c
|
|
@ -14,26 +14,24 @@ all copies or substantial portions of the Software.
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
|
DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
|
||||||
BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
|
BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
|
||||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
Except as contained in this notice, the name of Digital Equipment Corporation
|
Except as contained in this notice, the name of Digital Equipment Corporation
|
||||||
shall not be used in advertising or otherwise to promote the sale, use or other
|
shall not be used in advertising or otherwise to promote the sale, use or other
|
||||||
dealings in this Software without prior written authorization from Digital
|
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 <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,255 +39,7 @@ 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 "windowstr.h"
|
|
||||||
#include "protocol-versions.h"
|
|
||||||
|
|
||||||
CARD16 DPMSPowerLevel = 0;
|
|
||||||
Bool DPMSDisabledSwitch = FALSE;
|
|
||||||
CARD32 DPMSStandbyTime = -1;
|
|
||||||
CARD32 DPMSSuspendTime = -1;
|
|
||||||
CARD32 DPMSOffTime = -1;
|
|
||||||
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
|
|
||||||
DPMSSupported(void)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
/* For each screen, check if DPMS is supported */
|
|
||||||
for (i = 0; i < screenInfo.numScreens; i++)
|
|
||||||
if (screenInfo.screens[i]->DPMS != NULL)
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
for (i = 0; i < screenInfo.numGPUScreens; i++)
|
|
||||||
if (screenInfo.gpuscreens[i]->DPMS != NULL)
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Bool
|
|
||||||
isUnblank(int mode)
|
|
||||||
{
|
|
||||||
switch (mode) {
|
|
||||||
case SCREEN_SAVER_OFF:
|
|
||||||
case SCREEN_SAVER_FORCER:
|
|
||||||
return TRUE;
|
|
||||||
case SCREEN_SAVER_ON:
|
|
||||||
case SCREEN_SAVER_CYCLE:
|
|
||||||
return FALSE;
|
|
||||||
default:
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
DPMSSet(ClientPtr client, int level)
|
|
||||||
{
|
|
||||||
int rc, i;
|
|
||||||
int old_level = DPMSPowerLevel;
|
|
||||||
|
|
||||||
DPMSPowerLevel = level;
|
|
||||||
|
|
||||||
if (level != DPMSModeOn) {
|
|
||||||
if (isUnblank(screenIsSaved)) {
|
|
||||||
rc = dixSaveScreens(client, SCREEN_SAVER_FORCER, ScreenSaverActive);
|
|
||||||
if (rc != Success)
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
} else if (!isUnblank(screenIsSaved)) {
|
|
||||||
rc = dixSaveScreens(client, SCREEN_SAVER_OFF, ScreenSaverReset);
|
|
||||||
if (rc != Success)
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < screenInfo.numScreens; i++)
|
|
||||||
if (screenInfo.screens[i]->DPMS != NULL)
|
|
||||||
screenInfo.screens[i]->DPMS(screenInfo.screens[i], level);
|
|
||||||
|
|
||||||
for (i = 0; i < screenInfo.numGPUScreens; i++)
|
|
||||||
if (screenInfo.gpuscreens[i]->DPMS != NULL)
|
|
||||||
screenInfo.gpuscreens[i]->DPMS(screenInfo.gpuscreens[i], level);
|
|
||||||
|
|
||||||
if (DPMSPowerLevel != old_level)
|
|
||||||
SendDPMSInfoNotify();
|
|
||||||
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcDPMSGetVersion(ClientPtr client)
|
ProcDPMSGetVersion(ClientPtr client)
|
||||||
|
|
@ -299,8 +49,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);
|
||||||
|
|
@ -322,7 +72,7 @@ ProcDPMSCapable(ClientPtr client)
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0,
|
.length = 0,
|
||||||
.capable = TRUE
|
.capable = DPMSCapableFlag
|
||||||
};
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSCapableReq);
|
REQUEST_SIZE_MATCH(xDPMSCapableReq);
|
||||||
|
|
@ -390,10 +140,10 @@ ProcDPMSEnable(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSEnableReq);
|
REQUEST_SIZE_MATCH(xDPMSEnableReq);
|
||||||
|
|
||||||
DPMSEnabled = TRUE;
|
if (DPMSCapableFlag) {
|
||||||
if (!was_enabled) {
|
DPMSEnabled = TRUE;
|
||||||
SetScreenSaverTimer();
|
if (!was_enabled)
|
||||||
SendDPMSInfoNotify();
|
SetScreenSaverTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
|
|
@ -402,8 +152,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 +159,6 @@ ProcDPMSDisable(ClientPtr client)
|
||||||
DPMSSet(client, DPMSModeOn);
|
DPMSSet(client, DPMSModeOn);
|
||||||
|
|
||||||
DPMSEnabled = FALSE;
|
DPMSEnabled = FALSE;
|
||||||
if (was_enabled)
|
|
||||||
SendDPMSInfoNotify();
|
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
@ -483,27 +229,51 @@ 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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
|
static int
|
||||||
|
SProcDPMSCapable(ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xDPMSCapableReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
|
REQUEST_SIZE_MATCH(xDPMSCapableReq);
|
||||||
|
|
||||||
|
return ProcDPMSCapable(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcDPMSGetTimeouts(ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xDPMSGetTimeoutsReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
|
REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
|
||||||
|
|
||||||
|
return ProcDPMSGetTimeouts(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
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 +282,34 @@ SProcDPMSSetTimeouts(ClientPtr client)
|
||||||
return ProcDPMSSetTimeouts(client);
|
return ProcDPMSSetTimeouts(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
|
SProcDPMSEnable(ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xDPMSEnableReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
|
REQUEST_SIZE_MATCH(xDPMSEnableReq);
|
||||||
|
|
||||||
|
return ProcDPMSEnable(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcDPMSDisable(ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xDPMSDisableReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
|
REQUEST_SIZE_MATCH(xDPMSDisableReq);
|
||||||
|
|
||||||
|
return ProcDPMSDisable(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
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);
|
||||||
|
|
@ -523,18 +317,18 @@ SProcDPMSForceLevel(ClientPtr client)
|
||||||
return ProcDPMSForceLevel(client);
|
return ProcDPMSForceLevel(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcDPMSDispatch(ClientPtr client)
|
SProcDPMSDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
|
@ -542,58 +336,28 @@ 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
DPMSCloseDownExtension(ExtensionEntry *e)
|
|
||||||
{
|
|
||||||
DPMSSet(serverClient, DPMSModeOn);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DPMSExtensionInit(void)
|
DPMSExtensionInit(void)
|
||||||
{
|
{
|
||||||
ExtensionEntry *extEntry;
|
AddExtension(DPMSExtensionName, 0, 0,
|
||||||
|
ProcDPMSDispatch, SProcDPMSDispatch,
|
||||||
#define CONDITIONALLY_SET_DPMS_TIMEOUT(_timeout_value_) \
|
NULL, StandardMinorOpcode);
|
||||||
if (_timeout_value_ == -1) { /* not yet set from config */ \
|
|
||||||
_timeout_value_ = ScreenSaverTime; \
|
|
||||||
}
|
|
||||||
|
|
||||||
CONDITIONALLY_SET_DPMS_TIMEOUT(DPMSStandbyTime)
|
|
||||||
CONDITIONALLY_SET_DPMS_TIMEOUT(DPMSSuspendTime)
|
|
||||||
CONDITIONALLY_SET_DPMS_TIMEOUT(DPMSOffTime)
|
|
||||||
|
|
||||||
DPMSPowerLevel = DPMSModeOn;
|
|
||||||
DPMSEnabled = DPMSSupported();
|
|
||||||
|
|
||||||
ClientType = CreateNewResourceType(DPMSFreeClient, "DPMSClient");
|
|
||||||
DPMSEventType = CreateNewResourceType(DPMSFreeEvents, "DPMSEvent");
|
|
||||||
eventResource = FakeClientID(0);
|
|
||||||
|
|
||||||
if (DPMSEnabled && ClientType && DPMSEventType &&
|
|
||||||
(extEntry = AddExtension(DPMSExtensionName, 0, 0,
|
|
||||||
ProcDPMSDispatch, SProcDPMSDispatch,
|
|
||||||
DPMSCloseDownExtension, StandardMinorOpcode))) {
|
|
||||||
DPMSReqCode = extEntry->base;
|
|
||||||
GERegisterExtension(DPMSReqCode, SDPMSInfoNotifyEvent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,7 @@
|
||||||
|
|
||||||
#include "dixstruct.h"
|
#include "dixstruct.h"
|
||||||
|
|
||||||
extern int DPMSSet(ClientPtr client, int level);
|
int _X_EXPORT DPMSSet(ClientPtr client, int level);
|
||||||
extern Bool DPMSSupported(void);
|
Bool _X_EXPORT DPMSSupported(void);
|
||||||
|
|
||||||
extern CARD32 DPMSStandbyTime;
|
|
||||||
extern CARD32 DPMSSuspendTime;
|
|
||||||
extern CARD32 DPMSOffTime;
|
|
||||||
extern CARD16 DPMSPowerLevel;
|
|
||||||
extern Bool DPMSEnabled;
|
|
||||||
extern Bool DPMSDisabledSwitch;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
47
Xext/dpmsstubs.c
Normal file
47
Xext/dpmsstubs.c
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
/*****************************************************************
|
||||||
|
|
||||||
|
Copyright (c) 1996 Digital Equipment Corporation, Maynard, Massachusetts.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software.
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
|
||||||
|
BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
|
||||||
|
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||||
|
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
Except as contained in this notice, the name of Digital Equipment Corporation
|
||||||
|
shall not be used in advertising or otherwise to promote the sale, use or other
|
||||||
|
dealings in this Software without prior written authorization from Digital
|
||||||
|
Equipment Corporation.
|
||||||
|
|
||||||
|
******************************************************************/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "dpmsproc.h"
|
||||||
|
|
||||||
|
#define FALSE 0
|
||||||
|
|
||||||
|
Bool
|
||||||
|
DPMSSupported(void)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
DPMSSet(ClientPtr client, int level)
|
||||||
|
{
|
||||||
|
return Success;
|
||||||
|
}
|
||||||
110
Xext/geext.c
110
Xext/geext.c
|
|
@ -23,36 +23,31 @@
|
||||||
* 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);
|
||||||
|
|
||||||
|
#define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0]))
|
||||||
#define EXT_MASK(ext) ((ext) & 0x7F)
|
#define EXT_MASK(ext) ((ext) & 0x7F)
|
||||||
|
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
|
|
@ -95,19 +90,29 @@ ProcGEQueryVersion(ClientPtr client)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int (*ProcGEVector[GENumberRequests]) (ClientPtr) = {
|
||||||
|
/* Version 1.0 */
|
||||||
|
ProcGEQueryVersion};
|
||||||
|
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
/* swapped request handlers */
|
/* swapped request handlers */
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int (*SProcGEVector[GENumberRequests]) (ClientPtr) = {
|
||||||
|
/* Version 1.0 */
|
||||||
|
SProcGEQueryVersion};
|
||||||
|
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
/* callbacks */
|
/* callbacks */
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
|
|
@ -116,35 +121,50 @@ 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 >= NUM_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
|
||||||
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a new client inits a connection to the X server.
|
||||||
|
*
|
||||||
|
* We alloc a simple struct to store the client's major/minor version. Can be
|
||||||
|
* used in the furture for versioning support.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
GEClientCallback(CallbackListPtr *list, void *closure, void *data)
|
||||||
|
{
|
||||||
|
NewClientInfoRec *clientinfo = (NewClientInfoRec *) data;
|
||||||
|
ClientPtr pClient = clientinfo->client;
|
||||||
|
GEClientInfoPtr pGEClient = GEGetClient(pClient);
|
||||||
|
|
||||||
|
pGEClient->major_version = 0;
|
||||||
|
pGEClient->minor_version = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset extension. Called on server shutdown. */
|
/* Reset extension. Called on server shutdown. */
|
||||||
static void
|
static void
|
||||||
GEResetProc(ExtensionEntry * extEntry)
|
GEResetProc(ExtensionEntry * extEntry)
|
||||||
{
|
{
|
||||||
|
DeleteCallback(&ClientStateCallback, GEClientCallback, 0);
|
||||||
EventSwapVector[GenericEvent] = NotImplemented;
|
EventSwapVector[GenericEvent] = NotImplemented;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -155,7 +175,7 @@ GEResetProc(ExtensionEntry * extEntry)
|
||||||
* written on the wire, this one calls the registered swap function to do the
|
* written on the wire, this one calls the registered swap function to do the
|
||||||
* work.
|
* work.
|
||||||
*/
|
*/
|
||||||
static void _X_COLD
|
static void
|
||||||
SGEGenericEvent(xEvent *from, xEvent *to)
|
SGEGenericEvent(xEvent *from, xEvent *to)
|
||||||
{
|
{
|
||||||
xGenericEvent *gefrom = (xGenericEvent *) from;
|
xGenericEvent *gefrom = (xGenericEvent *) from;
|
||||||
|
|
@ -177,16 +197,28 @@ 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 (!AddCallback(&ClientStateCallback, GEClientCallback, 0)) {
|
||||||
GEResetProc, StandardMinorOpcode))
|
FatalError("GEExtensionInit: register client callback failed.\n");
|
||||||
FatalError("GEInit: AddExtensions failed.\n");
|
}
|
||||||
|
|
||||||
|
if ((extEntry = AddExtension(GE_NAME,
|
||||||
|
0, GENumberErrors,
|
||||||
|
ProcGEDispatch, SProcGEDispatch,
|
||||||
|
GEResetProc, StandardMinorOpcode)) != 0) {
|
||||||
|
memset(GEExtensions, 0, sizeof(GEExtensions));
|
||||||
|
|
||||||
|
EventSwapVector[GenericEvent] = (EventSwapPtr) SGEGenericEvent;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
FatalError("GEInit: AddExtensions failed.\n");
|
||||||
|
}
|
||||||
|
|
||||||
memset(GEExtensions, 0, sizeof(GEExtensions));
|
|
||||||
EventSwapVector[GenericEvent] = (EventSwapPtr) SGEGenericEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
|
|
|
||||||
42
Xext/geext.h
42
Xext/geext.h
|
|
@ -25,12 +25,50 @@ other dealings in this Software without prior written authorization
|
||||||
from the author.
|
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 (c) 2014, Oracle and/or its affiliates.
|
* 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"),
|
||||||
|
|
@ -19,23 +19,36 @@
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
* 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.
|
||||||
|
*
|
||||||
|
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef XORG_PROBES_H
|
|
||||||
#define XORG_PROBES_H
|
|
||||||
|
|
||||||
#ifdef HAVE_DIX_CONFIG_H
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* definitions needed to include Dtrace probes in a source file */
|
#ifndef _GEINT_H_
|
||||||
|
#define _GEINT_H_
|
||||||
|
|
||||||
#ifdef XSERVER_DTRACE
|
#include <X11/X.h>
|
||||||
#include <sys/types.h>
|
#include <X11/Xproto.h>
|
||||||
typedef const char *string;
|
#include "misc.h"
|
||||||
typedef const uint8_t *const_uint8_p;
|
#include "os.h"
|
||||||
typedef const double *const_double_p;
|
#include "dixstruct.h"
|
||||||
#include "Xserver-dtrace.h"
|
#include "extnsionst.h"
|
||||||
#endif
|
#include <X11/extensions/geproto.h>
|
||||||
|
|
||||||
#endif /* XORG_PROBES_H */
|
extern _X_EXPORT DevPrivateKeyRec GEClientPrivateKeyRec;
|
||||||
|
|
||||||
|
#define GEClientPrivateKey (&GEClientPrivateKeyRec)
|
||||||
|
|
||||||
|
typedef struct _GEClientInfo {
|
||||||
|
CARD32 major_version;
|
||||||
|
CARD32 minor_version;
|
||||||
|
} GEClientInfoRec, *GEClientInfoPtr;
|
||||||
|
|
||||||
|
#define GEGetClient(pClient) ((GEClientInfoPtr)(dixLookupPrivate(&((pClient)->devPrivates), GEClientPrivateKey)))
|
||||||
|
|
||||||
|
extern _X_EXPORT int (*ProcGEVector[ /*GENumRequests */ ]) (ClientPtr);
|
||||||
|
extern _X_EXPORT int (*SProcGEVector[ /*GENumRequests */ ]) (ClientPtr);
|
||||||
|
|
||||||
|
#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"
|
||||||
|
|
@ -52,7 +54,7 @@ ht_create(int keySize,
|
||||||
ht->elements = 0;
|
ht->elements = 0;
|
||||||
ht->bucketBits = INITHASHSIZE;
|
ht->bucketBits = INITHASHSIZE;
|
||||||
numBuckets = 1 << ht->bucketBits;
|
numBuckets = 1 << ht->bucketBits;
|
||||||
ht->buckets = xallocarray(numBuckets, sizeof(*ht->buckets));
|
ht->buckets = malloc(numBuckets * sizeof(*ht->buckets));
|
||||||
ht->cdata = cdata;
|
ht->cdata = cdata;
|
||||||
|
|
||||||
if (ht->buckets) {
|
if (ht->buckets) {
|
||||||
|
|
@ -75,13 +77,10 @@ ht_destroy(HashTable ht)
|
||||||
for (c = 0; c < numBuckets; ++c) {
|
for (c = 0; c < numBuckets; ++c) {
|
||||||
xorg_list_for_each_entry_safe(it, tmp, &ht->buckets[c], l) {
|
xorg_list_for_each_entry_safe(it, tmp, &ht->buckets[c], l) {
|
||||||
xorg_list_del(&it->l);
|
xorg_list_del(&it->l);
|
||||||
free(it->key);
|
|
||||||
free(it->data);
|
|
||||||
free(it);
|
free(it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(ht->buckets);
|
free(ht->buckets);
|
||||||
free(ht);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
|
|
@ -93,7 +92,7 @@ double_size(HashTable ht)
|
||||||
int newNumBuckets = 1 << newBucketBits;
|
int newNumBuckets = 1 << newBucketBits;
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
newBuckets = xallocarray(newNumBuckets, sizeof(*ht->buckets));
|
newBuckets = malloc(newNumBuckets * sizeof(*ht->buckets));
|
||||||
if (newBuckets) {
|
if (newBuckets) {
|
||||||
for (c = 0; c < newNumBuckets; ++c) {
|
for (c = 0; c < newNumBuckets; ++c) {
|
||||||
xorg_list_init(&newBuckets[c]);
|
xorg_list_init(&newBuckets[c]);
|
||||||
|
|
@ -238,7 +237,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
|
||||||
|
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
srcs_xext = [
|
|
||||||
'bigreq.c',
|
|
||||||
'geext.c',
|
|
||||||
'shape.c',
|
|
||||||
'sleepuntil.c',
|
|
||||||
'sync.c',
|
|
||||||
'xcmisc.c',
|
|
||||||
'xtest.c',
|
|
||||||
]
|
|
||||||
|
|
||||||
hdrs_xext = [
|
|
||||||
'geext.h',
|
|
||||||
'syncsdk.h',
|
|
||||||
]
|
|
||||||
|
|
||||||
if build_dpms
|
|
||||||
srcs_xext += 'dpms.c'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if build_mitshm
|
|
||||||
srcs_xext += 'shm.c'
|
|
||||||
hdrs_xext += ['shmint.h']
|
|
||||||
endif
|
|
||||||
|
|
||||||
if build_hashtable
|
|
||||||
srcs_xext += 'hashtable.c'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if build_res
|
|
||||||
srcs_xext += 'xres.c'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if build_screensaver
|
|
||||||
srcs_xext += 'saver.c'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if build_xace
|
|
||||||
srcs_xext += 'xace.c'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if build_xf86bigfont
|
|
||||||
srcs_xext += 'xf86bigfont.c'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if build_xinerama
|
|
||||||
srcs_xext += ['panoramiX.c', 'panoramiXprocs.c', 'panoramiXSwap.c']
|
|
||||||
hdrs_xext += ['panoramiX.h', 'panoramiXsrv.h']
|
|
||||||
endif
|
|
||||||
|
|
||||||
if build_xsecurity
|
|
||||||
srcs_xext += ['security.c']
|
|
||||||
endif
|
|
||||||
|
|
||||||
if build_xselinux
|
|
||||||
srcs_xext += ['xselinux_ext.c', 'xselinux_hooks.c', 'xselinux_label.c']
|
|
||||||
endif
|
|
||||||
|
|
||||||
if build_xv
|
|
||||||
srcs_xext += ['xvmain.c', 'xvdisp.c', 'xvmc.c']
|
|
||||||
hdrs_xext += ['xvdix.h', 'xvmcext.h']
|
|
||||||
endif
|
|
||||||
|
|
||||||
libxserver_xext = static_library('libxserver_xext',
|
|
||||||
srcs_xext,
|
|
||||||
include_directories: inc,
|
|
||||||
dependencies: common_dep,
|
|
||||||
)
|
|
||||||
|
|
||||||
libxserver_xext_vidmode = static_library('libxserver_xext_vidmode',
|
|
||||||
'vidmode.c',
|
|
||||||
include_directories: inc,
|
|
||||||
dependencies: common_dep,
|
|
||||||
)
|
|
||||||
|
|
||||||
if build_xorg
|
|
||||||
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
|
||||||
|
|
@ -424,7 +427,7 @@ XineramaReinitData(void)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PanoramiXExtensionInit():
|
* PanoramiXExtensionInit():
|
||||||
* Called from InitExtensions in main().
|
* Called from InitExtensions in main().
|
||||||
* Register PanoramiXeen Extension
|
* Register PanoramiXeen Extension
|
||||||
* Initialize global variables.
|
* Initialize global variables.
|
||||||
*/
|
*/
|
||||||
|
|
@ -744,11 +747,15 @@ PanoramiXMaybeAddDepth(DepthPtr pDepth)
|
||||||
|
|
||||||
j = PanoramiXNumDepths;
|
j = PanoramiXNumDepths;
|
||||||
PanoramiXNumDepths++;
|
PanoramiXNumDepths++;
|
||||||
PanoramiXDepths = XNFreallocarray(PanoramiXDepths,
|
PanoramiXDepths = realloc(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;
|
/* XXX suboptimal, should grow these dynamically */
|
||||||
|
if (pDepth->numVids)
|
||||||
|
PanoramiXDepths[j].vids = malloc(sizeof(VisualID) * pDepth->numVids);
|
||||||
|
else
|
||||||
|
PanoramiXDepths[j].vids = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -782,16 +789,13 @@ PanoramiXMaybeAddVisual(VisualPtr pVisual)
|
||||||
/* found a matching visual on all screens, add it to the subset list */
|
/* found a matching visual on all screens, add it to the subset list */
|
||||||
j = PanoramiXNumVisuals;
|
j = PanoramiXNumVisuals;
|
||||||
PanoramiXNumVisuals++;
|
PanoramiXNumVisuals++;
|
||||||
PanoramiXVisuals = reallocarray(PanoramiXVisuals,
|
PanoramiXVisuals = realloc(PanoramiXVisuals,
|
||||||
PanoramiXNumVisuals, sizeof(VisualRec));
|
PanoramiXNumVisuals * sizeof(VisualRec));
|
||||||
|
|
||||||
memcpy(&PanoramiXVisuals[j], pVisual, sizeof(VisualRec));
|
memcpy(&PanoramiXVisuals[j], pVisual, sizeof(VisualRec));
|
||||||
|
|
||||||
for (k = 0; k < PanoramiXNumDepths; k++) {
|
for (k = 0; k < PanoramiXNumDepths; k++) {
|
||||||
if (PanoramiXDepths[k].depth == pVisual->nplanes) {
|
if (PanoramiXDepths[k].depth == pVisual->nplanes) {
|
||||||
PanoramiXDepths[k].vids = reallocarray(PanoramiXDepths[k].vids,
|
|
||||||
PanoramiXDepths[k].numVids + 1,
|
|
||||||
sizeof(VisualID));
|
|
||||||
PanoramiXDepths[k].vids[PanoramiXDepths[k].numVids] = pVisual->vid;
|
PanoramiXDepths[k].vids[PanoramiXDepths[k].numVids] = pVisual->vid;
|
||||||
PanoramiXDepths[k].numVids++;
|
PanoramiXDepths[k].numVids++;
|
||||||
break;
|
break;
|
||||||
|
|
@ -817,11 +821,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) {
|
||||||
|
|
@ -984,11 +988,10 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
|
||||||
xPanoramiXGetScreenSizeReply rep;
|
xPanoramiXGetScreenSizeReply rep;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
|
|
||||||
|
|
||||||
if (stuff->screen >= PanoramiXNumScreens)
|
if (stuff->screen >= PanoramiXNumScreens)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ Equipment Corporation.
|
||||||
|
|
||||||
/* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */
|
/* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PanoramiX definitions
|
* PanoramiX definitions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -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,41 +47,77 @@ Equipment Corporation.
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "panoramiXh.h"
|
#include "panoramiXh.h"
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
|
SProcPanoramiXQueryVersion(ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xPanoramiXQueryVersionReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
|
REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
|
||||||
|
return ProcPanoramiXQueryVersion(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
int _X_COLD
|
static int
|
||||||
|
SProcXineramaIsActive(ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xXineramaIsActiveReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
|
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
|
||||||
|
return ProcXineramaIsActive(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcXineramaQueryScreens(ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xXineramaQueryScreensReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
|
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
|
||||||
|
return ProcXineramaQueryScreens(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
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"
|
||||||
|
|
@ -108,7 +106,7 @@ PanoramiXCreateWindow(ClientPtr client)
|
||||||
if ((Mask) stuff->mask & CWColormap) {
|
if ((Mask) stuff->mask & CWColormap) {
|
||||||
cmap_offset = Ones((Mask) stuff->mask & (CWColormap - 1));
|
cmap_offset = Ones((Mask) stuff->mask & (CWColormap - 1));
|
||||||
tmp = *((CARD32 *) &stuff[1] + cmap_offset);
|
tmp = *((CARD32 *) &stuff[1] + cmap_offset);
|
||||||
if (tmp != CopyFromParent) {
|
if ((tmp != CopyFromParent) && (tmp != None)) {
|
||||||
result = dixLookupResourceByType((void **) &cmap, tmp,
|
result = dixLookupResourceByType((void **) &cmap, tmp,
|
||||||
XRT_COLORMAP, client,
|
XRT_COLORMAP, client,
|
||||||
DixReadAccess);
|
DixReadAccess);
|
||||||
|
|
@ -212,7 +210,7 @@ PanoramiXChangeWindowAttributes(ClientPtr client)
|
||||||
if ((Mask) stuff->valueMask & CWColormap) {
|
if ((Mask) stuff->valueMask & CWColormap) {
|
||||||
cmap_offset = Ones((Mask) stuff->valueMask & (CWColormap - 1));
|
cmap_offset = Ones((Mask) stuff->valueMask & (CWColormap - 1));
|
||||||
tmp = *((CARD32 *) &stuff[1] + cmap_offset);
|
tmp = *((CARD32 *) &stuff[1] + cmap_offset);
|
||||||
if (tmp != CopyFromParent) {
|
if ((tmp != CopyFromParent) && (tmp != None)) {
|
||||||
result = dixLookupResourceByType((void **) &cmap, tmp,
|
result = dixLookupResourceByType((void **) &cmap, tmp,
|
||||||
XRT_COLORMAP, client,
|
XRT_COLORMAP, client,
|
||||||
DixReadAccess);
|
DixReadAccess);
|
||||||
|
|
@ -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;
|
||||||
|
|
||||||
|
|
@ -511,7 +509,7 @@ PanoramiXConfigureWindow(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* have to go forward or you get expose events before
|
/* have to go forward or you get expose events before
|
||||||
ConfigureNotify events */
|
ConfigureNotify events */
|
||||||
FOR_NSCREENS_FORWARD(j) {
|
FOR_NSCREENS_FORWARD(j) {
|
||||||
stuff->window = win->info[j].id;
|
stuff->window = win->info[j].id;
|
||||||
|
|
@ -1039,7 +1037,7 @@ PanoramiXClearToBackground(ClientPtr client)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
For Window to Pixmap copies you're screwed since each screen's
|
For Window to Pixmap copies you're screwed since each screen's
|
||||||
pixmap will look like what it sees on its screen. Unless the
|
pixmap will look like what it sees on its screen. Unless the
|
||||||
screens overlap and the window lies on each, the two copies
|
screens overlap and the window lies on each, the two copies
|
||||||
|
|
@ -1052,7 +1050,7 @@ PanoramiXClearToBackground(ClientPtr client)
|
||||||
int
|
int
|
||||||
PanoramiXCopyArea(ClientPtr client)
|
PanoramiXCopyArea(ClientPtr client)
|
||||||
{
|
{
|
||||||
int j, result, srcx, srcy, dstx, dsty, width, height;
|
int j, result, srcx, srcy, dstx, dsty;
|
||||||
PanoramiXRes *gc, *src, *dst;
|
PanoramiXRes *gc, *src, *dst;
|
||||||
Bool srcIsRoot = FALSE;
|
Bool srcIsRoot = FALSE;
|
||||||
Bool dstIsRoot = FALSE;
|
Bool dstIsRoot = FALSE;
|
||||||
|
|
@ -1093,8 +1091,6 @@ PanoramiXCopyArea(ClientPtr client)
|
||||||
srcy = stuff->srcY;
|
srcy = stuff->srcY;
|
||||||
dstx = stuff->dstX;
|
dstx = stuff->dstX;
|
||||||
dsty = stuff->dstY;
|
dsty = stuff->dstY;
|
||||||
width = stuff->width;
|
|
||||||
height = stuff->height;
|
|
||||||
if ((dst->type == XRT_PIXMAP) && (src->type == XRT_WINDOW)) {
|
if ((dst->type == XRT_PIXMAP) && (src->type == XRT_WINDOW)) {
|
||||||
DrawablePtr drawables[MAXSCREENS];
|
DrawablePtr drawables[MAXSCREENS];
|
||||||
DrawablePtr pDst;
|
DrawablePtr pDst;
|
||||||
|
|
@ -1107,18 +1103,15 @@ 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(stuff->width, drawables[0]->depth);
|
||||||
if (!(data = calloc(height, pitch)))
|
if (!(data = calloc(1, stuff->height * pitch)))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
XineramaGetImageData(drawables, srcx, srcy, width, height, ZPixmap, ~0,
|
XineramaGetImageData(drawables, srcx, srcy,
|
||||||
data, pitch, srcIsRoot);
|
stuff->width, stuff->height, ZPixmap, ~0, data,
|
||||||
|
pitch, srcIsRoot);
|
||||||
|
|
||||||
FOR_NSCREENS_BACKWARD(j) {
|
FOR_NSCREENS_BACKWARD(j) {
|
||||||
stuff->gc = gc->info[j].id;
|
stuff->gc = gc->info[j].id;
|
||||||
|
|
@ -1130,63 +1123,14 @@ PanoramiXCopyArea(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
(*pGC->ops->PutImage) (pDst, pGC, pDst->depth, dstx, dsty,
|
(*pGC->ops->PutImage) (pDst, pGC, pDst->depth, dstx, dsty,
|
||||||
width, height, 0, ZPixmap, data);
|
stuff->width, stuff->height,
|
||||||
|
0, ZPixmap, data);
|
||||||
|
|
||||||
if (dstShared)
|
if (dstShared)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(data);
|
free(data);
|
||||||
|
|
||||||
if (pGC->graphicsExposures) {
|
|
||||||
RegionRec rgn;
|
|
||||||
int dx, dy;
|
|
||||||
BoxRec sourceBox;
|
|
||||||
|
|
||||||
dx = drawables[0]->x;
|
|
||||||
dy = drawables[0]->y;
|
|
||||||
if (srcIsRoot) {
|
|
||||||
dx += screenInfo.screens[0]->x;
|
|
||||||
dy += screenInfo.screens[0]->y;
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceBox.x1 = min(srcx + dx, 0);
|
|
||||||
sourceBox.y1 = min(srcy + dy, 0);
|
|
||||||
sourceBox.x2 = max(sourceBox.x1 + width, 32767);
|
|
||||||
sourceBox.y2 = max(sourceBox.y1 + height, 32767);
|
|
||||||
|
|
||||||
RegionInit(&rgn, &sourceBox, 1);
|
|
||||||
|
|
||||||
/* subtract the (screen-space) clips of the source drawables */
|
|
||||||
FOR_NSCREENS(j) {
|
|
||||||
ScreenPtr screen = screenInfo.screens[j];
|
|
||||||
RegionPtr sd;
|
|
||||||
|
|
||||||
if (pGC->subWindowMode == IncludeInferiors)
|
|
||||||
sd = NotClippedByChildren((WindowPtr)drawables[j]);
|
|
||||||
else
|
|
||||||
sd = &((WindowPtr)drawables[j])->clipList;
|
|
||||||
|
|
||||||
if (srcIsRoot)
|
|
||||||
RegionTranslate(&rgn, -screen->x, -screen->y);
|
|
||||||
|
|
||||||
RegionSubtract(&rgn, &rgn, sd);
|
|
||||||
|
|
||||||
if (srcIsRoot)
|
|
||||||
RegionTranslate(&rgn, screen->x, screen->y);
|
|
||||||
|
|
||||||
if (pGC->subWindowMode == IncludeInferiors)
|
|
||||||
RegionDestroy(sd);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -dx/-dy to get back to dest-relative, plus request offsets */
|
|
||||||
RegionTranslate(&rgn, -dx + dstx, -dy + dsty);
|
|
||||||
|
|
||||||
/* intersect with gc clip; just one screen is fine because pixmap */
|
|
||||||
RegionIntersect(&rgn, &rgn, pGC->pCompositeClip);
|
|
||||||
|
|
||||||
/* and expose */
|
|
||||||
SendGraphicsExpose(client, &rgn, dst->info[0].id, X_CopyArea, 0);
|
|
||||||
RegionUninit(&rgn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DrawablePtr pDst = NULL, pSrc = NULL;
|
DrawablePtr pDst = NULL, pSrc = NULL;
|
||||||
|
|
@ -1249,8 +1193,9 @@ PanoramiXCopyArea(ClientPtr client)
|
||||||
Bool overlap;
|
Bool overlap;
|
||||||
|
|
||||||
RegionValidate(&totalReg, &overlap);
|
RegionValidate(&totalReg, &overlap);
|
||||||
SendGraphicsExpose(client, &totalReg, stuff->dstDrawable,
|
(*pDst->pScreen->SendGraphicsExpose) (client, &totalReg,
|
||||||
X_CopyArea, 0);
|
stuff->dstDrawable,
|
||||||
|
X_CopyArea, 0);
|
||||||
RegionUninit(&totalReg);
|
RegionUninit(&totalReg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1361,8 +1306,9 @@ PanoramiXCopyPlane(ClientPtr client)
|
||||||
Bool overlap;
|
Bool overlap;
|
||||||
|
|
||||||
RegionValidate(&totalReg, &overlap);
|
RegionValidate(&totalReg, &overlap);
|
||||||
SendGraphicsExpose(client, &totalReg, stuff->dstDrawable,
|
(*pdstDraw->pScreen->SendGraphicsExpose) (client, &totalReg,
|
||||||
X_CopyPlane, 0);
|
stuff->dstDrawable,
|
||||||
|
X_CopyPlane, 0);
|
||||||
RegionUninit(&totalReg);
|
RegionUninit(&totalReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1397,7 +1343,7 @@ PanoramiXPolyPoint(ClientPtr client)
|
||||||
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
||||||
npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyPointReq));
|
npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyPointReq));
|
||||||
if (npoint > 0) {
|
if (npoint > 0) {
|
||||||
origPts = xallocarray(npoint, sizeof(xPoint));
|
origPts = malloc(npoint * sizeof(xPoint));
|
||||||
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
|
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
|
||||||
FOR_NSCREENS_FORWARD(j) {
|
FOR_NSCREENS_FORWARD(j) {
|
||||||
|
|
||||||
|
|
@ -1462,7 +1408,7 @@ PanoramiXPolyLine(ClientPtr client)
|
||||||
isRoot = IS_ROOT_DRAWABLE(draw);
|
isRoot = IS_ROOT_DRAWABLE(draw);
|
||||||
npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyLineReq));
|
npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyLineReq));
|
||||||
if (npoint > 0) {
|
if (npoint > 0) {
|
||||||
origPts = xallocarray(npoint, sizeof(xPoint));
|
origPts = malloc(npoint * sizeof(xPoint));
|
||||||
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
|
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
|
||||||
FOR_NSCREENS_FORWARD(j) {
|
FOR_NSCREENS_FORWARD(j) {
|
||||||
|
|
||||||
|
|
@ -1531,7 +1477,7 @@ PanoramiXPolySegment(ClientPtr client)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
nsegs >>= 3;
|
nsegs >>= 3;
|
||||||
if (nsegs > 0) {
|
if (nsegs > 0) {
|
||||||
origSegs = xallocarray(nsegs, sizeof(xSegment));
|
origSegs = malloc(nsegs * sizeof(xSegment));
|
||||||
memcpy((char *) origSegs, (char *) &stuff[1], nsegs * sizeof(xSegment));
|
memcpy((char *) origSegs, (char *) &stuff[1], nsegs * sizeof(xSegment));
|
||||||
FOR_NSCREENS_FORWARD(j) {
|
FOR_NSCREENS_FORWARD(j) {
|
||||||
|
|
||||||
|
|
@ -1599,7 +1545,7 @@ PanoramiXPolyRectangle(ClientPtr client)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
nrects >>= 3;
|
nrects >>= 3;
|
||||||
if (nrects > 0) {
|
if (nrects > 0) {
|
||||||
origRecs = xallocarray(nrects, sizeof(xRectangle));
|
origRecs = malloc(nrects * sizeof(xRectangle));
|
||||||
memcpy((char *) origRecs, (char *) &stuff[1],
|
memcpy((char *) origRecs, (char *) &stuff[1],
|
||||||
nrects * sizeof(xRectangle));
|
nrects * sizeof(xRectangle));
|
||||||
FOR_NSCREENS_FORWARD(j) {
|
FOR_NSCREENS_FORWARD(j) {
|
||||||
|
|
@ -1666,7 +1612,7 @@ PanoramiXPolyArc(ClientPtr client)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
narcs /= sizeof(xArc);
|
narcs /= sizeof(xArc);
|
||||||
if (narcs > 0) {
|
if (narcs > 0) {
|
||||||
origArcs = xallocarray(narcs, sizeof(xArc));
|
origArcs = malloc(narcs * sizeof(xArc));
|
||||||
memcpy((char *) origArcs, (char *) &stuff[1], narcs * sizeof(xArc));
|
memcpy((char *) origArcs, (char *) &stuff[1], narcs * sizeof(xArc));
|
||||||
FOR_NSCREENS_FORWARD(j) {
|
FOR_NSCREENS_FORWARD(j) {
|
||||||
|
|
||||||
|
|
@ -1728,7 +1674,7 @@ PanoramiXFillPoly(ClientPtr client)
|
||||||
|
|
||||||
count = bytes_to_int32((client->req_len << 2) - sizeof(xFillPolyReq));
|
count = bytes_to_int32((client->req_len << 2) - sizeof(xFillPolyReq));
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
locPts = xallocarray(count, sizeof(DDXPointRec));
|
locPts = malloc(count * sizeof(DDXPointRec));
|
||||||
memcpy((char *) locPts, (char *) &stuff[1],
|
memcpy((char *) locPts, (char *) &stuff[1],
|
||||||
count * sizeof(DDXPointRec));
|
count * sizeof(DDXPointRec));
|
||||||
FOR_NSCREENS_FORWARD(j) {
|
FOR_NSCREENS_FORWARD(j) {
|
||||||
|
|
@ -1797,7 +1743,7 @@ PanoramiXPolyFillRectangle(ClientPtr client)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
things >>= 3;
|
things >>= 3;
|
||||||
if (things > 0) {
|
if (things > 0) {
|
||||||
origRects = xallocarray(things, sizeof(xRectangle));
|
origRects = malloc(things * sizeof(xRectangle));
|
||||||
memcpy((char *) origRects, (char *) &stuff[1],
|
memcpy((char *) origRects, (char *) &stuff[1],
|
||||||
things * sizeof(xRectangle));
|
things * sizeof(xRectangle));
|
||||||
FOR_NSCREENS_FORWARD(j) {
|
FOR_NSCREENS_FORWARD(j) {
|
||||||
|
|
@ -1864,7 +1810,7 @@ PanoramiXPolyFillArc(ClientPtr client)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
narcs /= sizeof(xArc);
|
narcs /= sizeof(xArc);
|
||||||
if (narcs > 0) {
|
if (narcs > 0) {
|
||||||
origArcs = xallocarray(narcs, sizeof(xArc));
|
origArcs = malloc(narcs * sizeof(xArc));
|
||||||
memcpy((char *) origArcs, (char *) &stuff[1], narcs * sizeof(xArc));
|
memcpy((char *) origArcs, (char *) &stuff[1], narcs * sizeof(xArc));
|
||||||
FOR_NSCREENS_FORWARD(j) {
|
FOR_NSCREENS_FORWARD(j) {
|
||||||
|
|
||||||
|
|
@ -1964,7 +1910,7 @@ PanoramiXGetImage(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
rc = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
||||||
XRC_DRAWABLE, client, DixReadAccess);
|
XRC_DRAWABLE, client, DixWriteAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return (rc == BadValue) ? BadDrawable : rc;
|
return (rc == BadValue) ? BadDrawable : rc;
|
||||||
|
|
||||||
|
|
@ -2013,12 +1959,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,
|
||||||
|
|
@ -2050,7 +1990,8 @@ PanoramiXGetImage(ClientPtr client)
|
||||||
if (linesPerBuf > h)
|
if (linesPerBuf > h)
|
||||||
linesPerBuf = h;
|
linesPerBuf = h;
|
||||||
}
|
}
|
||||||
if (!(pBuf = xallocarray(linesPerBuf, widthBytesLine)))
|
length = linesPerBuf * widthBytesLine;
|
||||||
|
if (!(pBuf = malloc(length)))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xGetImageReply), &xgi);
|
WriteReplyToClient(client, sizeof(xGetImageReply), &xgi);
|
||||||
|
|
|
||||||
228
Xext/saver.c
228
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,51 @@ 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"
|
|
||||||
#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 +192,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 +216,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 +266,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 +365,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;
|
||||||
|
|
||||||
|
|
@ -414,7 +426,7 @@ SendScreenSaverNotify(ScreenPtr pScreen, int state, Bool forced)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _X_COLD
|
static void
|
||||||
SScreenSaverNotifyEvent(xScreenSaverNotifyEvent * from,
|
SScreenSaverNotifyEvent(xScreenSaverNotifyEvent * from,
|
||||||
xScreenSaverNotifyEvent * to)
|
xScreenSaverNotifyEvent * to)
|
||||||
{
|
{
|
||||||
|
|
@ -437,7 +449,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);
|
||||||
|
|
@ -455,13 +467,16 @@ CreateSaverWindow(ScreenPtr pScreen)
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
int result;
|
int result;
|
||||||
unsigned long mask;
|
unsigned long mask;
|
||||||
|
Colormap *installedMaps;
|
||||||
|
int numInstalled;
|
||||||
|
int i;
|
||||||
Colormap wantMap;
|
Colormap wantMap;
|
||||||
ColormapPtr pCmap;
|
ColormapPtr pCmap;
|
||||||
|
|
||||||
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 +500,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 +520,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);
|
||||||
|
|
@ -530,10 +545,21 @@ CreateSaverWindow(ScreenPtr pScreen)
|
||||||
|
|
||||||
/* check and install our own colormap if it isn't installed now */
|
/* check and install our own colormap if it isn't installed now */
|
||||||
wantMap = wColormap(pWin);
|
wantMap = wColormap(pWin);
|
||||||
if (wantMap == None || IsMapInstalled(wantMap, pWin))
|
if (wantMap == None)
|
||||||
|
return TRUE;
|
||||||
|
installedMaps = malloc(pScreen->maxInstalledCmaps * sizeof(Colormap));
|
||||||
|
numInstalled = (*pWin->drawable.pScreen->ListInstalledColormaps)
|
||||||
|
(pScreen, installedMaps);
|
||||||
|
for (i = 0; i < numInstalled; i++)
|
||||||
|
if (installedMaps[i] == wantMap)
|
||||||
|
break;
|
||||||
|
|
||||||
|
free((char *) installedMaps);
|
||||||
|
|
||||||
|
if (i < numInstalled)
|
||||||
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 +583,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 +614,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 +637,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 +658,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 +728,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 +739,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 +764,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 +772,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,13 +861,13 @@ 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;
|
||||||
}
|
}
|
||||||
/* over allocate for override redirect */
|
/* over allocate for override redirect */
|
||||||
pAttr->values = values = xallocarray(len + 1, sizeof(unsigned long));
|
pAttr->values = values = malloc((len + 1) * sizeof(unsigned long));
|
||||||
if (!values) {
|
if (!values) {
|
||||||
ret = BadAlloc;
|
ret = BadAlloc;
|
||||||
goto bail;
|
goto bail;
|
||||||
|
|
@ -884,7 +912,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 +944,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 +1027,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 +1047,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 +1064,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 +1081,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 +1106,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 +1117,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;
|
||||||
|
|
@ -1126,7 +1157,7 @@ ProcScreenSaverSetAttributes(ClientPtr client)
|
||||||
if ((Mask) stuff->mask & CWColormap) {
|
if ((Mask) stuff->mask & CWColormap) {
|
||||||
cmap_offset = Ones((Mask) stuff->mask & (CWColormap - 1));
|
cmap_offset = Ones((Mask) stuff->mask & (CWColormap - 1));
|
||||||
tmp = *((CARD32 *) &stuff[1] + cmap_offset);
|
tmp = *((CARD32 *) &stuff[1] + cmap_offset);
|
||||||
if (tmp != CopyFromParent) {
|
if ((tmp != CopyFromParent) && (tmp != None)) {
|
||||||
status = dixLookupResourceByType((void **) &cmap, tmp,
|
status = dixLookupResourceByType((void **) &cmap, tmp,
|
||||||
XRT_COLORMAP, client,
|
XRT_COLORMAP, client,
|
||||||
DixReadAccess);
|
DixReadAccess);
|
||||||
|
|
@ -1149,83 +1180,72 @@ 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;
|
||||||
|
|
||||||
|
|
||||||
rc = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
rc = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
||||||
XRC_DRAWABLE, client, DixWriteAccess);
|
XRC_DRAWABLE, client, DixWriteAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
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
|
||||||
ProcScreenSaverSuspend(ClientPtr client)
|
ProcScreenSaverSuspend(ClientPtr client)
|
||||||
{
|
{
|
||||||
ScreenSaverSuspensionPtr *prev, this;
|
ScreenSaverSuspensionPtr *prev, this;
|
||||||
BOOL suspend;
|
|
||||||
|
|
||||||
REQUEST(xScreenSaverSuspendReq);
|
REQUEST(xScreenSaverSuspendReq);
|
||||||
REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
|
REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
|
||||||
|
|
||||||
/*
|
|
||||||
* Old versions of XCB encode suspend as 1 byte followed by three
|
|
||||||
* pad bytes (which are always cleared), instead of a 4 byte
|
|
||||||
* value. Be compatible by just checking for a non-zero value in
|
|
||||||
* all 32-bits.
|
|
||||||
*/
|
|
||||||
suspend = stuff->suspend != 0;
|
|
||||||
|
|
||||||
/* Check if this client is suspending the screensaver */
|
/* Check if this client is suspending the screensaver */
|
||||||
for (prev = &suspendingClients; (this = *prev); prev = &this->next)
|
for (prev = &suspendingClients; (this = *prev); prev = &this->next)
|
||||||
if (this->pClient == client)
|
if (this->pClient == client)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (this) {
|
if (this) {
|
||||||
if (suspend == TRUE)
|
if (stuff->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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we get to this point, this client isn't suspending the screensaver */
|
/* If we get to this point, this client isn't suspending the screensaver */
|
||||||
if (suspend == FALSE)
|
if (stuff->suspend == FALSE)
|
||||||
return Success;
|
return Success;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 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,47 +1273,59 @@ 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,
|
|
||||||
};
|
#define NUM_REQUESTS ((sizeof NormalVector) / (sizeof NormalVector[0]))
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcScreenSaverDispatch(ClientPtr client)
|
ProcScreenSaverDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
|
||||||
if (stuff->data < ARRAY_SIZE(NormalVector))
|
if (stuff->data < NUM_REQUESTS)
|
||||||
return (*NormalVector[stuff->data]) (client);
|
return (*NormalVector[stuff->data]) (client);
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
|
SProcScreenSaverQueryVersion(ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xScreenSaverQueryVersionReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
|
REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq);
|
||||||
|
return ProcScreenSaverQueryVersion(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
return ProcScreenSaverSelectInput(client);
|
return ProcScreenSaverSelectInput(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
|
|
@ -1307,39 +1339,39 @@ SProcScreenSaverSetAttributes(ClientPtr client)
|
||||||
return ProcScreenSaverSetAttributes(client);
|
return ProcScreenSaverSetAttributes(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcScreenSaverSuspend(ClientPtr client)
|
SProcScreenSaverSuspend(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xScreenSaverSuspendReq);
|
REQUEST(xScreenSaverSuspendReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
|
REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
|
||||||
swapl(&stuff->suspend);
|
|
||||||
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
|
||||||
SProcScreenSaverDispatch(ClientPtr client)
|
SProcScreenSaverDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
|
||||||
if (stuff->data < ARRAY_SIZE(NormalVector))
|
if (stuff->data < NUM_REQUESTS)
|
||||||
return (*SwappedVector[stuff->data]) (client);
|
return (*SwappedVector[stuff->data]) (client);
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
||||||
|
|
@ -71,10 +63,11 @@ typedef struct {
|
||||||
XID authId;
|
XID authId;
|
||||||
} SecurityStateRec;
|
} SecurityStateRec;
|
||||||
|
|
||||||
/* The only extensions that untrusted clients have access to */
|
/* Extensions that untrusted clients shouldn't have access to */
|
||||||
static const char *SecurityTrustedExtensions[] = {
|
static const char *SecurityTrustedExtensions[] = {
|
||||||
"XC-MISC",
|
"XC-MISC",
|
||||||
"BIG-REQUESTS",
|
"BIG-REQUESTS",
|
||||||
|
"XpExtension",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -155,7 +148,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 +199,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 */
|
||||||
|
|
@ -220,7 +213,7 @@ SecurityDeleteAuthorization(void *value, XID id)
|
||||||
CloseDownClient(clients[i]);
|
CloseDownClient(clients[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
SecurityAudit("revoked authorization ID %lu\n", (unsigned long)pAuth->id);
|
SecurityAudit("revoked authorization ID %d\n", pAuth->id);
|
||||||
free(pAuth);
|
free(pAuth);
|
||||||
return Success;
|
return Success;
|
||||||
|
|
||||||
|
|
@ -312,7 +305,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 +369,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;
|
||||||
|
|
@ -557,9 +550,9 @@ ProcSecurityGenerateAuthorization(ClientPtr client)
|
||||||
WriteToClient(client, authdata_len, pAuthdata);
|
WriteToClient(client, authdata_len, pAuthdata);
|
||||||
|
|
||||||
SecurityAudit
|
SecurityAudit
|
||||||
("client %d generated authorization %lu trust %d timeout %lu group %lu events %lu\n",
|
("client %d generated authorization %d trust %d timeout %d group %d events %d\n",
|
||||||
client->index, (unsigned long)pAuth->id, pAuth->trustLevel, (unsigned long)pAuth->timeout,
|
client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout,
|
||||||
(unsigned long)pAuth->group, (unsigned long)eventMask);
|
pAuth->group, eventMask);
|
||||||
|
|
||||||
/* the request succeeded; don't call RemoveAuthorization or free pAuth */
|
/* the request succeeded; don't call RemoveAuthorization or free pAuth */
|
||||||
return Success;
|
return Success;
|
||||||
|
|
@ -588,7 +581,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 */
|
||||||
|
|
||||||
|
|
@ -609,23 +602,27 @@ ProcSecurityDispatch(ClientPtr client)
|
||||||
}
|
}
|
||||||
} /* ProcSecurityDispatch */
|
} /* ProcSecurityDispatch */
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
return ProcSecurityQueryVersion(client);
|
return ProcSecurityQueryVersion(client);
|
||||||
} /* SProcSecurityQueryVersion */
|
} /* SProcSecurityQueryVersion */
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcSecurityGenerateAuthorization(ClientPtr client)
|
SProcSecurityGenerateAuthorization(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSecurityGenerateAuthorizationReq);
|
REQUEST(xSecurityGenerateAuthorizationReq);
|
||||||
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,24 +630,26 @@ 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 */
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
} /* SProcSecurityRevokeAuthorization */
|
} /* SProcSecurityRevokeAuthorization */
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcSecurityDispatch(ClientPtr client)
|
SProcSecurityDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
|
@ -667,7 +666,7 @@ SProcSecurityDispatch(ClientPtr client)
|
||||||
}
|
}
|
||||||
} /* SProcSecurityDispatch */
|
} /* SProcSecurityDispatch */
|
||||||
|
|
||||||
static void _X_COLD
|
static void
|
||||||
SwapSecurityAuthorizationRevokedEvent(xSecurityAuthorizationRevokedEvent * from,
|
SwapSecurityAuthorizationRevokedEvent(xSecurityAuthorizationRevokedEvent * from,
|
||||||
xSecurityAuthorizationRevokedEvent * to)
|
xSecurityAuthorizationRevokedEvent * to)
|
||||||
{
|
{
|
||||||
|
|
@ -749,12 +748,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 +762,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;
|
||||||
|
|
||||||
|
|
@ -778,9 +777,9 @@ SecurityResource(CallbackListPtr *pcbl, void *unused, void *calldata)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SecurityAudit("Security: denied client %d access %lx to resource 0x%lx "
|
SecurityAudit("Security: denied client %d access %x to resource 0x%x "
|
||||||
"of client %d on request %s\n", rec->client->index,
|
"of client %d on request %s\n", rec->client->index,
|
||||||
(unsigned long)requested, (unsigned long)rec->id, cid,
|
requested, rec->id, cid,
|
||||||
SecurityLookupRequestName(rec->client));
|
SecurityLookupRequestName(rec->client));
|
||||||
rec->status = BadAccess; /* deny access */
|
rec->status = BadAccess; /* deny access */
|
||||||
}
|
}
|
||||||
|
|
@ -860,9 +859,9 @@ SecurityProperty(CallbackListPtr *pcbl, void *unused, void *calldata)
|
||||||
|
|
||||||
if (SecurityDoCheck(subj, obj, requested, allowed) != Success) {
|
if (SecurityDoCheck(subj, obj, requested, allowed) != Success) {
|
||||||
SecurityAudit("Security: denied client %d access to property %s "
|
SecurityAudit("Security: denied client %d access to property %s "
|
||||||
"(atom 0x%x) window 0x%lx of client %d on request %s\n",
|
"(atom 0x%x) window 0x%x of client %d on request %s\n",
|
||||||
rec->client->index, NameForAtom(name), name,
|
rec->client->index, NameForAtom(name), name,
|
||||||
(unsigned long)rec->pWin->drawable.id, wClient(rec->pWin)->index,
|
rec->pWin->drawable.id, wClient(rec->pWin)->index,
|
||||||
SecurityLookupRequestName(rec->client));
|
SecurityLookupRequestName(rec->client));
|
||||||
rec->status = BadAccess;
|
rec->status = BadAccess;
|
||||||
}
|
}
|
||||||
|
|
@ -889,10 +888,10 @@ SecuritySend(CallbackListPtr *pcbl, void *unused, void *calldata)
|
||||||
rec->events[i].u.u.type != ClientMessage) {
|
rec->events[i].u.u.type != ClientMessage) {
|
||||||
|
|
||||||
SecurityAudit("Security: denied client %d from sending event "
|
SecurityAudit("Security: denied client %d from sending event "
|
||||||
"of type %s to window 0x%lx of client %d\n",
|
"of type %s to window 0x%x of client %d\n",
|
||||||
rec->client->index,
|
rec->client->index,
|
||||||
LookupEventName(rec->events[i].u.u.type),
|
LookupEventName(rec->events[i].u.u.type),
|
||||||
(unsigned long)rec->pWin->drawable.id,
|
rec->pWin->drawable.id,
|
||||||
wClient(rec->pWin)->index);
|
wClient(rec->pWin)->index);
|
||||||
rec->status = BadAccess;
|
rec->status = BadAccess;
|
||||||
return;
|
return;
|
||||||
|
|
@ -913,8 +912,8 @@ SecurityReceive(CallbackListPtr *pcbl, void *unused, void *calldata)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SecurityAudit("Security: denied client %d from receiving an event "
|
SecurityAudit("Security: denied client %d from receiving an event "
|
||||||
"sent to window 0x%lx of client %d\n",
|
"sent to window 0x%x of client %d\n",
|
||||||
rec->client->index, (unsigned long)rec->pWin->drawable.id,
|
rec->client->index, rec->pWin->drawable.id,
|
||||||
wClient(rec->pWin)->index);
|
wClient(rec->pWin)->index);
|
||||||
rec->status = BadAccess;
|
rec->status = BadAccess;
|
||||||
}
|
}
|
||||||
|
|
@ -930,12 +929,12 @@ SecurityReceive(CallbackListPtr *pcbl, void *unused, void *calldata)
|
||||||
* Returns: nothing.
|
* Returns: nothing.
|
||||||
*
|
*
|
||||||
* Side Effects:
|
* Side Effects:
|
||||||
*
|
*
|
||||||
* If a new client is connecting, its authorization ID is copied to
|
* If a new client is connecting, its authorization ID is copied to
|
||||||
* client->authID. If this is a generated authorization, its reference
|
* client->authID. If this is a generated authorization, its reference
|
||||||
* count is bumped, its timer is cancelled if it was running, and its
|
* count is bumped, its timer is cancelled if it was running, and its
|
||||||
* trustlevel is copied to TRUSTLEVEL(client).
|
* trustlevel is copied to TRUSTLEVEL(client).
|
||||||
*
|
*
|
||||||
* If a client is disconnecting and the client was using a generated
|
* If a client is disconnecting and the client was using a generated
|
||||||
* authorization, the authorization's reference count is decremented, and
|
* authorization, the authorization's reference count is decremented, and
|
||||||
* if it is now zero, the timer for this authorization is started.
|
* if it is now zero, the timer for this authorization is started.
|
||||||
|
|
|
||||||
|
|
@ -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 */
|
||||||
|
|
|
||||||
102
Xext/shape.c
102
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;
|
||||||
|
|
@ -882,7 +881,6 @@ SendShapeNotify(WindowPtr pWin, int which)
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
UpdateCurrentTimeIf();
|
|
||||||
for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) {
|
for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) {
|
||||||
xShapeNotifyEvent se = {
|
xShapeNotifyEvent se = {
|
||||||
.type = ShapeNotify + ShapeEventBase,
|
.type = ShapeNotify + ShapeEventBase,
|
||||||
|
|
@ -998,7 +996,7 @@ ProcShapeGetRectangles(ClientPtr client)
|
||||||
|
|
||||||
nrects = RegionNumRects(region);
|
nrects = RegionNumRects(region);
|
||||||
box = RegionRects(region);
|
box = RegionRects(region);
|
||||||
rects = xallocarray(nrects, sizeof(xRectangle));
|
rects = malloc(nrects * sizeof(xRectangle));
|
||||||
if (!rects && nrects)
|
if (!rects && nrects)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
for (i = 0; i < nrects; i++, box++) {
|
for (i = 0; i < nrects; i++, box++) {
|
||||||
|
|
@ -1035,32 +1033,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);
|
||||||
|
|
@ -1075,7 +1073,7 @@ ProcShapeDispatch(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _X_COLD
|
static void
|
||||||
SShapeNotifyEvent(xShapeNotifyEvent * from, xShapeNotifyEvent * to)
|
SShapeNotifyEvent(xShapeNotifyEvent * from, xShapeNotifyEvent * to)
|
||||||
{
|
{
|
||||||
to->type = from->type;
|
to->type = from->type;
|
||||||
|
|
@ -1090,10 +1088,21 @@ SShapeNotifyEvent(xShapeNotifyEvent * from, xShapeNotifyEvent * to)
|
||||||
to->shaped = from->shaped;
|
to->shaped = from->shaped;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
|
SProcShapeQueryVersion(ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xShapeQueryVersionReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
|
return ProcShapeQueryVersion(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
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);
|
||||||
|
|
@ -1102,10 +1111,12 @@ SProcShapeRectangles(ClientPtr client)
|
||||||
return ProcShapeRectangles(client);
|
return ProcShapeRectangles(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
|
|
@ -1114,10 +1125,12 @@ SProcShapeMask(ClientPtr client)
|
||||||
return ProcShapeMask(client);
|
return ProcShapeMask(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
|
|
@ -1126,10 +1139,12 @@ SProcShapeCombine(ClientPtr client)
|
||||||
return ProcShapeCombine(client);
|
return ProcShapeCombine(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
|
|
@ -1137,49 +1152,56 @@ SProcShapeOffset(ClientPtr client)
|
||||||
return ProcShapeOffset(client);
|
return ProcShapeOffset(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcShapeDispatch(ClientPtr client)
|
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:
|
||||||
|
|
|
||||||
260
Xext/shm.c
260
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;
|
||||||
|
|
@ -156,6 +153,7 @@ static ShmFuncs fbFuncs = { fbShmCreatePixmap, NULL };
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__DragonFly__)
|
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__DragonFly__)
|
||||||
|
#include <sys/signal.h>
|
||||||
|
|
||||||
static Bool badSysCall = FALSE;
|
static Bool badSysCall = FALSE;
|
||||||
|
|
||||||
|
|
@ -172,7 +170,7 @@ CheckForShmSyscall(void)
|
||||||
int shmid = -1;
|
int shmid = -1;
|
||||||
|
|
||||||
/* If no SHM support in the kernel, the bad syscall will generate SIGSYS */
|
/* If no SHM support in the kernel, the bad syscall will generate SIGSYS */
|
||||||
oldHandler = OsSignal(SIGSYS, SigSysHandler);
|
oldHandler = signal(SIGSYS, SigSysHandler);
|
||||||
|
|
||||||
badSysCall = FALSE;
|
badSysCall = FALSE;
|
||||||
shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT);
|
shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT);
|
||||||
|
|
@ -185,7 +183,7 @@ CheckForShmSyscall(void)
|
||||||
/* Allocation failed */
|
/* Allocation failed */
|
||||||
badSysCall = TRUE;
|
badSysCall = TRUE;
|
||||||
}
|
}
|
||||||
OsSignal(SIGSYS, oldHandler);
|
signal(SIGSYS, oldHandler);
|
||||||
return !badSysCall;
|
return !badSysCall;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -210,7 +208,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,19 +249,18 @@ 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;
|
||||||
|
|
||||||
if (shmdesc)
|
if (shmdesc)
|
||||||
ShmDetachSegment(shmdesc, 0);
|
ShmDetachSegment(shmdesc, pPixmap->drawable.id);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
@ -304,8 +301,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)
|
||||||
|
|
@ -407,7 +404,7 @@ ProcShmAttach(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The attach was performed with root privs. We must
|
/* The attach was performed with root privs. We must
|
||||||
* do manual checking of access rights for the credentials
|
* do manual checking of access rights for the credentials
|
||||||
* of the client */
|
* of the client */
|
||||||
|
|
||||||
if (shm_access(client, &(SHM_PERM(buf)), stuff->readOnly) == -1) {
|
if (shm_access(client, &(SHM_PERM(buf)), stuff->readOnly) == -1) {
|
||||||
|
|
@ -430,7 +427,7 @@ ProcShmAttach(ClientPtr client)
|
||||||
|
|
||||||
/*ARGSUSED*/ static int
|
/*ARGSUSED*/ static int
|
||||||
ShmDetachSegment(void *value, /* must conform to DeleteType */
|
ShmDetachSegment(void *value, /* must conform to DeleteType */
|
||||||
XID unused)
|
XID shmseg)
|
||||||
{
|
{
|
||||||
ShmDescPtr shmdesc = (ShmDescPtr) value;
|
ShmDescPtr shmdesc = (ShmDescPtr) value;
|
||||||
ShmDescPtr *prev;
|
ShmDescPtr *prev;
|
||||||
|
|
@ -460,7 +457,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 +479,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 {
|
||||||
|
|
@ -622,7 +619,6 @@ ProcShmGetImage(ClientPtr client)
|
||||||
xShmGetImageReply xgi;
|
xShmGetImageReply xgi;
|
||||||
ShmDescPtr shmdesc;
|
ShmDescPtr shmdesc;
|
||||||
VisualID visual = None;
|
VisualID visual = None;
|
||||||
RegionPtr pVisibleRegion = NULL;
|
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xShmGetImageReq);
|
REQUEST(xShmGetImageReq);
|
||||||
|
|
@ -654,11 +650,6 @@ ProcShmGetImage(ClientPtr client)
|
||||||
wBorderWidth((WindowPtr) pDraw) + (int) pDraw->height)
|
wBorderWidth((WindowPtr) pDraw) + (int) pDraw->height)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
visual = wVisual(((WindowPtr) pDraw));
|
visual = wVisual(((WindowPtr) pDraw));
|
||||||
if (pDraw->type == DRAWABLE_WINDOW)
|
|
||||||
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 ||
|
||||||
|
|
@ -695,11 +686,6 @@ ProcShmGetImage(ClientPtr client)
|
||||||
stuff->width, stuff->height,
|
stuff->width, stuff->height,
|
||||||
stuff->format, stuff->planeMask,
|
stuff->format, stuff->planeMask,
|
||||||
shmdesc->addr + stuff->offset);
|
shmdesc->addr + stuff->offset);
|
||||||
if (pVisibleRegion)
|
|
||||||
XaceCensorImage(client, pVisibleRegion,
|
|
||||||
PixmapBytePad(stuff->width, pDraw->depth), pDraw,
|
|
||||||
stuff->x, stuff->y, stuff->width, stuff->height,
|
|
||||||
stuff->format, shmdesc->addr + stuff->offset);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
|
@ -711,11 +697,6 @@ ProcShmGetImage(ClientPtr client)
|
||||||
stuff->width, stuff->height,
|
stuff->width, stuff->height,
|
||||||
stuff->format, plane,
|
stuff->format, plane,
|
||||||
shmdesc->addr + length);
|
shmdesc->addr + length);
|
||||||
if (pVisibleRegion)
|
|
||||||
XaceCensorImage(client, pVisibleRegion,
|
|
||||||
BitmapBytePad(stuff->width), pDraw,
|
|
||||||
stuff->x, stuff->y, stuff->width, stuff->height,
|
|
||||||
stuff->format, shmdesc->addr + length);
|
|
||||||
length += lenPer;
|
length += lenPer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -732,7 +713,7 @@ ProcShmGetImage(ClientPtr client)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
static int
|
static int
|
||||||
ProcPanoramiXShmPutImage(ClientPtr client)
|
ProcPanoramiXShmPutImage(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
|
@ -841,19 +822,6 @@ ProcPanoramiXShmGetImage(ClientPtr client)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (format == ZPixmap) {
|
|
||||||
widthBytesLine = PixmapBytePad(w, pDraw->depth);
|
|
||||||
length = widthBytesLine * h;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
widthBytesLine = PixmapBytePad(w, 1);
|
|
||||||
lenPer = widthBytesLine * h;
|
|
||||||
plane = ((Mask) 1) << (pDraw->depth - 1);
|
|
||||||
length = lenPer * Ones(planemask & (plane | (plane - 1)));
|
|
||||||
}
|
|
||||||
|
|
||||||
VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client);
|
|
||||||
|
|
||||||
drawables = calloc(PanoramiXNumScreens, sizeof(DrawablePtr));
|
drawables = calloc(PanoramiXNumScreens, sizeof(DrawablePtr));
|
||||||
if (!drawables)
|
if (!drawables)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
@ -867,12 +835,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,
|
||||||
|
|
@ -882,6 +844,18 @@ ProcPanoramiXShmGetImage(ClientPtr client)
|
||||||
.depth = pDraw->depth
|
.depth = pDraw->depth
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (format == ZPixmap) {
|
||||||
|
widthBytesLine = PixmapBytePad(w, pDraw->depth);
|
||||||
|
length = widthBytesLine * h;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
widthBytesLine = PixmapBytePad(w, 1);
|
||||||
|
lenPer = widthBytesLine * h;
|
||||||
|
plane = ((Mask) 1) << (pDraw->depth - 1);
|
||||||
|
length = lenPer * Ones(planemask & (plane | (plane - 1)));
|
||||||
|
}
|
||||||
|
|
||||||
|
VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client);
|
||||||
xgi.size = length;
|
xgi.size = length;
|
||||||
|
|
||||||
if (length == 0) { /* nothing to do */
|
if (length == 0) { /* nothing to do */
|
||||||
|
|
@ -997,17 +971,11 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
|
||||||
stuff->offset);
|
stuff->offset);
|
||||||
|
|
||||||
if (pMap) {
|
if (pMap) {
|
||||||
result = XaceHookResourceAccess(client, stuff->pid,
|
|
||||||
X11_RESTYPE_PIXMAP, pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
|
||||||
if (result != Success) {
|
|
||||||
pDraw->pScreen->DestroyPixmap(pMap);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc);
|
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc);
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
@ -1018,9 +986,9 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result != Success) {
|
if (result == BadAlloc) {
|
||||||
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 +996,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif /* XINERAMA */
|
#endif
|
||||||
|
|
||||||
static PixmapPtr
|
static PixmapPtr
|
||||||
fbShmCreatePixmap(ScreenPtr pScreen,
|
fbShmCreatePixmap(ScreenPtr pScreen,
|
||||||
|
|
@ -1112,8 +1080,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 +1090,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 +1108,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
|
||||||
|
|
@ -1179,7 +1147,7 @@ ProcShmAttachFd(ClientPtr client)
|
||||||
fd, 0);
|
fd, 0);
|
||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
if (shmdesc->addr == ((char *) -1)) {
|
if ((shmdesc->addr == ((char *) -1))) {
|
||||||
free(shmdesc);
|
free(shmdesc);
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
}
|
}
|
||||||
|
|
@ -1207,55 +1175,30 @@ ProcShmAttachFd(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
shm_tmpfile(void)
|
shm_tmpfile(void)
|
||||||
{
|
{
|
||||||
const char *shmdirs[] = {
|
#ifdef SHMDIR
|
||||||
"/run/shm",
|
int fd;
|
||||||
"/var/tmp",
|
int flags;
|
||||||
"/tmp",
|
char template[] = SHMDIR "/shmfd-XXXXXX";
|
||||||
};
|
|
||||||
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) {
|
ErrorF ("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
|
||||||
|
fd = mkstemp(template);
|
||||||
for (int i = 0; i < ARRAY_SIZE(shmdirs); i++) {
|
if (fd < 0)
|
||||||
char template[PATH_MAX];
|
return -1;
|
||||||
snprintf(template, ARRAY_SIZE(template), "%s/shmfd-XXXXXX", shmdirs[i]);
|
unlink(template);
|
||||||
#ifdef HAVE_MKOSTEMP
|
if (fcntl(fd, F_GETFD, &flags) >= 0) {
|
||||||
fd = mkostemp(template, O_CLOEXEC);
|
flags |= FD_CLOEXEC;
|
||||||
|
(void) fcntl(fd, F_SETFD, &flags);
|
||||||
|
}
|
||||||
|
return fd;
|
||||||
#else
|
#else
|
||||||
fd = mkstemp(template);
|
return -1;
|
||||||
#endif
|
#endif
|
||||||
if (fd < 0)
|
|
||||||
continue;
|
|
||||||
unlink(template);
|
|
||||||
#ifndef HAVE_MKOSTEMP
|
|
||||||
int flags = fcntl(fd, F_GETFD);
|
|
||||||
if (flags != -1) {
|
|
||||||
flags |= FD_CLOEXEC;
|
|
||||||
(void) fcntl(fd, F_SETFD, flags);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return fd;
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
@ -1272,7 +1215,6 @@ ProcShmCreateSegment(ClientPtr client)
|
||||||
};
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShmCreateSegmentReq);
|
REQUEST_SIZE_MATCH(xShmCreateSegmentReq);
|
||||||
LEGAL_NEW_RESOURCE(stuff->shmseg, client);
|
|
||||||
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) {
|
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) {
|
||||||
client->errorValue = stuff->readOnly;
|
client->errorValue = stuff->readOnly;
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
@ -1295,7 +1237,7 @@ ProcShmCreateSegment(ClientPtr client)
|
||||||
MAP_SHARED,
|
MAP_SHARED,
|
||||||
fd, 0);
|
fd, 0);
|
||||||
|
|
||||||
if (shmdesc->addr == ((char *) -1)) {
|
if ((shmdesc->addr == ((char *) -1))) {
|
||||||
close(fd);
|
close(fd);
|
||||||
free(shmdesc);
|
free(shmdesc);
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
@ -1322,7 +1264,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;
|
||||||
}
|
}
|
||||||
|
|
@ -1335,35 +1277,30 @@ static int
|
||||||
ProcShmDispatch(ClientPtr client)
|
ProcShmDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
|
||||||
if (stuff->data == X_ShmQueryVersion)
|
|
||||||
return ProcShmQueryVersion(client);
|
|
||||||
|
|
||||||
if (!client->local)
|
|
||||||
return BadRequest;
|
|
||||||
|
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
|
case X_ShmQueryVersion:
|
||||||
|
return ProcShmQueryVersion(client);
|
||||||
case X_ShmAttach:
|
case X_ShmAttach:
|
||||||
return ProcShmAttach(client);
|
return ProcShmAttach(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:
|
||||||
|
|
@ -1376,7 +1313,7 @@ ProcShmDispatch(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _X_COLD
|
static void
|
||||||
SShmCompletionEvent(xShmCompletionEvent * from, xShmCompletionEvent * to)
|
SShmCompletionEvent(xShmCompletionEvent * from, xShmCompletionEvent * to)
|
||||||
{
|
{
|
||||||
to->type = from->type;
|
to->type = from->type;
|
||||||
|
|
@ -1388,29 +1325,41 @@ SShmCompletionEvent(xShmCompletionEvent * from, xShmCompletionEvent * to)
|
||||||
cpswapl(from->offset, to->offset);
|
cpswapl(from->offset, to->offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
|
SProcShmQueryVersion(ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xShmQueryVersionReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
|
return ProcShmQueryVersion(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
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);
|
||||||
return ProcShmAttach(client);
|
return ProcShmAttach(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
|
|
@ -1427,10 +1376,11 @@ SProcShmPutImage(ClientPtr client)
|
||||||
return ProcShmPutImage(client);
|
return ProcShmPutImage(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
|
|
@ -1443,10 +1393,11 @@ SProcShmGetImage(ClientPtr client)
|
||||||
return ProcShmGetImage(client);
|
return ProcShmGetImage(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
|
|
@ -1458,20 +1409,22 @@ SProcShmCreatePixmap(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SHM_FD_PASSING
|
#ifdef SHM_FD_PASSING
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcShmAttachFd(ClientPtr client)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
|
|
@ -1479,18 +1432,13 @@ SProcShmCreateSegment(ClientPtr client)
|
||||||
}
|
}
|
||||||
#endif /* SHM_FD_PASSING */
|
#endif /* SHM_FD_PASSING */
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcShmDispatch(ClientPtr client)
|
SProcShmDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
|
||||||
if (stuff->data == X_ShmQueryVersion)
|
|
||||||
return ProcShmQueryVersion(client);
|
|
||||||
|
|
||||||
if (!client->local)
|
|
||||||
return BadRequest;
|
|
||||||
|
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
|
case X_ShmQueryVersion:
|
||||||
|
return SProcShmQueryVersion(client);
|
||||||
case X_ShmAttach:
|
case X_ShmAttach:
|
||||||
return SProcShmAttach(client);
|
return SProcShmAttach(client);
|
||||||
case X_ShmDetach:
|
case X_ShmDetach:
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -61,11 +63,14 @@ static void ClientAwaken(ClientPtr /* client */ ,
|
||||||
static int SertafiedDelete(void * /* value */ ,
|
static int SertafiedDelete(void * /* value */ ,
|
||||||
XID /* id */
|
XID /* id */
|
||||||
);
|
);
|
||||||
static void SertafiedBlockHandler(void *data,
|
static void SertafiedBlockHandler(void * /* data */ ,
|
||||||
void *timeout);
|
OSTimePtr /* wt */ ,
|
||||||
|
void * /* LastSelectMask */
|
||||||
static void SertafiedWakeupHandler(void *data,
|
);
|
||||||
int i);
|
static void SertafiedWakeupHandler(void * /* data */ ,
|
||||||
|
int /* i */ ,
|
||||||
|
void * /* LastSelectMask */
|
||||||
|
);
|
||||||
|
|
||||||
int
|
int
|
||||||
ClientSleepUntil(ClientPtr client,
|
ClientSleepUntil(ClientPtr client,
|
||||||
|
|
@ -123,7 +128,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
|
||||||
|
|
@ -148,7 +154,7 @@ SertafiedDelete(void *value, XID id)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
SertafiedBlockHandler(void *data, void *wt)
|
SertafiedBlockHandler(void *data, OSTimePtr wt, void *LastSelectMask)
|
||||||
{
|
{
|
||||||
SertafiedPtr pReq, pNext;
|
SertafiedPtr pReq, pNext;
|
||||||
unsigned long delay;
|
unsigned long delay;
|
||||||
|
|
@ -164,7 +170,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
|
||||||
|
|
@ -180,7 +186,7 @@ SertafiedBlockHandler(void *data, void *wt)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
SertafiedWakeupHandler(void *data, int i)
|
SertafiedWakeupHandler(void *data, int i, void *LastSelectMask)
|
||||||
{
|
{
|
||||||
SertafiedPtr pReq, pNext;
|
SertafiedPtr pReq, pNext;
|
||||||
TimeStamp now;
|
TimeStamp now;
|
||||||
|
|
@ -193,7 +199,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,
|
||||||
|
|
|
||||||
675
Xext/sync.c
675
Xext/sync.c
File diff suppressed because it is too large
Load diff
|
|
@ -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; \
|
||||||
|
|
|
||||||
|
|
@ -30,13 +30,13 @@ and Olivetti Research Limited, Cambridge, England.
|
||||||
|
|
||||||
All Rights Reserved
|
All Rights Reserved
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software and its
|
Permission to use, copy, modify, and distribute this software and its
|
||||||
documentation for any purpose and without fee is hereby granted,
|
documentation for any purpose and without fee is hereby granted,
|
||||||
provided that the above copyright notice appear in all copies and that
|
provided that the above copyright notice appear in all copies and that
|
||||||
both that copyright notice and this permission notice appear in
|
both that copyright notice and this permission notice appear in
|
||||||
supporting documentation, and that the names of Digital or Olivetti
|
supporting documentation, and that the names of Digital or Olivetti
|
||||||
not be used in advertising or publicity pertaining to distribution of the
|
not be used in advertising or publicity pertaining to distribution of the
|
||||||
software without specific, written prior permission.
|
software without specific, written prior permission.
|
||||||
|
|
||||||
DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
|
DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
|
||||||
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
|
@ -67,19 +67,19 @@ typedef enum {
|
||||||
} SyncCounterType;
|
} SyncCounterType;
|
||||||
|
|
||||||
typedef void (*SyncSystemCounterQueryValue)(void *counter,
|
typedef void (*SyncSystemCounterQueryValue)(void *counter,
|
||||||
int64_t *value_return
|
CARD64 *value_return
|
||||||
);
|
);
|
||||||
typedef void (*SyncSystemCounterBracketValues)(void *counter,
|
typedef void (*SyncSystemCounterBracketValues)(void *counter,
|
||||||
int64_t *pbracket_less,
|
CARD64 *pbracket_less,
|
||||||
int64_t *pbracket_greater
|
CARD64 *pbracket_greater
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef struct _SysCounterInfo {
|
typedef struct _SysCounterInfo {
|
||||||
SyncCounter *pCounter;
|
SyncCounter *pCounter;
|
||||||
char *name;
|
char *name;
|
||||||
int64_t resolution;
|
CARD64 resolution;
|
||||||
int64_t bracket_greater;
|
CARD64 bracket_greater;
|
||||||
int64_t bracket_less;
|
CARD64 bracket_less;
|
||||||
SyncCounterType counterType; /* how can this counter change */
|
SyncCounterType counterType; /* how can this counter change */
|
||||||
SyncSystemCounterQueryValue QueryValue;
|
SyncSystemCounterQueryValue QueryValue;
|
||||||
SyncSystemCounterBracketValues BracketValues;
|
SyncSystemCounterBracketValues BracketValues;
|
||||||
|
|
@ -97,7 +97,7 @@ typedef struct _SyncAlarm {
|
||||||
SyncTrigger trigger;
|
SyncTrigger trigger;
|
||||||
ClientPtr client;
|
ClientPtr client;
|
||||||
XSyncAlarm alarm_id;
|
XSyncAlarm alarm_id;
|
||||||
int64_t delta;
|
CARD64 delta;
|
||||||
int events;
|
int events;
|
||||||
int state;
|
int state;
|
||||||
SyncAlarmClientList *pEventClients;
|
SyncAlarmClientList *pEventClients;
|
||||||
|
|
@ -111,7 +111,7 @@ typedef struct {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
SyncTrigger trigger;
|
SyncTrigger trigger;
|
||||||
int64_t event_threshold;
|
CARD64 event_threshold;
|
||||||
SyncAwaitHeader *pHeader;
|
SyncAwaitHeader *pHeader;
|
||||||
} SyncAwait;
|
} SyncAwait;
|
||||||
|
|
||||||
|
|
@ -121,15 +121,16 @@ typedef union {
|
||||||
} SyncAwaitUnion;
|
} SyncAwaitUnion;
|
||||||
|
|
||||||
extern SyncCounter* SyncCreateSystemCounter(const char *name,
|
extern SyncCounter* SyncCreateSystemCounter(const char *name,
|
||||||
int64_t initial_value,
|
CARD64 initial_value,
|
||||||
int64_t resolution,
|
CARD64 resolution,
|
||||||
SyncCounterType counterType,
|
SyncCounterType counterType,
|
||||||
SyncSystemCounterQueryValue QueryValue,
|
SyncSystemCounterQueryValue QueryValue,
|
||||||
SyncSystemCounterBracketValues BracketValues
|
SyncSystemCounterBracketValues BracketValues
|
||||||
);
|
);
|
||||||
|
|
||||||
extern void SyncChangeCounter(SyncCounter *pCounter,
|
extern void SyncChangeCounter(SyncCounter *pCounter,
|
||||||
int64_t new_value);
|
CARD64 new_value
|
||||||
|
);
|
||||||
|
|
||||||
extern void SyncDestroySystemCounter(void *pCounter);
|
extern void SyncDestroySystemCounter(void *pCounter);
|
||||||
|
|
||||||
|
|
|
||||||
272
Xext/xace.c
272
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,20 +29,37 @@ 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 };
|
#define XSERV_t
|
||||||
|
#define TRANS_SERVER
|
||||||
|
#include <X11/Xtrans/Xtrans.h>
|
||||||
|
#include "../os/osdep.h"
|
||||||
|
|
||||||
|
_X_EXPORT CallbackListPtr XaceHooks[XACE_NUM_HOOKS] = { 0 };
|
||||||
|
|
||||||
/* Special-cased hook functions. Called by Xserver.
|
/* Special-cased hook functions. Called by Xserver.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
XaceHookDispatch0(ClientPtr client, int major)
|
XaceHookDispatch(ClientPtr client, int major)
|
||||||
{
|
{
|
||||||
/* Call the extension dispatch hook */
|
/* Call the audit begin callback, there is no return value. */
|
||||||
ExtensionEntry *ext = GetExtensionEntry(major);
|
XaceAuditRec rec = { client, 0 };
|
||||||
XaceExtAccessRec erec = { client, ext, DixUseAccess, Success };
|
CallCallbacks(&XaceHooks[XACE_AUDIT_BEGIN], &rec);
|
||||||
if (ext)
|
|
||||||
CallCallbacks(&XaceHooks[XACE_EXT_DISPATCH], &erec);
|
if (major < 128) {
|
||||||
/* On error, pretend extension doesn't exist */
|
/* Call the core dispatch hook */
|
||||||
return (erec.status == Success) ? Success : BadRequest;
|
XaceCoreDispatchRec drec = { client, Success /* default allow */ };
|
||||||
|
CallCallbacks(&XaceHooks[XACE_CORE_DISPATCH], &drec);
|
||||||
|
return drec.status;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* Call the extension dispatch hook */
|
||||||
|
ExtensionEntry *ext = GetExtensionEntry(major);
|
||||||
|
XaceExtAccessRec erec = { client, ext, DixUseAccess, Success };
|
||||||
|
if (ext)
|
||||||
|
CallCallbacks(&XaceHooks[XACE_EXT_DISPATCH], &erec);
|
||||||
|
/* On error, pretend extension doesn't exist */
|
||||||
|
return (erec.status == Success) ? Success : BadRequest;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
@ -63,100 +79,138 @@ XaceHookSelectionAccess(ClientPtr client, Selection ** ppSel, Mask access_mode)
|
||||||
return rec.status;
|
return rec.status;
|
||||||
}
|
}
|
||||||
|
|
||||||
int XaceHookResourceAccess(ClientPtr client, XID id, RESTYPE rtype, void *res,
|
void
|
||||||
RESTYPE ptype, void *parent, Mask access_mode)
|
XaceHookAuditEnd(ClientPtr ptr, int result)
|
||||||
{
|
{
|
||||||
XaceResourceAccessRec rec = { client, id, rtype, res, ptype, parent,
|
XaceAuditRec rec = { ptr, result };
|
||||||
access_mode, Success };
|
/* call callbacks, there is no return value. */
|
||||||
CallCallbacks(&XaceHooks[XACE_RESOURCE_ACCESS], &rec);
|
CallCallbacks(&XaceHooks[XACE_AUDIT_END], &rec);
|
||||||
return rec.status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int XaceHookDeviceAccess(ClientPtr client, DeviceIntPtr dev, Mask access_mode)
|
/* Entry point for hook functions. Called by Xserver.
|
||||||
{
|
|
||||||
XaceDeviceAccessRec rec = { client, dev, access_mode, Success };
|
|
||||||
CallCallbacks(&XaceHooks[XACE_DEVICE_ACCESS], &rec);
|
|
||||||
return rec.status;
|
|
||||||
}
|
|
||||||
|
|
||||||
int XaceHookSendAccess(ClientPtr client, DeviceIntPtr dev, WindowPtr win,
|
|
||||||
xEventPtr ev, int count)
|
|
||||||
{
|
|
||||||
XaceSendAccessRec rec = { client, dev, win, ev, count, Success };
|
|
||||||
CallCallbacks(&XaceHooks[XACE_SEND_ACCESS], &rec);
|
|
||||||
return rec.status;
|
|
||||||
}
|
|
||||||
|
|
||||||
int XaceHookReceiveAccess(ClientPtr client, WindowPtr win,
|
|
||||||
xEventPtr ev, int count)
|
|
||||||
{
|
|
||||||
XaceReceiveAccessRec rec = { client, win, ev, count, Success };
|
|
||||||
CallCallbacks(&XaceHooks[XACE_RECEIVE_ACCESS], &rec);
|
|
||||||
return rec.status;
|
|
||||||
}
|
|
||||||
|
|
||||||
int XaceHookClientAccess(ClientPtr client, ClientPtr target, Mask access_mode)
|
|
||||||
{
|
|
||||||
XaceClientAccessRec rec = { client, target, access_mode, Success };
|
|
||||||
CallCallbacks(&XaceHooks[XACE_CLIENT_ACCESS], &rec);
|
|
||||||
return rec.status;
|
|
||||||
}
|
|
||||||
|
|
||||||
int XaceHookExtAccess(ClientPtr client, ExtensionEntry *ext)
|
|
||||||
{
|
|
||||||
XaceExtAccessRec rec = { client, ext, DixGetAttrAccess, Success };
|
|
||||||
CallCallbacks(&XaceHooks[XACE_EXT_ACCESS], &rec);
|
|
||||||
return rec.status;
|
|
||||||
}
|
|
||||||
|
|
||||||
int XaceHookServerAccess(ClientPtr client, Mask access_mode)
|
|
||||||
{
|
|
||||||
XaceServerAccessRec rec = { client, access_mode, Success };
|
|
||||||
CallCallbacks(&XaceHooks[XACE_SERVER_ACCESS], &rec);
|
|
||||||
return rec.status;
|
|
||||||
}
|
|
||||||
|
|
||||||
int XaceHookScreenAccess(ClientPtr client, ScreenPtr screen, Mask access_mode)
|
|
||||||
{
|
|
||||||
XaceScreenAccessRec rec = { client, screen, access_mode, Success };
|
|
||||||
CallCallbacks(&XaceHooks[XACE_SCREEN_ACCESS], &rec);
|
|
||||||
return rec.status;
|
|
||||||
}
|
|
||||||
|
|
||||||
int XaceHookScreensaverAccess(ClientPtr client, ScreenPtr screen, Mask access_mode)
|
|
||||||
{
|
|
||||||
XaceScreenAccessRec rec = { client, screen, access_mode, Success };
|
|
||||||
CallCallbacks(&XaceHooks[XACE_SCREENSAVER_ACCESS], &rec);
|
|
||||||
return rec.status;
|
|
||||||
}
|
|
||||||
|
|
||||||
int XaceHookAuthAvail(ClientPtr client, XID authId)
|
|
||||||
{
|
|
||||||
XaceAuthAvailRec rec = { client, authId };
|
|
||||||
CallCallbacks(&XaceHooks[XACE_AUTH_AVAIL], &rec);
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
int XaceHookKeyAvail(xEventPtr ev, DeviceIntPtr dev, int count)
|
|
||||||
{
|
|
||||||
XaceKeyAvailRec rec = { ev, dev, count };
|
|
||||||
CallCallbacks(&XaceHooks[XACE_KEY_AVAIL], &rec);
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* XaceHookIsSet
|
|
||||||
*
|
|
||||||
* Utility function to determine whether there are any callbacks listening on a
|
|
||||||
* particular XACE hook.
|
|
||||||
*
|
|
||||||
* Returns non-zero if there is a callback, zero otherwise.
|
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
XaceHookIsSet(int hook)
|
XaceHook(int hook, ...)
|
||||||
{
|
{
|
||||||
if (hook < 0 || hook >= XACE_NUM_HOOKS)
|
union {
|
||||||
return 0;
|
XaceResourceAccessRec res;
|
||||||
return XaceHooks[hook] != NULL;
|
XaceDeviceAccessRec dev;
|
||||||
|
XaceSendAccessRec send;
|
||||||
|
XaceReceiveAccessRec recv;
|
||||||
|
XaceClientAccessRec client;
|
||||||
|
XaceExtAccessRec ext;
|
||||||
|
XaceServerAccessRec server;
|
||||||
|
XaceScreenAccessRec screen;
|
||||||
|
XaceAuthAvailRec auth;
|
||||||
|
XaceKeyAvailRec key;
|
||||||
|
} u;
|
||||||
|
int *prv = NULL; /* points to return value from callback */
|
||||||
|
va_list ap; /* argument list */
|
||||||
|
|
||||||
|
if (!XaceHooks[hook])
|
||||||
|
return Success;
|
||||||
|
|
||||||
|
va_start(ap, hook);
|
||||||
|
|
||||||
|
/* Marshal arguments for passing to callback.
|
||||||
|
* Each callback has its own case, which sets up a structure to hold
|
||||||
|
* the arguments and integer return parameter, or in some cases just
|
||||||
|
* sets calldata directly to a single argument (with no return result)
|
||||||
|
*/
|
||||||
|
switch (hook) {
|
||||||
|
case XACE_RESOURCE_ACCESS:
|
||||||
|
u.res.client = va_arg(ap, ClientPtr);
|
||||||
|
u.res.id = va_arg(ap, XID);
|
||||||
|
u.res.rtype = va_arg(ap, RESTYPE);
|
||||||
|
u.res.res = va_arg(ap, void *);
|
||||||
|
u.res.ptype = va_arg(ap, RESTYPE);
|
||||||
|
u.res.parent = va_arg(ap, void *);
|
||||||
|
u.res.access_mode = va_arg(ap, Mask);
|
||||||
|
|
||||||
|
u.res.status = Success; /* default allow */
|
||||||
|
prv = &u.res.status;
|
||||||
|
break;
|
||||||
|
case XACE_DEVICE_ACCESS:
|
||||||
|
u.dev.client = va_arg(ap, ClientPtr);
|
||||||
|
u.dev.dev = va_arg(ap, DeviceIntPtr);
|
||||||
|
u.dev.access_mode = va_arg(ap, Mask);
|
||||||
|
|
||||||
|
u.dev.status = Success; /* default allow */
|
||||||
|
prv = &u.dev.status;
|
||||||
|
break;
|
||||||
|
case XACE_SEND_ACCESS:
|
||||||
|
u.send.client = va_arg(ap, ClientPtr);
|
||||||
|
u.send.dev = va_arg(ap, DeviceIntPtr);
|
||||||
|
u.send.pWin = va_arg(ap, WindowPtr);
|
||||||
|
|
||||||
|
u.send.events = va_arg(ap, xEventPtr);
|
||||||
|
u.send.count = va_arg(ap, int);
|
||||||
|
|
||||||
|
u.send.status = Success; /* default allow */
|
||||||
|
prv = &u.send.status;
|
||||||
|
break;
|
||||||
|
case XACE_RECEIVE_ACCESS:
|
||||||
|
u.recv.client = va_arg(ap, ClientPtr);
|
||||||
|
u.recv.pWin = va_arg(ap, WindowPtr);
|
||||||
|
|
||||||
|
u.recv.events = va_arg(ap, xEventPtr);
|
||||||
|
u.recv.count = va_arg(ap, int);
|
||||||
|
|
||||||
|
u.recv.status = Success; /* default allow */
|
||||||
|
prv = &u.recv.status;
|
||||||
|
break;
|
||||||
|
case XACE_CLIENT_ACCESS:
|
||||||
|
u.client.client = va_arg(ap, ClientPtr);
|
||||||
|
u.client.target = va_arg(ap, ClientPtr);
|
||||||
|
u.client.access_mode = va_arg(ap, Mask);
|
||||||
|
|
||||||
|
u.client.status = Success; /* default allow */
|
||||||
|
prv = &u.client.status;
|
||||||
|
break;
|
||||||
|
case XACE_EXT_ACCESS:
|
||||||
|
u.ext.client = va_arg(ap, ClientPtr);
|
||||||
|
|
||||||
|
u.ext.ext = va_arg(ap, ExtensionEntry *);
|
||||||
|
u.ext.access_mode = DixGetAttrAccess;
|
||||||
|
u.ext.status = Success; /* default allow */
|
||||||
|
prv = &u.ext.status;
|
||||||
|
break;
|
||||||
|
case XACE_SERVER_ACCESS:
|
||||||
|
u.server.client = va_arg(ap, ClientPtr);
|
||||||
|
u.server.access_mode = va_arg(ap, Mask);
|
||||||
|
|
||||||
|
u.server.status = Success; /* default allow */
|
||||||
|
prv = &u.server.status;
|
||||||
|
break;
|
||||||
|
case XACE_SCREEN_ACCESS:
|
||||||
|
case XACE_SCREENSAVER_ACCESS:
|
||||||
|
u.screen.client = va_arg(ap, ClientPtr);
|
||||||
|
u.screen.screen = va_arg(ap, ScreenPtr);
|
||||||
|
u.screen.access_mode = va_arg(ap, Mask);
|
||||||
|
|
||||||
|
u.screen.status = Success; /* default allow */
|
||||||
|
prv = &u.screen.status;
|
||||||
|
break;
|
||||||
|
case XACE_AUTH_AVAIL:
|
||||||
|
u.auth.client = va_arg(ap, ClientPtr);
|
||||||
|
u.auth.authId = va_arg(ap, XID);
|
||||||
|
|
||||||
|
break;
|
||||||
|
case XACE_KEY_AVAIL:
|
||||||
|
u.key.event = va_arg(ap, xEventPtr);
|
||||||
|
u.key.keybd = va_arg(ap, DeviceIntPtr);
|
||||||
|
u.key.count = va_arg(ap, int);
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
va_end(ap);
|
||||||
|
return 0; /* unimplemented hook number */
|
||||||
|
}
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
/* call callbacks and return result, if any. */
|
||||||
|
CallCallbacks(&XaceHooks[hook], &u);
|
||||||
|
return prv ? *prv : Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XaceCensorImage
|
/* XaceCensorImage
|
||||||
|
|
@ -191,10 +245,10 @@ XaceCensorImage(ClientPtr client,
|
||||||
BoxRec imageBox;
|
BoxRec imageBox;
|
||||||
int nRects;
|
int nRects;
|
||||||
|
|
||||||
imageBox.x1 = pDraw->x + x;
|
imageBox.x1 = x;
|
||||||
imageBox.y1 = pDraw->y + y;
|
imageBox.y1 = y;
|
||||||
imageBox.x2 = pDraw->x + x + w;
|
imageBox.x2 = x + w;
|
||||||
imageBox.y2 = pDraw->y + y + h;
|
imageBox.y2 = y + h;
|
||||||
RegionInit(&imageRegion, &imageBox, 1);
|
RegionInit(&imageRegion, &imageBox, 1);
|
||||||
RegionNull(&censorRegion);
|
RegionNull(&censorRegion);
|
||||||
|
|
||||||
|
|
@ -219,7 +273,7 @@ XaceCensorImage(ClientPtr client,
|
||||||
goto failSafe;
|
goto failSafe;
|
||||||
}
|
}
|
||||||
for (pBox = RegionRects(&censorRegion), i = 0; i < nRects; i++, pBox++) {
|
for (pBox = RegionRects(&censorRegion), i = 0; i < nRects; i++, pBox++) {
|
||||||
pRects[i].x = pBox->x1 - imageBox.x1;
|
pRects[i].x = pBox->x1;
|
||||||
pRects[i].y = pBox->y1 - imageBox.y1;
|
pRects[i].y = pBox->y1 - imageBox.y1;
|
||||||
pRects[i].width = pBox->x2 - pBox->x1;
|
pRects[i].width = pBox->x2 - pBox->x1;
|
||||||
pRects[i].height = pBox->y2 - pBox->y1;
|
pRects[i].height = pBox->y2 - pBox->y1;
|
||||||
|
|
@ -273,11 +327,15 @@ XaceCensorImage(ClientPtr client,
|
||||||
int
|
int
|
||||||
XaceGetConnectionNumber(ClientPtr client)
|
XaceGetConnectionNumber(ClientPtr client)
|
||||||
{
|
{
|
||||||
return GetClientFd(client);
|
XtransConnInfo ci = ((OsCommPtr) client->osPrivate)->trans_conn;
|
||||||
|
|
||||||
|
return _XSERVTransGetConnectionNumber(ci);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
XaceIsLocal(ClientPtr client)
|
XaceIsLocal(ClientPtr client)
|
||||||
{
|
{
|
||||||
return ClientIsLocal(client);
|
XtransConnInfo ci = ((OsCommPtr) client->osPrivate)->trans_conn;
|
||||||
|
|
||||||
|
return _XSERVTransIsLocal(ci);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
62
Xext/xace.h
62
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"
|
||||||
|
|
@ -53,7 +52,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#define XACE_SCREENSAVER_ACCESS 12
|
#define XACE_SCREENSAVER_ACCESS 12
|
||||||
#define XACE_AUTH_AVAIL 13
|
#define XACE_AUTH_AVAIL 13
|
||||||
#define XACE_KEY_AVAIL 14
|
#define XACE_KEY_AVAIL 14
|
||||||
#define XACE_NUM_HOOKS 15
|
#define XACE_AUDIT_BEGIN 15
|
||||||
|
#define XACE_AUDIT_END 16
|
||||||
|
#define XACE_NUM_HOOKS 17
|
||||||
|
|
||||||
extern _X_EXPORT CallbackListPtr XaceHooks[XACE_NUM_HOOKS];
|
extern _X_EXPORT CallbackListPtr XaceHooks[XACE_NUM_HOOKS];
|
||||||
|
|
||||||
|
|
@ -64,40 +65,15 @@ extern _X_EXPORT int XaceHook(int /*hook */ ,
|
||||||
... /*appropriate args for hook */
|
... /*appropriate args for hook */
|
||||||
);
|
);
|
||||||
|
|
||||||
/* determine whether any callbacks are present for the XACE hook */
|
|
||||||
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) \
|
|
||||||
((XaceHooks[XACE_EXT_DISPATCH] && (m) >= EXTENSION_BASE) ? \
|
|
||||||
XaceHookDispatch0((c), (m)) : \
|
|
||||||
Success)
|
|
||||||
|
|
||||||
extern _X_EXPORT int XaceHookPropertyAccess(ClientPtr ptr, WindowPtr pWin,
|
extern _X_EXPORT int XaceHookPropertyAccess(ClientPtr ptr, WindowPtr pWin,
|
||||||
PropertyPtr *ppProp,
|
PropertyPtr *ppProp,
|
||||||
Mask access_mode);
|
Mask access_mode);
|
||||||
extern _X_EXPORT int XaceHookSelectionAccess(ClientPtr ptr, Selection ** ppSel,
|
extern _X_EXPORT int XaceHookSelectionAccess(ClientPtr ptr, Selection ** ppSel,
|
||||||
Mask access_mode);
|
Mask access_mode);
|
||||||
|
extern _X_EXPORT void XaceHookAuditEnd(ClientPtr ptr, int result);
|
||||||
/* 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.
|
||||||
*/
|
*/
|
||||||
|
|
@ -132,38 +108,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 XaceHookIsSet(args...) 0
|
#define XaceHook(args...) Success
|
||||||
#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 XaceHookAuditEnd(args...) { ; }
|
||||||
#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 XaceHookIsSet(...) 0
|
#define XaceHook(...) Success
|
||||||
#define XaceHookDispatch(...) Success
|
#define XaceHookDispatch(...) Success
|
||||||
#define XaceHookPropertyAccess(...) Success
|
#define XaceHookPropertyAccess(...) Success
|
||||||
#define XaceHookSelectionAccess(...) Success
|
#define XaceHookSelectionAccess(...) Success
|
||||||
#define XaceHookResourceAccess(...) Success
|
#define XaceHookAuditEnd(...) { ; }
|
||||||
#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>
|
||||||
|
|
||||||
|
|
@ -99,7 +101,7 @@ ProcXCMiscGetXIDList(ClientPtr client)
|
||||||
if (stuff->count > UINT32_MAX / sizeof(XID))
|
if (stuff->count > UINT32_MAX / sizeof(XID))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
pids = xallocarray(stuff->count, sizeof(XID));
|
pids = (XID *) malloc(stuff->count * sizeof(XID));
|
||||||
if (!pids) {
|
if (!pids) {
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
@ -140,27 +142,39 @@ ProcXCMiscDispatch(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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
|
static int
|
||||||
|
SProcXCMiscGetXIDRange(ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
|
return ProcXCMiscGetXIDRange(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXCMiscDispatch(ClientPtr client)
|
SProcXCMiscDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
|
@ -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,19 @@
|
||||||
* 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
|
||||||
|
#if defined(linux) && (!defined(__GNU_LIBRARY__) || __GNU_LIBRARY__ < 2)
|
||||||
|
/* libc4 does not define __GNU_LIBRARY__, libc5 defines __GNU_LIBRARY__ as 1 */
|
||||||
|
/* Linux libc4 and libc5 only (because glibc doesn't include kernel headers):
|
||||||
|
Linux 2.0.x and 2.2.x define SHMLBA as PAGE_SIZE, but forget to define
|
||||||
|
PAGE_SIZE. It is defined in <asm/page.h>. */
|
||||||
|
#include <asm/page.h>
|
||||||
|
#endif
|
||||||
#ifdef SVR4
|
#ifdef SVR4
|
||||||
#include <sys/sysmacros.h>
|
#include <sys/sysmacros.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -56,24 +65,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
|
||||||
|
|
@ -89,6 +96,8 @@ static Bool badSysCall = FALSE;
|
||||||
|
|
||||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__DragonFly__)
|
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__DragonFly__)
|
||||||
|
|
||||||
|
#include <sys/signal.h>
|
||||||
|
|
||||||
static void
|
static void
|
||||||
SigSysHandler(int signo)
|
SigSysHandler(int signo)
|
||||||
{
|
{
|
||||||
|
|
@ -102,7 +111,7 @@ CheckForShmSyscall(void)
|
||||||
int shmid = -1;
|
int shmid = -1;
|
||||||
|
|
||||||
/* If no SHM support in the kernel, the bad syscall will generate SIGSYS */
|
/* If no SHM support in the kernel, the bad syscall will generate SIGSYS */
|
||||||
oldHandler = OsSignal(SIGSYS, SigSysHandler);
|
oldHandler = signal(SIGSYS, SigSysHandler);
|
||||||
|
|
||||||
badSysCall = FALSE;
|
badSysCall = FALSE;
|
||||||
shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT);
|
shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT);
|
||||||
|
|
@ -114,7 +123,7 @@ CheckForShmSyscall(void)
|
||||||
/* Allocation failed */
|
/* Allocation failed */
|
||||||
badSysCall = TRUE;
|
badSysCall = TRUE;
|
||||||
}
|
}
|
||||||
OsSignal(SIGSYS, oldHandler);
|
signal(SIGSYS, oldHandler);
|
||||||
return !badSysCall;
|
return !badSysCall;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -126,7 +135,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 +230,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 +249,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 +286,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 +338,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 +348,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 +362,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 +383,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) {
|
||||||
|
|
@ -390,10 +401,10 @@ ProcXF86BigfontQueryFont(ClientPtr client)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#endif
|
#endif
|
||||||
pCI = xallocarray(nCharInfos, sizeof(xCharInfo));
|
pCI = malloc(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,10 +436,10 @@ 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 (!FontSetPrivate(pFont, FontShmdescIndex, pDesc)) {
|
||||||
shmdealloc(pDesc);
|
shmdealloc(pDesc);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
@ -452,7 +463,7 @@ ProcXF86BigfontQueryFont(ClientPtr client)
|
||||||
if (hashModulus > nCharInfos + 1)
|
if (hashModulus > nCharInfos + 1)
|
||||||
hashModulus = nCharInfos + 1;
|
hashModulus = nCharInfos + 1;
|
||||||
|
|
||||||
tmp = xallocarray(4 * nCharInfos + 1, sizeof(CARD16));
|
tmp = malloc((4 * nCharInfos + 1) * sizeof(CARD16));
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
if (!pDesc)
|
if (!pDesc)
|
||||||
free(pCI);
|
free(pCI);
|
||||||
|
|
@ -648,23 +659,27 @@ ProcXF86BigfontDispatch(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXF86BigfontQueryVersion(ClientPtr client)
|
SProcXF86BigfontQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xXF86BigfontQueryVersionReq); */
|
REQUEST(xXF86BigfontQueryVersionReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
return ProcXF86BigfontQueryVersion(client);
|
return ProcXF86BigfontQueryVersion(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXF86BigfontDispatch(ClientPtr client)
|
SProcXF86BigfontDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
|
@ -688,7 +703,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
|
||||||
|
|
@ -708,7 +723,7 @@ XFree86BigfontExtensionInit(void)
|
||||||
+ (unsigned int) (65536.0 / (RAND_MAX + 1.0) * rand());
|
+ (unsigned int) (65536.0 / (RAND_MAX + 1.0) * rand());
|
||||||
/* fprintf(stderr, "signature = 0x%08X\n", signature); */
|
/* fprintf(stderr, "signature = 0x%08X\n", signature); */
|
||||||
|
|
||||||
FontShmdescIndex = xfont2_allocate_font_private_index();
|
FontShmdescIndex = AllocateFontPrivateIndex();
|
||||||
|
|
||||||
#if !defined(CSRG_BASED) && !defined(__CYGWIN__)
|
#if !defined(CSRG_BASED) && !defined(__CYGWIN__)
|
||||||
pagesize = SHMLBA;
|
pagesize = SHMLBA;
|
||||||
|
|
|
||||||
175
Xext/xres.c
175
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
|
||||||
|
|
@ -223,9 +223,7 @@ ProcXResQueryClients(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXResQueryClientsReq);
|
REQUEST_SIZE_MATCH(xXResQueryClientsReq);
|
||||||
|
|
||||||
current_clients = xallocarray(currentMaxClients, sizeof(int));
|
current_clients = malloc(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++) {
|
||||||
|
|
@ -276,24 +274,6 @@ ResFindAllRes(void *value, XID id, RESTYPE type, void *cdata)
|
||||||
counts[(type & TypeMask) - 1]++;
|
counts[(type & TypeMask) - 1]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
static CARD32
|
|
||||||
resourceTypeAtom(int i)
|
|
||||||
{
|
|
||||||
CARD32 ret;
|
|
||||||
|
|
||||||
const char *name = LookupResourceName(i);
|
|
||||||
if (strcmp(name, XREGISTRY_UNKNOWN))
|
|
||||||
ret = MakeAtom(name, strlen(name), TRUE);
|
|
||||||
else {
|
|
||||||
char buf[40];
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "Unregistered resource %i", i + 1);
|
|
||||||
ret = MakeAtom(buf, strlen(buf), TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcXResQueryClientResources(ClientPtr client)
|
ProcXResQueryClientResources(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
|
@ -338,12 +318,22 @@ ProcXResQueryClientResources(ClientPtr client)
|
||||||
|
|
||||||
if (num_types) {
|
if (num_types) {
|
||||||
xXResType scratch;
|
xXResType scratch;
|
||||||
|
const char *name;
|
||||||
|
|
||||||
for (i = 0; i < lastResourceType; i++) {
|
for (i = 0; i < lastResourceType; i++) {
|
||||||
if (!counts[i])
|
if (!counts[i])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
scratch.resource_type = resourceTypeAtom(i + 1);
|
name = LookupResourceName(i + 1);
|
||||||
|
if (strcmp(name, XREGISTRY_UNKNOWN))
|
||||||
|
scratch.resource_type = MakeAtom(name, strlen(name), TRUE);
|
||||||
|
else {
|
||||||
|
char buf[40];
|
||||||
|
|
||||||
|
snprintf(buf, sizeof(buf), "Unregistered resource %i", i + 1);
|
||||||
|
scratch.resource_type = MakeAtom(buf, strlen(buf), TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
scratch.count = counts[i];
|
scratch.count = counts[i];
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
|
|
@ -359,6 +349,21 @@ ProcXResQueryClientResources(ClientPtr client)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned long
|
||||||
|
ResGetApproxPixmapBytes(PixmapPtr pix)
|
||||||
|
{
|
||||||
|
unsigned long nPixels;
|
||||||
|
float bytesPerPixel;
|
||||||
|
|
||||||
|
bytesPerPixel = (float)pix->drawable.bitsPerPixel / 8.0;
|
||||||
|
nPixels = pix->drawable.width * pix->drawable.height;
|
||||||
|
|
||||||
|
/* Divide by refcnt as pixmap could be shared between clients,
|
||||||
|
* so total pixmap mem is shared between these.
|
||||||
|
*/
|
||||||
|
return (nPixels * bytesPerPixel) / pix->refcnt;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ResFindResourcePixmaps(void *value, XID id, RESTYPE type, void *cdata)
|
ResFindResourcePixmaps(void *value, XID id, RESTYPE type, void *cdata)
|
||||||
{
|
{
|
||||||
|
|
@ -370,6 +375,57 @@ ResFindResourcePixmaps(void *value, XID id, RESTYPE type, void *cdata)
|
||||||
*bytes += size.pixmapRefSize;
|
*bytes += size.pixmapRefSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ResFindPixmaps(void *value, XID id, void *cdata)
|
||||||
|
{
|
||||||
|
unsigned long *bytes = (unsigned long *) cdata;
|
||||||
|
PixmapPtr pix = (PixmapPtr) value;
|
||||||
|
|
||||||
|
*bytes += ResGetApproxPixmapBytes(pix);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ResFindWindowPixmaps(void *value, XID id, void *cdata)
|
||||||
|
{
|
||||||
|
unsigned long *bytes = (unsigned long *) cdata;
|
||||||
|
WindowPtr pWin = (WindowPtr) value;
|
||||||
|
|
||||||
|
if (pWin->backgroundState == BackgroundPixmap)
|
||||||
|
*bytes += ResGetApproxPixmapBytes(pWin->background.pixmap);
|
||||||
|
|
||||||
|
if (pWin->border.pixmap != NULL && !pWin->borderIsPixel)
|
||||||
|
*bytes += ResGetApproxPixmapBytes(pWin->border.pixmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ResFindGCPixmaps(void *value, XID id, void *cdata)
|
||||||
|
{
|
||||||
|
unsigned long *bytes = (unsigned long *) cdata;
|
||||||
|
GCPtr pGC = (GCPtr) value;
|
||||||
|
|
||||||
|
if (pGC->stipple != NULL)
|
||||||
|
*bytes += ResGetApproxPixmapBytes(pGC->stipple);
|
||||||
|
|
||||||
|
if (pGC->tile.pixmap != NULL && !pGC->tileIsPixel)
|
||||||
|
*bytes += ResGetApproxPixmapBytes(pGC->tile.pixmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ResFindPicturePixmaps(void *value, XID id, void *cdata)
|
||||||
|
{
|
||||||
|
#ifdef RENDER
|
||||||
|
ResFindResourcePixmaps(value, id, PictureType, cdata);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ResFindCompositeClientWindowPixmaps (void *value, XID id, void *cdata)
|
||||||
|
{
|
||||||
|
#ifdef COMPOSITE
|
||||||
|
ResFindResourcePixmaps(value, id, CompositeClientWindowType, cdata);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcXResQueryClientPixmapBytes(ClientPtr client)
|
ProcXResQueryClientPixmapBytes(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
|
@ -389,8 +445,34 @@ ProcXResQueryClientPixmapBytes(ClientPtr client)
|
||||||
|
|
||||||
bytes = 0;
|
bytes = 0;
|
||||||
|
|
||||||
FindAllClientResources(clients[clientID], ResFindResourcePixmaps,
|
FindClientResourcesByType(clients[clientID], RT_PIXMAP, ResFindPixmaps,
|
||||||
(void *) (&bytes));
|
(void *) (&bytes));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Make sure win background pixmaps also held to account.
|
||||||
|
*/
|
||||||
|
FindClientResourcesByType(clients[clientID], RT_WINDOW,
|
||||||
|
ResFindWindowPixmaps, (void *) (&bytes));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GC Tile & Stipple pixmaps too.
|
||||||
|
*/
|
||||||
|
FindClientResourcesByType(clients[clientID], RT_GC,
|
||||||
|
ResFindGCPixmaps, (void *) (&bytes));
|
||||||
|
|
||||||
|
#ifdef RENDER
|
||||||
|
/* Render extension picture pixmaps. */
|
||||||
|
FindClientResourcesByType(clients[clientID], PictureType,
|
||||||
|
ResFindPicturePixmaps,
|
||||||
|
(void *)(&bytes));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef COMPOSITE
|
||||||
|
/* Composite extension client window pixmaps. */
|
||||||
|
FindClientResourcesByType(clients[clientID], CompositeClientWindowType,
|
||||||
|
ResFindCompositeClientWindowPixmaps,
|
||||||
|
(void *)(&bytes));
|
||||||
|
#endif
|
||||||
|
|
||||||
rep = (xXResQueryClientPixmapBytesReply) {
|
rep = (xXResQueryClientPixmapBytesReply) {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
|
|
@ -444,7 +526,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 +693,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 +701,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 +711,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)
|
||||||
{
|
{
|
||||||
|
|
@ -703,7 +785,7 @@ AddSubResourceSizeSpec(void *value,
|
||||||
sizeFunc(value, id, &size);
|
sizeFunc(value, id, &size);
|
||||||
|
|
||||||
crossRef->spec.resource = id;
|
crossRef->spec.resource = id;
|
||||||
crossRef->spec.type = resourceTypeAtom(type);
|
crossRef->spec.type = type;
|
||||||
crossRef->bytes = size.resourceSize;
|
crossRef->bytes = size.resourceSize;
|
||||||
crossRef->refCount = size.refCnt;
|
crossRef->refCount = size.refCnt;
|
||||||
crossRef->useCount = 1;
|
crossRef->useCount = 1;
|
||||||
|
|
@ -776,7 +858,7 @@ AddResourceSizeValue(void *ptr, XID id, RESTYPE type, void *cdata)
|
||||||
sizeFunc(ptr, id, &size);
|
sizeFunc(ptr, id, &size);
|
||||||
|
|
||||||
value->size.spec.resource = id;
|
value->size.spec.resource = id;
|
||||||
value->size.spec.type = resourceTypeAtom(type);
|
value->size.spec.type = type;
|
||||||
value->size.bytes = size.resourceSize;
|
value->size.bytes = size.resourceSize;
|
||||||
value->size.refCount = size.refCnt;
|
value->size.refCount = size.refCnt;
|
||||||
value->size.useCount = 1;
|
value->size.useCount = 1;
|
||||||
|
|
@ -957,8 +1039,6 @@ ProcXResQueryResourceBytes (ClientPtr client)
|
||||||
ConstructResourceBytesCtx ctx;
|
ConstructResourceBytesCtx ctx;
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xXResQueryResourceBytesReq);
|
REQUEST_AT_LEAST_SIZE(xXResQueryResourceBytesReq);
|
||||||
if (stuff->numSpecs > UINT32_MAX / sizeof(ctx.specs[0]))
|
|
||||||
return BadLength;
|
|
||||||
REQUEST_FIXED_SIZE(xXResQueryResourceBytesReq,
|
REQUEST_FIXED_SIZE(xXResQueryResourceBytesReq,
|
||||||
stuff->numSpecs * sizeof(ctx.specs[0]));
|
stuff->numSpecs * sizeof(ctx.specs[0]));
|
||||||
|
|
||||||
|
|
@ -1019,14 +1099,14 @@ ProcResDispatch(ClientPtr client)
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXResQueryVersion(ClientPtr client)
|
SProcXResQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST_SIZE_MATCH(xXResQueryVersionReq);
|
REQUEST_SIZE_MATCH(xXResQueryVersionReq);
|
||||||
return ProcXResQueryVersion(client);
|
return ProcXResQueryVersion(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXResQueryClientResources(ClientPtr client)
|
SProcXResQueryClientResources(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXResQueryClientResourcesReq);
|
REQUEST(xXResQueryClientResourcesReq);
|
||||||
|
|
@ -1035,7 +1115,7 @@ SProcXResQueryClientResources(ClientPtr client)
|
||||||
return ProcXResQueryClientResources(client);
|
return ProcXResQueryClientResources(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXResQueryClientPixmapBytes(ClientPtr client)
|
SProcXResQueryClientPixmapBytes(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXResQueryClientPixmapBytesReq);
|
REQUEST(xXResQueryClientPixmapBytesReq);
|
||||||
|
|
@ -1044,7 +1124,7 @@ SProcXResQueryClientPixmapBytes(ClientPtr client)
|
||||||
return ProcXResQueryClientPixmapBytes(client);
|
return ProcXResQueryClientPixmapBytes(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXResQueryClientIds (ClientPtr client)
|
SProcXResQueryClientIds (ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXResQueryClientIdsReq);
|
REQUEST(xXResQueryClientIdsReq);
|
||||||
|
|
@ -1057,15 +1137,15 @@ SProcXResQueryClientIds (ClientPtr client)
|
||||||
/** @brief Implements the XResQueryResourceBytes of XResProto v1.2.
|
/** @brief Implements the XResQueryResourceBytes of XResProto v1.2.
|
||||||
This variant byteswaps request contents before issuing the
|
This variant byteswaps request contents before issuing the
|
||||||
rest of the work to ProcXResQueryResourceBytes */
|
rest of the work to ProcXResQueryResourceBytes */
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXResQueryResourceBytes (ClientPtr client)
|
SProcXResQueryResourceBytes (ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXResQueryResourceBytesReq);
|
REQUEST(xXResQueryResourceBytesReq);
|
||||||
int c;
|
int c;
|
||||||
xXResResourceIdSpec *specs = (void*) ((char*) stuff + sizeof(*stuff));
|
xXResResourceIdSpec *specs = (void*) ((char*) stuff + sizeof(*stuff));
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xXResQueryResourceBytesReq);
|
|
||||||
swapl(&stuff->numSpecs);
|
swapl(&stuff->numSpecs);
|
||||||
|
REQUEST_AT_LEAST_SIZE(xXResQueryResourceBytesReq);
|
||||||
REQUEST_FIXED_SIZE(xXResQueryResourceBytesReq,
|
REQUEST_FIXED_SIZE(xXResQueryResourceBytesReq,
|
||||||
stuff->numSpecs * sizeof(specs[0]));
|
stuff->numSpecs * sizeof(specs[0]));
|
||||||
|
|
||||||
|
|
@ -1076,10 +1156,11 @@ SProcXResQueryResourceBytes (ClientPtr client)
|
||||||
return ProcXResQueryResourceBytes(client);
|
return ProcXResQueryResourceBytes(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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 */
|
||||||
|
|
@ -527,13 +528,13 @@ ProcSELinuxDispatch(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcSELinuxQueryVersion(ClientPtr client)
|
SProcSELinuxQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
return ProcSELinuxQueryVersion(client);
|
return ProcSELinuxQueryVersion(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcSELinuxSetCreateContext(ClientPtr client, unsigned offset)
|
SProcSELinuxSetCreateContext(ClientPtr client, unsigned offset)
|
||||||
{
|
{
|
||||||
REQUEST(SELinuxSetCreateContextReq);
|
REQUEST(SELinuxSetCreateContextReq);
|
||||||
|
|
@ -543,7 +544,7 @@ SProcSELinuxSetCreateContext(ClientPtr client, unsigned offset)
|
||||||
return ProcSELinuxSetCreateContext(client, offset);
|
return ProcSELinuxSetCreateContext(client, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcSELinuxSetDeviceContext(ClientPtr client)
|
SProcSELinuxSetDeviceContext(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(SELinuxSetContextReq);
|
REQUEST(SELinuxSetContextReq);
|
||||||
|
|
@ -554,7 +555,7 @@ SProcSELinuxSetDeviceContext(ClientPtr client)
|
||||||
return ProcSELinuxSetDeviceContext(client);
|
return ProcSELinuxSetDeviceContext(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcSELinuxGetDeviceContext(ClientPtr client)
|
SProcSELinuxGetDeviceContext(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(SELinuxGetContextReq);
|
REQUEST(SELinuxGetContextReq);
|
||||||
|
|
@ -564,7 +565,7 @@ SProcSELinuxGetDeviceContext(ClientPtr client)
|
||||||
return ProcSELinuxGetDeviceContext(client);
|
return ProcSELinuxGetDeviceContext(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcSELinuxGetDrawableContext(ClientPtr client)
|
SProcSELinuxGetDrawableContext(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(SELinuxGetContextReq);
|
REQUEST(SELinuxGetContextReq);
|
||||||
|
|
@ -574,7 +575,7 @@ SProcSELinuxGetDrawableContext(ClientPtr client)
|
||||||
return ProcSELinuxGetDrawableContext(client);
|
return ProcSELinuxGetDrawableContext(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcSELinuxGetPropertyContext(ClientPtr client, void *privKey)
|
SProcSELinuxGetPropertyContext(ClientPtr client, void *privKey)
|
||||||
{
|
{
|
||||||
REQUEST(SELinuxGetPropertyContextReq);
|
REQUEST(SELinuxGetPropertyContextReq);
|
||||||
|
|
@ -585,7 +586,7 @@ SProcSELinuxGetPropertyContext(ClientPtr client, void *privKey)
|
||||||
return ProcSELinuxGetPropertyContext(client, privKey);
|
return ProcSELinuxGetPropertyContext(client, privKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcSELinuxGetSelectionContext(ClientPtr client, void *privKey)
|
SProcSELinuxGetSelectionContext(ClientPtr client, void *privKey)
|
||||||
{
|
{
|
||||||
REQUEST(SELinuxGetContextReq);
|
REQUEST(SELinuxGetContextReq);
|
||||||
|
|
@ -595,7 +596,7 @@ SProcSELinuxGetSelectionContext(ClientPtr client, void *privKey)
|
||||||
return ProcSELinuxGetSelectionContext(client, privKey);
|
return ProcSELinuxGetSelectionContext(client, privKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcSELinuxListProperties(ClientPtr client)
|
SProcSELinuxListProperties(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(SELinuxGetContextReq);
|
REQUEST(SELinuxGetContextReq);
|
||||||
|
|
@ -605,7 +606,7 @@ SProcSELinuxListProperties(ClientPtr client)
|
||||||
return ProcSELinuxListProperties(client);
|
return ProcSELinuxListProperties(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcSELinuxGetClientContext(ClientPtr client)
|
SProcSELinuxGetClientContext(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(SELinuxGetContextReq);
|
REQUEST(SELinuxGetContextReq);
|
||||||
|
|
@ -615,11 +616,13 @@ SProcSELinuxGetClientContext(ClientPtr client)
|
||||||
return ProcSELinuxGetClientContext(client);
|
return ProcSELinuxGetClientContext(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcSELinuxDispatch(ClientPtr client)
|
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,10 @@ 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);
|
||||||
|
|
||||||
|
AddExtensionAlias("Flask", extEntry);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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,8 @@ 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"
|
||||||
|
#include "../os/osdep.h"
|
||||||
#define _XSELINUX_NEED_FLASK_MAP
|
#define _XSELINUX_NEED_FLASK_MAP
|
||||||
#include "xselinuxint.h"
|
#include "xselinuxint.h"
|
||||||
|
|
||||||
|
|
@ -115,7 +115,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);
|
||||||
|
|
@ -147,7 +147,7 @@ SELinuxLabelClient(ClientPtr client)
|
||||||
strncpy(subj->command, cmdname, COMMAND_LEN - 1);
|
strncpy(subj->command, cmdname, COMMAND_LEN - 1);
|
||||||
|
|
||||||
if (!cached)
|
if (!cached)
|
||||||
free((void *) cmdname); /* const char * */
|
free(cmdname); /* const char * */
|
||||||
}
|
}
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
|
|
@ -170,7 +170,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 +200,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -294,9 +294,6 @@ SELinuxAudit(void *auditdata,
|
||||||
audit->extension ? audit->extension : "");
|
audit->extension ? audit->extension : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
SELinuxLog(int type, const char *fmt, ...) _X_ATTRIBUTE_PRINTF(2, 3);
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
SELinuxLog(int type, const char *fmt, ...)
|
SELinuxLog(int type, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
|
@ -319,7 +316,6 @@ SELinuxLog(int type, const char *fmt, ...)
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
vsnprintf(buf, MAX_AUDIT_MESSAGE_LENGTH, fmt, ap);
|
vsnprintf(buf, MAX_AUDIT_MESSAGE_LENGTH, fmt, ap);
|
||||||
rc = audit_log_user_avc_message(audit_fd, aut, buf, NULL, NULL, NULL, 0);
|
rc = audit_log_user_avc_message(audit_fd, aut, buf, NULL, NULL, NULL, 0);
|
||||||
(void) rc;
|
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
LogMessageVerb(X_WARNING, 0, "%s", buf);
|
LogMessageVerb(X_WARNING, 0, "%s", buf);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -480,7 +476,7 @@ SELinuxExtension(CallbackListPtr *pcbl, void *unused, void *calldata)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Perform the security check */
|
/* Perform the security check */
|
||||||
auditdata.extension = (char *) rec->ext->name;
|
auditdata.extension = rec->ext->name;
|
||||||
rc = SELinuxDoCheck(subj, obj, SECCLASS_X_EXTENSION, rec->access_mode,
|
rc = SELinuxDoCheck(subj, obj, SECCLASS_X_EXTENSION, rec->access_mode,
|
||||||
&auditdata);
|
&auditdata);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -663,7 +659,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 +761,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 +770,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 +788,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)
|
||||||
|
|
@ -811,9 +807,15 @@ SELinuxResourceState(CallbackListPtr *pcbl, void *unused, void *calldata)
|
||||||
static int netlink_fd;
|
static int netlink_fd;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
SELinuxNetlinkNotify(int fd, int ready, void *data)
|
SELinuxBlockHandler(void *data, struct timeval **tv, void *read_mask)
|
||||||
{
|
{
|
||||||
avc_netlink_check_nb();
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
SELinuxWakeupHandler(void *data, int num_fds, void *read_mask)
|
||||||
|
{
|
||||||
|
if (num_fds > 0 && FD_ISSET(netlink_fd, (fd_set *) read_mask))
|
||||||
|
avc_netlink_check_nb();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -839,7 +841,9 @@ SELinuxFlaskReset(void)
|
||||||
/* Tear down SELinux stuff */
|
/* Tear down SELinux stuff */
|
||||||
audit_close(audit_fd);
|
audit_close(audit_fd);
|
||||||
avc_netlink_release_fd();
|
avc_netlink_release_fd();
|
||||||
RemoveNotifyFd(netlink_fd);
|
RemoveBlockAndWakeupHandlers(SELinuxBlockHandler, SELinuxWakeupHandler,
|
||||||
|
NULL);
|
||||||
|
RemoveGeneralSocket(netlink_fd);
|
||||||
|
|
||||||
avc_destroy();
|
avc_destroy();
|
||||||
}
|
}
|
||||||
|
|
@ -848,7 +852,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) {
|
||||||
|
|
@ -911,7 +915,9 @@ SELinuxFlaskInit(void)
|
||||||
FatalError("SELinux: Failed to create atom\n");
|
FatalError("SELinux: Failed to create atom\n");
|
||||||
|
|
||||||
netlink_fd = avc_netlink_acquire_fd();
|
netlink_fd = avc_netlink_acquire_fd();
|
||||||
SetNotifyFd(netlink_fd, SELinuxNetlinkNotify, X_NOTIFY_READ, NULL);
|
AddGeneralSocket(netlink_fd);
|
||||||
|
RegisterBlockAndWakeupHandlers(SELinuxBlockHandler, SELinuxWakeupHandler,
|
||||||
|
NULL);
|
||||||
|
|
||||||
/* Register callbacks */
|
/* Register callbacks */
|
||||||
ret &= AddCallback(&ClientStateCallback, SELinuxClientState, NULL);
|
ret &= AddCallback(&ClientStateCallback, SELinuxClientState, NULL);
|
||||||
|
|
|
||||||
|
|
@ -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 */
|
||||||
|
|
@ -63,7 +64,7 @@ SELinuxArraySet(SELinuxArrayRec * rec, unsigned key, void *val)
|
||||||
{
|
{
|
||||||
if (key >= rec->size) {
|
if (key >= rec->size) {
|
||||||
/* Need to increase size of array */
|
/* Need to increase size of array */
|
||||||
rec->array = reallocarray(rec->array, key + 1, sizeof(val));
|
rec->array = realloc(rec->array, (key + 1) * sizeof(val));
|
||||||
if (!rec->array)
|
if (!rec->array)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
memset(rec->array + rec->size, 0, (key - rec->size + 1) * sizeof(val));
|
memset(rec->array + rec->size, 0, (key - rec->size + 1) * sizeof(val));
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
127
Xext/xtest.c
127
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, NULL);
|
||||||
|
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);
|
||||||
|
|
@ -487,26 +468,30 @@ ProcXTestDispatch(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
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);
|
||||||
return ProcXTestCompareCursor(client);
|
return ProcXTestCompareCursor(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
XTestSwapFakeInput(ClientPtr client, xReq * req)
|
XTestSwapFakeInput(ClientPtr client, xReq * req)
|
||||||
{
|
{
|
||||||
int nev;
|
int nev;
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
@ -530,20 +514,31 @@ XTestSwapFakeInput(ClientPtr client, xReq * req)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXTestFakeInput(ClientPtr client)
|
SProcXTestFakeInput(ClientPtr client)
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
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
|
static int
|
||||||
|
SProcXTestGrabControl(ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xXTestGrabControlReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length);
|
||||||
|
REQUEST_SIZE_MATCH(xXTestGrabControlReq);
|
||||||
|
return ProcXTestGrabControl(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
SProcXTestDispatch(ClientPtr client)
|
SProcXTestDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
209
Xext/xvdisp.c
209
Xext/xvdisp.c
|
|
@ -4,13 +4,13 @@ and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
|
||||||
|
|
||||||
All Rights Reserved
|
All Rights Reserved
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software and its
|
Permission to use, copy, modify, and distribute this software and its
|
||||||
documentation for any purpose and without fee is hereby granted,
|
documentation for any purpose and without fee is hereby granted,
|
||||||
provided that the above copyright notice appear in all copies and that
|
provided that the above copyright notice appear in all copies and that
|
||||||
both that copyright notice and this permission notice appear in
|
both that copyright notice and this permission notice appear in
|
||||||
supporting documentation, and that the names of Digital or MIT not be
|
supporting documentation, and that the names of Digital or MIT not be
|
||||||
used in advertising or publicity pertaining to distribution of the
|
used in advertising or publicity pertaining to distribution of the
|
||||||
software without specific, written prior permission.
|
software without specific, written prior permission.
|
||||||
|
|
||||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||||
|
|
@ -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)
|
||||||
|
|
@ -297,6 +297,9 @@ SWriteListImageFormatsReply(ClientPtr client, xvListImageFormatsReply * rep)
|
||||||
if ((_c)->swapped) SWriteImageFormatInfo(_c, _d); \
|
if ((_c)->swapped) SWriteImageFormatInfo(_c, _d); \
|
||||||
else WriteToClient(_c, sz_xvImageFormatInfo, _d)
|
else WriteToClient(_c, sz_xvImageFormatInfo, _d)
|
||||||
|
|
||||||
|
#define _AllocatePort(_i,_p) \
|
||||||
|
((_p)->id != _i) ? (* (_p)->pAdaptor->ddAllocatePort)(_i,_p,&_p) : Success
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcXvQueryExtension(ClientPtr client)
|
ProcXvQueryExtension(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
|
@ -353,6 +356,8 @@ ProcXvQueryAdaptors(ClientPtr client)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(*pxvs->ddQueryAdaptors) (pScreen, &pxvs->pAdaptors, &pxvs->nAdaptors);
|
||||||
|
|
||||||
rep = (xvQueryAdaptorsReply) {
|
rep = (xvQueryAdaptorsReply) {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
@ -417,12 +422,18 @@ ProcXvQueryEncodings(ClientPtr client)
|
||||||
XvPortPtr pPort;
|
XvPortPtr pPort;
|
||||||
int ne;
|
int ne;
|
||||||
XvEncodingPtr pe;
|
XvEncodingPtr pe;
|
||||||
|
int status;
|
||||||
|
|
||||||
REQUEST(xvQueryEncodingsReq);
|
REQUEST(xvQueryEncodingsReq);
|
||||||
REQUEST_SIZE_MATCH(xvQueryEncodingsReq);
|
REQUEST_SIZE_MATCH(xvQueryEncodingsReq);
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
|
||||||
|
client->errorValue = stuff->port;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
rep = (xvQueryEncodingsReply) {
|
rep = (xvQueryEncodingsReply) {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
@ -474,6 +485,11 @@ ProcXvPutVideo(ClientPtr client)
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
|
||||||
|
client->errorValue = stuff->port;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(pPort->pAdaptor->type & XvInputMask) ||
|
if (!(pPort->pAdaptor->type & XvInputMask) ||
|
||||||
!(pPort->pAdaptor->type & XvVideoMask)) {
|
!(pPort->pAdaptor->type & XvVideoMask)) {
|
||||||
client->errorValue = stuff->port;
|
client->errorValue = stuff->port;
|
||||||
|
|
@ -504,6 +520,11 @@ ProcXvPutStill(ClientPtr client)
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
|
||||||
|
client->errorValue = stuff->port;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(pPort->pAdaptor->type & XvInputMask) ||
|
if (!(pPort->pAdaptor->type & XvInputMask) ||
|
||||||
!(pPort->pAdaptor->type & XvStillMask)) {
|
!(pPort->pAdaptor->type & XvStillMask)) {
|
||||||
client->errorValue = stuff->port;
|
client->errorValue = stuff->port;
|
||||||
|
|
@ -534,6 +555,11 @@ ProcXvGetVideo(ClientPtr client)
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess);
|
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess);
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
|
||||||
|
client->errorValue = stuff->port;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(pPort->pAdaptor->type & XvOutputMask) ||
|
if (!(pPort->pAdaptor->type & XvOutputMask) ||
|
||||||
!(pPort->pAdaptor->type & XvVideoMask)) {
|
!(pPort->pAdaptor->type & XvVideoMask)) {
|
||||||
client->errorValue = stuff->port;
|
client->errorValue = stuff->port;
|
||||||
|
|
@ -564,6 +590,11 @@ ProcXvGetStill(ClientPtr client)
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess);
|
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess);
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
|
||||||
|
client->errorValue = stuff->port;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(pPort->pAdaptor->type & XvOutputMask) ||
|
if (!(pPort->pAdaptor->type & XvOutputMask) ||
|
||||||
!(pPort->pAdaptor->type & XvStillMask)) {
|
!(pPort->pAdaptor->type & XvStillMask)) {
|
||||||
client->errorValue = stuff->port;
|
client->errorValue = stuff->port;
|
||||||
|
|
@ -600,6 +631,7 @@ ProcXvSelectVideoNotify(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcXvSelectPortNotify(ClientPtr client)
|
ProcXvSelectPortNotify(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
int status;
|
||||||
XvPortPtr pPort;
|
XvPortPtr pPort;
|
||||||
|
|
||||||
REQUEST(xvSelectPortNotifyReq);
|
REQUEST(xvSelectPortNotifyReq);
|
||||||
|
|
@ -607,6 +639,11 @@ ProcXvSelectPortNotify(ClientPtr client)
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
|
||||||
|
client->errorValue = stuff->port;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
return XvdiSelectPortNotify(client, pPort, stuff->onoff);
|
return XvdiSelectPortNotify(client, pPort, stuff->onoff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -622,6 +659,11 @@ ProcXvGrabPort(ClientPtr client)
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
|
||||||
|
client->errorValue = stuff->port;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
status = XvdiGrabPort(client, pPort, stuff->time, &result);
|
status = XvdiGrabPort(client, pPort, stuff->time, &result);
|
||||||
|
|
||||||
if (status != Success) {
|
if (status != Success) {
|
||||||
|
|
@ -642,6 +684,7 @@ ProcXvGrabPort(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcXvUngrabPort(ClientPtr client)
|
ProcXvUngrabPort(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
int status;
|
||||||
XvPortPtr pPort;
|
XvPortPtr pPort;
|
||||||
|
|
||||||
REQUEST(xvGrabPortReq);
|
REQUEST(xvGrabPortReq);
|
||||||
|
|
@ -649,13 +692,18 @@ ProcXvUngrabPort(ClientPtr client)
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
|
||||||
|
client->errorValue = stuff->port;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
return XvdiUngrabPort(client, pPort, stuff->time);
|
return XvdiUngrabPort(client, pPort, stuff->time);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcXvStopVideo(ClientPtr client)
|
ProcXvStopVideo(ClientPtr client)
|
||||||
{
|
{
|
||||||
int ret;
|
int status, ret;
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
XvPortPtr pPort;
|
XvPortPtr pPort;
|
||||||
|
|
||||||
|
|
@ -664,6 +712,11 @@ ProcXvStopVideo(ClientPtr client)
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
|
||||||
|
client->errorValue = stuff->port;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess);
|
ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -682,6 +735,11 @@ ProcXvSetPortAttribute(ClientPtr client)
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixSetAttrAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixSetAttrAccess);
|
||||||
|
|
||||||
|
if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
|
||||||
|
client->errorValue = stuff->port;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
if (!ValidAtom(stuff->attribute)) {
|
if (!ValidAtom(stuff->attribute)) {
|
||||||
client->errorValue = stuff->attribute;
|
client->errorValue = stuff->attribute;
|
||||||
return BadAtom;
|
return BadAtom;
|
||||||
|
|
@ -711,6 +769,11 @@ ProcXvGetPortAttribute(ClientPtr client)
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess);
|
||||||
|
|
||||||
|
if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
|
||||||
|
client->errorValue = stuff->port;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
if (!ValidAtom(stuff->attribute)) {
|
if (!ValidAtom(stuff->attribute)) {
|
||||||
client->errorValue = stuff->attribute;
|
client->errorValue = stuff->attribute;
|
||||||
return BadAtom;
|
return BadAtom;
|
||||||
|
|
@ -737,6 +800,7 @@ ProcXvGetPortAttribute(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcXvQueryBestSize(ClientPtr client)
|
ProcXvQueryBestSize(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
int status;
|
||||||
unsigned int actual_width, actual_height;
|
unsigned int actual_width, actual_height;
|
||||||
XvPortPtr pPort;
|
XvPortPtr pPort;
|
||||||
xvQueryBestSizeReply rep;
|
xvQueryBestSizeReply rep;
|
||||||
|
|
@ -746,7 +810,12 @@ ProcXvQueryBestSize(ClientPtr client)
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
(*pPort->pAdaptor->ddQueryBestSize) (pPort, stuff->motion,
|
if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
|
||||||
|
client->errorValue = stuff->port;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
(*pPort->pAdaptor->ddQueryBestSize) (client, pPort, stuff->motion,
|
||||||
stuff->vid_w, stuff->vid_h,
|
stuff->vid_w, stuff->vid_h,
|
||||||
stuff->drw_w, stuff->drw_h,
|
stuff->drw_w, stuff->drw_h,
|
||||||
&actual_width, &actual_height);
|
&actual_width, &actual_height);
|
||||||
|
|
@ -767,7 +836,7 @@ ProcXvQueryBestSize(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcXvQueryPortAttributes(ClientPtr client)
|
ProcXvQueryPortAttributes(ClientPtr client)
|
||||||
{
|
{
|
||||||
int size, i;
|
int status, size, i;
|
||||||
XvPortPtr pPort;
|
XvPortPtr pPort;
|
||||||
XvAttributePtr pAtt;
|
XvAttributePtr pAtt;
|
||||||
xvQueryPortAttributesReply rep;
|
xvQueryPortAttributesReply rep;
|
||||||
|
|
@ -778,6 +847,11 @@ ProcXvQueryPortAttributes(ClientPtr client)
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess);
|
||||||
|
|
||||||
|
if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
|
||||||
|
client->errorValue = stuff->port;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
rep = (xvQueryPortAttributesReply) {
|
rep = (xvQueryPortAttributesReply) {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
@ -828,6 +902,11 @@ ProcXvPutImage(ClientPtr client)
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
|
||||||
|
client->errorValue = stuff->port;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(pPort->pAdaptor->type & XvImageMask) ||
|
if (!(pPort->pAdaptor->type & XvImageMask) ||
|
||||||
!(pPort->pAdaptor->type & XvInputMask)) {
|
!(pPort->pAdaptor->type & XvInputMask)) {
|
||||||
client->errorValue = stuff->port;
|
client->errorValue = stuff->port;
|
||||||
|
|
@ -851,7 +930,8 @@ ProcXvPutImage(ClientPtr client)
|
||||||
|
|
||||||
width = stuff->width;
|
width = stuff->width;
|
||||||
height = stuff->height;
|
height = stuff->height;
|
||||||
size = (*pPort->pAdaptor->ddQueryImageAttributes) (pPort, pImage, &width,
|
size = (*pPort->pAdaptor->ddQueryImageAttributes) (client,
|
||||||
|
pPort, pImage, &width,
|
||||||
&height, NULL, NULL);
|
&height, NULL, NULL);
|
||||||
size += sizeof(xvPutImageReq);
|
size += sizeof(xvPutImageReq);
|
||||||
size = bytes_to_int32(size);
|
size = bytes_to_int32(size);
|
||||||
|
|
@ -888,6 +968,11 @@ ProcXvShmPutImage(ClientPtr client)
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
|
||||||
|
client->errorValue = stuff->port;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(pPort->pAdaptor->type & XvImageMask) ||
|
if (!(pPort->pAdaptor->type & XvImageMask) ||
|
||||||
!(pPort->pAdaptor->type & XvInputMask)) {
|
!(pPort->pAdaptor->type & XvInputMask)) {
|
||||||
client->errorValue = stuff->port;
|
client->errorValue = stuff->port;
|
||||||
|
|
@ -916,7 +1001,8 @@ ProcXvShmPutImage(ClientPtr client)
|
||||||
|
|
||||||
width = stuff->width;
|
width = stuff->width;
|
||||||
height = stuff->height;
|
height = stuff->height;
|
||||||
size_needed = (*pPort->pAdaptor->ddQueryImageAttributes) (pPort, pImage,
|
size_needed = (*pPort->pAdaptor->ddQueryImageAttributes) (client,
|
||||||
|
pPort, pImage,
|
||||||
&width, &height,
|
&width, &height,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
if ((size_needed + stuff->offset) > shmdesc->size)
|
if ((size_needed + stuff->offset) > shmdesc->size)
|
||||||
|
|
@ -949,6 +1035,7 @@ ProcXvShmPutImage(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcXvShmPutImage(ClientPtr client)
|
ProcXvShmPutImage(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
SendErrorToClient(client, XvReqCode, xv_ShmPutImage, 0, BadImplementation);
|
||||||
return BadImplementation;
|
return BadImplementation;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -999,7 +1086,7 @@ ProcXvQueryImageAttributes(ClientPtr client)
|
||||||
width = stuff->width;
|
width = stuff->width;
|
||||||
height = stuff->height;
|
height = stuff->height;
|
||||||
|
|
||||||
size = (*pPort->pAdaptor->ddQueryImageAttributes) (pPort, pImage,
|
size = (*pPort->pAdaptor->ddQueryImageAttributes) (client, pPort, pImage,
|
||||||
&width, &height, offsets,
|
&width, &height, offsets,
|
||||||
pitches);
|
pitches);
|
||||||
|
|
||||||
|
|
@ -1107,6 +1194,7 @@ ProcXvDispatch(ClientPtr client)
|
||||||
UpdateCurrentTime();
|
UpdateCurrentTime();
|
||||||
|
|
||||||
if (stuff->data >= xvNumRequests) {
|
if (stuff->data >= xvNumRequests) {
|
||||||
|
SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest);
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1115,49 +1203,63 @@ ProcXvDispatch(ClientPtr client)
|
||||||
|
|
||||||
/* Swapped Procs */
|
/* Swapped Procs */
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
|
SProcXvQueryExtension(ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xvQueryExtensionReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvQueryExtensionReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
|
return XvProcVector[xv_QueryExtension] (client);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXvQueryEncodings(ClientPtr client)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXvGrabPort(ClientPtr client)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXvUngrabPort(ClientPtr client)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXvPutVideo(ClientPtr client)
|
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);
|
||||||
|
|
@ -1172,11 +1274,12 @@ SProcXvPutVideo(ClientPtr client)
|
||||||
return XvProcVector[xv_PutVideo] (client);
|
return XvProcVector[xv_PutVideo] (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXvPutStill(ClientPtr client)
|
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);
|
||||||
|
|
@ -1191,11 +1294,12 @@ SProcXvPutStill(ClientPtr client)
|
||||||
return XvProcVector[xv_PutStill] (client);
|
return XvProcVector[xv_PutStill] (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXvGetVideo(ClientPtr client)
|
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);
|
||||||
|
|
@ -1210,11 +1314,12 @@ SProcXvGetVideo(ClientPtr client)
|
||||||
return XvProcVector[xv_GetVideo] (client);
|
return XvProcVector[xv_GetVideo] (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXvGetStill(ClientPtr client)
|
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);
|
||||||
|
|
@ -1229,11 +1334,12 @@ SProcXvGetStill(ClientPtr client)
|
||||||
return XvProcVector[xv_GetStill] (client);
|
return XvProcVector[xv_GetStill] (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXvPutImage(ClientPtr client)
|
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);
|
||||||
|
|
@ -1252,11 +1358,12 @@ SProcXvPutImage(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MITSHM
|
#ifdef MITSHM
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXvShmPutImage(ClientPtr client)
|
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);
|
||||||
|
|
@ -1279,60 +1386,66 @@ SProcXvShmPutImage(ClientPtr client)
|
||||||
#define SProcXvShmPutImage ProcXvShmPutImage
|
#define SProcXvShmPutImage ProcXvShmPutImage
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXvSelectVideoNotify(ClientPtr client)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXvSelectPortNotify(ClientPtr client)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXvStopVideo(ClientPtr client)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXvSetPortAttribute(ClientPtr client)
|
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);
|
||||||
return XvProcVector[xv_SetPortAttribute] (client);
|
return XvProcVector[xv_SetPortAttribute] (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXvGetPortAttribute(ClientPtr client)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXvQueryBestSize(ClientPtr client)
|
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);
|
||||||
|
|
@ -1341,20 +1454,22 @@ SProcXvQueryBestSize(ClientPtr client)
|
||||||
return XvProcVector[xv_QueryBestSize] (client);
|
return XvProcVector[xv_QueryBestSize] (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXvQueryPortAttributes(ClientPtr client)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXvQueryImageAttributes(ClientPtr client)
|
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);
|
||||||
|
|
@ -1362,17 +1477,18 @@ SProcXvQueryImageAttributes(ClientPtr client)
|
||||||
return XvProcVector[xv_QueryImageAttributes] (client);
|
return XvProcVector[xv_QueryImageAttributes] (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXvListImageFormats(ClientPtr client)
|
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,
|
||||||
|
|
@ -1391,7 +1507,7 @@ static int (*SXvProcVector[xvNumRequests]) (ClientPtr) = {
|
||||||
SProcXvListImageFormats,
|
SProcXvListImageFormats,
|
||||||
SProcXvQueryImageAttributes, SProcXvPutImage, SProcXvShmPutImage,};
|
SProcXvQueryImageAttributes, SProcXvPutImage, SProcXvShmPutImage,};
|
||||||
|
|
||||||
int _X_COLD
|
int
|
||||||
SProcXvDispatch(ClientPtr client)
|
SProcXvDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
|
@ -1399,13 +1515,14 @@ SProcXvDispatch(ClientPtr client)
|
||||||
UpdateCurrentTime();
|
UpdateCurrentTime();
|
||||||
|
|
||||||
if (stuff->data >= xvNumRequests) {
|
if (stuff->data >= xvNumRequests) {
|
||||||
|
SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest);
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
return SXvProcVector[stuff->data] (client);
|
return SXvProcVector[stuff->data] (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef PANORAMIX
|
||||||
static int
|
static int
|
||||||
XineramaXvStopVideo(ClientPtr client)
|
XineramaXvStopVideo(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
|
@ -1465,14 +1582,12 @@ XineramaXvShmPutImage(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvShmPutImageReq);
|
REQUEST(xvShmPutImageReq);
|
||||||
PanoramiXRes *draw, *gc, *port;
|
PanoramiXRes *draw, *gc, *port;
|
||||||
Bool send_event;
|
Bool send_event = stuff->send_event;
|
||||||
Bool isRoot;
|
Bool isRoot;
|
||||||
int result, i, x, y;
|
int result, i, x, y;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xvShmPutImageReq);
|
REQUEST_SIZE_MATCH(xvShmPutImageReq);
|
||||||
|
|
||||||
send_event = stuff->send_event;
|
|
||||||
|
|
||||||
result = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
result = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
||||||
XRC_DRAWABLE, client, DixWriteAccess);
|
XRC_DRAWABLE, client, DixWriteAccess);
|
||||||
if (result != Success)
|
if (result != Success)
|
||||||
|
|
@ -1513,7 +1628,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 +1883,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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
118
Xext/xvdix.h
118
Xext/xvdix.h
|
|
@ -4,13 +4,13 @@ and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
|
||||||
|
|
||||||
All Rights Reserved
|
All Rights Reserved
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software and its
|
Permission to use, copy, modify, and distribute this software and its
|
||||||
documentation for any purpose and without fee is hereby granted,
|
documentation for any purpose and without fee is hereby granted,
|
||||||
provided that the above copyright notice appear in all copies and that
|
provided that the above copyright notice appear in all copies and that
|
||||||
both that copyright notice and this permission notice appear in
|
both that copyright notice and this permission notice appear in
|
||||||
supporting documentation, and that the names of Digital or MIT not be
|
supporting documentation, and that the names of Digital or MIT not be
|
||||||
used in advertising or publicity pertaining to distribution of the
|
used in advertising or publicity pertaining to distribution of the
|
||||||
software without specific, written prior permission.
|
software without specific, written prior permission.
|
||||||
|
|
||||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||||
|
|
@ -25,18 +25,18 @@ SOFTWARE.
|
||||||
#ifndef XVDIX_H
|
#ifndef XVDIX_H
|
||||||
#define XVDIX_H
|
#define XVDIX_H
|
||||||
/*
|
/*
|
||||||
** File:
|
** File:
|
||||||
**
|
**
|
||||||
** xvdix.h --- Xv device independent header file
|
** xvdix.h --- Xv device independent header file
|
||||||
**
|
**
|
||||||
** Author:
|
** Author:
|
||||||
**
|
**
|
||||||
** David Carver (Digital Workstation Engineering/Project Athena)
|
** David Carver (Digital Workstation Engineering/Project Athena)
|
||||||
**
|
**
|
||||||
** Revisions:
|
** Revisions:
|
||||||
**
|
**
|
||||||
** 29.08.91 Carver
|
** 29.08.91 Carver
|
||||||
** - removed UnrealizeWindow wrapper unrealizing windows no longer
|
** - removed UnrealizeWindow wrapper unrealizing windows no longer
|
||||||
** preempts video
|
** preempts video
|
||||||
**
|
**
|
||||||
** 11.06.91 Carver
|
** 11.06.91 Carver
|
||||||
|
|
@ -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;
|
||||||
|
|
@ -131,29 +157,32 @@ typedef struct {
|
||||||
int nPorts;
|
int nPorts;
|
||||||
struct _XvPortRec *pPorts;
|
struct _XvPortRec *pPorts;
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
int (*ddPutVideo) (DrawablePtr, struct _XvPortRec *, GCPtr,
|
int (*ddAllocatePort) (unsigned long, struct _XvPortRec *,
|
||||||
|
struct _XvPortRec **);
|
||||||
|
int (*ddFreePort) (struct _XvPortRec *);
|
||||||
|
int (*ddPutVideo) (ClientPtr, DrawablePtr, struct _XvPortRec *, GCPtr,
|
||||||
INT16, INT16, CARD16, CARD16,
|
INT16, INT16, CARD16, CARD16,
|
||||||
INT16, INT16, CARD16, CARD16);
|
INT16, INT16, CARD16, CARD16);
|
||||||
int (*ddPutStill) (DrawablePtr, struct _XvPortRec *, GCPtr,
|
int (*ddPutStill) (ClientPtr, DrawablePtr, struct _XvPortRec *, GCPtr,
|
||||||
INT16, INT16, CARD16, CARD16,
|
INT16, INT16, CARD16, CARD16,
|
||||||
INT16, INT16, CARD16, CARD16);
|
INT16, INT16, CARD16, CARD16);
|
||||||
int (*ddGetVideo) (DrawablePtr, struct _XvPortRec *, GCPtr,
|
int (*ddGetVideo) (ClientPtr, DrawablePtr, struct _XvPortRec *, GCPtr,
|
||||||
INT16, INT16, CARD16, CARD16,
|
INT16, INT16, CARD16, CARD16,
|
||||||
INT16, INT16, CARD16, CARD16);
|
INT16, INT16, CARD16, CARD16);
|
||||||
int (*ddGetStill) (DrawablePtr, struct _XvPortRec *, GCPtr,
|
int (*ddGetStill) (ClientPtr, DrawablePtr, struct _XvPortRec *, GCPtr,
|
||||||
INT16, INT16, CARD16, CARD16,
|
INT16, INT16, CARD16, CARD16,
|
||||||
INT16, INT16, CARD16, CARD16);
|
INT16, INT16, CARD16, CARD16);
|
||||||
int (*ddStopVideo) (struct _XvPortRec *, DrawablePtr);
|
int (*ddStopVideo) (ClientPtr, struct _XvPortRec *, DrawablePtr);
|
||||||
int (*ddSetPortAttribute) (struct _XvPortRec *, Atom, INT32);
|
int (*ddSetPortAttribute) (ClientPtr, struct _XvPortRec *, Atom, INT32);
|
||||||
int (*ddGetPortAttribute) (struct _XvPortRec *, Atom, INT32 *);
|
int (*ddGetPortAttribute) (ClientPtr, struct _XvPortRec *, Atom, INT32 *);
|
||||||
int (*ddQueryBestSize) (struct _XvPortRec *, CARD8,
|
int (*ddQueryBestSize) (ClientPtr, struct _XvPortRec *, CARD8,
|
||||||
CARD16, CARD16, CARD16, CARD16,
|
CARD16, CARD16, CARD16, CARD16,
|
||||||
unsigned int *, unsigned int *);
|
unsigned int *, unsigned int *);
|
||||||
int (*ddPutImage) (DrawablePtr, struct _XvPortRec *, GCPtr,
|
int (*ddPutImage) (ClientPtr, DrawablePtr, struct _XvPortRec *, GCPtr,
|
||||||
INT16, INT16, CARD16, CARD16,
|
INT16, INT16, CARD16, CARD16,
|
||||||
INT16, INT16, CARD16, CARD16,
|
INT16, INT16, CARD16, CARD16,
|
||||||
XvImagePtr, unsigned char *, Bool, CARD16, CARD16);
|
XvImagePtr, unsigned char *, Bool, CARD16, CARD16);
|
||||||
int (*ddQueryImageAttributes) (struct _XvPortRec *, XvImagePtr,
|
int (*ddQueryImageAttributes) (ClientPtr, struct _XvPortRec *, XvImagePtr,
|
||||||
CARD16 *, CARD16 *, int *, int *);
|
CARD16 *, CARD16 *, int *, int *);
|
||||||
DevUnion devPriv;
|
DevUnion devPriv;
|
||||||
} XvAdaptorRec, *XvAdaptorPtr;
|
} XvAdaptorRec, *XvAdaptorPtr;
|
||||||
|
|
@ -169,6 +198,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;
|
||||||
|
|
@ -176,10 +213,55 @@ typedef struct {
|
||||||
DestroyWindowProcPtr DestroyWindow;
|
DestroyWindowProcPtr DestroyWindow;
|
||||||
DestroyPixmapProcPtr DestroyPixmap;
|
DestroyPixmapProcPtr DestroyPixmap;
|
||||||
CloseScreenProcPtr CloseScreen;
|
CloseScreenProcPtr CloseScreen;
|
||||||
|
Bool (*ddCloseScreen) (ScreenPtr);
|
||||||
|
int (*ddQueryAdaptors) (ScreenPtr, XvAdaptorPtr *, int *);
|
||||||
|
DevUnion devPriv;
|
||||||
} 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 int XvdiSendPortNotify(XvPortPtr, Atom, INT32);
|
||||||
|
extern _X_EXPORT int XvdiVideoStopped(XvPortPtr, int);
|
||||||
|
|
||||||
|
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 XvdiPreemptVideo(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 */
|
|
||||||
329
Xext/xvmain.c
329
Xext/xvmain.c
|
|
@ -4,13 +4,13 @@ and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
|
||||||
|
|
||||||
All Rights Reserved
|
All Rights Reserved
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software and its
|
Permission to use, copy, modify, and distribute this software and its
|
||||||
documentation for any purpose and without fee is hereby granted,
|
documentation for any purpose and without fee is hereby granted,
|
||||||
provided that the above copyright notice appear in all copies and that
|
provided that the above copyright notice appear in all copies and that
|
||||||
both that copyright notice and this permission notice appear in
|
both that copyright notice and this permission notice appear in
|
||||||
supporting documentation, and that the names of Digital or MIT not be
|
supporting documentation, and that the names of Digital or MIT not be
|
||||||
used in advertising or publicity pertaining to distribution of the
|
used in advertising or publicity pertaining to distribution of the
|
||||||
software without specific, written prior permission.
|
software without specific, written prior permission.
|
||||||
|
|
||||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||||
|
|
@ -23,11 +23,11 @@ SOFTWARE.
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** File:
|
** File:
|
||||||
**
|
**
|
||||||
** xvmain.c --- Xv server extension main device independent module.
|
** xvmain.c --- Xv server extension main device independent module.
|
||||||
**
|
**
|
||||||
** Author:
|
** Author:
|
||||||
**
|
**
|
||||||
** David Carver (Digital Workstation Engineering/Project Athena)
|
** David Carver (Digital Workstation Engineering/Project Athena)
|
||||||
**
|
**
|
||||||
|
|
@ -58,7 +58,7 @@ SOFTWARE.
|
||||||
**
|
**
|
||||||
** 24.01.91 Carver
|
** 24.01.91 Carver
|
||||||
** - version 1.4 upgrade
|
** - version 1.4 upgrade
|
||||||
**
|
**
|
||||||
** Notes:
|
** Notes:
|
||||||
**
|
**
|
||||||
** Port structures reference client structures in a two different
|
** Port structures reference client structures in a two different
|
||||||
|
|
@ -73,67 +73,56 @@ 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"
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include "pixmapstr.h"
|
#include "pixmapstr.h"
|
||||||
#include "gcstruct.h"
|
#include "gc.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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -313,6 +302,8 @@ XvCloseScreen(ScreenPtr pScreen)
|
||||||
pScreen->DestroyWindow = pxvs->DestroyWindow;
|
pScreen->DestroyWindow = pxvs->DestroyWindow;
|
||||||
pScreen->CloseScreen = pxvs->CloseScreen;
|
pScreen->CloseScreen = pxvs->CloseScreen;
|
||||||
|
|
||||||
|
(*pxvs->ddCloseScreen) (pScreen);
|
||||||
|
|
||||||
free(pxvs);
|
free(pxvs);
|
||||||
|
|
||||||
dixSetPrivate(&pScreen->devPrivates, XvScreenKey, NULL);
|
dixSetPrivate(&pScreen->devPrivates, XvScreenKey, NULL);
|
||||||
|
|
@ -338,24 +329,36 @@ XvGetRTPort(void)
|
||||||
return XvRTPort;
|
return XvRTPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static Bool
|
||||||
XvStopAdaptors(DrawablePtr pDrawable)
|
XvDestroyPixmap(PixmapPtr pPix)
|
||||||
{
|
{
|
||||||
ScreenPtr pScreen = pDrawable->pScreen;
|
Bool status;
|
||||||
XvScreenPtr pxvs = dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
|
ScreenPtr pScreen;
|
||||||
XvAdaptorPtr pa = pxvs->pAdaptors;
|
XvScreenPtr pxvs;
|
||||||
int na = pxvs->nAdaptors;
|
XvAdaptorPtr pa;
|
||||||
|
int na;
|
||||||
|
XvPortPtr pp;
|
||||||
|
int np;
|
||||||
|
|
||||||
|
pScreen = pPix->drawable.pScreen;
|
||||||
|
|
||||||
|
SCREEN_PROLOGUE(pScreen, DestroyPixmap);
|
||||||
|
|
||||||
|
pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
|
||||||
|
|
||||||
/* CHECK TO SEE IF THIS PORT IS IN USE */
|
/* CHECK TO SEE IF THIS PORT IS IN USE */
|
||||||
|
|
||||||
|
pa = pxvs->pAdaptors;
|
||||||
|
na = pxvs->nAdaptors;
|
||||||
while (na--) {
|
while (na--) {
|
||||||
XvPortPtr pp = pa->pPorts;
|
np = pa->nPorts;
|
||||||
int np = pa->nPorts;
|
pp = pa->pPorts;
|
||||||
|
|
||||||
while (np--) {
|
while (np--) {
|
||||||
if (pp->pDraw == pDrawable) {
|
if (pp->pDraw == (DrawablePtr) pPix) {
|
||||||
XvdiSendVideoNotify(pp, pDrawable, XvPreempted);
|
XvdiSendVideoNotify(pp, pp->pDraw, XvPreempted);
|
||||||
|
|
||||||
(void) (*pp->pAdaptor->ddStopVideo) (pp, pDrawable);
|
(void) (*pp->pAdaptor->ddStopVideo) (NULL, pp, pp->pDraw);
|
||||||
|
|
||||||
pp->pDraw = NULL;
|
pp->pDraw = NULL;
|
||||||
pp->client = NULL;
|
pp->client = NULL;
|
||||||
|
|
@ -365,20 +368,9 @@ XvStopAdaptors(DrawablePtr pDrawable)
|
||||||
}
|
}
|
||||||
pa++;
|
pa++;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static Bool
|
status = (*pScreen->DestroyPixmap) (pPix);
|
||||||
XvDestroyPixmap(PixmapPtr pPix)
|
|
||||||
{
|
|
||||||
ScreenPtr pScreen = pPix->drawable.pScreen;
|
|
||||||
Bool status = TRUE;
|
|
||||||
|
|
||||||
if (pPix->refcnt == 1)
|
|
||||||
XvStopAdaptors(&pPix->drawable);
|
|
||||||
|
|
||||||
SCREEN_PROLOGUE(pScreen, DestroyPixmap);
|
|
||||||
if (pScreen->DestroyPixmap)
|
|
||||||
status = pScreen->DestroyPixmap(pPix);
|
|
||||||
SCREEN_EPILOGUE(pScreen, DestroyPixmap, XvDestroyPixmap);
|
SCREEN_EPILOGUE(pScreen, DestroyPixmap, XvDestroyPixmap);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
|
@ -388,23 +380,79 @@ XvDestroyPixmap(PixmapPtr pPix)
|
||||||
static Bool
|
static Bool
|
||||||
XvDestroyWindow(WindowPtr pWin)
|
XvDestroyWindow(WindowPtr pWin)
|
||||||
{
|
{
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
|
||||||
Bool status;
|
Bool status;
|
||||||
|
ScreenPtr pScreen;
|
||||||
|
XvScreenPtr pxvs;
|
||||||
|
XvAdaptorPtr pa;
|
||||||
|
int na;
|
||||||
|
XvPortPtr pp;
|
||||||
|
int np;
|
||||||
|
|
||||||
XvStopAdaptors(&pWin->drawable);
|
pScreen = pWin->drawable.pScreen;
|
||||||
|
|
||||||
SCREEN_PROLOGUE(pScreen, DestroyWindow);
|
SCREEN_PROLOGUE(pScreen, DestroyWindow);
|
||||||
|
|
||||||
|
pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
|
||||||
|
|
||||||
|
/* CHECK TO SEE IF THIS PORT IS IN USE */
|
||||||
|
|
||||||
|
pa = pxvs->pAdaptors;
|
||||||
|
na = pxvs->nAdaptors;
|
||||||
|
while (na--) {
|
||||||
|
np = pa->nPorts;
|
||||||
|
pp = pa->pPorts;
|
||||||
|
|
||||||
|
while (np--) {
|
||||||
|
if (pp->pDraw == (DrawablePtr) pWin) {
|
||||||
|
XvdiSendVideoNotify(pp, pp->pDraw, XvPreempted);
|
||||||
|
|
||||||
|
(void) (*pp->pAdaptor->ddStopVideo) (NULL, pp, pp->pDraw);
|
||||||
|
|
||||||
|
pp->pDraw = NULL;
|
||||||
|
pp->client = NULL;
|
||||||
|
pp->time = currentTime;
|
||||||
|
}
|
||||||
|
pp++;
|
||||||
|
}
|
||||||
|
pa++;
|
||||||
|
}
|
||||||
|
|
||||||
status = (*pScreen->DestroyWindow) (pWin);
|
status = (*pScreen->DestroyWindow) (pWin);
|
||||||
|
|
||||||
SCREEN_EPILOGUE(pScreen, DestroyWindow, XvDestroyWindow);
|
SCREEN_EPILOGUE(pScreen, DestroyWindow, XvDestroyWindow);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The XvdiVideoStopped procedure is a hook for the device dependent layer.
|
||||||
|
It provides a way for the dd layer to inform the di layer that video has
|
||||||
|
stopped in a port for reasons that the di layer had no control over; note
|
||||||
|
that it doesn't call back into the dd layer */
|
||||||
|
|
||||||
|
int
|
||||||
|
XvdiVideoStopped(XvPortPtr pPort, int reason)
|
||||||
|
{
|
||||||
|
|
||||||
|
/* IF PORT ISN'T ACTIVE THEN WE'RE DONE */
|
||||||
|
|
||||||
|
if (!pPort->pDraw)
|
||||||
|
return Success;
|
||||||
|
|
||||||
|
XvdiSendVideoNotify(pPort, pPort->pDraw, reason);
|
||||||
|
|
||||||
|
pPort->pDraw = NULL;
|
||||||
|
pPort->client = NULL;
|
||||||
|
pPort->time = currentTime;
|
||||||
|
|
||||||
|
return Success;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
XvdiDestroyPort(void *pPort, XID id)
|
XvdiDestroyPort(void *pPort, XID id)
|
||||||
{
|
{
|
||||||
return Success;
|
return (*((XvPortPtr) pPort)->pAdaptor->ddFreePort) (pPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
@ -437,7 +485,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 +529,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;
|
||||||
|
|
@ -544,7 +592,7 @@ XvdiPutVideo(ClientPtr client,
|
||||||
XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted);
|
XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted);
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) (*pPort->pAdaptor->ddPutVideo) (pDraw, pPort, pGC,
|
(void) (*pPort->pAdaptor->ddPutVideo) (client, pDraw, pPort, pGC,
|
||||||
vid_x, vid_y, vid_w, vid_h,
|
vid_x, vid_y, vid_w, vid_h,
|
||||||
drw_x, drw_y, drw_w, drw_h);
|
drw_x, drw_y, drw_w, drw_h);
|
||||||
|
|
||||||
|
|
@ -586,7 +634,7 @@ XvdiPutStill(ClientPtr client,
|
||||||
|
|
||||||
pPort->time = currentTime;
|
pPort->time = currentTime;
|
||||||
|
|
||||||
status = (*pPort->pAdaptor->ddPutStill) (pDraw, pPort, pGC,
|
status = (*pPort->pAdaptor->ddPutStill) (client, pDraw, pPort, pGC,
|
||||||
vid_x, vid_y, vid_w, vid_h,
|
vid_x, vid_y, vid_w, vid_h,
|
||||||
drw_x, drw_y, drw_w, drw_h);
|
drw_x, drw_y, drw_w, drw_h);
|
||||||
|
|
||||||
|
|
@ -622,7 +670,7 @@ XvdiPutImage(ClientPtr client,
|
||||||
|
|
||||||
pPort->time = currentTime;
|
pPort->time = currentTime;
|
||||||
|
|
||||||
return (*pPort->pAdaptor->ddPutImage) (pDraw, pPort, pGC,
|
return (*pPort->pAdaptor->ddPutImage) (client, pDraw, pPort, pGC,
|
||||||
src_x, src_y, src_w, src_h,
|
src_x, src_y, src_w, src_h,
|
||||||
drw_x, drw_y, drw_w, drw_h,
|
drw_x, drw_y, drw_w, drw_h,
|
||||||
image, data, sync, width, height);
|
image, data, sync, width, height);
|
||||||
|
|
@ -661,7 +709,7 @@ XvdiGetVideo(ClientPtr client,
|
||||||
XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted);
|
XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted);
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) (*pPort->pAdaptor->ddGetVideo) (pDraw, pPort, pGC,
|
(void) (*pPort->pAdaptor->ddGetVideo) (client, pDraw, pPort, pGC,
|
||||||
vid_x, vid_y, vid_w, vid_h,
|
vid_x, vid_y, vid_w, vid_h,
|
||||||
drw_x, drw_y, drw_w, drw_h);
|
drw_x, drw_y, drw_w, drw_h);
|
||||||
|
|
||||||
|
|
@ -701,7 +749,7 @@ XvdiGetStill(ClientPtr client,
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = (*pPort->pAdaptor->ddGetStill) (pDraw, pPort, pGC,
|
status = (*pPort->pAdaptor->ddGetStill) (client, pDraw, pPort, pGC,
|
||||||
vid_x, vid_y, vid_w, vid_h,
|
vid_x, vid_y, vid_w, vid_h,
|
||||||
drw_x, drw_y, drw_w, drw_h);
|
drw_x, drw_y, drw_w, drw_h);
|
||||||
|
|
||||||
|
|
@ -812,9 +860,10 @@ XvdiSelectVideoNotify(ClientPtr client, DrawablePtr pDraw, BOOL onoff)
|
||||||
if (!(tpn = malloc(sizeof(XvVideoNotifyRec))))
|
if (!(tpn = malloc(sizeof(XvVideoNotifyRec))))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
tpn->next = NULL;
|
tpn->next = NULL;
|
||||||
tpn->client = NULL;
|
if (!AddResource(pDraw->id, XvRTVideoNotifyList, tpn)) {
|
||||||
if (!AddResource(pDraw->id, XvRTVideoNotifyList, tpn))
|
free(tpn);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* LOOK TO SEE IF ENTRY ALREADY EXISTS */
|
/* LOOK TO SEE IF ENTRY ALREADY EXISTS */
|
||||||
|
|
@ -823,10 +872,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 +881,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;
|
||||||
|
|
@ -857,8 +904,7 @@ XvdiSelectVideoNotify(ClientPtr client, DrawablePtr pDraw, BOOL onoff)
|
||||||
|
|
||||||
tpn->client = NULL;
|
tpn->client = NULL;
|
||||||
tpn->id = FakeClientID(client->index);
|
tpn->id = FakeClientID(client->index);
|
||||||
if (!AddResource(tpn->id, XvRTVideoNotify, tpn))
|
AddResource(tpn->id, XvRTVideoNotify, tpn);
|
||||||
return BadAlloc;
|
|
||||||
|
|
||||||
tpn->client = client;
|
tpn->client = client;
|
||||||
return Success;
|
return Success;
|
||||||
|
|
@ -895,7 +941,7 @@ XvdiSelectPortNotify(ClientPtr client, XvPortPtr pPort, BOOL onoff)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DIDN'T FIND IT; SO REUSE LIST ELEMENT IF ONE IS FREE OTHERWISE
|
/* DIDN'T FIND IT; SO REUSE LIST ELEMENT IF ONE IS FREE OTHERWISE
|
||||||
CREATE A NEW ONE AND ADD IT TO THE BEGINNING OF THE LIST */
|
CREATE A NEW ONE AND ADD IT TO THE BEGINNING OF THE LIST */
|
||||||
|
|
||||||
if (!tpn) {
|
if (!tpn) {
|
||||||
|
|
@ -907,8 +953,7 @@ XvdiSelectPortNotify(ClientPtr client, XvPortPtr pPort, BOOL onoff)
|
||||||
|
|
||||||
tpn->client = client;
|
tpn->client = client;
|
||||||
tpn->id = FakeClientID(client->index);
|
tpn->id = FakeClientID(client->index);
|
||||||
if (!AddResource(tpn->id, XvRTPortNotify, tpn))
|
AddResource(tpn->id, XvRTPortNotify, tpn);
|
||||||
return BadAlloc;
|
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
|
|
||||||
|
|
@ -936,7 +981,29 @@ XvdiStopVideo(ClientPtr client, XvPortPtr pPort, DrawablePtr pDraw)
|
||||||
|
|
||||||
XvdiSendVideoNotify(pPort, pDraw, XvStopped);
|
XvdiSendVideoNotify(pPort, pDraw, XvStopped);
|
||||||
|
|
||||||
status = (*pPort->pAdaptor->ddStopVideo) (pPort, pDraw);
|
status = (*pPort->pAdaptor->ddStopVideo) (client, pPort, pDraw);
|
||||||
|
|
||||||
|
pPort->pDraw = NULL;
|
||||||
|
pPort->client = (ClientPtr) client;
|
||||||
|
pPort->time = currentTime;
|
||||||
|
|
||||||
|
return status;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
XvdiPreemptVideo(ClientPtr client, XvPortPtr pPort, DrawablePtr pDraw)
|
||||||
|
{
|
||||||
|
int status;
|
||||||
|
|
||||||
|
/* IF PORT ISN'T ACTIVE THEN WE'RE DONE */
|
||||||
|
|
||||||
|
if (!pPort->pDraw || (pPort->pDraw != pDraw))
|
||||||
|
return Success;
|
||||||
|
|
||||||
|
XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted);
|
||||||
|
|
||||||
|
status = (*pPort->pAdaptor->ddStopVideo) (client, pPort, pPort->pDraw);
|
||||||
|
|
||||||
pPort->pDraw = NULL;
|
pPort->pDraw = NULL;
|
||||||
pPort->client = (ClientPtr) client;
|
pPort->client = (ClientPtr) client;
|
||||||
|
|
@ -979,7 +1046,7 @@ XvdiSetPortAttribute(ClientPtr client,
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
status =
|
status =
|
||||||
(*pPort->pAdaptor->ddSetPortAttribute) (pPort, attribute,
|
(*pPort->pAdaptor->ddSetPortAttribute) (client, pPort, attribute,
|
||||||
value);
|
value);
|
||||||
if (status == Success)
|
if (status == Success)
|
||||||
XvdiSendPortNotify(pPort, attribute, value);
|
XvdiSendPortNotify(pPort, attribute, value);
|
||||||
|
|
@ -993,12 +1060,12 @@ XvdiGetPortAttribute(ClientPtr client,
|
||||||
{
|
{
|
||||||
|
|
||||||
return
|
return
|
||||||
(*pPort->pAdaptor->ddGetPortAttribute) (pPort, attribute,
|
(*pPort->pAdaptor->ddGetPortAttribute) (client, pPort, attribute,
|
||||||
p_value);
|
p_value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _X_COLD
|
static void
|
||||||
WriteSwappedVideoNotifyEvent(xvEvent * from, xvEvent * to)
|
WriteSwappedVideoNotifyEvent(xvEvent * from, xvEvent * to)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -1012,7 +1079,7 @@ WriteSwappedVideoNotifyEvent(xvEvent * from, xvEvent * to)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _X_COLD
|
static void
|
||||||
WriteSwappedPortNotifyEvent(xvEvent * from, xvEvent * to)
|
WriteSwappedPortNotifyEvent(xvEvent * from, xvEvent * to)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -1024,77 +1091,3 @@ WriteSwappedPortNotifyEvent(xvEvent * from, xvEvent * to)
|
||||||
cpswapl(from->u.portNotify.value, to->u.portNotify.value);
|
cpswapl(from->u.portNotify.value, to->u.portNotify.value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
XvFreeAdaptor(XvAdaptorPtr pAdaptor)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
free(pAdaptor->name);
|
|
||||||
pAdaptor->name = NULL;
|
|
||||||
|
|
||||||
if (pAdaptor->pEncodings) {
|
|
||||||
XvEncodingPtr pEncode = pAdaptor->pEncodings;
|
|
||||||
|
|
||||||
for (i = 0; i < pAdaptor->nEncodings; i++, pEncode++)
|
|
||||||
free(pEncode->name);
|
|
||||||
free(pAdaptor->pEncodings);
|
|
||||||
pAdaptor->pEncodings = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
free(pAdaptor->pFormats);
|
|
||||||
pAdaptor->pFormats = NULL;
|
|
||||||
|
|
||||||
free(pAdaptor->pPorts);
|
|
||||||
pAdaptor->pPorts = NULL;
|
|
||||||
|
|
||||||
if (pAdaptor->pAttributes) {
|
|
||||||
XvAttributePtr pAttribute = pAdaptor->pAttributes;
|
|
||||||
|
|
||||||
for (i = 0; i < pAdaptor->nAttributes; i++, pAttribute++)
|
|
||||||
free(pAttribute->name);
|
|
||||||
free(pAdaptor->pAttributes);
|
|
||||||
pAdaptor->pAttributes = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
free(pAdaptor->pImages);
|
|
||||||
pAdaptor->pImages = NULL;
|
|
||||||
|
|
||||||
free(pAdaptor->devPriv.ptr);
|
|
||||||
pAdaptor->devPriv.ptr = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
XvFillColorKey(DrawablePtr pDraw, CARD32 key, RegionPtr region)
|
|
||||||
{
|
|
||||||
ScreenPtr pScreen = pDraw->pScreen;
|
|
||||||
ChangeGCVal pval[2];
|
|
||||||
BoxPtr pbox = RegionRects(region);
|
|
||||||
int i, nbox = RegionNumRects(region);
|
|
||||||
xRectangle *rects;
|
|
||||||
GCPtr gc;
|
|
||||||
|
|
||||||
gc = GetScratchGC(pDraw->depth, pScreen);
|
|
||||||
if (!gc)
|
|
||||||
return;
|
|
||||||
|
|
||||||
pval[0].val = key;
|
|
||||||
pval[1].val = IncludeInferiors;
|
|
||||||
(void) ChangeGC(NullClient, gc, GCForeground | GCSubwindowMode, pval);
|
|
||||||
ValidateGC(pDraw, gc);
|
|
||||||
|
|
||||||
rects = xallocarray(nbox, sizeof(xRectangle));
|
|
||||||
if (rects) {
|
|
||||||
for (i = 0; i < nbox; i++, pbox++) {
|
|
||||||
rects[i].x = pbox->x1 - pDraw->x;
|
|
||||||
rects[i].y = pbox->y1 - pDraw->y;
|
|
||||||
rects[i].width = pbox->x2 - pbox->x1;
|
|
||||||
rects[i].height = pbox->y2 - pbox->y1;
|
|
||||||
}
|
|
||||||
|
|
||||||
(*gc->ops->PolyFillRect) (pDraw, gc, nbox, rects);
|
|
||||||
|
|
||||||
free(rects);
|
|
||||||
}
|
|
||||||
FreeScratchGC(gc);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
36
Xext/xvmc.c
36
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;
|
||||||
|
|
@ -250,10 +253,6 @@ ProcXvMCCreateContext(ClientPtr client)
|
||||||
free(pContext);
|
free(pContext);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (!AddResource(pContext->context_id, XvMCRTContext, pContext)) {
|
|
||||||
free(data);
|
|
||||||
return BadAlloc;
|
|
||||||
}
|
|
||||||
|
|
||||||
rep = (xvmcCreateContextReply) {
|
rep = (xvmcCreateContextReply) {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
|
|
@ -267,6 +266,7 @@ ProcXvMCCreateContext(ClientPtr client)
|
||||||
WriteToClient(client, sizeof(xvmcCreateContextReply), &rep);
|
WriteToClient(client, sizeof(xvmcCreateContextReply), &rep);
|
||||||
if (dwords)
|
if (dwords)
|
||||||
WriteToClient(client, dwords << 2, data);
|
WriteToClient(client, dwords << 2, data);
|
||||||
|
AddResource(pContext->context_id, XvMCRTContext, pContext);
|
||||||
|
|
||||||
free(data);
|
free(data);
|
||||||
|
|
||||||
|
|
@ -287,7 +287,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;
|
||||||
}
|
}
|
||||||
|
|
@ -329,11 +329,6 @@ ProcXvMCCreateSurface(ClientPtr client)
|
||||||
free(pSurface);
|
free(pSurface);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (!AddResource(pSurface->surface_id, XvMCRTSurface, pSurface)) {
|
|
||||||
free(data);
|
|
||||||
return BadAlloc;
|
|
||||||
}
|
|
||||||
|
|
||||||
rep = (xvmcCreateSurfaceReply) {
|
rep = (xvmcCreateSurfaceReply) {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
@ -343,6 +338,7 @@ ProcXvMCCreateSurface(ClientPtr client)
|
||||||
WriteToClient(client, sizeof(xvmcCreateSurfaceReply), &rep);
|
WriteToClient(client, sizeof(xvmcCreateSurfaceReply), &rep);
|
||||||
if (dwords)
|
if (dwords)
|
||||||
WriteToClient(client, dwords << 2, data);
|
WriteToClient(client, dwords << 2, data);
|
||||||
|
AddResource(pSurface->surface_id, XvMCRTSurface, pSurface);
|
||||||
|
|
||||||
free(data);
|
free(data);
|
||||||
|
|
||||||
|
|
@ -365,7 +361,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;
|
||||||
}
|
}
|
||||||
|
|
@ -449,11 +445,6 @@ ProcXvMCCreateSubpicture(ClientPtr client)
|
||||||
free(pSubpicture);
|
free(pSubpicture);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (!AddResource(pSubpicture->subpicture_id, XvMCRTSubpicture, pSubpicture)) {
|
|
||||||
free(data);
|
|
||||||
return BadAlloc;
|
|
||||||
}
|
|
||||||
|
|
||||||
rep = (xvmcCreateSubpictureReply) {
|
rep = (xvmcCreateSubpictureReply) {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
@ -471,6 +462,7 @@ ProcXvMCCreateSubpicture(ClientPtr client)
|
||||||
WriteToClient(client, sizeof(xvmcCreateSubpictureReply), &rep);
|
WriteToClient(client, sizeof(xvmcCreateSubpictureReply), &rep);
|
||||||
if (dwords)
|
if (dwords)
|
||||||
WriteToClient(client, dwords << 2, data);
|
WriteToClient(client, dwords << 2, data);
|
||||||
|
AddResource(pSubpicture->subpicture_id, XvMCRTSubpicture, pSubpicture);
|
||||||
|
|
||||||
free(data);
|
free(data);
|
||||||
|
|
||||||
|
|
@ -493,7 +485,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;
|
||||||
}
|
}
|
||||||
|
|
@ -687,7 +679,7 @@ ProcXvMCDispatch(ClientPtr client)
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcXvMCDispatch(ClientPtr client)
|
SProcXvMCDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* We only support local */
|
/* We only support local */
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
20
Xi/allowev.c
20
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"
|
||||||
|
|
@ -70,10 +69,11 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int _X_COLD
|
int
|
||||||
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;
|
||||||
|
|
|
||||||
20
Xi/chgdctl.c
20
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"
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
@ -70,12 +71,13 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int _X_COLD
|
int
|
||||||
SProcXChangeDeviceControl(ClientPtr client)
|
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;
|
||||||
|
|
@ -245,7 +247,7 @@ ProcXChangeDeviceControl(ClientPtr client)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void _X_COLD
|
void
|
||||||
SRepXChangeDeviceControl(ClientPtr client, int size,
|
SRepXChangeDeviceControl(ClientPtr client, int size,
|
||||||
xChangeDeviceControlReply * rep)
|
xChangeDeviceControlReply * rep)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
12
Xi/chgfctl.c
12
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>
|
||||||
|
|
@ -69,10 +71,11 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int _X_COLD
|
int
|
||||||
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
|
||||||
|
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 */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
15
Xi/chgkmap.c
15
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"
|
||||||
|
|
@ -69,12 +69,13 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int _X_COLD
|
int
|
||||||
SProcXChangeDeviceKeyMapping(ClientPtr client)
|
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,
|
||||||
|
|
|
||||||
17
Xi/chgprop.c
17
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"
|
||||||
|
|
||||||
|
|
@ -71,10 +71,11 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int _X_COLD
|
int
|
||||||
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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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 */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
533
Xi/exevents.c
533
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.
|
||||||
|
|
@ -516,9 +471,9 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to)
|
||||||
|
|
||||||
oldTrace = to->focus->trace;
|
oldTrace = to->focus->trace;
|
||||||
memcpy(to->focus, from->focus, sizeof(FocusClassRec));
|
memcpy(to->focus, from->focus, sizeof(FocusClassRec));
|
||||||
to->focus->trace = reallocarray(oldTrace,
|
to->focus->trace = realloc(oldTrace,
|
||||||
to->focus->traceSize,
|
to->focus->traceSize *
|
||||||
sizeof(WindowPtr));
|
sizeof(WindowPtr));
|
||||||
if (!to->focus->trace && to->focus->traceSize)
|
if (!to->focus->trace && to->focus->traceSize)
|
||||||
FatalError("[Xi] no memory for trace.\n");
|
FatalError("[Xi] no memory for trace.\n");
|
||||||
memcpy(to->focus->trace, from->focus->trace,
|
memcpy(to->focus->trace, from->focus->trace,
|
||||||
|
|
@ -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.
|
||||||
*/
|
*/
|
||||||
|
|
@ -728,7 +661,7 @@ void
|
||||||
DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to,
|
DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to,
|
||||||
DeviceChangedEvent *dce)
|
DeviceChangedEvent *dce)
|
||||||
{
|
{
|
||||||
input_lock();
|
OsBlockSIGIO();
|
||||||
|
|
||||||
/* generic feedback classes, not tied to pointer and/or keyboard */
|
/* generic feedback classes, not tied to pointer and/or keyboard */
|
||||||
DeepCopyFeedbackClasses(from, to);
|
DeepCopyFeedbackClasses(from, to);
|
||||||
|
|
@ -738,7 +671,7 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to,
|
||||||
if ((dce->flags & DEVCHANGE_POINTER_EVENT))
|
if ((dce->flags & DEVCHANGE_POINTER_EVENT))
|
||||||
DeepCopyPointerClasses(from, to);
|
DeepCopyPointerClasses(from, to);
|
||||||
|
|
||||||
input_unlock();
|
OsReleaseSIGIO();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -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,32 +1375,13 @@ 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;
|
||||||
|
|
||||||
if (!ti->emulate_pointer)
|
|
||||||
return !Success;
|
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
|
|
@ -1489,7 +1403,7 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
|
|
||||||
if (grab->ownerEvents) {
|
if (grab->ownerEvents) {
|
||||||
WindowPtr focus = NullWindow;
|
WindowPtr focus = NullWindow;
|
||||||
WindowPtr sprite_win = DeepestSpriteWin(dev->spriteInfo->sprite);
|
WindowPtr sprite_win = dev->spriteInfo->sprite->win;
|
||||||
|
|
||||||
deliveries = DeliverDeviceEvents(sprite_win, ptrev, grab, focus, dev);
|
deliveries = DeliverDeviceEvents(sprite_win, ptrev, grab, focus, dev);
|
||||||
}
|
}
|
||||||
|
|
@ -1515,9 +1429,8 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
GrabPtr devgrab = dev->deviceGrab.grab;
|
GrabPtr devgrab = dev->deviceGrab.grab;
|
||||||
WindowPtr sprite_win = DeepestSpriteWin(dev->spriteInfo->sprite);
|
|
||||||
|
|
||||||
DeliverDeviceEvents(sprite_win, ptrev, grab, win, dev);
|
DeliverDeviceEvents(win, ptrev, grab, win, dev);
|
||||||
/* FIXME: bad hack
|
/* FIXME: bad hack
|
||||||
* Implicit passive grab activated in response to this event. Store
|
* Implicit passive grab activated in response to this event. Store
|
||||||
* the event.
|
* the event.
|
||||||
|
|
@ -1530,7 +1443,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 +1452,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 +1481,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 +1494,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);
|
||||||
}
|
}
|
||||||
|
|
@ -1666,14 +1589,13 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
|
||||||
if (!ti) {
|
if (!ti) {
|
||||||
DebugF("[Xi] %s: Failed to get event %d for touchpoint %d\n",
|
DebugF("[Xi] %s: Failed to get event %d for touchpoint %d\n",
|
||||||
dev->name, type, touchid);
|
dev->name, type, touchid);
|
||||||
goto out;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 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))
|
||||||
|
|
@ -1701,7 +1623,6 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
|
||||||
if (ev->any.type == ET_TouchEnd)
|
if (ev->any.type == ET_TouchEnd)
|
||||||
TouchEndTouch(dev, ti);
|
TouchEndTouch(dev, ti);
|
||||||
|
|
||||||
out:
|
|
||||||
if (emulate_pointer)
|
if (emulate_pointer)
|
||||||
UpdateDeviceState(dev, &ev->device_event);
|
UpdateDeviceState(dev, &ev->device_event);
|
||||||
}
|
}
|
||||||
|
|
@ -1749,72 +1670,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.
|
||||||
*/
|
*/
|
||||||
|
|
@ -1874,18 +1729,6 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* send KeyPress and KeyRelease events to XACE plugins */
|
|
||||||
if (XaceHookIsSet(XACE_KEY_AVAIL) &&
|
|
||||||
(event->type == ET_KeyPress || event->type == ET_KeyRelease)) {
|
|
||||||
xEvent *core;
|
|
||||||
int count;
|
|
||||||
|
|
||||||
if (EventToCore(ev, &core, &count) == Success && count > 0) {
|
|
||||||
XaceHookKeyAvail(core, device, 0);
|
|
||||||
free(core);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (DeviceEventCallback && !syncEvents.playingEvents) {
|
if (DeviceEventCallback && !syncEvents.playingEvents) {
|
||||||
DeviceEventInfoRec eventinfo;
|
DeviceEventInfoRec eventinfo;
|
||||||
SpritePtr pSprite = device->spriteInfo->sprite;
|
SpritePtr pSprite = device->spriteInfo->sprite;
|
||||||
|
|
@ -1903,11 +1746,7 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
|
||||||
|
|
||||||
switch (event->type) {
|
switch (event->type) {
|
||||||
case ET_KeyPress:
|
case ET_KeyPress:
|
||||||
/* Don't deliver focus events (e.g. from KeymapNotify when running
|
if (!grab && CheckDeviceGrabs(device, event, 0))
|
||||||
* nested) to clients. */
|
|
||||||
if (event->source_type == EVENT_SOURCE_FOCUS)
|
|
||||||
return;
|
|
||||||
if (!grab && CheckDeviceGrabs(device, ev, 0))
|
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case ET_KeyRelease:
|
case ET_KeyRelease:
|
||||||
|
|
@ -1920,7 +1759,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;
|
||||||
|
|
@ -1938,19 +1777,15 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Don't deliver focus events (e.g. from KeymapNotify when running
|
if (grab)
|
||||||
* nested) to clients. */
|
DeliverGrabbedEvent((InternalEvent *) event, device,
|
||||||
if (event->source_type != EVENT_SOURCE_FOCUS) {
|
deactivateDeviceGrab);
|
||||||
if (grab)
|
else if (device->focus && !IsPointerEvent(ev))
|
||||||
DeliverGrabbedEvent((InternalEvent *) event, device,
|
DeliverFocusedEvent(device, (InternalEvent *) event,
|
||||||
deactivateDeviceGrab);
|
GetSpriteWindow(device));
|
||||||
else if (device->focus && !IsPointerEvent(ev))
|
else
|
||||||
DeliverFocusedEvent(device, (InternalEvent *) event,
|
DeliverDeviceEvents(GetSpriteWindow(device), (InternalEvent *) event,
|
||||||
GetSpriteWindow(device));
|
NullGrab, NullWindow, device);
|
||||||
else
|
|
||||||
DeliverDeviceEvents(GetSpriteWindow(device), (InternalEvent *) event,
|
|
||||||
NullGrab, NullWindow, device);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (deactivateDeviceGrab == TRUE) {
|
if (deactivateDeviceGrab == TRUE) {
|
||||||
(*device->deviceGrab.DeactivateGrab) (device);
|
(*device->deviceGrab.DeactivateGrab) (device);
|
||||||
|
|
@ -2009,14 +1844,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 +1860,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 +1882,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 +1908,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 +1925,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 +1940,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 +1960,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 +1983,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 +1993,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 +2048,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 +2227,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 +2237,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 +2293,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 +2326,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 +2336,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 +2353,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 +2367,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 +2414,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 +2502,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 +2528,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 +2642,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 +2674,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 +2835,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 +2941,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 +2951,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 +3052,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;
|
||||||
|
|
|
||||||
217
Xi/extinit.c
217
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
|
||||||
|
|
@ -376,6 +380,18 @@ DevPrivateKeyRec XIClientPrivateKeyRec;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
static void
|
||||||
|
XIClientCallback(CallbackListPtr *list, void *closure, void *data)
|
||||||
|
{
|
||||||
|
NewClientInfoRec *clientinfo = (NewClientInfoRec *) data;
|
||||||
|
ClientPtr pClient = clientinfo->client;
|
||||||
|
XIClientPtr pXIClient;
|
||||||
|
|
||||||
|
pXIClient = dixLookupPrivate(&pClient->devPrivates, XIClientPrivateKey);
|
||||||
|
pXIClient->major_version = 0;
|
||||||
|
pXIClient->minor_version = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
*
|
*
|
||||||
* ProcIDispatch - main dispatch routine for requests to this extension.
|
* ProcIDispatch - main dispatch routine for requests to this extension.
|
||||||
|
|
@ -390,7 +406,6 @@ ProcIDispatch(ClientPtr client)
|
||||||
if (stuff->data >= ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data])
|
if (stuff->data >= ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data])
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
|
|
||||||
UpdateCurrentTimeIf();
|
|
||||||
return (*ProcIVector[stuff->data]) (client);
|
return (*ProcIVector[stuff->data]) (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -403,14 +418,13 @@ ProcIDispatch(ClientPtr client)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int _X_COLD
|
static int
|
||||||
SProcIDispatch(ClientPtr client)
|
SProcIDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
if (stuff->data >= ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data])
|
if (stuff->data >= ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data])
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
|
|
||||||
UpdateCurrentTimeIf();
|
|
||||||
return (*SProcIVector[stuff->data]) (client);
|
return (*SProcIVector[stuff->data]) (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -421,7 +435,7 @@ SProcIDispatch(ClientPtr client)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void _X_COLD
|
static void
|
||||||
SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
|
SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
|
||||||
{
|
{
|
||||||
/* All we look at is the type field */
|
/* All we look at is the type field */
|
||||||
|
|
@ -516,7 +530,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 +554,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,76 +868,8 @@ 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
|
||||||
XI2EventSwap(xGenericEvent *from, xGenericEvent *to)
|
XI2EventSwap(xGenericEvent *from, xGenericEvent *to)
|
||||||
{
|
{
|
||||||
switch (from->evtype) {
|
switch (from->evtype) {
|
||||||
|
|
@ -973,24 +919,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 +961,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 +1039,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 +1060,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 +1079,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);
|
||||||
|
|
@ -1238,7 +1212,7 @@ MakeDeviceTypeAtoms(void)
|
||||||
*/
|
*/
|
||||||
#define DO_SWAP(func,type) func ((type *)from, (type *)to)
|
#define DO_SWAP(func,type) func ((type *)from, (type *)to)
|
||||||
|
|
||||||
static void _X_COLD
|
static void
|
||||||
SEventIDispatch(xEvent *from, xEvent *to)
|
SEventIDispatch(xEvent *from, xEvent *to)
|
||||||
{
|
{
|
||||||
int type = from->u.u.type & 0177;
|
int type = from->u.u.type & 0177;
|
||||||
|
|
@ -1322,6 +1296,9 @@ XInputExtensionInit(void)
|
||||||
(&XIClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(XIClientRec)))
|
(&XIClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(XIClientRec)))
|
||||||
FatalError("Cannot request private for XI.\n");
|
FatalError("Cannot request private for XI.\n");
|
||||||
|
|
||||||
|
if (!AddCallback(&ClientStateCallback, XIClientCallback, 0))
|
||||||
|
FatalError("Failed to add callback to XI.\n");
|
||||||
|
|
||||||
if (!XIBarrierInit())
|
if (!XIBarrierInit())
|
||||||
FatalError("Could not initialize barriers.\n");
|
FatalError("Could not initialize barriers.\n");
|
||||||
|
|
||||||
|
|
|
||||||
18
Xi/getbmap.c
18
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
|
||||||
|
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.
|
||||||
|
|
@ -106,7 +122,7 @@ ProcXGetDeviceButtonMapping(ClientPtr client)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void _X_COLD
|
void
|
||||||
SRepXGetDeviceButtonMapping(ClientPtr client, int size,
|
SRepXGetDeviceButtonMapping(ClientPtr client, int size,
|
||||||
xGetDeviceButtonMappingReply * rep)
|
xGetDeviceButtonMappingReply * rep)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -66,10 +68,11 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int _X_COLD
|
int
|
||||||
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));
|
||||||
|
|
@ -150,7 +153,7 @@ CopySwapDeviceEnable(ClientPtr client, DeviceIntPtr dev, char *buf)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void _X_COLD
|
void
|
||||||
SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep)
|
SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep)
|
||||||
{
|
{
|
||||||
swaps(&rep->sequenceNumber);
|
swaps(&rep->sequenceNumber);
|
||||||
|
|
|
||||||
20
Xi/getfctl.c
20
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
|
||||||
|
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];
|
||||||
|
|
@ -242,7 +258,7 @@ CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void _X_COLD
|
void
|
||||||
SRepXGetFeedbackControl(ClientPtr client, int size,
|
SRepXGetFeedbackControl(ClientPtr client, int size,
|
||||||
xGetFeedbackControlReply * rep)
|
xGetFeedbackControlReply * rep)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
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.
|
||||||
|
|
@ -114,7 +130,7 @@ ProcXGetDeviceFocus(ClientPtr client)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void _X_COLD
|
void
|
||||||
SRepXGetDeviceFocus(ClientPtr client, int size, xGetDeviceFocusReply * rep)
|
SRepXGetDeviceFocus(ClientPtr client, int size, xGetDeviceFocusReply * rep)
|
||||||
{
|
{
|
||||||
swaps(&rep->sequenceNumber);
|
swaps(&rep->sequenceNumber);
|
||||||
|
|
|
||||||
|
|
@ -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 */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
19
Xi/getkmap.c
19
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
|
||||||
|
SProcXGetDeviceKeyMapping(ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xGetDeviceKeyMappingReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
|
return (ProcXGetDeviceKeyMapping(client));
|
||||||
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* Get the device key mapping.
|
* Get the device key mapping.
|
||||||
|
|
@ -129,7 +146,7 @@ ProcXGetDeviceKeyMapping(ClientPtr client)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void _X_COLD
|
void
|
||||||
SRepXGetDeviceKeyMapping(ClientPtr client, int size,
|
SRepXGetDeviceKeyMapping(ClientPtr client, int size,
|
||||||
xGetDeviceKeyMappingReply * rep)
|
xGetDeviceKeyMappingReply * rep)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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 */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
19
Xi/getmmap.c
19
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
|
||||||
|
SProcXGetDeviceModifierMapping(ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xGetDeviceModifierMappingReq);
|
||||||
|
swaps(&stuff->length);
|
||||||
|
return (ProcXGetDeviceModifierMapping(client));
|
||||||
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* Get the device Modifier mapping.
|
* Get the device Modifier mapping.
|
||||||
|
|
@ -108,7 +125,7 @@ ProcXGetDeviceModifierMapping(ClientPtr client)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void _X_COLD
|
void
|
||||||
SRepXGetDeviceModifierMapping(ClientPtr client, int size,
|
SRepXGetDeviceModifierMapping(ClientPtr client, int size,
|
||||||
xGetDeviceModifierMappingReply * rep)
|
xGetDeviceModifierMappingReply * rep)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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 */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
19
Xi/getprop.c
19
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[];
|
||||||
|
|
@ -72,10 +72,11 @@ extern int ExtEventIndex;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int _X_COLD
|
int
|
||||||
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));
|
||||||
|
|
@ -117,9 +118,7 @@ ProcXGetDeviceDontPropagateList(ClientPtr client)
|
||||||
ClassFromMask(NULL, others->dontPropagateMask[i], i, &count, COUNT);
|
ClassFromMask(NULL, others->dontPropagateMask[i], i, &count, COUNT);
|
||||||
if (count) {
|
if (count) {
|
||||||
rep.count = count;
|
rep.count = count;
|
||||||
buf = xallocarray(rep.count, sizeof(XEventClass));
|
buf = (XEventClass *) malloc(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;
|
||||||
|
|
@ -174,7 +173,7 @@ XEventClass
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void _X_COLD
|
void
|
||||||
SRepXGetDeviceDontPropagateList(ClientPtr client, int size,
|
SRepXGetDeviceDontPropagateList(ClientPtr client, int size,
|
||||||
xGetDeviceDontPropagateListReply * rep)
|
xGetDeviceDontPropagateListReply * rep)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
||||||
|
|
@ -70,10 +70,11 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int _X_COLD
|
int
|
||||||
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));
|
||||||
|
|
@ -163,7 +164,7 @@ ProcXGetSelectedExtensionEvents(ClientPtr client)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void _X_COLD
|
void
|
||||||
SRepXGetSelectedExtensionEvents(ClientPtr client, int size,
|
SRepXGetSelectedExtensionEvents(ClientPtr client, int size,
|
||||||
xGetSelectedExtensionEventsReply * rep)
|
xGetSelectedExtensionEventsReply * rep)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -68,10 +70,11 @@ XExtensionVersion XIVersion;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int _X_COLD
|
int
|
||||||
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;
|
||||||
|
|
||||||
|
|
@ -117,7 +120,7 @@ ProcXGetExtensionVersion(ClientPtr client)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void _X_COLD
|
void
|
||||||
SRepXGetExtensionVersion(ClientPtr client, int size,
|
SRepXGetExtensionVersion(ClientPtr client, int size,
|
||||||
xGetExtensionVersionReply * rep)
|
xGetExtensionVersionReply * rep)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
14
Xi/grabdev.c
14
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 */
|
||||||
|
|
@ -70,17 +72,17 @@ extern int ExtEventIndex;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int _X_COLD
|
int
|
||||||
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)
|
||||||
*
|
*
|
||||||
|
|
@ -203,7 +205,7 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void _X_COLD
|
void
|
||||||
SRepXGrabDevice(ClientPtr client, int size, xGrabDeviceReply * rep)
|
SRepXGrabDevice(ClientPtr client, int size, xGrabDeviceReply * rep)
|
||||||
{
|
{
|
||||||
swaps(&rep->sequenceNumber);
|
swaps(&rep->sequenceNumber);
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
||||||
|
|
@ -70,10 +71,11 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int _X_COLD
|
int
|
||||||
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"
|
||||||
|
|
||||||
|
|
@ -70,10 +71,11 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int _X_COLD
|
int
|
||||||
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"
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
@ -67,10 +68,11 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int _X_COLD
|
int
|
||||||
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);
|
||||||
|
|
@ -160,7 +162,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void _X_COLD
|
void
|
||||||
SRepXGetDeviceMotionEvents(ClientPtr client, int size,
|
SRepXGetDeviceMotionEvents(ClientPtr client, int size,
|
||||||
xGetDeviceMotionEventsReply * rep)
|
xGetDeviceMotionEventsReply * rep)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
32
Xi/listdev.c
32
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
|
||||||
|
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;
|
||||||
|
|
@ -403,7 +413,7 @@ ProcXListInputDevices(ClientPtr client)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void _X_COLD
|
void
|
||||||
SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep)
|
SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep)
|
||||||
{
|
{
|
||||||
swaps(&rep->sequenceNumber);
|
swaps(&rep->sequenceNumber);
|
||||||
|
|
|
||||||
|
|
@ -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 */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
||||||
srcs_xi = [
|
|
||||||
'allowev.c',
|
|
||||||
'chgdctl.c',
|
|
||||||
'chgfctl.c',
|
|
||||||
'chgkbd.c',
|
|
||||||
'chgkmap.c',
|
|
||||||
'chgprop.c',
|
|
||||||
'chgptr.c',
|
|
||||||
'closedev.c',
|
|
||||||
'devbell.c',
|
|
||||||
'exevents.c',
|
|
||||||
'extinit.c',
|
|
||||||
'getbmap.c',
|
|
||||||
'getdctl.c',
|
|
||||||
'getfctl.c',
|
|
||||||
'getfocus.c',
|
|
||||||
'getkmap.c',
|
|
||||||
'getmmap.c',
|
|
||||||
'getprop.c',
|
|
||||||
'getselev.c',
|
|
||||||
'getvers.c',
|
|
||||||
'grabdev.c',
|
|
||||||
'grabdevb.c',
|
|
||||||
'grabdevk.c',
|
|
||||||
'gtmotion.c',
|
|
||||||
'listdev.c',
|
|
||||||
'opendev.c',
|
|
||||||
'queryst.c',
|
|
||||||
'selectev.c',
|
|
||||||
'sendexev.c',
|
|
||||||
'setbmap.c',
|
|
||||||
'setdval.c',
|
|
||||||
'setfocus.c',
|
|
||||||
'setmmap.c',
|
|
||||||
'setmode.c',
|
|
||||||
'ungrdev.c',
|
|
||||||
'ungrdevb.c',
|
|
||||||
'ungrdevk.c',
|
|
||||||
'xiallowev.c',
|
|
||||||
'xibarriers.c',
|
|
||||||
'xichangecursor.c',
|
|
||||||
'xichangehierarchy.c',
|
|
||||||
'xigetclientpointer.c',
|
|
||||||
'xigrabdev.c',
|
|
||||||
'xipassivegrab.c',
|
|
||||||
'xiproperty.c',
|
|
||||||
'xiquerydevice.c',
|
|
||||||
'xiquerypointer.c',
|
|
||||||
'xiqueryversion.c',
|
|
||||||
'xiselectev.c',
|
|
||||||
'xisetclientpointer.c',
|
|
||||||
'xisetdevfocus.c',
|
|
||||||
'xiwarppointer.c',
|
|
||||||
]
|
|
||||||
|
|
||||||
libxserver_xi = static_library('libxserver_xi',
|
|
||||||
srcs_xi,
|
|
||||||
include_directories: inc,
|
|
||||||
dependencies: common_dep,
|
|
||||||
)
|
|
||||||
|
|
||||||
srcs_xi_stubs = ['stubs.c']
|
|
||||||
libxserver_xi_stubs = static_library('libxserver_xi_stubs',
|
|
||||||
srcs_xi_stubs,
|
|
||||||
include_directories: inc,
|
|
||||||
dependencies: common_dep,
|
|
||||||
)
|
|
||||||
19
Xi/opendev.c
19
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
|
||||||
|
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.
|
||||||
|
|
@ -146,7 +163,7 @@ ProcXOpenDevice(ClientPtr client)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void _X_COLD
|
void
|
||||||
SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep)
|
SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep)
|
||||||
{
|
{
|
||||||
swaps(&rep->sequenceNumber);
|
swaps(&rep->sequenceNumber);
|
||||||
|
|
|
||||||
|
|
@ -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 */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
28
Xi/queryst.c
28
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
|
||||||
|
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.
|
||||||
|
|
@ -165,7 +179,7 @@ ProcXQueryDeviceState(ClientPtr client)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void _X_COLD
|
void
|
||||||
SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep)
|
SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep)
|
||||||
{
|
{
|
||||||
swaps(&rep->sequenceNumber);
|
swaps(&rep->sequenceNumber);
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
@ -117,10 +119,11 @@ HandleDevicePresenceMask(ClientPtr client, WindowPtr win,
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int _X_COLD
|
int
|
||||||
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"
|
||||||
|
|
||||||
|
|
@ -72,38 +73,31 @@ extern int lastEvent; /* Defined in extension.c */
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int _X_COLD
|
int
|
||||||
SProcXSendExtensionEvent(ClientPtr client)
|
SProcXSendExtensionEvent(ClientPtr client)
|
||||||
{
|
{
|
||||||
CARD32 *p;
|
CARD32 *p;
|
||||||
int i;
|
int i;
|
||||||
xEvent eventT = { .u.u.type = 0 };
|
xEvent eventT;
|
||||||
xEvent *eventP;
|
xEvent *eventP;
|
||||||
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;
|
||||||
|
|
||||||
eventP = (xEvent *) &stuff[1];
|
eventP = (xEvent *) &stuff[1];
|
||||||
for (i = 0; i < stuff->num_events; i++, eventP++) {
|
for (i = 0; i < stuff->num_events; i++, eventP++) {
|
||||||
if (eventP->u.u.type == GenericEvent) {
|
|
||||||
client->errorValue = eventP->u.u.type;
|
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
proc = EventSwapVector[eventP->u.u.type & 0177];
|
proc = EventSwapVector[eventP->u.u.type & 0177];
|
||||||
/* no swapping proc; invalid event type? */
|
if (proc == NotImplemented) /* no swapping proc; invalid event type? */
|
||||||
if (proc == NotImplemented) {
|
|
||||||
client->errorValue = eventP->u.u.type;
|
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
|
||||||
(*proc) (eventP, &eventT);
|
(*proc) (eventP, &eventT);
|
||||||
*eventP = eventT;
|
*eventP = eventT;
|
||||||
}
|
}
|
||||||
|
|
@ -123,7 +117,7 @@ SProcXSendExtensionEvent(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcXSendExtensionEvent(ClientPtr client)
|
ProcXSendExtensionEvent(ClientPtr client)
|
||||||
{
|
{
|
||||||
int ret, i;
|
int ret;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xEvent *first;
|
xEvent *first;
|
||||||
XEventClass *list;
|
XEventClass *list;
|
||||||
|
|
@ -132,7 +126,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;
|
||||||
|
|
@ -147,12 +141,10 @@ ProcXSendExtensionEvent(ClientPtr client)
|
||||||
/* The client's event type must be one defined by an extension. */
|
/* The client's event type must be one defined by an extension. */
|
||||||
|
|
||||||
first = ((xEvent *) &stuff[1]);
|
first = ((xEvent *) &stuff[1]);
|
||||||
for (i = 0; i < stuff->num_events; i++) {
|
if (!((EXTENSION_EVENT_BASE <= first->u.u.type) &&
|
||||||
if (!((EXTENSION_EVENT_BASE <= first[i].u.u.type) &&
|
(first->u.u.type < lastEvent))) {
|
||||||
(first[i].u.u.type < lastEvent))) {
|
client->errorValue = first->u.u.type;
|
||||||
client->errorValue = first[i].u.u.type;
|
return BadValue;
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
list = (XEventClass *) (first + stuff->num_events);
|
list = (XEventClass *) (first + stuff->num_events);
|
||||||
|
|
|
||||||
28
Xi/setbmap.c
28
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
|
||||||
|
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;
|
||||||
|
|
||||||
|
|
@ -116,7 +130,7 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void _X_COLD
|
void
|
||||||
SRepXSetDeviceButtonMapping(ClientPtr client, int size,
|
SRepXSetDeviceButtonMapping(ClientPtr client, int size,
|
||||||
xSetDeviceButtonMappingReply * rep)
|
xSetDeviceButtonMappingReply * rep)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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 */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
28
Xi/setdval.c
28
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
|
||||||
|
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;
|
||||||
|
|
||||||
|
|
@ -123,7 +137,7 @@ ProcXSetDeviceValuators(ClientPtr client)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void _X_COLD
|
void
|
||||||
SRepXSetDeviceValuators(ClientPtr client, int size,
|
SRepXSetDeviceValuators(ClientPtr client, int size,
|
||||||
xSetDeviceValuatorsReply * rep)
|
xSetDeviceValuatorsReply * rep)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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 */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue