Add patch for editor scrolling problem, rhbz#1198217

This commit is contained in:
Mat Booth 2015-10-13 16:47:23 +01:00
parent ae86da2d2c
commit 03adf48477
3 changed files with 59 additions and 91 deletions

View File

@ -1,90 +0,0 @@
From a41f152c868984b41b73945f374966ad621c3e13 Mon Sep 17 00:00:00 2001
From: Snjezana Peco
Date: Thu, 21 May 2015 10:41:39 +0200
Subject: Bug 466499 - [GTK3] Path text not drawn in column of commit dialog
window
Change-Id: I508432a354314ca11839e03fbac7b5adc44fff3c
Signed-off-by: Snjezana Peco <snjeza.peco@gmail.com>
---
.../Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java | 3 ++-
.../Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java | 17 ++++-------------
2 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
index e49865b..9b904ad 100644
--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
+++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
@@ -2662,7 +2662,8 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
}
}
if (item != null) {
- if (OS.GTK_IS_CELL_RENDERER_TOGGLE (cell) || (OS.GTK_IS_CELL_RENDERER_PIXBUF (cell) && (columnIndex != 0 || (style & SWT.CHECK) == 0))) {
+ if (OS.GTK_IS_CELL_RENDERER_TOGGLE (cell) ||
+ ( (OS.GTK_IS_CELL_RENDERER_PIXBUF (cell) || OS.GTK_VERSION > OS.VERSION(3, 13, 0)) && (columnIndex != 0 || (style & SWT.CHECK) == 0))) {
drawFlags = (int)/*64*/flags;
drawState = SWT.FOREGROUND;
long /*int*/ [] ptr = new long /*int*/ [1];
diff --git a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
index 4d5448a..bc64152 100644
--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
+++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
@@ -2675,7 +2675,8 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
}
}
if (item != null) {
- if (OS.GTK_IS_CELL_RENDERER_TOGGLE (cell) || (OS.GTK_IS_CELL_RENDERER_PIXBUF (cell) && (columnIndex != 0 || (style & SWT.CHECK) == 0))) {
+ if (OS.GTK_IS_CELL_RENDERER_TOGGLE (cell) ||
+ ( (OS.GTK_IS_CELL_RENDERER_PIXBUF (cell) || OS.GTK_VERSION > OS.VERSION(3, 13, 0)) && (columnIndex != 0 || (style & SWT.CHECK) == 0))) {
drawFlags = (int)/*64*/flags;
drawState = SWT.FOREGROUND;
long /*int*/ [] ptr = new long /*int*/ [1];
@@ -2775,9 +2776,6 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
sendEvent (SWT.EraseItem, event);
drawForeground = null;
drawState = event.doit ? event.detail : 0;
- if (OS.GTK3 && OS.GTK_VERSION <= OS.VERSION(3, 14, 8)) {
- drawState |= SWT.FOREGROUND;
- }
drawFlags &= ~(OS.GTK_CELL_RENDERER_FOCUSED | OS.GTK_CELL_RENDERER_SELECTED);
if ((drawState & SWT.SELECTED) != 0) drawFlags |= OS.GTK_CELL_RENDERER_SELECTED;
if ((drawState & SWT.FOCUSED) != 0) drawFlags |= OS.GTK_CELL_RENDERER_FOCUSED;
@@ -2821,10 +2819,8 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
if (OS.GTK_IS_CELL_RENDERER_TEXT (cell)) {
if (hooks (SWT.PaintItem)) {
GdkRectangle rect = new GdkRectangle ();
- GdkRectangle clipRect = new GdkRectangle ();
long /*int*/ path = OS.gtk_tree_model_get_path (modelHandle, iter);
OS.gtk_tree_view_get_cell_area (handle, path, columnHandle, rect);
- OS.gtk_tree_view_get_background_area (handle, path, columnHandle, clipRect);
OS.gtk_tree_path_free (path);
// A workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=459117
if (cr != 0 && OS.GTK_VERSION > OS.VERSION(3, 9, 0) && OS.GTK_VERSION <= OS.VERSION(3, 14, 8)) {
@@ -2877,12 +2873,9 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
gc.setFont (item.getFont (columnIndex));
if ((style & SWT.MIRRORED) != 0) {
rect.x = getClientWidth () - rect.width - rect.x;
- clipRect.x = getClientWidth () - clipRect.width - clipRect.x;
}
- if (!OS.GTK3){
- gc.setClipping (clipRect.x, clipRect.y, clipRect.width, clipRect.height);
- }
+ gc.setClipping (rect.x, rect.y, rect.width, rect.height);
Event event = new Event ();
event.item = item;
@@ -2893,9 +2886,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
event.width = contentWidth [0];
event.height = rect.height;
event.detail = drawState;
- if (!OS.GTK3 || OS.GTK_VERSION > OS.VERSION(3, 14, 8)) {
- sendEvent (SWT.PaintItem, event);
- }
+ sendEvent(SWT.PaintItem, event);
gc.dispose();
}
}
--
cgit v0.11.2-4-g4a35

View File

@ -0,0 +1,47 @@
From 7db3fba25fe89240fa80661d81a5dffa2f31ff14 Mon Sep 17 00:00:00 2001
From: Alexander Kurtakov
Date: Mon, 12 Oct 2015 19:08:43 +0300
Subject: Bug 479580 - Widgets with V_SCROLL not scrollable
Hiding scrollbar for widget created with style V_SCROLL shouldn't stop
other means of scrolling e.g. mouse wheel.
The fix is to use new GTK_POLICY_EXTERNAL (added in GTK 3.16) which
allows scrolling when scrollbars invisible which was not the possible
before that.
Change-Id: Icffb3c7792458369a7a7ee07dc317d83bf0757b2
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
---
.../Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java | 1 +
.../Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java | 3 +++
2 files changed, 4 insertions(+)
diff --git a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index fe8283d..cf8cda6 100644
--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -363,6 +363,7 @@ public class OS extends C {
public static final int GTK_POLICY_ALWAYS = 0x0;
public static final int GTK_POLICY_AUTOMATIC = 0x1;
public static final int GTK_POLICY_NEVER = 0x2;
+ public static final int GTK_POLICY_EXTERNAL = 0x3;
public static final int GTK_POS_TOP = 0x2;
public static final int GTK_POS_BOTTOM = 0x3;
public static final int GTK_PRINT_CAPABILITY_PAGE_SET = 1 << 0;
diff --git a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java
index 2d38a95..7295a27 100644
--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java
+++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java
@@ -389,6 +389,9 @@ boolean setScrollBarVisible (ScrollBar bar, boolean visible) {
int [] hsp = new int [1], vsp = new int [1];
OS.gtk_scrolled_window_get_policy (scrolledHandle, hsp, vsp);
int policy = visible ? OS.GTK_POLICY_ALWAYS : OS.GTK_POLICY_NEVER;
+ if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0) && !visible) {
+ policy = OS.GTK_POLICY_EXTERNAL;
+ }
if ((bar.style & SWT.HORIZONTAL) != 0) {
if (hsp [0] == policy) return false;
hsp [0] = policy;
--
cgit v0.11.2-4-g4a35

View File

@ -15,6 +15,10 @@ Epoch: 1
%global eclipse_tag R4_5_1
%global eclipse_version %{eclipse_major}.%{eclipse_minor}.%{eclipse_micro}
%if 0%{?fedora} >= 24
%global _jetty_version 9.3.4
%global _lucene_version 5.3.1
%else
%if 0%{?fedora} >= 23
%global _jetty_version 9.3.0
%global _lucene_version 5.3.0
@ -22,6 +26,7 @@ Epoch: 1
%global _jetty_version 9.2.9
%global _lucene_version 4.10.3
%endif
%endif
%ifarch %{ix86}
%define eclipse_arch x86
@ -44,7 +49,7 @@ Epoch: 1
Summary: An open, extensible IDE
Name: eclipse
Version: %{eclipse_version}
Release: 1%{?dist}
Release: 2%{?dist}
License: EPL
URL: http://www.eclipse.org/
@ -130,6 +135,8 @@ Patch23: %{pkg_name}-javaxannotation-import.patch
Patch24: %{pkg_name}-fix-tests.patch
Patch25: %{pkg_name}-adjust-droplets.patch
Patch26: eclipse-editor-scrolling-fix.patch
BuildRequires: rsync
BuildRequires: make, gcc
BuildRequires: glib2-devel
@ -377,6 +384,7 @@ pushd eclipse.platform.ui
popd
%patch24
%patch25
%patch26 -p1
# Resolving the target platform requires too many changes, so don't use it
%pom_xpath_remove "pom:configuration/pom:target" eclipse-platform-parent
@ -1113,6 +1121,9 @@ fi
%{_libdir}/%{pkg_name}/plugins/org.eclipse.osgi.compatibility.state_*
%changelog
* Tue Oct 13 2015 Mat Booth <mat.booth@redhat.com> - 1:4.5.1-2
- Add patch for editor scrolling problem, rhbz#1198217
* Wed Sep 30 2015 Mat Booth <mat.booth@redhat.com> - 1:4.5.1-1
- Update to Mars.1
- Fix JDT javafx and annotation processor tests