Commit graph

43 commits

Author SHA1 Message Date
Gaetan Nadon
f77c89c751 .gitignore: use common defaults with custom section # 24239
Using common defaults will reduce errors and maintenance.
Only the very small or inexistent custom section need periodic maintenance
when the structure of the component changes. Do not edit defaults.
2009-11-14 09:26:16 -05:00
Julien Cristau
640fec5f4f Add _XFUNCPROTOBEGIN/END to Xlib-xcb.h
X.Org bug#22252 <https://bugs.freedesktop.org/show_bug.cgi?id=22252>

Reported-by: Riku Salminen <rsalmin2@cc.hut.fi>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2009-08-02 17:22:24 +02:00
Peter Hutterer
554f755e55 Add generic event cookie handling to libX11.
Generic events require more bytes than Xlib provides in the standard XEvent.
Memory allocated by the extension and stored as pointers inside the event is
prone to leak by simple 'while (1) { XNextEvent(...); }' loops.

This patch adds cookie handling for generic events. Extensions may register
a cookie handler in addition to the normal event vectors. If an extension
has registered a cookie handler, _all_ generic events for this extensions
must be handled through cookies. Otherwise, the default event handler is
used.

The cookie handler must return an XGenericEventCookie with a pointer to the
data.The rest of the event (type, serialNumber, etc.) are to be filled as
normal. When a client retrieves such a cookie event, the data is stored in
an internal queue (the 'cookiejar'). This data is freed on the next call to
XNextEvent().

New extension interfaces:
    XESetWireToEventCookie(display, extension_number, cookie_handler)

Where cookie_handler must set cookie->data. The data pointer is of arbitray
size and type but must be a single memory block. This memory block
represents the actual extension's event.

New client interfaces:
    XGetEventData(display, *cookie);
    XFreeEventData(display, *cookie);

If the client needs the actual event data, it must call XGetEventData() with
the cookie. This returns the data pointer (and removes it from the cookie
jar) and the client is then responsible for freeing the event with
XFreeEventData(). It is safe to call either function with a non-cookie
event. Events unclaimed or not handled by the XGetEventData() are cleaned up
automatically.

Example client code:
    XEvent event;
    XGenericEventCookie *cookie = &ev;

    XNextEvent(display, &event);
    if (XGetEventData(display, cookie)) {
        XIEvent *xievent = cookie->data;
        ...
    } else if (cookie->type == GenericEvent) {
        /* handle generic event */
    } else {
        /* handle extension/core event */
    }
    XFreeEventData(display, cookie);

