Browse Source

libX11 package update

Signed-off-by: guibuilder_pel7x64builder0 <guibuilder@powerel.org>
master
guibuilder_pel7x64builder0 4 years ago
parent
commit
a9d9ca348a
  1. 56
      SOURCES/0001-_XDefaultIOError-Reformat-to-be-less-ugly.patch
  2. 79
      SOURCES/0002-_XDefaultIOError-Do-better-at-detecting-explicit-shu.patch
  3. 53
      SOURCES/dont-forward-keycode-0.patch
  4. 15
      SPECS/libX11.spec

56
SOURCES/0001-_XDefaultIOError-Reformat-to-be-less-ugly.patch

@ -0,0 +1,56 @@ @@ -0,0 +1,56 @@
From 6d2cde9633b5ee020cb60caea1cf61e090b86dd2 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Fri, 24 Mar 2017 11:07:35 -0400
Subject: [PATCH 1/2] _XDefaultIOError: Reformat to be less ugly

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
---
src/XlibInt.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/XlibInt.c b/src/XlibInt.c
index 73afe024..903e47f3 100644
--- a/src/XlibInt.c
+++ b/src/XlibInt.c
@@ -1243,24 +1243,24 @@ _X_NORETURN int _XDefaultIOError(
Display *dpy)
{
if (ECHECK(EPIPE)) {
- (void) fprintf (stderr,
- "X connection to %s broken (explicit kill or server shutdown).\r\n",
- DisplayString (dpy));
+ fprintf (stderr,
+ "X connection to %s broken (explicit kill or server shutdown).\r\n",
+ DisplayString (dpy));
} else {
- (void) fprintf (stderr,
- "XIO: fatal IO error %d (%s) on X server \"%s\"\r\n",
+ fprintf (stderr,
+ "XIO: fatal IO error %d (%s) on X server \"%s\"\r\n",
#ifdef WIN32
- WSAGetLastError(), strerror(WSAGetLastError()),
+ WSAGetLastError(), strerror(WSAGetLastError()),
#else
- errno, strerror (errno),
+ errno, strerror (errno),
#endif
- DisplayString (dpy));
- (void) fprintf (stderr,
- " after %lu requests (%lu known processed) with %d events remaining.\r\n",
- NextRequest(dpy) - 1, LastKnownRequestProcessed(dpy),
- QLength(dpy));
+ DisplayString (dpy));
+ fprintf (stderr,
+ " after %lu requests (%lu known processed) with %d events remaining.\r\n",
+ NextRequest(dpy) - 1, LastKnownRequestProcessed(dpy),
+ QLength(dpy));
+ }
- }
exit(1);
/*NOTREACHED*/
}
--
2.21.0

79
SOURCES/0002-_XDefaultIOError-Do-better-at-detecting-explicit-shu.patch

@ -0,0 +1,79 @@ @@ -0,0 +1,79 @@
From 5538b3e4ae6dee32c47db9dfc85b07bbe7b90f6c Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Fri, 24 Mar 2017 11:07:36 -0400
Subject: [PATCH 2/2] _XDefaultIOError: Do better at detecting explicit
shutdown

Currently, when the X server crashes or a client is disconnected with
XKillClient, you get a somewhat confusing error message from libX11
along the lines of:

XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
after 98 requests (40 known processed) with 0 events remaining.

What's happening here is the previous recvmsg has thrown EAGAIN, since
the socket is non-blocking. In this case, check whether the socket has
any more data to read, and if not treat it like EPIPE.

