Re: [PATCH] Include client name if available in PrintDeviceGrabInfo
On 12/08/2011 09:02 AM, Alan Coopersmith wrote: Also adds missing newline to first line of output. Before patch: [3581472.414] (II) Printing all currently active device grabs: [3581472.414] Active grab 0x180 (core) on device 'Virtual core pointer' (2): client pid 26174 uid 0 gid 10 [3581472.415] at 3581469139 (from active grab) (device thawed, state 1) [3581472.415] core event mask 0x0 [3581472.415] owner-events true, kb 1 ptr 1, confine 0, cursor 0x0 [3581472.415] Active grab 0x180 (core) on device 'Virtual core keyboard' (3) : client pid 26174 uid 0 gid 10 [3581472.415] at 3581469139 (from active grab) (device thawed, state 1) [3581472.415] core event mask 0x3 [3581472.415] owner-events true, kb 1 ptr 1, confine 0, cursor 0x0 [3581472.415] (II) End list of active device grabs After patch: [3581736.601] (II) Printing all currently active device grabs: [3581736.601] Active grab 0x160 (core) on device 'Virtual core pointer' (2): [3581736.601] client pid 26741 /usr/bin/xscreensaver -nosplash [3581736.601] at 3581735000 (from active grab) (device thawed, state 1) [3581736.601] core event mask 0x0 [3581736.601] owner-events true, kb 1 ptr 1, confine 0, cursor 0x0 [3581736.601] Active grab 0x160 (core) on device 'Virtual core keyboard' (3) : [3581736.601] client pid 26741 /usr/bin/xscreensaver -nosplash [3581736.601] at 3581735000 (from active grab) (device thawed, state 1) [3581736.601] core event mask 0x3 [3581736.601] owner-events true, kb 1 ptr 1, confine 0, cursor 0x0 [3581736.601] (II) End list of active device grabs Signed-off-by: Alan Coopersmithalan.coopersm...@oracle.com Reviewed-by: Rami Ylimäki rami.ylim...@vincit.fi +ErrorF( (no client information available for client %d)\n, + CLIENT_ID(grab-resource)); I'd prefer the format to be %lx as that is used generally for resources. That would make it easier to find the client XID from output of xrestop for example. -- Rami ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH v2 app-xfd] Use the Automake recommended alternative to AX_DEFINE_DIR
DATADIR, like any installation variable, is not known at configure time. This is by design to allow setting the variable at make time. The AX_DEFINE_DIR macro worked around this design and consequently cancelled an Automake feature. The alternative method suggested by Automake ends up being simpler while providing the same result as AX_DEFINE_DIR but without cancelling any feature. It is used in the xserver for the parser and in xquartz. The AX_DEFINE_DIR macro has been removed from the Autoconf Archive. There are no official providers for this macro anymore. Separate pre-processor from compiler flags. XFD_CFLAGS and CWARNFLAGS may contain compiler flags. Signed-off-by: Gaetan Nadon mems...@videotron.ca --- Makefile.am |5 ++--- configure.ac|3 +-- m4/ax_define_dir.m4 | 49 - 3 files changed, 3 insertions(+), 54 deletions(-) delete mode 100644 m4/ax_define_dir.m4 diff --git a/Makefile.am b/Makefile.am index 5052217..b179b4c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,11 +22,10 @@ SUBDIRS = man bin_PROGRAMS = xfd -AM_CFLAGS = $(XFD_CFLAGS) $(CWARNFLAGS) -DXRENDER -D_BSD_SOURCE +AM_CPPFLAGS = -DXRENDER -D_BSD_SOURCE -DLOCALEDIR=\$(LOCALEDIR)\ +AM_CFLAGS = $(XFD_CFLAGS) $(CWARNFLAGS) xfd_LDADD = $(XFD_LIBS) -ACLOCAL_AMFLAGS = -I m4 - xfd_SOURCES = \ grid.c \ grid.h \ diff --git a/configure.ac b/configure.ac index 51fadfb..f4e84e0 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,6 @@ dnl Process this file with autoconf to create configure. AC_PREREQ([2.60]) AC_INIT([xfd],[1.1.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xfd]) -AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE @@ -43,7 +42,7 @@ AC_MSG_CHECKING([where to install localized messages]) AC_ARG_WITH([localedir], AS_HELP_STRING([--with-localedir=path], [Path to install message files in (default: datadir/locale)]), [LOCALEDIR=${withval}], [LOCALEDIR=${datadir}/locale]) -AX_DEFINE_DIR([LOCALEDIR], [LOCALEDIR], [Location of translated messages]) +AC_SUBST([LOCALEDIR]) if test x$LOCALEDIR = xno -o x$USE_GETTEXT = xno ; then AC_MSG_RESULT([nowhere]) USE_GETTEXT=no diff --git a/m4/ax_define_dir.m4 b/m4/ax_define_dir.m4 deleted file mode 100644 index b74d155..000 --- a/m4/ax_define_dir.m4 +++ /dev/null @@ -1,49 +0,0 @@ -# === -# http://www.gnu.org/software/autoconf-archive/ax_define_dir.html -# === -# -# SYNOPSIS -# -# AX_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) -# -# DESCRIPTION -# -# This macro sets VARNAME to the expansion of the DIR variable, taking -# care of fixing up ${prefix} and such. -# -# VARNAME is then offered as both an output variable and a C preprocessor -# symbol. -# -# Example: -# -# AX_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) -# -# LICENSE -# -# Copyright (c) 2008 Stepan Kasal ka...@ucw.cz -# Copyright (c) 2008 Andreas Schwab sch...@suse.de -# Copyright (c) 2008 Guido U. Draheim gui...@gmx.de -# Copyright (c) 2008 Alexandre Oliva -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 6 - -AU_ALIAS([AC_DEFINE_DIR], [AX_DEFINE_DIR]) -AC_DEFUN([AX_DEFINE_DIR], [ - prefix_NONE= - exec_prefix_NONE= - test x$prefix = xNONE prefix_NONE=yes prefix=$ac_default_prefix - test x$exec_prefix = xNONE exec_prefix_NONE=yes exec_prefix=$prefix -dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn -dnl refers to ${prefix}. Thus we have to use `eval' twice. - eval ax_define_dir=\[$]$2\ - eval ax_define_dir=\$ax_define_dir\ - AC_SUBST($1, $ax_define_dir) - AC_DEFINE_UNQUOTED($1, $ax_define_dir, [$3]) - test $prefix_NONE prefix=NONE - test $exec_prefix_NONE exec_prefix=NONE -]) -- 1.7.4.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH app-xfd] Use the Automake recommended alternative to AX_DEFINE_DIR
On Wed, 2011-12-07 at 21:10 -0800, Alan Coopersmith wrote: On 12/07/11 10:39, Gaetan Nadon wrote: DATADIR, like any installation variable, is not known at configure time. This is by design to allow setting the variable at make time. The AX_DEFINE_DIR macro worked around this design and consequently cancelled an Automake feature. The alternative method suggested by Automake ends up being simpler while providing the same result as AX_DEFINE_DIR but without cancelling any feature. It is used in the xserver for the parser and in xquartz. The AX_DEFINE_DIR macro has been removed from the Autoconf Archive. There are no official providers for this macro anymore. Before automake 1.11 doing this would have contributed a lot of noise to the build logs, but silent mode should cover this. Many -Ds would be noisy and could overflow command limits in some cases. For simple cases like this it seems okay - in cases where we were exporting the definition in a .h file a more complex solution may be required. There is another Automake proposed alternative: Alternatively, create a dedicated header file: DISTCLEANFILES = myprog-paths.h myprog-paths.h: Makefile echo '#define DATADIR $(datadir)' $@ One nit/question, should it be CPPFLAGS instead of CFLAGS? See patch v2 Thanks. signature.asc Description: This is a digitally signed message part ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 0/7] Fix GLX files generated by Mesa for the server
There has been quite a bit of skew between what's in Mesa and what's needed in the xserver. This patch series cleans that up. Most of the changes are quite mundane and just make the code compile inside the xserver. However, the changes in patch 6/7 modify the way the availability and use of backtrace is handled. Once this series is reviewed and accepeted in Mesa, a short series that makes the newly generated code usable in the xserver will be posted to xorg-devel. The two sequences together are prerequesites to a Mesa series and an xserver series that will implement GLX_ARB_create_context and GLX_ARB_create_context_profile. Trees with these patches and the generated files can be found at: git://anongit.freedesktop.org/~idr/mesa glx-fixes git://anongit.freedesktop.org/~idr/xserver glx-fixes With these two branches, I observer no piglit regressions on Intel Ironlake hardware. I have not tested other hardware, but I would expect any regressions to be hardware independent. ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 1/7] glapi/glx: Remove g_disptab.h from xserver generated files
From: Ian Romanick ian.d.roman...@intel.com That file was removed from the xserver with commit: commit a80780a7638f847c3be20e5e0c7fe85e83d9bdd1 Author: Adam Jackson a...@redhat.com Date: Wed Nov 17 09:03:06 2010 -0500 glx: Remove swap barrier and hyperpipe support Never implemented in any open source driver. The implementation assumed explicit DDX driver knowledge of how the client-side driver worked, since at the time the server's GL renderer was not a DRI driver. But now, it is, so any implementation of these should be done with additional DRI driver API, like the swap control extension. Reviewed-by: Julien Cristau jcris...@debian.org Signed-off-by: Kristian Høgsberg k...@bitplanet.net Signed-off-by: Adam Jackson a...@redhat.com Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mapi/glapi/gen/glX_server_table.py |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/src/mapi/glapi/gen/glX_server_table.py b/src/mapi/glapi/gen/glX_server_table.py index f3962f8..1539753 100644 --- a/src/mapi/glapi/gen/glX_server_table.py +++ b/src/mapi/glapi/gen/glX_server_table.py @@ -362,7 +362,6 @@ class PrintGlxDispatchTables(glX_proto_common.glx_print_proto): print '#include glxext.h' print '#include indirect_dispatch.h' print '#include indirect_reqsize.h' - print '#include g_disptab.h' print '#include indirect_table.h' print '' return -- 1.7.6.4 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 2/7] glapi: Remove mention of nonexistent enums
From: Ian Romanick ian.d.roman...@intel.com glext.h doesn't have GL_MIN_PROGRAM_TEXEL_OFFSET_EXT or GL_MAX_PROGRAM_TEXEL_OFFSET_EXT. Using them in the XML causes code to be generated for the xserver that won't compile. Use the names that exist instead. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mapi/glapi/gen/EXT_gpu_shader4.xml |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mapi/glapi/gen/EXT_gpu_shader4.xml b/src/mapi/glapi/gen/EXT_gpu_shader4.xml index 7a8944e..bf2f6a3 100644 --- a/src/mapi/glapi/gen/EXT_gpu_shader4.xml +++ b/src/mapi/glapi/gen/EXT_gpu_shader4.xml @@ -31,10 +31,15 @@ enum name=UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT value=0x8DD6/ enum name=UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT value=0x8DD7/ enum name=UNSIGNED_INT_SAMPLER_BUFFER_EXTvalue=0x8DD8/ -enum name=MIN_PROGRAM_TEXEL_OFFSET_EXT value=0x8904 + +!-- There is no MIN_PROGRAM_TEXEL_OFFSET_EXT in glext.h. There is + MIN_PROGRAM_TEXEL_OFFSET_NV and MIN_PROGRAM_TEXEL_OFFSET (OpenGL + 3.0). Same goes for MAX_PROGRAM_TEXEL_OFFSET_EXT. +-- +enum name=MIN_PROGRAM_TEXEL_OFFSET value=0x8904 size name=Get mode=get/ /enum -enum name=MAX_PROGRAM_TEXEL_OFFSET_EXT value=0x8905 +enum name=MAX_PROGRAM_TEXEL_OFFSET value=0x8905 size name=Get mode=get/ /enum -- 1.7.6.4 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 3/7] glapi/glx: Don't send GL API files to the xserver
From: Ian Romanick ian.d.roman...@intel.com The versions in the xserver and in libGL have diverged enough that the xserver doesn't want these. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mapi/glapi/gen/Makefile |7 --- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/src/mapi/glapi/gen/Makefile b/src/mapi/glapi/gen/Makefile index 4110cda..13bd383 100644 --- a/src/mapi/glapi/gen/Makefile +++ b/src/mapi/glapi/gen/Makefile @@ -41,12 +41,6 @@ MESA_OUTPUTS = \ XORG_GLX_DIR = $(XORG_BASE)/glx XORG_GLAPI_DIR = $(XORG_BASE)/glx -XORG_GLAPI_FILES = \ - $(XORG_GLAPI_DIR)/glapi_getproc.c \ - $(XORG_GLAPI_DIR)/glapi_nop.c \ - $(XORG_GLAPI_DIR)/glthread.c \ - $(XORG_GLAPI_DIR)/glthread.h - XORG_GLAPI_OUTPUTS = \ $(XORG_GLAPI_DIR)/glprocs.h \ $(XORG_GLAPI_DIR)/glapioffsets.h \ @@ -55,7 +49,6 @@ XORG_GLAPI_OUTPUTS = \ $(XORG_GLAPI_DIR)/glapi_gentable.c XORG_OUTPUTS = \ - $(XORG_GLAPI_FILES) \ $(XORG_GLAPI_OUTPUTS) \ $(XORG_GLX_DIR)/indirect_dispatch.c \ $(XORG_GLX_DIR)/indirect_dispatch_swap.c \ -- 1.7.6.4 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 4/7] glapi/glx: Xserver wants dispatch.h, not glapidispatch.h
From: Ian Romanick ian.d.roman...@intel.com Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mapi/glapi/gen/Makefile |6 -- src/mapi/glapi/gen/glX_proto_recv.py |2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mapi/glapi/gen/Makefile b/src/mapi/glapi/gen/Makefile index 13bd383..c409285 100644 --- a/src/mapi/glapi/gen/Makefile +++ b/src/mapi/glapi/gen/Makefile @@ -43,9 +43,8 @@ XORG_GLAPI_DIR = $(XORG_BASE)/glx XORG_GLAPI_OUTPUTS = \ $(XORG_GLAPI_DIR)/glprocs.h \ - $(XORG_GLAPI_DIR)/glapioffsets.h \ $(XORG_GLAPI_DIR)/glapitable.h \ - $(XORG_GLAPI_DIR)/glapidispatch.h \ + $(XORG_GLAPI_DIR)/dispatch.h \ $(XORG_GLAPI_DIR)/glapi_gentable.c XORG_OUTPUTS = \ @@ -141,6 +140,9 @@ clean: $(XORG_GLAPI_DIR)/%.c: $(MESA_GLAPI_DIR)/%.c cp $ $@ +$(XORG_GLAPI_DIR)/dispatch.h: $(MESA_DIR)/main/dispatch.h + cp $ $@ + $(XORG_GLAPI_DIR)/%.h: $(MESA_GLAPI_DIR)/%.h cp $ $@ diff --git a/src/mapi/glapi/gen/glX_proto_recv.py b/src/mapi/glapi/gen/glX_proto_recv.py index 31745fc..f423c6d 100644 --- a/src/mapi/glapi/gen/glX_proto_recv.py +++ b/src/mapi/glapi/gen/glX_proto_recv.py @@ -92,7 +92,7 @@ class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto): print '#include glapi.h' print '#include glapitable.h' print '#include glthread.h' - print '#include glapidispatch.h' + print '#include dispatch.h' print '' print '#define __GLX_PAD(x) (((x) + 3) ~3)' print '' -- 1.7.6.4 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 5/7] glapi/glx: Generate dispatch.h so that the xserver can use it
From: Ian Romanick ian.d.roman...@intel.com Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mapi/glapi/gen/gl_table.py |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/mapi/glapi/gen/gl_table.py b/src/mapi/glapi/gen/gl_table.py index f6182b6..7f3b915 100644 --- a/src/mapi/glapi/gen/gl_table.py +++ b/src/mapi/glapi/gen/gl_table.py @@ -92,7 +92,11 @@ class PrintRemapTable(gl_XML.gl_print_base): * named function in the specified dispatch table. */ +/* GLXEXT is defined when building the GLX extension in the xserver. + */ +#if !defined(GLXEXT) #include main/mfeatures.h +#endif return -- 1.7.6.4 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 6/7] glapi/glx: Generate glapi_gentable.c so that the xserver can use it
From: Ian Romanick ian.d.roman...@intel.com Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mapi/glapi/gen/gl_gentable.py | 38 1 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/mapi/glapi/gen/gl_gentable.py b/src/mapi/glapi/gen/gl_gentable.py index 814238a..5657e32 100644 --- a/src/mapi/glapi/gen/gl_gentable.py +++ b/src/mapi/glapi/gen/gl_gentable.py @@ -33,8 +33,20 @@ import license import gl_XML, glX_XML import sys, getopt -header = -#if defined(DEBUG) !defined(_WIN32_WCE) +header = /* GLXEXT is the define used in the xserver when the GLX extension is being + * built. Hijack this to determine whether this file is being built for the + * server or the client. + */ +#ifdef HAVE_DIX_CONFIG_H +#include dix-config.h +#endif + +#if (defined(GLXEXT) defined(HAVE_BACKTRACE)) \\ + || (!defined(GLXEXT) defined(DEBUG) !defined(_WIN32_WCE)) +#define USE_BACKTRACE +#endif + +#ifdef USE_BACKTRACE #include execinfo.h #endif @@ -47,11 +59,22 @@ header = #include glapi.h #include glapitable.h +#ifdef GLXEXT +#include os.h +#endif + static void __glapi_gentable_NoOp(void) { -#if defined(DEBUG) !defined(_WIN32_WCE) -if (getenv(MESA_DEBUG) || getenv(LIBGL_DEBUG)) { -const char *fstr = Unknown; +const char *fstr = Unknown; + +/* Silence potential GCC warning for some #ifdef paths. + */ +(void) fstr; +#if defined(USE_BACKTRACE) +#if !defined(GLXEXT) +if (getenv(MESA_DEBUG) || getenv(LIBGL_DEBUG)) +#endif +{ void *frames[2]; if(backtrace(frames, 2) == 2) { @@ -61,9 +84,14 @@ __glapi_gentable_NoOp(void) { fstr = info.dli_sname; } +#if !defined(GLXEXT) fprintf(stderr, Call to unimplemented API: %s\\n, fstr); +#endif } #endif +#if defined(GLXEXT) +LogMessage(X_ERROR, GLX: Call to unimplemented API: %s\\n, fstr); +#endif } static void -- 1.7.6.4 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 7/7] glapi/glx: For GLX code, use the existing _X_HIDDEN and _X_INTERNAL defines
From: Ian Romanick ian.d.roman...@intel.com Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mapi/glapi/gen/glX_proto_recv.py | 15 --- src/mapi/glapi/gen/glX_proto_send.py | 16 src/mapi/glapi/gen/glX_proto_size.py | 19 +-- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/mapi/glapi/gen/glX_proto_recv.py b/src/mapi/glapi/gen/glX_proto_recv.py index f423c6d..b577bb6 100644 --- a/src/mapi/glapi/gen/glX_proto_recv.py +++ b/src/mapi/glapi/gen/glX_proto_recv.py @@ -41,7 +41,8 @@ class PrintGlxDispatch_h(gl_XML.gl_print_base): def printRealHeader(self): - self.printVisibility( HIDDEN, hidden ) + print '# include X11/Xfuncproto.h' + print '' print 'struct __GLXclientStateRec;' print '' return @@ -51,16 +52,16 @@ class PrintGlxDispatch_h(gl_XML.gl_print_base): for func in api.functionIterateAll(): if not func.ignore and not func.vectorequiv: if func.glx_rop: - print 'extern HIDDEN void __glXDisp_%s(GLbyte * pc);' % (func.name) - print 'extern HIDDEN void __glXDispSwap_%s(GLbyte * pc);' % (func.name) + print 'extern _X_HIDDEN void __glXDisp_%s(GLbyte * pc);' % (func.name) + print 'extern _X_HIDDEN void __glXDispSwap_%s(GLbyte * pc);' % (func.name) elif func.glx_sop or func.glx_vendorpriv: - print 'extern HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name) - print 'extern HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name) + print 'extern _X_HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name) + print 'extern _X_HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name) if func.glx_sop and func.glx_vendorpriv: n = func.glx_vendorpriv_names[0] - print 'extern HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (n) - print 'extern HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (n) + print 'extern _X_HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (n) + print 'extern _X_HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (n) return diff --git a/src/mapi/glapi/gen/glX_proto_send.py b/src/mapi/glapi/gen/glX_proto_send.py index 6330d91..bec0222 100644 --- a/src/mapi/glapi/gen/glX_proto_send.py +++ b/src/mapi/glapi/gen/glX_proto_send.py @@ -1008,25 +1008,25 @@ class PrintGlxProtoInit_h(gl_XML.gl_print_base): * \\author Ian Romanick i...@us.ibm.com */ - self.printVisibility( HIDDEN, hidden ) self.printFastcall() self.printNoinline() print +#include X11/Xfuncproto.h #include glxclient.h -extern HIDDEN NOINLINE CARD32 __glXReadReply( Display *dpy, size_t size, +extern _X_HIDDEN NOINLINE CARD32 __glXReadReply( Display *dpy, size_t size, void * dest, GLboolean reply_is_always_array ); -extern HIDDEN NOINLINE void __glXReadPixelReply( Display *dpy, +extern _X_HIDDEN NOINLINE void __glXReadPixelReply( Display *dpy, struct glx_context * gc, unsigned max_dim, GLint width, GLint height, GLint depth, GLenum format, GLenum type, void * dest, GLboolean dimensions_in_reply ); -extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupSingleRequest( +extern _X_HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupSingleRequest( struct glx_context * gc, GLint sop, GLint cmdlen ); -extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest( +extern _X_HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest( struct glx_context * gc, GLint code, GLint vop, GLint cmdlen ); @@ -1035,13 +1035,13 @@ extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest( for func in api.functionIterateGlx(): params = func.get_parameter_string() - print 'extern HIDDEN %s __indirect_gl%s(%s);' % (func.return_type, func.name, params) + print 'extern _X_HIDDEN %s __indirect_gl%s(%s);' % (func.return_type, func.name, params) for n in func.entry_points: if func.has_different_protocol(n):
Re: [Mesa-dev] [PATCH 0/7] Fix GLX files generated by Mesa for the server
On 12/08/2011 01:47 PM, Ian Romanick wrote: There has been quite a bit of skew between what's in Mesa and what's needed in the xserver. This patch series cleans that up. Most of the changes are quite mundane and just make the code compile inside the xserver. However, the changes in patch 6/7 modify the way the availability and use of backtrace is handled. Once this series is reviewed and accepeted in Mesa, a short series that makes the newly generated code usable in the xserver will be posted to xorg-devel. The two sequences together are prerequesites to a Mesa series and an xserver series that will implement GLX_ARB_create_context and GLX_ARB_create_context_profile. Trees with these patches and the generated files can be found at: git://anongit.freedesktop.org/~idr/mesa glx-fixes git://anongit.freedesktop.org/~idr/xserver glx-fixes With these two branches, I observer no piglit regressions on Intel Ironlake hardware. I have not tested other hardware, but I would expect any regressions to be hardware independent. I did a quick read-through and this looks OK to me. Reviewed-by: Brian Paul bri...@vmware.com -Brian ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver] dmx: fix distcheck failure, missing compsize.h in Makefile.am
On Wed, Dec 07, 2011 at 08:17:29PM -0500, Gaetan Nadon wrote: which was added in commit: dmx: Build fix for -Werror=implicit-function-declaration Signed-off-by: Gaetan Nadon mems...@videotron.ca --- hw/dmx/glxProxy/Makefile.am |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/dmx/glxProxy/Makefile.am b/hw/dmx/glxProxy/Makefile.am index 8516048..1d9177a 100644 --- a/hw/dmx/glxProxy/Makefile.am +++ b/hw/dmx/glxProxy/Makefile.am @@ -1,10 +1,12 @@ noinst_LIBRARIES = libglxproxy.a libglxproxy_a_SOURCES = compsize.c \ + compsize.h \ g_disptab.c \ g_disptab.h \ global.c \ glxcmds.c \ + glxcmds.h \ glxcmdsswap.c \ glxcontext.h \ glxdrawable.h \ -- 1.7.4.1 please fix the whitespace, but otherwise Reviewed-by: Peter Hutterer peter.hutte...@who-t.net Cheers, Peter ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver] Replace deprecated CWARNFLAGS with BASE_CFLAGS and NO_STRICT_ALIASING_CFLAG
On Wed, Dec 07, 2011 at 08:17:28PM -0500, Gaetan Nadon wrote: This patch makes use of the new functions in util-macros 1.16. CWARNGLAGS is left as is for backward compatibility but will no longer be maintained. Modules should migrate to the new BASE_CFLAGS variable and establish if they really do need the no strict aliasing or if it was there because they were no aware of it. series: Reviewed-by: Peter Hutterer peter.hutte...@who-t.net XORG_CWARNFLAGS --- Minimum version: 1.2.0 Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead) Defines CWARNFLAGS to enable C compiler warnings. This function is deprecated because it defines -fno-strict-aliasing which alters the code generated by the compiler. If -fno-strict-aliasing is needed, then it should be added explicitly in the module when it is updated to use BASE_CFLAGS. This patch requires util-macros version1.16.0 which provides the following: Alan Coopersmith (4): Add an optional argument to XORG_LD_WRAP Define __wrap_exit in test program source for XORG_LD_WRAP Add XORG_MEMORY_CHECK_FLAGS and require it in XORG_ENABLE_UNIT_TESTS XORG_TESTSET_CFLAG: Try to both compile link with the flags Jeremy Huddleston (7): Fix the test for -Werror=attributes Add XORG_TESTSET_CFLAG which can be used to test what flags the compiler supports Use XORG_TESTSET_CFLAG in XORG_STRICT_OPTION Add XORG_COMPILER_FLAGS to replace XORG_CWARNFLAGS Update XORG_CWARNFLAGS to use XORG_COMPILER_FLAGS Add additional flags to XORG_COMPILER_FLAGS XORG_TESTSET_CFLAG: Add support fot -Werror=unused-command-line-argument Signed-off-by: Gaetan Nadon mems...@videotron.ca --- configure.ac | 18 +++--- 1 files changed, 7 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 27bf7db..6bc1e5e 100644 --- a/configure.ac +++ b/configure.ac @@ -32,10 +32,10 @@ AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE -# Require xorg-macros minimum of 1.14 for XORG_COMPILER_BRAND in XORG_DEFAULT_OPTIONS +# Require xorg-macros minimum of 1.16 for XORG_COMPILER_FLAGS in XORG_DEFAULT_OPTIONS m4_ifndef([XORG_MACROS_VERSION], - [m4_fatal([must install xorg-macros 1.14 or later before running autoconf/autogen])]) -XORG_MACROS_VERSION(1.14) + [m4_fatal([must install xorg-macros 1.16 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.16) XORG_DEFAULT_OPTIONS XORG_WITH_DOXYGEN(1.6.1) XORG_CHECK_SGML_DOCTOOLS(1.8) @@ -82,15 +82,11 @@ AC_PROG_YACC AC_SYS_LARGEFILE XORG_PROG_RAWCPP -# Quoted so that make will expand $(CWARNFLAGS) in makefiles to allow +# Quoted so that make will expand $(BASE_CFLAGS) in makefiles to allow # easier overrides at build time. -XSERVER_CFLAGS='$(CWARNFLAGS)' - -dnl Explicitly add -fno-strict-aliasing since this option should disappear -dnl from util-macros CWARNFLAGS -if test x$GCC = xyes ; then -XSERVER_CFLAGS=$XSERVER_CFLAGS -fno-strict-aliasing -fi +XORG_TESTSET_CFLAG([NO_STRICT_ALIASING_CFLAG], [-fno-strict-aliasing]) +XSERVER_CFLAGS='$(BASE_CFLAGS) $(NO_STRICT_ALIASING_CFLAG)' +AC_SUBST([NO_STRICT_ALIASING_CFLAG]) dnl Check for dtrace program (needed to build Xserver dtrace probes) dnl Also checks for sys/sdt.h, since some Linux distros have an -- 1.7.4.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] xfree86: include xorg-config.h from xaalocal.h
On Tue, Dec 6, 2011 at 12:13 AM, Peter Hutterer peter.hutte...@who-t.netwrote: Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- hw/xfree86/xaa/xaalocal.h |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/hw/xfree86/xaa/xaalocal.h b/hw/xfree86/xaa/xaalocal.h index a9a70da..0780fb1 100644 --- a/hw/xfree86/xaa/xaalocal.h +++ b/hw/xfree86/xaa/xaalocal.h @@ -2,6 +2,10 @@ #ifndef _XAALOCAL_H #define _XAALOCAL_H +#ifdef HAVE_XORG_CONFIG_H +#include xorg-config.h +#endif + /* This file is very unorganized ! */ Reviewed-by: Alan Coopersmith alan.coopersm...@oracle.com -- -Alan Coopersmith-alan.coopersm...@oracle.com Oracle Solaris Platform Engineering: X Window System ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PULL] Input changes in preparation for multitouch
A whole bunch of basic changes required for the multitouch support. Does not include any actual MT stuff yet though. Commit cba34d2a7e72ea0c7e5a2d8482607157ceccf8db The following changes since commit fb22a408c69a84f81905147de9e82cf66ffb6eb2: Save major/minor opcodes in ClientRec for RecordAReply (2011-12-01 15:11:20 +) are available in the git repository at: git://people.freedesktop.org/~whot/xserver for-keith Peter Hutterer (22): include: add list_append() include: add list_last_entry to get the tail of a list include: point to the tests in list.c as examples include: a new list element does not need initialization, state so include: update struct list documentation to use one set of structs only include: rename foos to list_of_foos in the struct list documentation dix: switch the syncEvent queue to a struct list dix: add AllocGrab helper function dix: add CopyGrab() function dix: allocate temporary grabs on the heap dix: switch the dev-deviceGrab.activeGrab from GrabRec to GrabPtr Add a new XI2Mask struct and a few helper functions. input: swap the server over to use the XI2mask struct xfree86: bump the input ABI dix: use BUG_WARN for input mask size issues Xi: when removing a device, reset ClientPointers where needed xfixes: don't dereference a NULL cursor Xi: skip superfluous cast Xi: check button mapping value _before_ assigning it Xi: rename state to corestate in ProcessDeviceEvents xfree86: include xorg-config.h from xaalocal.h include: add BUG_WARN_MSG for custom error message on bug condition Xi/exevents.c | 88 +++-- Xi/ungrdevb.c | 32 +++-- Xi/ungrdevk.c | 31 +++-- Xi/xichangehierarchy.c | 15 ++ Xi/xigrabdev.c | 15 ++- Xi/xipassivegrab.c | 50 +--- Xi/xiselectev.c|5 +- dix/devices.c |3 + dix/events.c | 288 dix/grabs.c| 84 +++- dix/inpututils.c | 181 + hw/xfree86/common/xf86Module.h |2 +- hw/xfree86/xaa/xaalocal.h |4 + include/dix.h |1 + include/dixgrabs.h |4 + include/input.h|1 + include/inputstr.h | 22 ++- include/inpututils.h | 12 ++ include/list.h | 81 include/misc.h |9 +- test/input.c | 65 + test/list.c| 37 + test/xi2/Makefile.am |5 +- test/xi2/xi2.c | 129 ++ xfixes/cursor.c|4 +- 25 files changed, 892 insertions(+), 276 deletions(-) create mode 100644 test/xi2/xi2.c pgpJORcnDqmCe.pgp Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
xserver 1.12 schedule? (was: [ANNOUNCE] xorg-server 1.11.99.1)
On 11/27/11 17:39, Peter Hutterer wrote: On Sun, Nov 20, 2011 at 03:20:11PM -0800, Keith Packard wrote: We discussed doing regular releases from master, and Jeremy suggested (sensibly) that we just do them whenever there's a stable release. I completely spaced that plan, nor was I looking at the Google X.org calendar. In any case, here's the current state of master. It's missing a pull request from alanc -- there were a couple of build failures in that which I've replied back about and I expect that'll be fixed shortly. For those interested in helping out, here's the 1.12 release tracker. https://bugs.freedesktop.org/show_bug.cgi?id=40982 Anyone interested in helping clean up the release is encouraged to take a look at the outstanding bugs there. There's a slight snag about the 1.12 release schedule. I'm going biking in New Zealand next February, leaving on the 9th and not getting back until March 1st. So, we can either have the release done before I leave, or wait until I get back. It seems like the former might work a bit better, but it would mean pulling the release in to Feb 8th or so. Anyone have an opinion on the matter? We probably won't get X Input 2.2 done if the release is moved forward to Feb 8th. What's the date for the merge window end? Did we ever come to a conclusion here? Since no one else has stepped up to plan the katamari release, I'm thinking of having X11R7.7 rolled up around the server 1.12 release schedule, and would like to give people a heads up to get their doc, lib, apps, etc. changes rolled in. -- -Alan Coopersmith-alan.coopersm...@oracle.com Oracle Solaris Platform Engineering: X Window System ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: xserver 1.12 schedule? (was: [ANNOUNCE] xorg-server 1.11.99.1)
On Thu, 08 Dec 2011 16:54:15 -0800, Alan Coopersmith alan.coopersm...@oracle.com wrote: Did we ever come to a conclusion here? Since no one else has stepped up to plan the katamari release, I'm thinking of having X11R7.7 rolled up around the server 1.12 release schedule, and would like to give people a heads up to get their doc, lib, apps, etc. changes rolled in. Peter promised to finish up Xi by Christmas, which makes the schedule look like: Merge window closes:2011-12-25 Non-critical bugs: 2012-2-4 1.12 release: 2012-3-4 I should be able to manage the critical bug merging while I'm on holiday in New Zealand -- there's not usually much to do during that part of the release cycle; I'll let you know if I will be off-line for more than a day or so during that time. -- keith.pack...@intel.com pgp5bgiLqRdZC.pgp Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PULL] Input changes in preparation for multitouch
On Fri, 9 Dec 2011 10:50:33 +1000, Peter Hutterer peter.hutte...@who-t.net wrote: dix: switch the syncEvent queue to a struct list This exposes PlayReleasedEvents as a global function (for testing), which seems odd, but I guess it's mostly harmless? dix: add CopyGrab() function This one says that it introduces a memory leak that will be fixed when callers are switched to use FreeGrab, but I don't see any patch that fixes the leak. That doesn't seem like a good plan to me... -- keith.pack...@intel.com pgpI5HxObVqTA.pgp Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PULL] Input changes in preparation for multitouch
On Thu, Dec 08, 2011 at 07:04:05PM -0800, Keith Packard wrote: On Fri, 9 Dec 2011 10:50:33 +1000, Peter Hutterer peter.hutte...@who-t.net wrote: dix: switch the syncEvent queue to a struct list This exposes PlayReleasedEvents as a global function (for testing), which seems odd, but I guess it's mostly harmless? Yeah, no-one else but the tests need this. I doubt anyone will call this from a module and IIRC if it's not marked _X_EXPORT it won't be usable from modules anyway. If you have a good idea on how to mark functions as static if it wasn't for a test, that'd be great. dix: add CopyGrab() function This one says that it introduces a memory leak that will be fixed when callers are switched to use FreeGrab, but I don't see any patch that fixes the leak. That doesn't seem like a good plan to me... dix: allocate temporary grabs on the heap does that. I ran this through valgrind and it didn't complain, iirc. Cheers, Peter ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 01/21] include: add GetXI2MaskByte and GetXI2EventFilterMask to headers
This is needed for touch event processing. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- dix/events.c|4 ++-- include/input.h |3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dix/events.c b/dix/events.c index 59caa91..5dfcbf3 100644 --- a/dix/events.c +++ b/dix/events.c @@ -414,7 +414,7 @@ GetEventFilterMask(DeviceIntPtr dev, int evtype) return filters[dev ? dev-id : 0][evtype]; } -static inline Mask +inline Mask GetXI2EventFilterMask(int evtype) { return (1 (evtype % 8)); @@ -452,7 +452,7 @@ GetEventFilter(DeviceIntPtr dev, xEvent *event) * Return the single byte of the device's XI2 mask that contains the mask * for the event_type. */ -static int +int GetXI2MaskByte(XI2Mask *mask, DeviceIntPtr dev, int event_type) { /* we just return the matching filter because that's the only use diff --git a/include/input.h b/include/input.h index 8b0c18e..917e92f 100644 --- a/include/input.h +++ b/include/input.h @@ -57,6 +57,7 @@ SOFTWARE. #include xkbrules.h #include events.h #include list.h +#include X11/extensions/XI2.h #define DEVICE_INIT0 #define DEVICE_ON 1 @@ -537,6 +538,8 @@ extern _X_EXPORT void FreeInputAttributes(InputAttributes *attrs); extern Mask GetEventMask(DeviceIntPtr dev, xEvent* ev, InputClientsPtr clients); extern Mask GetEventFilter(DeviceIntPtr dev, xEvent *event); extern Bool WindowXI2MaskIsset(DeviceIntPtr dev, WindowPtr win, xEvent* ev); +extern Mask GetXI2EventFilterMask(int evtype); +extern int GetXI2MaskByte(XI2Mask *mask, DeviceIntPtr dev, int event_type); void FixUpEventFromWindow(SpritePtr pSprite, xEvent *xE, WindowPtr pWin, -- 1.7.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 02/21] Change GetXI2/XI/CoreType to just take a type argument
Avoids the dummy-event dance if we have an event type and need to get the matching XI2 type. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- dix/eventconvert.c | 16 dix/events.c | 14 +++--- hw/xfree86/common/xf86DGA.c |4 ++-- include/eventconvert.h |7 --- test/xi2/protocol-eventconvert.c |6 +++--- 5 files changed, 24 insertions(+), 23 deletions(-) diff --git a/dix/eventconvert.c b/dix/eventconvert.c index c9da396..67b420a 100644 --- a/dix/eventconvert.c +++ b/dix/eventconvert.c @@ -647,7 +647,7 @@ eventToDeviceEvent(DeviceEvent *ev, xEvent **xi) xde = (xXIDeviceEvent*)*xi; xde-type = GenericEvent; xde-extension = IReqCode; -xde-evtype = GetXI2Type((InternalEvent*)ev); +xde-evtype = GetXI2Type(ev-type); xde-time = ev-time; xde-length = bytes_to_int32(len - sizeof(xEvent)); xde-detail = ev-detail.button; @@ -714,7 +714,7 @@ eventToRawEvent(RawDeviceEvent *ev, xEvent **xi) raw = (xXIRawEvent*)*xi; raw-type = GenericEvent; raw-extension = IReqCode; -raw-evtype = GetXI2Type((InternalEvent*)ev); +raw-evtype = GetXI2Type(ev-type); raw-time = ev-time; raw-length = bytes_to_int32(len - sizeof(xEvent)); raw-detail = ev-detail.button; @@ -746,10 +746,10 @@ eventToRawEvent(RawDeviceEvent *ev, xEvent **xi) * equivalent exists. */ int -GetCoreType(InternalEvent *event) +GetCoreType(enum EventType type) { int coretype = 0; -switch(event-any.type) +switch(type) { case ET_Motion: coretype = MotionNotify; break; case ET_ButtonPress:coretype = ButtonPress; break; @@ -767,10 +767,10 @@ GetCoreType(InternalEvent *event) * equivalent exists. */ int -GetXIType(InternalEvent *event) +GetXIType(enum EventType type) { int xitype = 0; -switch(event-any.type) +switch(type) { case ET_Motion: xitype = DeviceMotionNotify; break; case ET_ButtonPress:xitype = DeviceButtonPress; break; @@ -790,11 +790,11 @@ GetXIType(InternalEvent *event) * equivalent exists. */ int -GetXI2Type(InternalEvent *event) +GetXI2Type(enum EventType type) { int xi2type = 0; -switch(event-any.type) +switch(type) { case ET_Motion: xi2type = XI_Motion; break; case ET_ButtonPress:xi2type = XI_ButtonPress; break; diff --git a/dix/events.c b/dix/events.c index 5dfcbf3..49f70c3 100644 --- a/dix/events.c +++ b/dix/events.c @@ -2553,13 +2553,13 @@ EventIsDeliverable(DeviceIntPtr dev, InternalEvent* event, WindowPtr win) int type; OtherInputMasks *inputMasks = wOtherInputMasks(win); -if ((type = GetXI2Type(event)) != 0) +if ((type = GetXI2Type(event-any.type)) != 0) { if (inputMasks xi2mask_isset(inputMasks-xi2mask, dev, type)) rc |= EVENT_XI2_MASK; } -if ((type = GetXIType(event)) != 0) +if ((type = GetXIType(event-any.type)) != 0) { filter = GetEventFilterMask(dev, type); @@ -2575,7 +2575,7 @@ EventIsDeliverable(DeviceIntPtr dev, InternalEvent* event, WindowPtr win) } -if ((type = GetCoreType(event)) != 0) +if ((type = GetCoreType(event-any.type)) != 0) { filter = GetEventFilterMask(dev, type); @@ -3712,7 +3712,7 @@ CheckPassiveGrabsOnWindow( tempGrab-modifiersDetail.exact = xkbi ? xkbi-state.grab_mods : 0; /* Check for XI2 and XI grabs first */ -tempGrab-type = GetXI2Type(event); +tempGrab-type = GetXI2Type(event-any.type); tempGrab-grabtype = GRABTYPE_XI2; if (GrabMatchesSecond(tempGrab, grab, FALSE)) match = XI2_MATCH; @@ -3720,7 +3720,7 @@ CheckPassiveGrabsOnWindow( if (!match) { tempGrab-grabtype = GRABTYPE_XI; -if ((tempGrab-type = GetXIType(event)) +if ((tempGrab-type = GetXIType(event-any.type)) (GrabMatchesSecond(tempGrab, grab, FALSE))) match = XI_MATCH; } @@ -3729,7 +3729,7 @@ CheckPassiveGrabsOnWindow( if (!match checkCore) { tempGrab-grabtype = GRABTYPE_CORE; -if ((tempGrab-type = GetCoreType(event)) +if ((tempGrab-type = GetCoreType(event-any.type)) (GrabMatchesSecond(tempGrab, grab, TRUE))) match = CORE_MATCH; } @@ -3784,7 +3784,7 @@ CheckPassiveGrabsOnWindow( if (!activate) break; -else if (!GetXIType(event) !GetCoreType(event)) +else if (!GetXIType(event-any.type) !GetCoreType(event-any.type)) { ErrorF(Event type %d in CheckPassiveGrabsOnWindow is neither XI 1.x nor core\n, event-any.type); diff --git
[PATCH 04/21] dix: deduplicate event delivery code
Move all the event delivery code into DeliverOneEvent, based on the InputLevel we're sending to. Functional change: we now check XI2 events with XACE too. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- dix/events.c | 111 - 1 files changed, 62 insertions(+), 49 deletions(-) diff --git a/dix/events.c b/dix/events.c index 49f70c3..ced29f7 100644 --- a/dix/events.c +++ b/dix/events.c @@ -2592,6 +2592,57 @@ EventIsDeliverable(DeviceIntPtr dev, InternalEvent* event, WindowPtr win) return rc; } +static int +DeliverEvent(DeviceIntPtr dev, xEvent *xE, int count, + WindowPtr win, Window child, GrabPtr grab) +{ +SpritePtr pSprite = dev-spriteInfo-sprite; +Mask filter; +int deliveries = 0; + +if (XaceHook(XACE_SEND_ACCESS, NULL, dev, win, xE, count) == Success) { +filter = GetEventFilter(dev, xE); +FixUpEventFromWindow(pSprite, xE, win, child, FALSE); +deliveries = DeliverEventsToWindow(dev, win, xE, count, +filter, grab); +} + +return deliveries; +} + +static int +DeliverOneEvent(InternalEvent *event, DeviceIntPtr dev, enum InputLevel level, +WindowPtr win, Window child, GrabPtr grab) +{ +xEvent *xE = NULL; +int count = 0; +int deliveries = 0; +int rc; + +switch(level) +{ +case XI2: +rc = EventToXI2(event, xE); +count = 1; +break; +case XI: +rc = EventToXI(event, xE, count); +break; +case CORE: +rc = EventToCore(event, xE, count); +break; +} + +if (rc == Success) +{ +deliveries = DeliverEvent(dev, xE, count, win, child, grab); +free(xE); +} else +BUG_WARN_MSG(rc != BadMatch, %s: conversion to level %d failed with rc %d\n, + dev-name, level, rc); +return deliveries; +} + /** * Deliver events caused by input devices. * @@ -2615,12 +2666,9 @@ int DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab, WindowPtr stopAt, DeviceIntPtr dev) { -SpritePtr pSprite = dev-spriteInfo-sprite; Window child = None; -Mask filter; int deliveries = 0; -xEvent *xE = NULL, *core = NULL; -int rc, mask, count = 0; +int mask; verify_internal_event(event); @@ -2631,64 +2679,32 @@ DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab, /* XI2 events first */ if (mask EVENT_XI2_MASK) { -xEvent *xi2 = NULL; -rc = EventToXI2(event, xi2); -if (rc == Success) -{ -/* XXX: XACE */ -filter = GetEventFilter(dev, xi2); -FixUpEventFromWindow(pSprite, xi2, pWin, child, FALSE); -deliveries = DeliverEventsToWindow(dev, pWin, xi2, 1, - filter, grab); -free(xi2); -if (deliveries 0) -goto unwind; -} else if (rc != BadMatch) -ErrorF([dix] %s: XI2 conversion failed in DDE (%d).\n, -dev-name, rc); +deliveries = DeliverOneEvent(event, dev, XI2, pWin, child, grab); +if (deliveries 0) +break; } /* XI events */ if (mask EVENT_XI1_MASK) { -rc = EventToXI(event, xE, count); -if (rc == Success) { -if (XaceHook(XACE_SEND_ACCESS, NULL, dev, pWin, xE, count) == Success) { -filter = GetEventFilter(dev, xE); -FixUpEventFromWindow(pSprite, xE, pWin, child, FALSE); -deliveries = DeliverEventsToWindow(dev, pWin, xE, count, - filter, grab); -if (deliveries 0) -goto unwind; -} -} else if (rc != BadMatch) -ErrorF([dix] %s: XI conversion failed in DDE (%d, %d). Skipping delivery.\n, -dev-name, event-any.type, rc); +deliveries = DeliverOneEvent(event, dev, XI, pWin, child, grab); +if (deliveries 0) +break; } /* Core event */ if ((mask EVENT_CORE_MASK) IsMaster(dev) dev-coreEvents) { -rc = EventToCore(event, core, count); -if (rc == Success) { -if (XaceHook(XACE_SEND_ACCESS, NULL, dev, pWin, core, count) == Success) { -filter = GetEventFilter(dev, core); -FixUpEventFromWindow(pSprite, core, pWin, child, FALSE); -
[PATCH 03/21] include: Add an InputLevel enum
From: Chase Douglas chase.doug...@canonical.com Currently unused, but will be in the future. Signed-off-by: Chase Douglas chase.doug...@canonical.com Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- include/eventconvert.h |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/include/eventconvert.h b/include/eventconvert.h index 571a511..bb45eef 100644 --- a/include/eventconvert.h +++ b/include/eventconvert.h @@ -31,6 +31,12 @@ #define FP1616(integral, frac) ((integral) * (1 16) + (frac) * (1 16)) +enum InputLevel { +CORE, +XI, +XI2, +}; + _X_EXPORT int EventToCore(InternalEvent *event, xEvent **core, int *count); _X_EXPORT int EventToXI(InternalEvent *ev, xEvent **xi, int *count); _X_EXPORT int EventToXI2(InternalEvent *ev, xEvent **xi); -- 1.7.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 05/21] dix: replace conversion errors with BUG_WARN_MSG
Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- dix/events.c | 17 + 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dix/events.c b/dix/events.c index ced29f7..705b079 100644 --- a/dix/events.c +++ b/dix/events.c @@ -4149,8 +4149,9 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev, GetEventFilter(thisDev, core), grab); } -} else if (rc != BadMatch) -ErrorF([dix] DeliverGrabbedEvent. Core conversion failed.\n); +} else +BUG_WARN_MSG(rc != BadMatch, %s: Core conversion failed on %d with %d\n, + thisDev-name, event-any.type, rc); } if (!deliveries) @@ -4164,9 +4165,9 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev, FixUpEventFromWindow(pSprite, xi2, grab-window, None, TRUE); /* XXX: XACE */ deliveries = TryClientEvents(rClient(grab), thisDev, xi2, 1, mask, 1, grab); -} else if (rc != BadMatch) -ErrorF([dix] %s: XI2 conversion failed in DGE (%d, %d). Skipping delivery.\n, -thisDev-name, event-any.type, rc); +} else +BUG_WARN_MSG(rc != BadMatch, %s: XI2 conversion failed on %d with %d\n, + thisDev-name, event-any.type, rc); } if (!deliveries) @@ -4197,9 +4198,9 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev, GetEventFilter(thisDev, xi), grab); } -} else if (rc != BadMatch) -ErrorF([dix] %s: XI conversion failed in DGE (%d, %d). Skipping delivery.\n, -thisDev-name, event-any.type, rc); +} else +BUG_WARN_MSG(rc != BadMatch, %s: XI conversion failed on %d with %d\n, + thisDev-name, event-any.type, rc); } if (deliveries (event-any.type == ET_Motion)) -- 1.7.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 06/21] dix: split grab event conversion and conversion into a helper function
Effective functional change: XI2 events are checked with XACE now. DeliverOneGrabbedEvent is exported for future use by touch events. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- dix/events.c | 144 include/dix.h |5 ++ 2 files changed, 77 insertions(+), 72 deletions(-) diff --git a/dix/events.c b/dix/events.c index 705b079..37039c6 100644 --- a/dix/events.c +++ b/dix/events.c @@ -4061,6 +4061,75 @@ unwind: return; } + +int +DeliverOneGrabbedEvent(InternalEvent *event, DeviceIntPtr dev, enum InputLevel level) +{ +SpritePtr pSprite = dev-spriteInfo-sprite; +int rc; +xEvent *xE = NULL; +int count = 0; +int deliveries = 0; +Mask mask; +GrabInfoPtr grabinfo = dev-deviceGrab; +GrabPtr grab = grabinfo-grab; +Mask filter; + +switch(level) +{ +case XI2: +rc = EventToXI2(event, xE); +count = 1; +if (rc == Success) +{ +int evtype = xi2_get_type(xE); +mask = xi2mask_isset(grab-xi2mask, dev, evtype); +filter = 1; +} +break; +case XI: +if (grabinfo-fromPassiveGrab grabinfo-implicitGrab) +mask = grab-deviceMask; +else +mask = grab-eventMask; +rc = EventToXI(event, xE, count); +if (rc == Success) +filter = GetEventFilter(dev, xE); +break; +case CORE: +rc = EventToCore(event, xE, count); +mask = grab-eventMask; +if (rc == Success) +filter = GetEventFilter(dev, xE); +break; +default: +BUG_WARN_MSG(1, Invalid input level %d\n, level); +return 0; +} + +if (rc == Success) +{ +FixUpEventFromWindow(pSprite, xE, grab-window, None, TRUE); +if (XaceHook(XACE_SEND_ACCESS, 0, dev, +grab-window, xE, count) || +XaceHook(XACE_RECEIVE_ACCESS, rClient(grab), +grab-window, xE, count)) +deliveries = 1; /* don't send, but pretend we did */ +else if (level != CORE || !IsInterferingGrab(rClient(grab), dev, xE)) +{ +deliveries = TryClientEvents(rClient(grab), dev, +xE, count, mask, filter, +grab); +} +} else +BUG_WARN_MSG(rc != BadMatch, %s: conversion to mode %d failed on %d with %d\n, +dev-name, level, event-any.type, rc); + +free(xE); +return deliveries; +} + + /** * Deliver an event from a device that is currently grabbed. Uses * DeliverDeviceEvents() for further delivery if a ownerEvents is set on the @@ -4080,10 +4149,6 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev, DeviceIntPtr dev; SpritePtr pSprite = thisDev-spriteInfo-sprite; BOOL sendCore = FALSE; -int rc, count = 0; -xEvent *xi = NULL; -xEvent *xi2 = NULL; -xEvent *core = NULL; grabinfo = thisDev-deviceGrab; grab = grabinfo-grab; @@ -4119,88 +4184,27 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev, } if (!deliveries) { -Mask mask; - /* XXX: In theory, we could pass the internal events through to * everything and only convert just before hitting the wire. We can't * do that yet, so DGE is the last stop for internal events. From here * onwards, we deal with core/XI events. */ -mask = grab-eventMask; - sendCore = (IsMaster(thisDev) thisDev-coreEvents); /* try core event */ if (sendCore grab-grabtype == GRABTYPE_CORE) { -rc = EventToCore(event, core, count); -if (rc == Success) -{ -FixUpEventFromWindow(pSprite, core, grab-window, None, TRUE); -if (XaceHook(XACE_SEND_ACCESS, 0, thisDev, -grab-window, core, count) || -XaceHook(XACE_RECEIVE_ACCESS, rClient(grab), -grab-window, core, count)) -deliveries = 1; /* don't send, but pretend we did */ -else if (!IsInterferingGrab(rClient(grab), thisDev, core)) -{ -deliveries = TryClientEvents(rClient(grab), thisDev, -core, count, mask, -GetEventFilter(thisDev, core), -grab); -} -} else -BUG_WARN_MSG(rc != BadMatch, %s: Core conversion failed on %d with %d\n, - thisDev-name, event-any.type, rc); +deliveries = DeliverOneGrabbedEvent(event, thisDev, CORE); } if (!deliveries) { -rc = EventToXI2(event, xi2); -if (rc == Success) -
[PATCH 07/21] dix: deduplicate callers of DeliverDeviceEvents in DeliverGrabbedEvents
No functional change. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- dix/events.c | 18 ++ 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dix/events.c b/dix/events.c index 37039c6..6e015fe 100644 --- a/dix/events.c +++ b/dix/events.c @@ -4156,6 +4156,7 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev, if (grab-ownerEvents) { WindowPtr focus; + WindowPtr win; /* Hack: Some pointer device have a focus class. So we need to check * for the type of event, to see if we really want to deliver it to @@ -4172,15 +4173,16 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev, else focus = PointerRootWin; if (focus == PointerRootWin) - deliveries = DeliverDeviceEvents(pSprite-win, event, grab, - NullWindow, thisDev); - else if (focus (focus == pSprite-win || -IsParent(focus, pSprite-win))) - deliveries = DeliverDeviceEvents(pSprite-win, event, grab, focus, -thisDev); + { + win = pSprite-win; + focus = NullWindow; + } else if (focus (focus == pSprite-win || + IsParent(focus, pSprite-win))) + win = pSprite-win; else if (focus) - deliveries = DeliverDeviceEvents(focus, event, grab, focus, -thisDev); + win = focus; + + deliveries = DeliverDeviceEvents(win, event, grab, focus, thisDev); } if (!deliveries) { -- 1.7.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 08/21] Xi: deduplicate button motion mask setting
No functional changes Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- Xi/exevents.c | 37 + 1 files changed, 25 insertions(+), 12 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index b2e82ec..1140554 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -704,6 +704,29 @@ ChangeMasterDeviceClasses(DeviceIntPtr device, DeviceChangedEvent *dce) } /** + * Add state and motionMask to the filter for this event. The protocol + * supports some extra masks for moton when a button is down: + * ButtonXMotionMask and the DeviceButtonMotionMask to trigger only when at + * least one button (or that specific button is down). These masks need to + * be added to the filters for core/XI motion events. + * + * @param device The device to update the mask for + * @param state The current button state mask + * @param motion_mask The motion mask (DeviceButtonMotionMask or 0) + */ +static void +UpdateDeviceMotionMask(DeviceIntPtr device, unsigned short state, + Mask motion_mask) +{ +Mask mask; + +mask = DevicePointerMotionMask | state | motion_mask; +SetMaskForEvent(device-id, mask, DeviceMotionNotify); +mask = PointerMotionMask | state | motion_mask; +SetMaskForEvent(device-id, mask, MotionNotify); +} + +/** * Update the device state according to the data in the event. * * return values are @@ -801,7 +824,6 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) device-valuator-motionHintWindow = NullWindow; set_key_up(device, key, KEY_PROCESSED); } else if (event-type == ET_ButtonPress) { -Mask mask; if (!b) return DONT_PROCESS; @@ -818,13 +840,8 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) if (b-map[key] = 5) b-state |= (Button1Mask 1) b-map[key]; -/* Add state and motionMask to the filter for this event */ -mask = DevicePointerMotionMask | b-state | b-motionMask; -SetMaskForEvent(device-id, mask, DeviceMotionNotify); -mask = PointerMotionMask | b-state | b-motionMask; -SetMaskForEvent(device-id, mask, MotionNotify); +UpdateDeviceMotionMask(device, b-state, b-motionMask); } else if (event-type == ET_ButtonRelease) { -Mask mask; if (!b) return DONT_PROCESS; @@ -859,11 +876,7 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) if (b-map[key] = 5) b-state = ~((Button1Mask 1) b-map[key]); -/* Add state and motionMask to the filter for this event */ -mask = DevicePointerMotionMask | b-state | b-motionMask; -SetMaskForEvent(device-id, mask, DeviceMotionNotify); -mask = PointerMotionMask | b-state | b-motionMask; -SetMaskForEvent(device-id, mask, MotionNotify); +UpdateDeviceMotionMask(device, b-state, b-motionMask); } else if (event-type == ET_ProximityIn) device-proximity-in_proximity = TRUE; else if (event-type == ET_ProximityOut) -- 1.7.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 09/21] Xi: split updating button count and state into helper functions
Functional change: for a button mapped to 0, the motionHintWindow is not updated to the NullWindow anymore. Before it got updated unconditionally to the button mapping. I have no idea what the practical effect of this is, but I guess it's closer to the correct behaviour: pressing a button that's logically disabled now does not disrupt the motion hint delivery. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- Xi/exevents.c | 41 + 1 files changed, 29 insertions(+), 12 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index 1140554..dab467c 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -726,6 +726,32 @@ UpdateDeviceMotionMask(DeviceIntPtr device, unsigned short state, SetMaskForEvent(device-id, mask, MotionNotify); } +static void +IncreaseButtonCount(DeviceIntPtr dev, int key, CARD8 *buttons_down, +Mask *motion_mask, unsigned short *state) +{ +if (dev-valuator) +dev-valuator-motionHintWindow = NullWindow; + +(*buttons_down)++; +*motion_mask = DeviceButtonMotionMask; +if (dev-button-map[key] = 5) +*state |= (Button1Mask 1) dev-button-map[key]; +} + +static void +DecreaseButtonCount(DeviceIntPtr dev, int key, CARD8 *buttons_down, +Mask *motion_mask, unsigned short *state) +{ +if (dev-valuator) +dev-valuator-motionHintWindow = NullWindow; + +if (*buttons_down = 1 !--(*buttons_down)) +*motion_mask = 0; +if (dev-button-map[key] = 5) +*state = ~((Button1Mask 1) dev-button-map[key]); +} + /** * Update the device state according to the data in the event. * @@ -831,15 +857,11 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) return DONT_PROCESS; set_button_down(device, key, BUTTON_PROCESSED); - if (device-valuator) - device-valuator-motionHintWindow = NullWindow; + if (!b-map[key]) return DONT_PROCESS; -b-buttonsDown++; - b-motionMask = DeviceButtonMotionMask; -if (b-map[key] = 5) - b-state |= (Button1Mask 1) b-map[key]; +IncreaseButtonCount(device, key, b-buttonsDown, b-motionMask, b-state); UpdateDeviceMotionMask(device, b-state, b-motionMask); } else if (event-type == ET_ButtonRelease) { if (!b) @@ -867,15 +889,10 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) } } set_button_up(device, key, BUTTON_PROCESSED); - if (device-valuator) - device-valuator-motionHintWindow = NullWindow; if (!b-map[key]) return DONT_PROCESS; -if (b-buttonsDown = 1 !--b-buttonsDown) - b-motionMask = 0; - if (b-map[key] = 5) - b-state = ~((Button1Mask 1) b-map[key]); +DecreaseButtonCount(device, key, b-buttonsDown, b-motionMask, b-state); UpdateDeviceMotionMask(device, b-state, b-motionMask); } else if (event-type == ET_ProximityIn) device-proximity-in_proximity = TRUE; -- 1.7.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 10/21] dix: move EventDeliveryState into a header file, we'll need it elsewhere
Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- dix/events.c|7 --- include/input.h |7 +++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dix/events.c b/dix/events.c index 6e015fe..12c1678 100644 --- a/dix/events.c +++ b/dix/events.c @@ -2014,13 +2014,6 @@ ActivateImplicitGrab(DeviceIntPtr dev, ClientPtr client, WindowPtr win, return TRUE; } -enum EventDeliveryState { -EVENT_DELIVERED, /** Event has been delivered to a client */ -EVENT_NOT_DELIVERED, /** Event was not delivered to any client */ -EVENT_SKIP, /** Event can be discarded by the caller */ -EVENT_REJECTED, /** Event was rejected for delivery to the client */ -}; - /** * Attempt event delivery to the client owning the window. */ diff --git a/include/input.h b/include/input.h index 917e92f..de2a75d 100644 --- a/include/input.h +++ b/include/input.h @@ -560,6 +560,13 @@ extern int EventIsDeliverable(DeviceIntPtr dev, InternalEvent* event, #define EVENT_XI2_MASK(1 3) /** XI2 mask set on window */ /* @} */ +enum EventDeliveryState { +EVENT_DELIVERED, /** Event has been delivered to a client */ +EVENT_NOT_DELIVERED, /** Event was not delivered to any client */ +EVENT_SKIP, /** Event can be discarded by the caller */ +EVENT_REJECTED, /** Event was rejected for delivery to the client */ +}; + /* Implemented by the DDX. */ extern _X_EXPORT int NewInputDeviceRequest( InputOption *options, -- 1.7.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 11/21] dix: Move grab check and activation logic to CheckPassiveGrab()
From: Chase Douglas chase.doug...@canonical.com This is needed for future pointer emulation work. Signed-off-by: Chase Douglas chase.doug...@canonical.com Reviewed-by: Peter Hutterer peter.hutte...@who-t.net Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- dix/events.c | 384 +++--- 1 files changed, 204 insertions(+), 180 deletions(-) diff --git a/dix/events.c b/dix/events.c index 12c1678..09d38a1 100644 --- a/dix/events.c +++ b/dix/events.c @@ -3635,6 +3635,207 @@ BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin) } /** + * Check an individual grab against an event to determine if a passive grab + * should be activated. + * If activate is true and a passive grab is found, it will be activated, and + * the event will be delivered to the client. + * + * @param device The device of the event to check. + * @param grab The grab to check. + * @param event The current device event. + * @param checkCore Check for core grabs too. + * @param activate Whether to activate a matching grab. + * @param tempGrab A pre-allocated temporary grab record for matching. This + *must have the window and device values filled in. + * @param[out] grab_return The modified value of grab, to be used in the + * caller for grab activation if a this function returns TRUE. May be NULL. + * + * @return Whether the grab matches the event. + */ +static Bool +CheckPassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event, + Bool checkCore, Bool activate, GrabPtr tempGrab, GrabPtr *grab_return) +{ +static const int CORE_MATCH = 0x1; +static const int XI_MATCH = 0x2; +static const int XI2_MATCH = 0x4; +SpritePtr pSprite = device-spriteInfo-sprite; +GrabInfoPtr grabinfo; +DeviceIntPtr gdev; +XkbSrvInfoPtr xkbi = NULL; +xEvent *xE = NULL; +int match = 0; +int count; +int rc; + +gdev = grab-modifierDevice; +if (grab-grabtype == GRABTYPE_CORE) +{ +gdev = GetMaster(device, KEYBOARD_OR_FLOAT); +} else if (grab-grabtype == GRABTYPE_XI2) +{ +/* if the device is an attached slave device, gdev must be the + * attached master keyboard. Since the slave may have been + * reattached after the grab, the modifier device may not be the + * same. */ +if (!IsMaster(grab-device) !IsFloating(device)) +gdev = GetMaster(device, MASTER_KEYBOARD); +} + +if (gdev gdev-key) +xkbi= gdev-key-xkbInfo; +tempGrab-modifierDevice = grab-modifierDevice; +tempGrab-modifiersDetail.exact = xkbi ? xkbi-state.grab_mods : 0; + +/* Check for XI2 and XI grabs first */ +tempGrab-type = GetXI2Type(event-any.type); +tempGrab-grabtype = GRABTYPE_XI2; +if (GrabMatchesSecond(tempGrab, grab, FALSE)) +match = XI2_MATCH; + +if (!match) +{ +tempGrab-grabtype = GRABTYPE_XI; +if ((tempGrab-type = GetXIType(event-any.type)) +(GrabMatchesSecond(tempGrab, grab, FALSE))) +match = XI_MATCH; +} + +/* Check for a core grab (ignore the device when comparing) */ +if (!match checkCore) +{ +tempGrab-grabtype = GRABTYPE_CORE; +if ((tempGrab-type = GetCoreType(event-any.type)) +(GrabMatchesSecond(tempGrab, grab, TRUE))) +match = CORE_MATCH; +} + +if (!match || (grab-confineTo + (!grab-confineTo-realized || +!BorderSizeNotEmpty(device, grab-confineTo +return FALSE; + +*grab_return = grab; +grabinfo = device-deviceGrab; +/* In some cases a passive core grab may exist, but the client + * already has a core grab on some other device. In this case we + * must not get the grab, otherwise we may never ungrab the + * device. + */ + +if (grab-grabtype == GRABTYPE_CORE) +{ +DeviceIntPtr other; +BOOL interfering = FALSE; + +/* A passive grab may have been created for a different device + than it is assigned to at this point in time. + Update the grab's device and modifier device to reflect the + current state. + Since XGrabDeviceButton requires to specify the + modifierDevice explicitly, we don't override this choice. + */ +if (tempGrab-type GenericEvent) +{ +grab-device = device; +grab-modifierDevice = GetMaster(device, MASTER_KEYBOARD); +} + +for (other = inputInfo.devices; other; other = other-next) +{ +GrabPtr othergrab = other-deviceGrab.grab; +if (othergrab othergrab-grabtype == GRABTYPE_CORE +SameClient(grab, rClient(othergrab)) +((IsPointerDevice(grab-device) + IsPointerDevice(othergrab-device)) || + (IsKeyboardDevice(grab-device) + IsKeyboardDevice(othergrab-device +{
[PATCH 12/21] dix: Split ActivatePassiveGrab() from CheckPassiveGrab()
From: Chase Douglas chase.doug...@canonical.com The changed logic means we don't require the explicit grab = NULL setting and early exit anymore. Not 100% of it, but if we see that message pop up in a log we know it's broken. Signed-off-by: Chase Douglas chase.doug...@canonical.com Reviewed-by: Peter Hutterer peter.hutte...@who-t.net Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- dix/events.c| 199 ++- include/input.h |2 + 2 files changed, 112 insertions(+), 89 deletions(-) diff --git a/dix/events.c b/dix/events.c index 09d38a1..3041ae6 100644 --- a/dix/events.c +++ b/dix/events.c @@ -3635,38 +3635,128 @@ BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin) } /** + * Activate the given passive grab. If the grab is activated successfully, the + * event has been delivered to the client. + * + * @param device The device of the event to check. + * @param grab The grab to check. + * @param event The current device event. + * + * @return Whether the grab has been activated. + */ +Bool +ActivatePassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event) +{ +SpritePtr pSprite = device-spriteInfo-sprite; +GrabInfoPtr grabinfo = device-deviceGrab; +xEvent *xE = NULL; +int count; +int rc; + +if (!GetXIType(event-any.type) !GetCoreType(event-any.type)) +{ +ErrorF(Event type %d in CheckPassiveGrabsOnWindow is neither +XI 1.x nor core\n, event-any.type); +return FALSE; +} + +/* The only consumers of corestate are Xi 1.x and core events, which + * are guaranteed to come from DeviceEvents. */ +if (grab-grabtype == GRABTYPE_XI || grab-grabtype == GRABTYPE_CORE) +{ +DeviceIntPtr gdev; + +event-device_event.corestate = 0x1f00; + +if (grab-grabtype == GRABTYPE_CORE) +gdev = GetMaster(device, KEYBOARD_OR_FLOAT); +else +gdev = grab-modifierDevice; + +if (gdev gdev-key gdev-key-xkbInfo) +event-device_event.corestate |= +gdev-key-xkbInfo-state.grab_mods (~0x1f00); +} + +if (grab-grabtype == GRABTYPE_CORE) +{ +rc = EventToCore(event, xE, count); +if (rc != Success) +{ +BUG_WARN_MSG(rc != BadMatch,[dix] %s: core conversion failed + (%d, %d).\n, device-name, event-any.type, rc); +return FALSE; +} +} else if (grab-grabtype == GRABTYPE_XI2) +{ +rc = EventToXI2(event, xE); +if (rc != Success) +{ +if (rc != BadMatch) +BUG_WARN_MSG(rc != BadMatch,[dix] %s: XI2 conversion failed + (%d, %d).\n, device-name, event-any.type, rc); +return FALSE; +} +count = 1; +} else +{ +rc = EventToXI(event, xE, count); +if (rc != Success) +{ +if (rc != BadMatch) +BUG_WARN_MSG(rc != BadMatch,[dix] %s: XI conversion failed + (%d, %d).\n, device-name, event-any.type, rc); +return FALSE; +} +} + +(*grabinfo-ActivateGrab)(device, grab, currentTime, TRUE); + +if (xE) +{ +FixUpEventFromWindow(pSprite, xE, grab-window, None, TRUE); + +/* XXX: XACE? */ +TryClientEvents(rClient(grab), device, xE, count, +GetEventFilter(device, xE), +GetEventFilter(device, xE), grab); +} + +if (grabinfo-sync.state == FROZEN_NO_EVENT) +{ +if (!grabinfo-sync.event) +grabinfo-sync.event = calloc(1, sizeof(DeviceEvent)); +*grabinfo-sync.event = event-device_event; +grabinfo-sync.state = FROZEN_WITH_EVENT; +} + +free(xE); +return TRUE; +} + +/** * Check an individual grab against an event to determine if a passive grab * should be activated. - * If activate is true and a passive grab is found, it will be activated, and - * the event will be delivered to the client. * * @param device The device of the event to check. * @param grab The grab to check. * @param event The current device event. * @param checkCore Check for core grabs too. - * @param activate Whether to activate a matching grab. * @param tempGrab A pre-allocated temporary grab record for matching. This *must have the window and device values filled in. - * @param[out] grab_return The modified value of grab, to be used in the - * caller for grab activation if a this function returns TRUE. May be NULL. * * @return Whether the grab matches the event. */ static Bool CheckPassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event, - Bool checkCore, Bool activate, GrabPtr tempGrab, GrabPtr *grab_return) + Bool checkCore, GrabPtr tempGrab) { static const int CORE_MATCH = 0x1; static const int XI_MATCH = 0x2; static const int
[PATCH 13/21] dix: remove event type check
Can't remember why this is there but we'll need to pass in XI2 events soon, so this check is obsolete. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- dix/events.c |7 --- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/dix/events.c b/dix/events.c index 3041ae6..e94001a 100644 --- a/dix/events.c +++ b/dix/events.c @@ -3653,13 +3653,6 @@ ActivatePassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event) int count; int rc; -if (!GetXIType(event-any.type) !GetCoreType(event-any.type)) -{ -ErrorF(Event type %d in CheckPassiveGrabsOnWindow is neither -XI 1.x nor core\n, event-any.type); -return FALSE; -} - /* The only consumers of corestate are Xi 1.x and core events, which * are guaranteed to come from DeviceEvents. */ if (grab-grabtype == GRABTYPE_XI || grab-grabtype == GRABTYPE_CORE) -- 1.7.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 14/21] dix: compare the grab type, not the tempGrab type
No functional change. To get here, GrabMatchesSecond() needs to be TRUE and for that the two grab types must be identical. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- dix/events.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dix/events.c b/dix/events.c index e94001a..349d9b4 100644 --- a/dix/events.c +++ b/dix/events.c @@ -3816,7 +3816,7 @@ CheckPassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event, Since XGrabDeviceButton requires to specify the modifierDevice explicitly, we don't override this choice. */ -if (tempGrab-type GenericEvent) +if (grab-type GenericEvent) { grab-device = device; grab-modifierDevice = GetMaster(device, MASTER_KEYBOARD); -- 1.7.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 15/21] dix: split core grab interference check into helper function
No functional changes. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- dix/events.c | 43 +-- 1 files changed, 25 insertions(+), 18 deletions(-) diff --git a/dix/events.c b/dix/events.c index 349d9b4..4d80358 100644 --- a/dix/events.c +++ b/dix/events.c @@ -3727,6 +3727,30 @@ ActivatePassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event) return TRUE; } +static BOOL +CoreGrabInterferes(DeviceIntPtr device, GrabPtr grab) +{ +DeviceIntPtr other; +BOOL interfering = FALSE; + +for (other = inputInfo.devices; other; other = other-next) +{ +GrabPtr othergrab = other-deviceGrab.grab; +if (othergrab othergrab-grabtype == GRABTYPE_CORE +SameClient(grab, rClient(othergrab)) +((IsPointerDevice(grab-device) + IsPointerDevice(othergrab-device)) || + (IsKeyboardDevice(grab-device) + IsKeyboardDevice(othergrab-device +{ +interfering = TRUE; +break; +} +} + +return interfering; +} + /** * Check an individual grab against an event to determine if a passive grab * should be activated. @@ -3806,9 +3830,6 @@ CheckPassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event, if (grab-grabtype == GRABTYPE_CORE) { -DeviceIntPtr other; -BOOL interfering = FALSE; - /* A passive grab may have been created for a different device than it is assigned to at this point in time. Update the grab's device and modifier device to reflect the @@ -3822,21 +3843,7 @@ CheckPassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event, grab-modifierDevice = GetMaster(device, MASTER_KEYBOARD); } -for (other = inputInfo.devices; other; other = other-next) -{ -GrabPtr othergrab = other-deviceGrab.grab; -if (othergrab othergrab-grabtype == GRABTYPE_CORE -SameClient(grab, rClient(othergrab)) -((IsPointerDevice(grab-device) - IsPointerDevice(othergrab-device)) || - (IsKeyboardDevice(grab-device) - IsKeyboardDevice(othergrab-device -{ -interfering = TRUE; -break; -} -} -if (interfering) +if (CoreGrabInterferes(device, grab)) return FALSE; } -- 1.7.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 16/21] dix: move grab matching code into a helper function
No functional changes. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- dix/events.c | 81 +++--- 1 files changed, 60 insertions(+), 21 deletions(-) diff --git a/dix/events.c b/dix/events.c index 4d80358..9fcd447 100644 --- a/dix/events.c +++ b/dix/events.c @@ -3751,6 +3751,62 @@ CoreGrabInterferes(DeviceIntPtr device, GrabPtr grab) return interfering; } +enum MatchFlags { +NO_MATCH= 0x0, +CORE_MATCH = 0x1, +XI_MATCH= 0x2, +XI2_MATCH = 0x4, +}; + +/** + * Match the grab against the temporary grab on the given input level. + * Modifies the temporary grab pointer. + * + * @param grab The grab to match against + * @param tmp The temporary grab to use for matching + * @param level The input level we want to match on + * @param event_type Wire protocol event type + * + * @return The respective matched flag or 0 for no match + */ +static enum MatchFlags +MatchForType(const GrabPtr grab, GrabPtr tmp, enum InputLevel level, int event_type) +{ +enum MatchFlags match; +BOOL ignore_device = FALSE; +int grabtype; +int evtype; + +switch(level) +{ +case XI2: +grabtype = GRABTYPE_XI2; +evtype = GetXI2Type(event_type); +BUG_WARN(!evtype); +match = XI2_MATCH; +break; +case XI: +grabtype = GRABTYPE_XI; +evtype = GetXIType(event_type); +match = XI_MATCH; +break; +case CORE: +grabtype = GRABTYPE_CORE; +evtype = GetCoreType(event_type); +match = CORE_MATCH; +ignore_device = TRUE; +break; +} + +tmp-grabtype = grabtype; +tmp-type = evtype; + +if (tmp-type GrabMatchesSecond(tmp, grab, ignore_device)) +return match; + +return NO_MATCH; +} + /** * Check an individual grab against an event to determine if a passive grab * should be activated. @@ -3768,12 +3824,9 @@ static Bool CheckPassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event, Bool checkCore, GrabPtr tempGrab) { -static const int CORE_MATCH = 0x1; -static const int XI_MATCH = 0x2; -static const int XI2_MATCH = 0x4; DeviceIntPtr gdev; XkbSrvInfoPtr xkbi = NULL; -int match = 0; +enum MatchFlags match = 0; gdev = grab-modifierDevice; if (grab-grabtype == GRABTYPE_CORE) @@ -3795,27 +3848,13 @@ CheckPassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event, tempGrab-modifiersDetail.exact = xkbi ? xkbi-state.grab_mods : 0; /* Check for XI2 and XI grabs first */ -tempGrab-type = GetXI2Type(event-any.type); -tempGrab-grabtype = GRABTYPE_XI2; -if (GrabMatchesSecond(tempGrab, grab, FALSE)) -match = XI2_MATCH; +match = MatchForType(grab, tempGrab, XI2, GetXI2Type(event-any.type)); if (!match) -{ -tempGrab-grabtype = GRABTYPE_XI; -if ((tempGrab-type = GetXIType(event-any.type)) -(GrabMatchesSecond(tempGrab, grab, FALSE))) -match = XI_MATCH; -} +match = MatchForType(grab, tempGrab, XI, GetXIType(event-any.type)); -/* Check for a core grab (ignore the device when comparing) */ if (!match checkCore) -{ -tempGrab-grabtype = GRABTYPE_CORE; -if ((tempGrab-type = GetCoreType(event-any.type)) -(GrabMatchesSecond(tempGrab, grab, TRUE))) -match = CORE_MATCH; -} +match = MatchForType(grab, tempGrab, CORE, GetCoreType(event-any.type)); if (!match || (grab-confineTo (!grab-confineTo-realized || -- 1.7.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 17/21] dix: split out core state and event state setting into helper functions
no functional changes. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- Xi/exevents.c| 31 +++ dix/inpututils.c | 39 +++ include/inpututils.h |2 ++ 3 files changed, 44 insertions(+), 28 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index dab467c..d4ee185 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -915,7 +915,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device) int key = 0, rootX, rootY; ButtonClassPtr b; int ret = 0; -int corestate, i; +int corestate; DeviceIntPtr mouse = NULL, kbd = NULL; DeviceEvent *event = ev-device_event; @@ -945,33 +945,8 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device) mouse = NULL; } -/* core state needs to be assembled BEFORE the device is updated. */ -corestate = (kbd kbd-key) ? XkbStateFieldFromRec(kbd-key-xkbInfo-state) : 0; -corestate |= (mouse mouse-button) ? (mouse-button-state) : 0; - -for (i = 0; mouse mouse-button i mouse-button-numButtons; i++) -if (BitIsOn(mouse-button-down, i)) -SetBit(event-buttons, i); - -if (kbd kbd-key) -{ -XkbStatePtr state; -/* we need the state before the event happens */ -if (event-type == ET_KeyPress || event-type == ET_KeyRelease) -state = kbd-key-xkbInfo-prev_state; -else -state = kbd-key-xkbInfo-state; - -event-mods.base = state-base_mods; -event-mods.latched = state-latched_mods; -event-mods.locked = state-locked_mods; -event-mods.effective = state-mods; - -event-group.base = state-base_group; -event-group.latched = state-latched_group; -event-group.locked = state-locked_group; -event-group.effective = state-group; -} +corestate = event_get_corestate(mouse, kbd); +event_set_state(mouse, kbd, event); ret = UpdateDeviceState(device, event); if (ret == DONT_PROCESS) diff --git a/dix/inpututils.c b/dix/inpututils.c index 60f9fa0..5844daf 100644 --- a/dix/inpututils.c +++ b/dix/inpututils.c @@ -657,6 +657,45 @@ void init_device_event(DeviceEvent *event, DeviceIntPtr dev, Time ms) event-sourceid = dev-id; } +int event_get_corestate(DeviceIntPtr mouse, DeviceIntPtr kbd) +{ +int corestate; +/* core state needs to be assembled BEFORE the device is updated. */ +corestate = (kbd kbd-key) ? XkbStateFieldFromRec(kbd-key-xkbInfo-state) : 0; +corestate |= (mouse mouse-button) ? (mouse-button-state) : 0; +return corestate; +} + +void event_set_state(DeviceIntPtr mouse, DeviceIntPtr kbd, DeviceEvent *event) +{ +int i; + +for (i = 0; mouse mouse-button i mouse-button-numButtons; i++) +if (BitIsOn(mouse-button-down, i)) +SetBit(event-buttons, i); + +if (kbd kbd-key) +{ +XkbStatePtr state; +/* we need the state before the event happens */ +if (event-type == ET_KeyPress || event-type == ET_KeyRelease) +state = kbd-key-xkbInfo-prev_state; +else +state = kbd-key-xkbInfo-state; + +event-mods.base = state-base_mods; +event-mods.latched = state-latched_mods; +event-mods.locked = state-locked_mods; +event-mods.effective = state-mods; + +event-group.base = state-base_group; +event-group.latched = state-latched_group; +event-group.locked = state-locked_group; +event-group.effective = state-group; +} +} + + Bool point_on_screen(ScreenPtr pScreen, int x, int y) { diff --git a/include/inpututils.h b/include/inpututils.h index 5f9dfec..96ad6df 100644 --- a/include/inpututils.h +++ b/include/inpututils.h @@ -40,6 +40,8 @@ struct _ValuatorMask { extern void verify_internal_event(const InternalEvent *ev); extern void init_device_event(DeviceEvent *event, DeviceIntPtr dev, Time ms); +extern int event_get_corestate(DeviceIntPtr mouse, DeviceIntPtr kbd); +extern void event_set_state(DeviceIntPtr mouse, DeviceIntPtr kbd, DeviceEvent *event); FP3232 double_to_fp3232(double in); FP1616 double_to_fp1616(double in); -- 1.7.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 18/21] dix: move delivery stop condition out of event mask
Previously, this was only called if there was a mask match, so even if we had a no-propagate flag set or a stopAt window specified, if no mask triggered on the window we would recurse up to the root window and eventually deliver. Move this, so that the stopAt and do-not-propagate mask is honoured. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- dix/events.c | 11 ++- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dix/events.c b/dix/events.c index 9fcd447..05590e2 100644 --- a/dix/events.c +++ b/dix/events.c @@ -2693,12 +2693,13 @@ DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab, break; } -if ((deliveries 0) || (pWin == stopAt) || +} + +if ((deliveries 0) || (pWin == stopAt) || (mask EVENT_DONT_PROPAGATE_MASK)) -{ -deliveries = 0; -break; -} +{ +deliveries = 0; +break; } child = pWin-drawable.id; -- 1.7.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 19/21] Add GrabIsPointerGrab and GrabIsKeyboardGrab helpers
No functional changes Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- Xi/exevents.c |8 ++-- dix/grabs.c| 17 + include/dixgrabs.h |2 ++ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index d4ee185..3e19029 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1001,9 +1001,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device) case ET_KeyRelease: if (grab device-deviceGrab.fromPassiveGrab (key == device-deviceGrab.activatingKey) -(device-deviceGrab.grab-type == KeyPress || - device-deviceGrab.grab-type == DeviceKeyPress || - device-deviceGrab.grab-type == XI_KeyPress)) +GrabIsKeyboardGrab(device-deviceGrab.grab)) deactivateDeviceGrab = TRUE; break; case ET_ButtonPress: @@ -1023,9 +1021,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device) event-detail.button = b-map[key]; if (grab !b-buttonsDown device-deviceGrab.fromPassiveGrab -(device-deviceGrab.grab-type == ButtonPress || - device-deviceGrab.grab-type == DeviceButtonPress || - device-deviceGrab.grab-type == XI_ButtonPress)) +GrabIsPointerGrab(device-deviceGrab.grab)) deactivateDeviceGrab = TRUE; default: break; diff --git a/dix/grabs.c b/dix/grabs.c index aced130..0157b78 100644 --- a/dix/grabs.c +++ b/dix/grabs.c @@ -60,6 +60,7 @@ SOFTWARE. #include dixgrabs.h #include xace.h #include exevents.h +#include exglobals.h #include inpututils.h #define BITMASK(i) (((Mask)1) ((i) 31)) @@ -737,3 +738,19 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab) #undef UPDATE } + +Bool +GrabIsPointerGrab(GrabPtr grab) +{ +return (grab-type == ButtonPress || +grab-type == DeviceButtonPress || +grab-type == XI_ButtonPress); +} + +Bool +GrabIsKeyboardGrab(GrabPtr grab) +{ + return (grab-type == KeyPress || + grab-type == DeviceKeyPress || + grab-type == XI_KeyPress); +} diff --git a/include/dixgrabs.h b/include/dixgrabs.h index 65ff45d..ea88770 100644 --- a/include/dixgrabs.h +++ b/include/dixgrabs.h @@ -64,4 +64,6 @@ extern _X_EXPORT int AddPassiveGrabToList( extern _X_EXPORT Bool DeletePassiveGrabFromList( GrabPtr /* pMinuendGrab */); +extern Bool GrabIsPointerGrab(GrabPtr grab); +extern Bool GrabIsKeyboardGrab(GrabPtr grab); #endif /* DIXGRABS_H */ -- 1.7.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 20/21] input: replace GRABTYPE_* with the InputLevel enums
They achieve the same thing, re-use the more generic InputLevel so we can convert to/fro easier. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- Xi/exevents.c | 26 +++--- Xi/grabdev.c|2 +- Xi/grabdevb.c |4 +- Xi/grabdevk.c |4 +- Xi/ungrdev.c|2 +- Xi/ungrdevb.c |2 +- Xi/ungrdevk.c |2 +- Xi/xigrabdev.c |4 +- Xi/xipassivegrab.c |8 +- dix/events.c| 64 dix/grabs.c | 30 include/dixgrabs.h |2 +- include/eventconvert.h |6 -- include/exevents.h |6 +- include/input.h |6 ++ include/inputstr.h |8 +-- test/input.c| 130 +++--- test/xi2/protocol-xipassivegrabdevice.c |4 +- 18 files changed, 152 insertions(+), 158 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index 3e19029..3c9ee4a 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1389,9 +1389,9 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, int CheckGrabValues(ClientPtr client, GrabParameters* param) { -if (param-grabtype != GRABTYPE_CORE -param-grabtype != GRABTYPE_XI -param-grabtype != GRABTYPE_XI2) +if (param-grabtype != CORE +param-grabtype != XI +param-grabtype != XI2) { ErrorF([Xi] grabtype is invalid. This is a bug.\n); return BadImplementation; @@ -1408,7 +1408,7 @@ CheckGrabValues(ClientPtr client, GrabParameters* param) return BadValue; } -if (param-grabtype != GRABTYPE_XI2 (param-modifiers != AnyModifier) +if (param-grabtype != XI2 (param-modifiers != AnyModifier) (param-modifiers ~AllModifiersMask)) { client-errorValue = param-modifiers; return BadValue; @@ -1423,7 +1423,7 @@ CheckGrabValues(ClientPtr client, GrabParameters* param) int GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, - int button, GrabParameters *param, GrabType grabtype, + int button, GrabParameters *param, enum InputLevel grabtype, GrabMask *mask) { WindowPtr pWin, confineTo; @@ -1463,9 +1463,9 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, if (rc != Success) return rc; -if (grabtype == GRABTYPE_XI) +if (grabtype == XI) type = DeviceButtonPress; -else if (grabtype == GRABTYPE_XI2) +else if (grabtype == XI2) type = XI_ButtonPress; grab = CreateGrab(client-index, dev, modifier_device, pWin, grabtype, @@ -1476,12 +1476,12 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, } /** - * Grab the given key. If grabtype is GRABTYPE_XI, the key is a keycode. If - * grabtype is GRABTYPE_XI2, the key is a keysym. + * Grab the given key. If grabtype is XI, the key is a keycode. If + * grabtype is XI2, the key is a keysym. */ int GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, -int key, GrabParameters *param, GrabType grabtype, GrabMask *mask) +int key, GrabParameters *param, enum InputLevel grabtype, GrabMask *mask) { WindowPtr pWin; GrabPtr grab; @@ -1494,7 +1494,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, return rc; if ((dev-id != XIAllDevices dev-id != XIAllMasterDevices) k == NULL) return BadMatch; -if (grabtype == GRABTYPE_XI) +if (grabtype == XI) { if ((key k-xkbInfo-desc-max_key_code || key k-xkbInfo-desc-min_key_code) @@ -1503,7 +1503,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, return BadValue; } type = DeviceKeyPress; -} else if (grabtype == GRABTYPE_XI2) +} else if (grabtype == XI2) type = XI_KeyPress; rc = dixLookupWindow(pWin, param-grabWindow, client, DixSetAttrAccess); @@ -1558,7 +1558,7 @@ GrabWindow(ClientPtr client, DeviceIntPtr dev, int type, if (rc != Success) return rc; -grab = CreateGrab(client-index, dev, dev, pWin, GRABTYPE_XI2, +grab = CreateGrab(client-index, dev, dev, pWin, XI2, mask, param, (type == XIGrabtypeEnter) ? XI_Enter : XI_FocusIn, 0, NULL, cursor); diff --git a/Xi/grabdev.c b/Xi/grabdev.c index 4572c33..8fd114e 100644 --- a/Xi/grabdev.c +++ b/Xi/grabdev.c @@ -130,7 +130,7 @@ ProcXGrabDevice(ClientPtr client) rc = GrabDevice(client, dev, stuff-other_devices_mode, stuff-this_device_mode, stuff-grabWindow,
[PATCH 21/21] dix: always allocate and set the grab's sync.event
Allocate the memory at device creation time and always store the event, even if we're not frozen. This way we know which event triggered the grab. Since the event was never freed anyway except on device shutdown, this doesn't really change things much. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- dix/devices.c |1 + dix/events.c |8 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/dix/devices.c b/dix/devices.c index e448eab..9ca8fe0 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -275,6 +275,7 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) dev-deviceGrab.ActivateGrab = ActivateKeyboardGrab; dev-deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; dev-deviceGrab.activeGrab = AllocGrab(); +dev-deviceGrab.sync.event = calloc(1, sizeof(DeviceEvent)); XkbSetExtension(dev, ProcessKeyboardEvent); diff --git a/dix/events.c b/dix/events.c index 69b64ba..828b143 100644 --- a/dix/events.c +++ b/dix/events.c @@ -3717,12 +3717,8 @@ ActivatePassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event) } if (grabinfo-sync.state == FROZEN_NO_EVENT) -{ -if (!grabinfo-sync.event) -grabinfo-sync.event = calloc(1, sizeof(DeviceEvent)); -*grabinfo-sync.event = event-device_event; grabinfo-sync.state = FROZEN_WITH_EVENT; -} +*grabinfo-sync.event = event-device_event; free(xE); return TRUE; @@ -4310,8 +4306,6 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev, case FREEZE_NEXT_EVENT: grabinfo-sync.state = FROZEN_WITH_EVENT; FreezeThaw(thisDev, TRUE); - if (!grabinfo-sync.event) - grabinfo-sync.event = calloc(1, sizeof(InternalEvent)); *grabinfo-sync.event = event-device_event; break; } -- 1.7.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: xserver 1.12 schedule? (was: [ANNOUNCE] xorg-server 1.11.99.1)
On Thu, Dec 08, 2011 at 06:09:09PM -0800, Keith Packard wrote: On Thu, 08 Dec 2011 16:54:15 -0800, Alan Coopersmith alan.coopersm...@oracle.com wrote: Did we ever come to a conclusion here? Since no one else has stepped up to plan the katamari release, I'm thinking of having X11R7.7 rolled up around the server 1.12 release schedule, and would like to give people a heads up to get their doc, lib, apps, etc. changes rolled in. Peter promised to finish up Xi by Christmas, which makes the schedule look like: Merge window closes:2011-12-25 Non-critical bugs: 2012-2-4 1.12 release: 2012-3-4 I should be able to manage the critical bug merging while I'm on holiday in New Zealand -- there's not usually much to do during that part of the release cycle; I'll let you know if I will be off-line for more than a day or so during that time. with the MT work, it's likely that the crit. bug window won't be as quiet as previous ones. Just as an advance warning, some of the nastier details will probably only be exposed when distros start shipping the code. Cheers, Peter ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PULL] Input changes in preparation for multitouch
On Fri, 9 Dec 2011 13:33:33 +1000, Peter Hutterer peter.hutte...@who-t.net wrote: dix: allocate temporary grabs on the heap does that. I ran this through valgrind and it didn't complain, iirc. With that understood, and with the segfault in 'make check' fixed that we discussed on IRC (a bug in the test), this series has been merged. 6369b59..522f8bc master - master -- keith.pack...@intel.com pgpeW43FZ0yPP.pgp Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Include client name if available in PrintDeviceGrabInfo
On 12/08/11 01:28, Rami Ylimäki wrote: Reviewed-by: Rami Ylimäki rami.ylim...@vincit.fi Thanks. [3581736.601] Active grab 0x160 (core) on device 'Virtual core pointer' (2): [3581736.601] client pid 26741 /usr/bin/xscreensaver -nosplash + ErrorF( (no client information available for client %d)\n, + CLIENT_ID(grab-resource)); I'd prefer the format to be %lx as that is used generally for resources. That would make it easier to find the client XID from output of xrestop for example. Is that necessary when we already print the grab resource id on the previous line? People who want that format can just ignore the trailing bits of the resource id. -- -Alan Coopersmith-alan.coopersm...@oracle.com Oracle Solaris Platform Engineering: X Window System ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] Change disable_clientpointer return type to void
It doesn't return anything, nor does it's caller expect it to. Fixes Solaris Studio compiler error: xichangehierarchy.c, line 214: Function has no return statement : disable_clientpointer Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com --- Xi/xichangehierarchy.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c index a8bc761..503404e 100644 --- a/Xi/xichangehierarchy.c +++ b/Xi/xichangehierarchy.c @@ -200,7 +200,7 @@ unwind: return rc; } -static int +static void disable_clientpointer(DeviceIntPtr dev) { int i; -- 1.7.3.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Change disable_clientpointer return type to void
On Thu, Dec 08, 2011 at 09:52:07PM -0800, Alan Coopersmith wrote: It doesn't return anything, nor does it's caller expect it to. Fixes Solaris Studio compiler error: xichangehierarchy.c, line 214: Function has no return statement : disable_clientpointer Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com Reviewed-by: Peter Hutterer peter.hutte...@who-t.net Keith, please push this, thanks. --- Xi/xichangehierarchy.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c index a8bc761..503404e 100644 --- a/Xi/xichangehierarchy.c +++ b/Xi/xichangehierarchy.c @@ -200,7 +200,7 @@ unwind: return rc; } -static int +static void disable_clientpointer(DeviceIntPtr dev) { int i; -- 1.7.3.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel