Commit graph

59 commits

Author SHA1 Message Date
Peter Hutterer
ba8a7a1916 Switch GetEmptyReq and GetResReq to call _XGetRequest
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-11-08 07:24:07 +10:00
Peter Hutterer
4a060f993b Add _XGetRequest as substitute for GetReq/GetReqExtra
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-11-08 07:24:07 +10:00
Bodo Graumann
50e1537933 libX11: Fixing modifier key range in Xutil.h (Bug #21910)
IsModifierKey, defined in include/X11/Xutil.h, is a macro determining,
which keys are regarded as modifiers. The constants ISO_Level5_Shift,
ISO_Level5_Latch and ISO_Level5_Lock where excluded previously, leaving
some Neo2 modifiers functionless in combination with compose.
This patch adjusts the range to include the correct, full range of
modifier constants.

Neo2 Bug 277 <http://wiki.neo-layout.org/ticket/277>

X.Org Bug 21910 <http://bugs.freedesktop.org/show_bug.cgi?id=21910>

Signed-off-by: Bodo Graumann <mail@bodograumann.de>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-11 19:06:38 +01:00
Jeremy Huddleston
f2651e03f3 Mark XKeycodeToKeysym as _X_DEPRECATED
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-10 14:09:17 -07:00
Alan Coopersmith
0ee6d8247d Fix man page and comment references to use XFreeModifiermap (lowercase map)
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-05-17 20:49:59 -07:00
Jeremy Huddleston
ae39d82b01 Silence clang static analysis warnings for SetReqLen
This provides a simplified version of the SetReqLen macro when using clang for
static analysis.  Prior to this change, we would see many Idempotent operation
warnings inside this macro due to the common case of calling with arg2 and
arg3 being the same variable.  This has no effect on code produced during
compilation, but it silences a number of false positives in static analysis.

XIPassiveGrab.c:170:5: warning: Assigned value is always the same as the existing value
    SetReqLen(req, num_modifiers, num_modifiers);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from XIPassiveGrab.c:26:
.../include/X11/Xlibint.h:580:8: note: instantiated from:
            n = badlen; \
              ^

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-08 09:08:07 -07:00
Jeremy Huddleston
626e5e34be Annotate _XIOError as _X_NORETURN
Found-by: clang static analyzer
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-04 11:21:41 -07:00
Jeremy Huddleston
d3d7896408 clang analyzer: Don't warn about Xmalloc(0)
This will prevent a number of false positives in where clang's
static analysis reports about calls to malloc(0).

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-03 09:32:53 -07:00
Alan Coopersmith
d2714d65e8 Revert "Mark atom names argument to XInternAtoms as const"
This reverts commit c870111546.

The constification of a pointer to a pointer caused unexpected issues,
and xorg-devel was unable to come up with a clean, safe, reasonable way
to handle them, so we're chalking this up for now as yet another mistake
in the Xlib API definition we'll be living with.

See https://bugs.freedesktop.org/show_bug.cgi?id=32098 for details.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-12-21 18:51:17 -08:00
Alan Coopersmith
c870111546 Mark atom names argument to XInternAtoms as const
Updates code & docs for XInternAtoms.

The single atom name argument to XInternAtom was already const char *
in the code, but not the docs, so updated it in the docs too.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-24 15:23:27 -08:00
Jeremy Huddleston
d0cbf38891 Add an "X11_" string to header guards to avoid possible collision
This addresses a build failure which can result from <X11/Xlocale.h> and
<xlocale.h> being included in the same code since they both used the same
_XLOCALE_H_ protection.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-09-26 21:21:16 -07:00
Adam Jackson
10dd881e78 Zero buffer data in BufAlloc()
Inspired by a pattern in NoMachine's NX.  Consistently zeroed buffers
compress better with ssh and friends.  Note that you'll need to rebuild
all your protocol libraries to take advantage of this.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-09-14 00:42:07 -07:00
Fernando Carrijo
6de368c9aa Purge macros NEED_EVENTS and NEED_REPLIES
Signed-off-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-07-07 15:12:34 -07:00
Josh Triplett
15e5eaf628 Remove support for building without XCB
And there was much rejoicing.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>

Consensus on #xorg-devel agrees with removing --without-xcb; in
particular, acks from Adam Jackson, Daniel Stone, Kristian Høgsberg,
Julien Cristau, and Rémi Cardona.
2010-06-03 22:19:14 -07:00
Jeremy Huddleston
d232b259c3 Fix various build warnings
imLcIm.c: In function '_XimCachedFileName':
imLcIm.c:361: warning: format '%03x' expects type 'unsigned int', but argument 8 has type 'long unsigned int'
imLcIm.c:364: warning: format '%03x' expects type 'unsigned int', but argument 8 has type 'long unsigned int'

imRm.c: In function '_XimDefaultArea':
imRm.c:597: warning: cast from pointer to integer of different size
imRm.c: In function '_XimDefaultColormap':
imRm.c:626: warning: cast from pointer to integer of different size

lcFile.c:224: warning: no previous prototype for 'xlocaledir'

lcUTF8.c: In function 'iconv_cstombs':
lcUTF8.c:1841: warning: assignment discards qualifiers from pointer target type
lcUTF8.c:1869: warning: pointer targets in passing argument 1 of 'wctomb' differ in signedness
lcUTF8.c:1873: warning: pointer targets in passing argument 1 of 'wctomb' differ in signedness
lcUTF8.c: In function 'iconv_mbstocs':
lcUTF8.c:1935: warning: pointer targets in passing argument 2 of 'mbtowc' differ in signedness
lcUTF8.c: In function 'iconv_mbtocs':
lcUTF8.c:2031: warning: pointer targets in passing argument 2 of 'mbtowc' differ in signedness
lcUTF8.c: In function 'iconv_mbstostr':
lcUTF8.c:2121: warning: pointer targets in passing argument 2 of 'mbtowc' differ in signedness
lcUTF8.c: In function 'iconv_strtombs':
lcUTF8.c:2180: warning: pointer targets in passing argument 1 of 'wctomb' differ in signedness
lcUTF8.c: In function '_XlcAddGB18030LocaleConverters':
lcUTF8.c:2367: warning: passing argument 5 of '_XlcSetConverter' from incompatible pointer type
lcUTF8.c:2368: warning: passing argument 5 of '_XlcSetConverter' from incompatible pointer type
lcUTF8.c:2373: warning: passing argument 5 of '_XlcSetConverter' from incompatible pointer type
lcUTF8.c:2374: warning: passing argument 5 of '_XlcSetConverter' from incompatible pointer type
lcUTF8.c:2375: warning: passing argument 5 of '_XlcSetConverter' from incompatible pointer type
lcUTF8.c:2376: warning: passing argument 5 of '_XlcSetConverter' from incompatible pointer type
lcUTF8.c:2377: warning: passing argument 5 of '_XlcSetConverter' from incompatible pointer type

XlibInt.c: In function '_XGetHostname':
XlibInt.c:3441: warning: implicit declaration of function 'gethostname'
XlibInt.c:3441: warning: nested extern declaration of 'gethostname'

ConnDis.c: In function '_XDisconnectDisplay':
ConnDis.c:540: warning: old-style function definition
ConnDis.c: In function '_XSendClientPrefix':
ConnDis.c:554: warning: old-style function definition
ConnDis.c: In function 'XSetAuthorization':
ConnDis.c:677: warning: old-style function definition

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-23 15:52:51 -07:00
Alan Coopersmith
ddb1786720 Purge CVS/RCS id tags
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2010-01-14 17:38:26 -08:00
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