From c45c586b4e22b6dae2b5edb6912636e9f64be753 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Fri, 23 Oct 2015 11:12:22 -0400 Subject: [PATCH] fix X11 hangs with patches from upstream bug 16497 --- ...-Disable-backing-store-in-X11-window.patch | 26 +++++++++++++++++ ...otify-event-while-intializing-window.patch | 29 +++++++++++++++++++ R.spec | 9 +++++- 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 0001-Disable-backing-store-in-X11-window.patch create mode 100644 0001-Wait-for-MapNotify-event-while-intializing-window.patch diff --git a/0001-Disable-backing-store-in-X11-window.patch b/0001-Disable-backing-store-in-X11-window.patch new file mode 100644 index 0000000..7989daf --- /dev/null +++ b/0001-Disable-backing-store-in-X11-window.patch @@ -0,0 +1,26 @@ +From bf674ad00579d76d5ade415ee08c62fa4a652f96 Mon Sep 17 00:00:00 2001 +From: Siteshwar Vashisht +Date: Thu, 17 Sep 2015 10:13:24 -0400 +Subject: [PATCH] Disable backing store in X11 window + +Xorg server will not generate Expose events if backing store is enabled. Since implementation of this X11 module relies on Expose events, we should explicitly disable backing store in X11 window. +--- + src/modules/X11/devX11.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/src/modules/X11/devX11.c b/src/modules/X11/devX11.c +index b714f1a..143441f 100644 +--- a/src/modules/X11/devX11.c ++++ b/src/modules/X11/devX11.c +@@ -1477,7 +1477,7 @@ X11_Open(pDevDesc dd, pX11Desc xd, const char *dsp, + memset(&attributes, 0, sizeof(attributes)); + attributes.background_pixel = whitepixel; + attributes.border_pixel = blackpixel; +- attributes.backing_store = Always; ++ attributes.backing_store = NotUseful; + attributes.event_mask = ButtonPressMask + | ButtonMotionMask + | PointerMotionHintMask +-- +1.7.1 + diff --git a/0001-Wait-for-MapNotify-event-while-intializing-window.patch b/0001-Wait-for-MapNotify-event-while-intializing-window.patch new file mode 100644 index 0000000..fc5c8ce --- /dev/null +++ b/0001-Wait-for-MapNotify-event-while-intializing-window.patch @@ -0,0 +1,29 @@ +From 1d2f8f70375b5d34ec7485833e20f5b78ed135ed Mon Sep 17 00:00:00 2001 +From: Siteshwar Vashisht +Date: Thu, 17 Sep 2015 08:55:55 -0400 +Subject: [PATCH] Wait for MapNotify event while intializing window + +--- + src/modules/X11/devX11.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/modules/X11/devX11.c b/src/modules/X11/devX11.c +index c2eab80..b714f1a 100644 +--- a/src/modules/X11/devX11.c ++++ b/src/modules/X11/devX11.c +@@ -1698,10 +1698,10 @@ X11_Open(pDevDesc dd, pX11Desc xd, const char *dsp, + XMapWindow(display, xd->window); + XSync(display, 0); + +- /* Gobble expose events */ ++ /* Gobble MapNotify events */ + + while ( XPeekEvent(display, &event), +- !XCheckTypedEvent(display, Expose, &event)) ++ !XCheckTypedEvent(display, MapNotify, &event)) + ; + /* XNextEvent(display, &event); + if (event.xany.type == Expose) { +-- +1.7.1 + diff --git a/R.spec b/R.spec index 80b7925..26ea052 100644 --- a/R.spec +++ b/R.spec @@ -51,12 +51,14 @@ Name: R Version: 3.2.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A language for data analysis and graphics URL: http://www.r-project.org Source0: ftp://cran.r-project.org/pub/R/src/base/R-3/R-%{version}.tar.gz Source1: macros.R Source2: R-make-search-index.sh +Patch0: 0001-Disable-backing-store-in-X11-window.patch +Patch1: 0001-Wait-for-MapNotify-event-while-intializing-window.patch License: GPLv2+ Group: Applications/Engineering BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -325,6 +327,8 @@ from the R project. This package provides the static libRmath library. %prep %setup -q +%patch0 -p1 -b .disable-backing-store +%patch1 -p1 -b .wait-for-map-notify # Filter false positive provides. cat < %{name}-prov @@ -957,6 +961,9 @@ R CMD javareconf \ %postun -n libRmath -p /sbin/ldconfig %changelog +* Fri Oct 13 2015 Tom Callaway - 3.2.2-2 +- apply patches from upstream bug 16497 to fix X11 hangs + * Fri Aug 14 2015 Tom Callaway - 3.2.2-1 - update to 3.2.2