Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(938)

Issue 176190044: IMdkit: Track window property offsets correctly (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 11 months ago by fujiwara
Modified:
9 years, 10 months ago
Reviewers:
shawn.p.huang, Peng
CC:
shawn.p.huang_gmail.com, klemensbaum_gmail.com
Base URL:
git@github.com:ibus/ibus.git@master
Visibility:
Public.

Description

IMdkit: Track window property offsets correctly The XIM specification requires that XIM tranports over 20 bytes in size be transferred via window properties. The sender calls XChangeProperty with PropModeAppend, and instructs the recipient via ClientMessage to call XGetWindowProperty with delete set to True. Naive implementations exhibit a race condition because the receiver could have written more data in the meantime, and XGetWindowProperty only deletes the property when bytes_after_return is zero. If bytes_after_return is non-zero, it is necessary to use an offset when reading from the property again. To ensure that the property data does not grow indefinitely, Xlib recycles 21 Atoms in round-robin fashion. Because the XIM specification does not limit the number of Atom names of the form "_clientXXX" to be used for data transfer over window properties, an XIM server should be able to keep of track any number of Atoms, remembering the offset into each property. This patch implements correct tracking of property offsets. Signed-off-by: Klemens Baum <klemensbaum@gmail.com> Reviewed-by: Keith Packard <keithp@keithp.com> rhbz#1175595 BUG=https://code.google.com/p/ibus/issues/detail?id=1751 TEST=client/x11/ibus-x11

Patch Set 1 #

Patch Set 2 : Updated with the latest master. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+154 lines, -45 lines) Patch
M util/IMdkit/Makefile.am View 2 chunks +3 lines, -2 lines 0 comments Download
M util/IMdkit/Xi18n.h View 4 chunks +19 lines, -4 lines 0 comments Download
A util/IMdkit/i18nOffsetCache.c View 1 chunk +89 lines, -0 lines 0 comments Download
M util/IMdkit/i18nUtil.c View 3 chunks +6 lines, -3 lines 0 comments Download
M util/IMdkit/i18nX.c View 6 chunks +37 lines, -36 lines 0 comments Download

Messages

Total messages: 5
fujiwara
9 years, 11 months ago (2014-12-01 09:34:43 UTC) #1
fujiwara
LGTM. I asked: > The saving offset in_Xi18nSetPropertyOffset() does not depend on the value of ...
9 years, 11 months ago (2014-12-10 04:46:44 UTC) #2
Peng
On 2014/12/10 04:46:44, fujiwara wrote: > LGTM. > > I asked: > > The saving ...
9 years, 11 months ago (2014-12-12 02:42:08 UTC) #3
fujiwara
https://bugzilla.redhat.com/show_bug.cgi?id=1175595 is also reported and the user confirmed this patch fixes the problem.
9 years, 11 months ago (2014-12-18 07:22:33 UTC) #4
fujiwara
9 years, 10 months ago (2015-01-06 06:49:14 UTC) #5
Message was sent while issue was closed.
WRT your question, as to why XGetWindowProperty removes data when
bytes_after_return is zero and delete is set, this is actually documented in the
man page of XGetWindowProperty():

 | If delete is True and bytes_after_return is zero, XGetWindowProp-
 | erty deletes the property from the window and generates a Proper-
 | tyNotify event on the window.

Properties are stored in the Server, not in the clients, therefore the code that
actually removes the property is not to be found in libX11 but in the Xserver
itself, in ProcGetProperty() from dix/property.c:

http://opengrok.brq.redhat.com/source/xref/RHEL-6/xorg-x11-server/1.15.0/22.e...
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b