Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXi Yan2018-10-19 16:05:31 +0000
committerAndrey Loskutov2018-10-30 12:35:15 +0000
commite4b55c0b9e272f58deca6320664a073a2af373d4 (patch)
tree917a3bb5a6bac492bafec049f1606c52e4eae194
parent62d2b8df4b34008e4944c364dc84435d09cd94fe (diff)
downloadeclipse.platform.swt-e4b55c0b9e272f58deca6320664a073a2af373d4.tar.gz
eclipse.platform.swt-e4b55c0b9e272f58deca6320664a073a2af373d4.tar.xz
eclipse.platform.swt-e4b55c0b9e272f58deca6320664a073a2af373d4.zip
Bug 540298 - [regression] NPE in Widget.filtersY20181030-0940
Trying to address NPE caused by gtk_widget_hide(). Change-Id: Iffcbbd9664e6158fa17614edf051bf86146dbbac Signed-off-by: Xi Yan <xixiyan@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index 96f95b146e..5f2d3d26e8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -3446,7 +3446,8 @@ long /*int*/ gtk_draw (long /*int*/ widget, long /*int*/ cairo) {
* makes the widget visible again in setBounds. See Bug 533469, Bug 531120.
*/
if (GTK.GTK_VERSION > OS.VERSION (3, 18, 0) && (state & ZERO_WIDTH) != 0 && (state & ZERO_HEIGHT) != 0) {
- if (GTK.gtk_widget_get_visible(widget)) GTK.gtk_widget_hide(widget);
+ if (widget != 0 && GTK.gtk_widget_get_visible(widget)) GTK.gtk_widget_set_opacity(widget, 0);
+ if (display == null || display.isDisposed()) error (SWT.ERROR_DEVICE_DISPOSED);
}
/*
* Modify the drawing of the widget with cairo_clip.

Back to the top