diff options
| author | Snjezana Peco | 2015-04-14 13:02:54 +0000 |
|---|---|---|
| committer | Alexander Kurtakov | 2015-04-16 16:47:44 +0000 |
| commit | a448e5fba612fd4d50d640de1bf1837494976dba (patch) | |
| tree | 396aaa3afb36ec08c56e0515d06711533a772fd2 | |
| parent | 79d9fccb3fbc773688882f3e7477eaa419d13abb (diff) | |
| download | eclipse.platform.swt-a448e5fba612fd4d50d640de1bf1837494976dba.tar.gz eclipse.platform.swt-a448e5fba612fd4d50d640de1bf1837494976dba.tar.xz eclipse.platform.swt-a448e5fba612fd4d50d640de1bf1837494976dba.zip | |
Bug 459117 - [GTK3] [GTK3.14] Leaking text from list in target-platform preference page
Change-Id: I06210e629ca28ecf0e2387a11c6789e19be9da16
Signed-off-by: Snjezana Peco <snjeza.peco@gmail.com>
| -rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java | 15 | ||||
| -rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java | 4 |
2 files changed, 16 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java index a3b223c3e1..437d798ec7 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java @@ -2632,7 +2632,13 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo long /*int*/ path = OS.gtk_tree_model_get_path (modelHandle, iter); OS.gtk_tree_view_get_background_area (handle, path, columnHandle, rect); 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)) { + GdkRectangle r2 = new GdkRectangle (); + OS.gdk_cairo_get_clip_rectangle (cr, r2); + rect.x = r2.x; + rect.width = r2.width; + } if ((drawState & SWT.SELECTED) == 0) { if ((state & PARENT_BACKGROUND) != 0 || backgroundImage != null) { Control control = findBackgroundControl (); @@ -2748,6 +2754,13 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo long /*int*/ path = OS.gtk_tree_model_get_path (modelHandle, iter); OS.gtk_tree_view_get_background_area (handle, path, columnHandle, rect); 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)) { + GdkRectangle r2 = new GdkRectangle (); + OS.gdk_cairo_get_clip_rectangle (cr, r2); + rect.x = r2.x; + rect.width = r2.width; + } ignoreSize = true; int [] contentX = new int [1], contentWidth = new int [1]; gtk_cell_renderer_get_preferred_size (cell, handle, contentWidth, null); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java index f67a33c34e..cba55c32c7 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java @@ -2718,7 +2718,7 @@ 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.GTK_VERSION <= OS.VERSION(3, 14, 8)) { + 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); @@ -2823,7 +2823,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.GTK_VERSION > OS.VERSION(3, 14, 8)) { + if (!OS.GTK3 || OS.GTK_VERSION > OS.VERSION(3, 14, 8)) { sendEvent (SWT.PaintItem, event); } gc.dispose(); |
