Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Pun2017-01-25 18:44:40 +0000
committerAlexander Kurtakov2017-02-20 11:21:09 +0000
commita6faa38b93f4cb00168ac8f1755dfe0662f7e03c (patch)
tree567ce5cd3e0a53041a24c32cf1f54abc1cb05f75
parent8272e4f2f6e182c39b48afc519d8b0b243baece3 (diff)
downloadeclipse.platform.swt-a6faa38b93f4cb00168ac8f1755dfe0662f7e03c.tar.gz
eclipse.platform.swt-a6faa38b93f4cb00168ac8f1755dfe0662f7e03c.tar.xz
eclipse.platform.swt-a6faa38b93f4cb00168ac8f1755dfe0662f7e03c.zip
Bug 500013 - [Wayland] Keyboard Left and Right Arrow keys are very slow
or unresponsive The Caret drawing mechanism was originally implemented to be done using a generated cairo from parent window using gdk_cairo_create(). This is now deprecated and not working in Wayland. Drawing of the caret is now handled in a draw signal which is triggered by a queue_draw() call. Fixed a race condition issue caused by a variable introduced called isDrawing. Removed it so cursor as it was not necessary and will not cause the caret to disappear anymore. Change-Id: I7be19f1982a18145c6192b266459ea9d3472d4fb Signed-off-by: Ian Pun <ipun@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java11
2 files changed, 4 insertions, 10 deletions
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 242d395b7e..2e3a67170d 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
@@ -176,9 +176,8 @@ long /*int*/ gtk_draw (long /*int*/ widget, long /*int*/ cairo) {
if (isFocus) caret.setFocus ();
} else {
result = super.gtk_draw (widget, cairo);
- if (caret != null && caret.isDrawing) {
+ if (caret != null) {
drawCaret(widget,cairo);
- caret.isDrawing = false;
}
}
return result;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java
index bceeec6637..0e4a13ada6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java
@@ -38,7 +38,7 @@ import org.eclipse.swt.internal.gtk.*;
public class Caret extends Widget {
Canvas parent;
int x, y, width, height;
- boolean isVisible, isShowing, isDrawing;
+ boolean isVisible, isShowing;
int blinkRate;
Image image;
Font font;
@@ -160,13 +160,8 @@ boolean drawCaret () {
OS.gdk_colormap_free_colors (colormap, color, 1);
return true;
} else {
- if (isDrawing) {
- return false;
- } else {
- isDrawing = true;
- OS.gtk_widget_queue_draw(parent.handle);
- return true;
- }
+ OS.gtk_widget_queue_draw(parent.handle);
+ return true;
}
}

Back to the top