From 3644239ecd171fff59f960b78d0c4d403ac221e5 Mon Sep 17 00:00:00 2001 From: Roland Grunberg Date: Nov 03 2015 18:58:45 +0000 Subject: Fix "Workspace chooser won't launch" on Wayland. - Resolves: rhbz#1277594 --- diff --git a/eclipse-bug-480986.patch b/eclipse-bug-480986.patch new file mode 100644 index 0000000..3010334 --- /dev/null +++ b/eclipse-bug-480986.patch @@ -0,0 +1,47 @@ +From 531d3f18481988494e77b5f1ded92a7f346ea14d Mon Sep 17 00:00:00 2001 +From: Eric Williams +Date: Wed, 28 Oct 2015 10:52:36 -0400 +Subject: Bug 480986: [Wayland] Workspace chooser won't launch + +gtk_size_allocate() in Shell is called more often on Wayland. These +additional and unexpected calls trigger an infinite recursive call to +resizeBounds(), which causes non-resizable Shells/Dialogs to crash. + +The fix is to only resize Shells that have the SWT.RESIZE attribute +enabled. + +Tested on Gtk3.16 on Wayland, Gtk3.16 on X, and Gtk2.24. AllNonBrowser +JUnit test cases pass on Gtk3 running X. There are some irregularities +with test cases on Wayland, as outlined in bug 480893. + +Change-Id: I55612d8486cdd512e275a8a7456e0197ed717c75 +Signed-off-by: Eric Williams +--- + .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java +index d65af5c..49ae036 100644 +--- eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java ++++ eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java +@@ -1528,10 +1528,15 @@ long /*int*/ gtk_size_allocate (long /*int*/ widget, long /*int*/ allocation) { + OS.gtk_widget_get_allocation (shellHandle, widgetAllocation); + int width = widgetAllocation.width; + int height = widgetAllocation.height; +- if (!resized || oldWidth != width || oldHeight != height) { ++ ++ // Bug 474235: on Wayland gtk_size_allocate() is called more frequently, causing an ++ // infinitely recursive resize call. This causes non-resizable Shells/Dialogs to ++ // crash. Fix: only call resizeBounds() on resizable Shells. ++ if ((!resized || oldWidth != width || oldHeight != height) ++ && (OS.GTK3 && !OS.isX11() ? ((style & SWT.RESIZE) != 0) : true)) { //Wayland + oldWidth = width; + oldHeight = height; +- resizeBounds (width, height, true); ++ resizeBounds (width, height, true); //this is called to resize child widgets when the shell is resized. + } + return 0; + } +-- +cgit v0.11.2-4-g4a35 + diff --git a/eclipse.spec b/eclipse.spec index facfcb2..1d23419 100644 --- a/eclipse.spec +++ b/eclipse.spec @@ -49,7 +49,7 @@ Epoch: 1 Summary: An open, extensible IDE Name: eclipse Version: %{eclipse_version} -Release: 3%{?dist} +Release: 4%{?dist} License: EPL URL: http://www.eclipse.org/ @@ -136,6 +136,7 @@ Patch24: %{pkg_name}-fix-tests.patch Patch25: %{pkg_name}-adjust-droplets.patch Patch26: eclipse-editor-scrolling-fix.patch +Patch27: %{pkg_name}-bug-480986.patch BuildRequires: rsync BuildRequires: make, gcc @@ -385,6 +386,7 @@ popd %patch24 %patch25 %patch26 -p1 +%patch27 # Resolving the target platform requires too many changes, so don't use it %pom_xpath_remove "pom:configuration/pom:target" eclipse-platform-parent @@ -1121,6 +1123,10 @@ fi %{_libdir}/%{pkg_name}/plugins/org.eclipse.osgi.compatibility.state_* %changelog +* Tue Nov 03 2015 Roland Grunberg - 1:4.5.1-4 +- Fix "Workspace chooser won't launch" on Wayland. +- Resolves: rhbz#1277594 + * Mon Nov 2 2015 Mikolaj Izdebski - 1:4.5.1-3 - Rebuild for new eclipse-ecf