diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-10-19 22:15:01 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-10-19 22:15:01 +0200 |
commit | 70ac75f4ab184c21d11b9840a47362610aaef481 (patch) | |
tree | 183b9ec7e6897fb2cea7296b461a35ca93dfce6e /nx-X11/lib/X11/imTrans.c | |
parent | 6c303d9e4ffd162b8c7f59a4b135e592d923a656 (diff) | |
parent | 70e9d346fe34af127d2c827c3678e53d0f4312ae (diff) | |
download | nx-libs-70ac75f4ab184c21d11b9840a47362610aaef481.tar.gz nx-libs-70ac75f4ab184c21d11b9840a47362610aaef481.tar.bz2 nx-libs-70ac75f4ab184c21d11b9840a47362610aaef481.zip |
Merge branch 'uli42-pr/libX11_further_backports' into 3.6.x
Attributes GH PR #222: https://github.com/ArcticaProject/nx-libs/pull/222
Diffstat (limited to 'nx-X11/lib/X11/imTrans.c')
-rw-r--r-- | nx-X11/lib/X11/imTrans.c | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/nx-X11/lib/X11/imTrans.c b/nx-X11/lib/X11/imTrans.c index 0fdc8cd9a..7f936cff6 100644 --- a/nx-X11/lib/X11/imTrans.c +++ b/nx-X11/lib/X11/imTrans.c @@ -1,5 +1,5 @@ /* - * Copyright 1992 Sun Microsystems, Inc. All rights reserved. + * Copyright 1992 Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -72,7 +72,7 @@ PERFORMANCE OF THIS SOFTWARE. #endif -Private Bool +static Bool _XimTransConnect( Xim im) { @@ -122,7 +122,7 @@ _XimTransConnect( } -Private Bool +static Bool _XimTransShutdown( Xim im) { @@ -142,7 +142,7 @@ _XimTransShutdown( -Public Bool +Bool _XimTransRegisterDispatcher( Xim im, Bool (*callback)( @@ -153,7 +153,7 @@ _XimTransRegisterDispatcher( TransSpecRec *spec = (TransSpecRec *)im->private.proto.spec; TransIntrCallbackPtr rec; - if (!(rec = (TransIntrCallbackPtr)Xmalloc(sizeof(TransIntrCallbackRec)))) + if (!(rec = Xmalloc(sizeof(TransIntrCallbackRec)))) return False; rec->func = callback; @@ -164,7 +164,7 @@ _XimTransRegisterDispatcher( } -Public void +void _XimFreeTransIntrCallback( Xim im) { @@ -180,7 +180,7 @@ _XimFreeTransIntrCallback( } -Public Bool +Bool _XimTransCallDispatcher(Xim im, INT16 len, XPointer data) { TransSpecRec *spec = (TransSpecRec *)im->private.proto.spec; @@ -194,7 +194,7 @@ _XimTransCallDispatcher(Xim im, INT16 len, XPointer data) } -Public Bool +Bool _XimTransFilterWaitEvent( Display *d, Window w, @@ -209,7 +209,7 @@ _XimTransFilterWaitEvent( } -Public void +void _XimTransInternalConnection( Display *d, int fd, @@ -222,12 +222,20 @@ _XimTransInternalConnection( if (spec->is_putback) return; + + bzero(&ev, sizeof(ev)); /* FIXME: other fields may be accessed, too. */ kev = (XKeyEvent *)&ev; kev->type = KeyPress; kev->send_event = False; kev->display = im->core.display; kev->window = spec->window; kev->keycode = 0; + kev->time = 0L; + kev->serial = LastKnownRequestProcessed(im->core.display); +#if 0 + fprintf(stderr,"%s,%d: putback FIXED kev->time=0 kev->serial=%lu\n", __FILE__, __LINE__, kev->serial); +#endif + XPutBackEvent(im->core.display, &ev); XFlush(im->core.display); spec->is_putback = True; @@ -235,7 +243,7 @@ _XimTransInternalConnection( } -Public Bool +Bool _XimTransWrite(Xim im, INT16 len, XPointer data) { TransSpecRec *spec = (TransSpecRec *)im->private.proto.spec; @@ -252,7 +260,7 @@ _XimTransWrite(Xim im, INT16 len, XPointer data) } -Public Bool +Bool _XimTransRead( Xim im, XPointer recv_buf, @@ -273,7 +281,7 @@ _XimTransRead( } -Public void +void _XimTransFlush( Xim im) { @@ -282,7 +290,7 @@ _XimTransFlush( -Public Bool +Bool _XimTransConf( Xim im, char *address) @@ -290,17 +298,14 @@ _XimTransConf( char *paddr; TransSpecRec *spec; - if (!(paddr = (char *)Xmalloc(strlen(address) + 1))) + if (!(paddr = strdup(address))) return False; - if (!(spec = (TransSpecRec *) Xmalloc(sizeof(TransSpecRec)))) { + if (!(spec = Xcalloc(1, sizeof(TransSpecRec)))) { Xfree(paddr); return False; } - bzero(spec, sizeof(TransSpecRec)); - - (void)strcpy(paddr, address); spec->address = paddr; im->private.proto.spec = (XPointer)spec; |