Cookies are not multi-threading safe. Clients that use XGetEventData() must
lock between XNextEvent and XGetEventData to avoid other threads freeing
cookies.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-12 16:09:57 +10:00
Alan Coopersmith
38f9054554 Drop ancient USG SysV #ifdefs
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-06-16 08:21:52 -07:00
Adam Jackson
7bfe1323f1 Remove X_NOT_STDC_ENV usage. (#6527) 2009-06-12 12:44:01 -04:00
Alan Coopersmith
9bad8309ef flags member of Display structure needs to be marked volatile
Since the Xlib multithreaded code checks the flags variable in _XFlushInt
to see if the other threads are done yet, it has to be marked volatile so
the compiler doesn't optimize out re-loading it on each trip through the
while loop and end up in an impossible-to-exit infinite loop of CPU chewing.

Part of fix for Sun bug 6409332: infinite loop in XFlushInt() on x86/32-bit
<http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6409332>

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-02-20 15:17:13 -08:00
Paulo Cesar Pereira de Andrade
427e9d45d4 Allow multiple inclusions of cursorfont.h, cosmetic patch. 2009-02-02 16:31:05 -02:00
Paulo Cesar Pereira de Andrade
8ba0ca32a6 Janitor: ansification, make distcheck, compiler warnings.
Only convert to use "ansi prototypes" the functions warned from
compilation with "./autogen.sh --prefix=/usr", on a Linux computer.

  Also, only address "trivial" compiler warning fixes in this commit.

  The new .gitignore is the output of a command like:
% find . -name .gitignore -exec cat {} \; | sort | uniq
and only the toplevel .gitignore file was kept.
2009-01-28 20:31:42 -02:00
Jamey Sharp
e6a7b70cdb Support multiple independent internal sync handlers
Xlib has several independent tasks that need to be performed with the
display unlocked. It does this by replacing the existing sync handler with
one of a variety of internal sync handlers. However, if multiple internal
sync handlers need to run, then the last one registering wins and
previously registered internal sync handlers are never invoked. This
manifested as a bug with DRI applications on Xlib/XCB as that requires
both an XID handler after every XID allocation, and the periodic sequence
number handler. The XID handler would win, and the sequence number handler
would never be invoked.

Fix this by unifying the internal sync handler mechanism into a single
function that calls all of the known internal sync handlers. They all need
to deal with being called when not strictly necessary now.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Josh Triplett <josh@freedesktop.org>
2008-11-04 08:54:01 -08:00
Peter Hutterer
596e081b74 Fix unbalanced parenthesis in XKBlib.h # 16551
X.Org Bug 16551 <http://bugs.freedesktop.org/show_bug.cgi?id=16551>
2008-06-28 20:15:16 +09:30
Alan Coopersmith
cf49e53701 Strip whitespace from end of lines in source files 2008-06-17 14:41:17 -07:00
Peter Hutterer
c9b2ff1e6a Merge branch 'master' into xge 2008-05-12 17:58:37 +09:30
Matthieu Herrb
bf69541238 nuke RCS Ids 2008-03-09 09:08:07 +01:00
Josh Triplett
416f38f2e6 Revert "Revert "include: don't distribute XlibConf.h""
This reverts commit 79fa3d8070.

Re-revert the XlibConf.h change, which prevented distribution, not
installation.
2007-06-03 12:13:44 -07:00
Josh Triplett
79fa3d8070 Revert "include: don't distribute XlibConf.h"
This reverts commit c9e28e05ae.

The installed XlibInt.h includes XlibConf.h , so libX11 should ship
XlibConf.h.  (Commit c9e28e05ae didn't actually
prevent automake from shipping XlibConf.h, because it used
nodist_x11include_HEADERS rather than nodist_HEADERS.)
2007-06-02 22:05:16 -07:00
Peter Hutterer
a68a1cd7cb Add XGenericEvent definition and handling for long events. 2007-05-15 16:54:01 +09:30
Daniel Stone
c9e28e05ae include: don't distribute XlibConf.h
Since XlibConf.h is built by configure, don't distribute it.
2006-12-16 00:47:23 +02:00
Josh Triplett
ab728ca372 XCL is dead; long live Xlib/XCB
Rename all instances of "XCL" to Xlib/XCB-derived names.

The only user-visible change: rename the include file <X11/xcl.h> to
<X11/Xlib-xcb.h>; programs will need to change their #include lines to match.

Remove the XCL cast inlines from Xlib-xcb.h.
2006-10-06 12:36:39 -07:00
Jamey Sharp
ffd367f708 No longer #include Xmd from xcl.h: we do not need it. 2006-10-04 17:16:46 -07:00
Jamey Sharp
bde3cd123d libxcb now installs header files in <xcb>, not <X11/XCB>. 2006-09-25 04:13:20 -07:00
Ian Osgood
87d00207f5 Track XCB's "Great Renaming". 2006-09-24 23:39:01 -07:00
Matthias Hopf
9354351fcb Bug #3104: Compose table cache for faster X11 application starts. Part 1: Pointerless compose data structure, using indices instead of pointers, needed for mmap()ing data structure. 2006-06-16 16:31:37 +02:00
Daniel Stone
3a16f262ab Bug #1625: Include keysym.h from Xutil.h. 2006-04-07 17:49:41 +03:00
Jamey Sharp
e3f4525718 Add explicit include of Xmd.h to work around bug including both xcb.h and Xmd.h simultaneously. 2006-03-31 22:52:14 -08:00
Jamey Sharp
f25b4b00e1 Move .cvsignore to .gitignore. 2006-02-19 12:28:41 -08:00
Jamey Sharp
c7cda56eeb Land XCB support on X.org HEAD. 2006-02-19 11:49:15 -08:00
Kean Johnson
6bb0c3796b See ChangeLog entry 2005-11-07 for details. 2005-11-08 06:33:25 +00:00
Kevin E Martin
dd7a9cdecd Modify modular libs to use Xregion.h instead of region.h 2005-07-23 18:09:39 +00:00
Kevin E Martin
6d635a88d9 lib/Xrender/Picture.c Change region.h to Xregion.h and modify internal references to include <X11/Xregion.h>. 2005-07-23 18:06:16 +00:00
Keith Packard
19ba9d0df8 Clean up .cvsignore files 2005-07-09 06:01:49 +00:00
Keith Packard
afdae2e8cc Create and use XlibConf.h to match modular build which needs XTHREADS defined when building extensions 2005-07-08 07:11:56 +00:00
Keith Packard
86fa88dc59 Create and install XlibConf.h to provide external users of Xlibint.h the defines necessary to correctly use the library. Xlibint.h should #include this new file.
Add a bunch of .cvsignore files
2005-07-08 06:57:06 +00:00
Daniel Stone
8c7677138e Add Xtrans definitions (FONT_t, TRANS_CLIENT) to clean up warnings.
Add XSERV_t, TRANS_SERVER, TRANS_REOPEN to quash warnings.
Add #include <dix-config.h> or <xorg-config.h>, as appropriate, to all source files in the xserver/xorg tree, predicated on defines of HAVE_{DIX,XORG}_CONFIG_H. Change all Xfont includes to <X11/fonts/foo.h>.
2005-07-03 07:00:55 +00:00
Daniel Stone
9a895777e3 Typo in ImUtil.h commit -- I AM CAPTAIN SKILL. 2005-06-15 13:37:43 +00:00
Daniel Stone
845dfc6b42 Move ImUtil.h from src/ to include/X11/. Additionally, copy Cmap.h as a distribution file. 2005-06-15 13:27:48 +00:00
Egbert Eich
46e8d8a654 gcc4 allows to check if sentinels are correct (a sentinel is the terminating element in a varargs list). A sentinel needs to be NULL, not 0 - which doesn't make a difference on 32bit but matters on 64bit. Furthermore it can be told that functions have a printf-like format string and argument list so that they can verify that both match. To use these features certain attributes need to be set - which are compiler specific. To do this we define macros which are expanded depending on the compiler version. For now we put those in include/Xfuncproto.h (the XFree86 DDX layer contains a file compiler.h which however is not visible outside the DDX) (Bugzilla #3268). 2005-05-17 08:10:10 +00:00
Søren Sandmann Pedersen
7eee605e3a - For now put xtrans in X11/Xtrans/X11, since libX11 is looking for it in <X11/...>
- For Xcomposite and Xdamage, don't link the build system out of the xc tree
- Link the public X11 headers into their own directory
- Add links to XKeysymDB and XErrorDB
- Add links to all the Xlib man pages
- Add links to the lcUniConv subdirectory
- Conditionally include config.h in Xlib source
2005-05-13 22:53:36 +00:00
Jim Gettys
d5e7ab1941 fix comment to indicate additional possible mode. i bug 1756 reported by Owen Taylor. 2004-12-02 16:18:16 +00:00
Egbert Eich
2d3afb68a1 Fixed some lockups in XIM code when the application is running with multi thread support. These lockups occur deep down in XFilterEvents() which itself locks when another Xlib function gets called that also locks. This fixes two instances by separating those Xlib functions into an internal (non-locking) call and a locking wrapper that is used as an external function. There may be several other such instances therefore another more general patch is eventually required (Bugzilla #1182). 2004-08-31 11:37:03 +00:00
Kevin E Martin
e689746c8d Fix header file to #ifdef the XKB keysyms when they are used. This fixes the X test suite build failure. 2004-08-19 06:48:06 +00:00
Egbert Eich
c6349f4319 Merging XORG-CURRENT into trunk 2004-04-23 18:42:09 +00:00
Kaleb Keithley
c3c4ddc682 Initial revision 2003-11-25 19:28:07 +00:00
Kaleb Keithley
deae12c6b6 R6.6 is the Xorg base-line 2003-11-14 15:54:30 +00:00