summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti <silenio_quarti@ca.ibm.com>2012-11-06 17:20:04 -0500
committerSilenio Quarti <silenio_quarti@ca.ibm.com>2012-11-06 17:20:04 -0500
commit033543d2c530f3ef9e2efb7e2d0271a91bde3d81 (patch)
treeaf268007f0cd3afdc7c08f29549c28c03444717b
parent39ea37fd2c6d90b10f7eb09a640cff1075657b69 (diff)
downloadeclipse.platform.swt-033543d2c530f3ef9e2efb7e2d0271a91bde3d81.tar.gz
eclipse.platform.swt-033543d2c530f3ef9e2efb7e2d0271a91bde3d81.tar.xz
eclipse.platform.swt-033543d2c530f3ef9e2efb7e2d0271a91bde3d81.zip
Bug 392700 - Bad scrolling in editor (N20121022-1000)
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java11
5 files changed, 23 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
index d6a3273909..6ed017dfd8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
@@ -7635,6 +7635,16 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gdk_1window_1restack)
}
#endif
+#ifndef NO__1gdk_1window_1scroll
+JNIEXPORT void JNICALL OS_NATIVE(_1gdk_1window_1scroll)
+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jint arg2)
+{
+ OS_NATIVE_ENTER(env, that, _1gdk_1window_1scroll_FUNC);
+ gdk_window_scroll((GdkWindow *)arg0, arg1, arg2);
+ OS_NATIVE_EXIT(env, that, _1gdk_1window_1scroll_FUNC);
+}
+#endif
+
#ifndef NO__1gdk_1window_1set_1back_1pixmap
JNIEXPORT void JNICALL OS_NATIVE(_1gdk_1window_1set_1back_1pixmap)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jboolean arg2)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
index 612c21ea0e..654fe53138 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
@@ -582,6 +582,7 @@ char * OS_nativeFunctionNames[] = {
"_1gdk_1window_1remove_1filter",
"_1gdk_1window_1resize",
"_1gdk_1window_1restack",
+ "_1gdk_1window_1scroll",
"_1gdk_1window_1set_1back_1pixmap",
"_1gdk_1window_1set_1background_1pattern",
"_1gdk_1window_1set_1cursor",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
index 680384cd27..7dfe3ec380 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
@@ -592,6 +592,7 @@ typedef enum {
_1gdk_1window_1remove_1filter_FUNC,
_1gdk_1window_1resize_FUNC,
_1gdk_1window_1restack_FUNC,
+ _1gdk_1window_1scroll_FUNC,
_1gdk_1window_1set_1back_1pixmap_FUNC,
_1gdk_1window_1set_1background_1pattern_FUNC,
_1gdk_1window_1set_1cursor_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index 88d2ab6b17..d7e8cabeb8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -5630,6 +5630,16 @@ public static final void gdk_window_restack(long /*int*/ window, long /*int*/ si
lock.unlock();
}
}
+/** @param window cast=(GdkWindow *) */
+public static final native void _gdk_window_scroll(long /*int*/ window, int dx, int dy);
+public static final void gdk_window_scroll(long /*int*/ window, int dx, int dy) {
+ lock.lock();
+ try {
+ _gdk_window_scroll(window, dx, dy);
+ } finally {
+ lock.unlock();
+ }
+}
/** @method flags=dynamic */
public static final native void _gdk_window_set_background_pattern(long /*int*/ window, long /*int*/ pattern);
public static final void gdk_window_set_background_pattern(long /*int*/ window, long /*int*/ pattern) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java
index 8b8cb099a4..184bcf548c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java
@@ -12,7 +12,6 @@ package org.eclipse.swt.widgets;
import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.internal.cairo.Cairo;
import org.eclipse.swt.internal.gtk.*;
import org.eclipse.swt.*;
@@ -287,16 +286,8 @@ public void scroll (int destX, int destY, int x, int y, int width, int height, b
redrawWidget (x, y, width, height, false, false, false);
redrawWidget (destX, destY, width, height, false, false, false);
} else {
-// GC gc = new GC (this);
-// gc.copyArea (x, y, width, height, destX, destY);
-// gc.dispose ();
if (OS.GTK3) {
- OS.gdk_window_invalidate_rect (window, copyRect, true);
- long /*int*/ cairo = OS.gdk_cairo_create (window);
- OS.gdk_cairo_set_source_window (cairo, window, 0, 0);
- Cairo.cairo_rectangle (cairo, copyRect.x + deltaX, copyRect.y + deltaY, copyRect.width, copyRect.height);
- Cairo.cairo_fill (cairo);
- Cairo.cairo_destroy (cairo);
+ OS.gdk_window_scroll (window, deltaX, deltaY);
} else {
long /*int*/ gdkGC = OS.gdk_gc_new (window);
OS.gdk_gc_set_exposures (gdkGC, true);