diff options
author | Leo Ufimtsev | 2018-03-16 16:44:19 +0000 |
---|---|---|
committer | Leo Ufimtsev | 2018-03-19 18:57:26 +0000 |
commit | 0854396f0ab183b36576d7b4be3f60d14cf885d8 (patch) | |
tree | b67ed683b84c0b92007443e745b066b704e6fbe6 /bundles/org.eclipse.swt/Eclipse SWT PI/gtk | |
parent | ede1bd8e91290a53aeefd1db7070eae876ae281d (diff) | |
download | eclipse.platform.swt-0854396f0ab183b36576d7b4be3f60d14cf885d8.tar.gz eclipse.platform.swt-0854396f0ab183b36576d7b4be3f60d14cf885d8.tar.xz eclipse.platform.swt-0854396f0ab183b36576d7b4be3f60d14cf885d8.zip |
Bug 531048 [GTK3] Large problems drawing ownerdraw tables (fix)
TL;DR:
Gtk3 delays some Tree/Table initialization logic.
We wait till it's done first to finish some initialization after.
It's not a clean fix, but given SWT's custom drawing and requirement
for API to be win/cocoa consistent, I couldn't find a better fix.
Details:
Gtk3's delayed initialization breaks custom drawn Tree/Tables that have
invisible columns
because internally GTK skips a lot of initialization for invisible
items (for optimization).
Fix is to wait till this is done and in the mean time 'cache' the
'desired' state of a column in a hash table. Once initialization is
done, we flush state (i.e hide/show columns as requested).
Technical notes:
- Fix is same for Tree and Table.
- I put things into Control, because I have another fix in mind that
will use the 'delayed' logic. (invisible Rowlayout had such issues).
- I piggy back onto 'draw' signal, which is only sent once
Gtk3/Caching initialization has occured.
- I had to put columns into a hash table because some columns
don't have a TableColumn java object associated with it.
On the side, this also fixes accessibility warning reported in 399522.
Verified against bug Snippet, jUnits, manual tests, child eclipse.
@ Reviewer, you can verify against snippet found in bug.
Before you get cheese, after thinngs work.
Patchset 4:
- Minor update, moved some code higher up into table/tree
so that check is only done for these two widgets and not for all
widgets.
Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=5310483
Change-Id: I3152f64ddb296879d9bad08bdaeb5c38e0672ef8
Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/gtk')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java index 2cddd0a741..cab6ca3e34 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java @@ -7772,8 +7772,13 @@ public class GTK extends OS { lock.unlock(); } } + /** @param column cast=(GtkTreeViewColumn *) */ public static final native boolean _gtk_tree_view_column_get_visible(long /*int*/ column); + /** + * (!) SWT: This method should not be called directly. + * Instead use Control.gtk_tree_view_column_get_visible (...) + */ public static final boolean gtk_tree_view_column_get_visible(long /*int*/ column) { lock.lock(); try { @@ -7782,6 +7787,7 @@ public class GTK extends OS { lock.unlock(); } } + /** @param column cast=(GtkTreeViewColumn *) */ public static final native int _gtk_tree_view_column_get_width(long /*int*/ column); public static final int gtk_tree_view_column_get_width(long /*int*/ column) { @@ -7959,8 +7965,13 @@ public class GTK extends OS { lock.unlock(); } } + /** @param tree_column cast=(GtkTreeViewColumn *) */ public static final native void _gtk_tree_view_column_set_visible (long /*int*/ tree_column, boolean visible); + /** + * (!) SWT: This method should not be called directly. + * Instead use Control.gtk_tree_view_column_set_visible (...) + */ public static final void gtk_tree_view_column_set_visible (long /*int*/ tree_column, boolean visible) { lock.lock(); try { @@ -7970,6 +7981,7 @@ public class GTK extends OS { } } /** + * @param tree_column cast=(GtkTreeViewColumn *) * @param widget cast=(GtkWidget *) */ |