Signed-off-by: Adam Jackson <ajax@redhat.com>
---
src/XlibInt.c | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/src/XlibInt.c b/src/XlibInt.c
index 903e47f3..dd39445b 100644
--- a/src/XlibInt.c
+++ b/src/XlibInt.c
@@ -50,6 +50,8 @@ from The Open Group.
#ifdef XTHREADS
#include "locking.h"
+#include <sys/ioctl.h>
+
/* these pointers get initialized by XInitThreads */
LockInfoPtr _Xglobal_lock = NULL;
void (*_XCreateMutex_fn)(LockInfoPtr) = NULL;
@@ -1234,6 +1236,21 @@ _XWireToEvent(
return(True);
}
+static int
+SocketBytesReadable(Display *dpy)
+{
+ int bytes = 0, last_error;
+#ifdef WIN32
+ last_error = WSAGetLastError();
+ ioctlsocket(ConnectionNumber(dpy), FIONREAD, &bytes);
+ WSASetLastError(last_error);
+#else
+ last_error = errno;
+ ioctl(ConnectionNumber(dpy), FIONREAD, &bytes);
+ errno = last_error;
+#endif
+ return bytes;
+}
/*
* _XDefaultIOError - Default fatal system error reporting routine. Called
@@ -1242,7 +1259,17 @@ _XWireToEvent(
_X_NORETURN int _XDefaultIOError(
Display *dpy)
{
- if (ECHECK(EPIPE)) {
+ int killed = ECHECK(EPIPE);
+
+ /*
+ * If the socket was closed on the far end, the final recvmsg in
+ * xcb will have thrown EAGAIN because we're non-blocking. Detect
+ * this to get the more informative error message.
+ */
+ if (ECHECK(EAGAIN) && SocketBytesReadable(dpy) <= 0)
+ killed = True;
+
+ if (killed) {
fprintf (stderr,
"X connection to %s broken (explicit kill or server shutdown).\r\n",
DisplayString (dpy));
--
2.21.0

53
SOURCES/dont-forward-keycode-0.patch

@ -0,0 +1,53 @@ @@ -0,0 +1,53 @@
diff -up libX11-1.6.3/modules/im/ximcp/imDefFlt.c.jx libX11-1.6.3/modules/im/ximcp/imDefFlt.c
--- libX11-1.6.3/modules/im/ximcp/imDefFlt.c.jx 2015-03-09 18:28:45.000000000 -0400
+++ libX11-1.6.3/modules/im/ximcp/imDefFlt.c 2015-03-10 12:32:31.912149644 -0400
@@ -142,7 +142,7 @@ _XimProtoKeypressFilter(
{
Xim im = (Xim)ic->core.im;
- if (IS_FABRICATED(im)) {
+ if ((ev->keycode == 0) || IS_FABRICATED(im)) {
_XimPendingFilter(ic);
UNMARK_FABRICATED(im);
return NOTFILTERD;
diff -up libX11-1.6.3/modules/im/ximcp/imDefLkup.c.jx libX11-1.6.3/modules/im/ximcp/imDefLkup.c
--- libX11-1.6.3/modules/im/ximcp/imDefLkup.c.jx 2015-03-09 18:28:45.000000000 -0400
+++ libX11-1.6.3/modules/im/ximcp/imDefLkup.c 2015-03-10 12:32:31.911149637 -0400
@@ -332,6 +332,17 @@ _XimForwardEvent(
XEvent *ev,
Bool sync)
{
+ /*
+ * Don't forward a key event which has keycode=0.
+ * keycode=0 is reserved for special purpose to let Xmb/wcLookupString()
+ * functions know that there is a commited string available from IM.
+ */
+ if (((ev->type == KeyPress) || (ev->type == KeyRelease))) {
+ if (((XKeyEvent *)ev)->keycode == 0) {
+ return True;
+ }
+ }
+
#ifdef EXT_FORWARD
if (((ev->type == KeyPress) || (ev->type == KeyRelease)))
if (_XimExtForwardKeyEvent(ic, (XKeyEvent *)ev, sync))
@@ -604,6 +615,19 @@ _XimUnregCommitInfo(
Xfree(info->keysym);
ic->private.proto.commit_info = info->next;
Xfree(info);
+
+ /*
+ * "Commit" uses fabricated flag to process a commited string
+ * from IM engine.
+ * Turn off the fabricated flag here (unregister the commited
+ * information function). Otherwise, next regular key press
+ * event will be ignored at _XimProtoKeypressFilter() and it
+ * will not be passed to IM engine.
+ */
+ if (IS_FABRICATED(ic)) {
+ UNMARK_FABRICATED(ic);
+ }
+
return;
}

15
SPECS/libX11.spec

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@

Summary: Core X11 protocol client library
Name: libX11
Version: 1.6.5
Version: 1.6.7
Release: 2%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
License: MIT
Group: System Environment/Libraries
@ -19,6 +19,8 @@ Source0: https://xorg.freedesktop.org/archive/individual/lib/%{name}-%{version}. @@ -19,6 +19,8 @@ Source0: https://xorg.freedesktop.org/archive/individual/lib/%{name}-%{version}.
%endif

Patch2: dont-forward-keycode-0.patch
Patch3: 0001-_XDefaultIOError-Reformat-to-be-less-ugly.patch
Patch4: 0002-_XDefaultIOError-Do-better-at-detecting-explicit-shu.patch

BuildRequires: xorg-x11-util-macros >= 1.11
BuildRequires: pkgconfig(xproto) >= 7.0.15
@ -52,6 +54,8 @@ X.Org X11 libX11 development package @@ -52,6 +54,8 @@ X.Org X11 libX11 development package
%prep
%setup -q -n %{tarball}-%{?gitdate:%{gitdate}}%{!?gitdate:%{version}}
%patch2 -p1 -b .dont-forward-keycode-0
%patch3 -p1 -b .reformat
%patch4 -p1 -b .shutdown

%build
autoreconf -v --install --force
@ -111,6 +115,15 @@ rm -rf $RPM_BUILD_ROOT @@ -111,6 +115,15 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man5/*.5*

%changelog
* Tue May 28 2019 Adam Jackson <ajax@redhat.com> - 1.6.7-2
- Restore the less-alarming server-disconnect message

* Mon Apr 15 2019 Adam Jackson <ajax@redhat.com> - 1.6.7-1
- libX11 1.6.7

* Fri Mar 01 2019 Adam Jackson <ajax@redhat.com> - 1.6.5-3
- Make the server-disconnect message less alarming

* Thu Jul 12 2018 Peter Hutterer <peter.hutterer@redhat.com> 1.6.5-2
- Rebuild to pick up new xproto keysyms (#1600147)


Loading…
Cancel
Save