Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java86
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java37
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java15
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java8
8 files changed, 49 insertions, 164 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 78ba8d3a9e..ae31f7be36 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
@@ -7799,13 +7799,8 @@ 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 {
@@ -7814,7 +7809,6 @@ 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) {
@@ -7992,13 +7986,8 @@ 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 {
@@ -8008,7 +7997,6 @@ public class GTK extends OS {
}
}
/**
-
* @param tree_column cast=(GtkTreeViewColumn *)
* @param widget cast=(GtkWidget *)
*/
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 f075de868c..7df9fe52fb 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
@@ -93,23 +93,6 @@ public abstract class Control extends Widget implements Drawable {
if (gestureEnd.getAddress() == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
}
- /**
- * (Gtk3-only) Delayed initialization after Gtk3 lazy initialization/caching occurred.
- *
- * 1) On Gtk3, GtkTree is heavily optimized and a lot of things are cached/initialized later (e.g after 5th/10th
- * g_main_context_iteration(), or during idle CPU time).
- *
- * 2) Further, Gtk3.6+ (ish) is optimized not to initialize 'invisible' components (e.g invisible table columns).
- *
- * Due to this lazy (1) & ignored code (2) combination, if a *custom* component is invisible during the lazy initialization,
- * it can lead to incorrect initialization of such custom components (e.g Custom-drawn Virtual trees/tables).
- * E.g 'TreeCheese' (see Screenshots in Bug 531048).
- *
- * The solution is to finalize some initialization *after* the lazy initialization is completed.
- */
- boolean lazyInitializationOccured;
- Hashtable<Long, Boolean> delayedVisibilityState = new Hashtable<>();
-
Control () {
}
@@ -6382,73 +6365,4 @@ Point getWindowOrigin () {
return new Point (x [0], y [0]);
}
-
-/**
-* GtkTreeViewColumns must be visible during gtk3's lazy initialization/caching,
-* otherwise custom-drawing/renders aren't initialized properly and we
-* get tree-cheese. See 531048.
-*
-* The solution is to cache the 'desired' visibility state during initialization,
-* and only apply it after lazy initialization is complete.
-*
-* Note on TableColumn Visibility:
-* 1) When a (Java) Table is created, it creates a GtkTreeViewColumn which is visible. (Note, no Java TableColumn is created)
-* 2) When the first (Java) TableColum is created, the first GtkTreeViewColumn is attached to it and is made invisible.
-* 3) When the 2nd+ (Java) TableColumn is created, a new GtkTreeViewColumn is created for each one and is made invisible.
-*
-* TableColumn is invisible until pack() or setWidth() is called on it, this is so that there is consistent api across Win/Cocoa/Gtk.
-* See: org.eclipse.swt.tests.manualJUnit.MJ_Table: column_noWidth_bug399522()
-*/
-void gtk_tree_view_column_set_visible (long /*int*/ columnHandle, boolean visible) {
- if (GTK.GTK3) {
- if (lazyInitializationOccured) {
- GTK.gtk_tree_view_column_set_visible (columnHandle, visible);
- } else {
- delayedVisibilityState.put(new Long(columnHandle), Boolean.valueOf(visible));
- }
- } else {
- GTK.gtk_tree_view_column_set_visible (columnHandle, visible);
- }
-}
-
-boolean gtk_tree_view_column_get_visible (long /*int*/ columnHandle) {
- if (GTK.GTK3) {
- if (lazyInitializationOccured) {
- return GTK.gtk_tree_view_column_get_visible(columnHandle);
- } else {
- Boolean visibilityState = delayedVisibilityState.get(new Long(columnHandle));
- if (visibilityState != null) {
- return visibilityState;
- } else {
- return true; //GtkTreeColumn is initially visible until we hide it.
- }
- }
- } else {
- return GTK.gtk_tree_view_column_get_visible(columnHandle);
- }
-}
-
-
-/**
- * From testing, I observed that generally the 'draw' signal is only sent once lazy
- * initialization/caching is complete, so we piggy back onto the draw signal for delayed initialization.
- * In contrast, mapping/realization events can sometimes be sent before such 'lazy' initialization is completed (or during),
- * so they are not suitable.
- * I.e mapping/realization events can be sent before the first g_main_context_iteration() is ran, but draw is only sent
- * *just before* something is actually visually displayed to the user. (typically after 16+ g_main_context_iterations).
- *
- * See bug 531048.
- */
-void delayedInitialization(long /*int*/ widget) {
- assert GTK.GTK3;
- if (isDisposed()) return;
-
- for (Long columnHandleObject : delayedVisibilityState.keySet()) {
- long /*int*/ columnHandle = (long /*int*/) columnHandleObject.longValue();
- Boolean visible = delayedVisibilityState.get(columnHandleObject);
- if (visible != null) {
- GTK.gtk_tree_view_column_set_visible (columnHandle, visible);
- }
- }
-}
}
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 dff41bd279..9e218f4b92 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
@@ -623,7 +623,12 @@ void createColumn (TableColumn column, int index) {
GTK.gtk_tree_view_column_set_clickable (columnHandle, true);
GTK.gtk_tree_view_column_set_min_width (columnHandle, 0);
GTK.gtk_tree_view_insert_column (handle, columnHandle, index);
-
+ /*
+ * Bug in GTK3. The column header has the wrong CSS styling if it is hidden
+ * when inserting to the tree widget. The fix is to hide the column only
+ * after it is inserted.
+ */
+ if (columnCount != 0) GTK.gtk_tree_view_column_set_visible (columnHandle, false);
if (column != null) {
column.handle = columnHandle;
column.modelIndex = modelIndex;
@@ -680,13 +685,10 @@ void createHandle (int index) {
void createItem (TableColumn column, int index) {
if (!(0 <= index && index <= columnCount)) error (SWT.ERROR_INVALID_RANGE);
-
- // A GtkColumn that is not a (java)TableColumn is created when Table is created.
- // - For the first TableColumn java object, we attach the first created GtkColumn to the (java)TableColumn object.
- // - For every subsequent TableColumn java object, we create a new column.
if (columnCount == 0) {
column.handle = GTK.gtk_tree_view_get_column (handle, 0);
GTK.gtk_tree_view_column_set_sizing (column.handle, GTK.GTK_TREE_VIEW_COLUMN_FIXED);
+ GTK.gtk_tree_view_column_set_visible (column.handle, false);
column.modelIndex = FIRST_COLUMN;
createRenderers (column.handle, column.modelIndex, true, column.style);
column.customDraw = firstCustomDraw;
@@ -694,13 +696,6 @@ void createItem (TableColumn column, int index) {
} else {
createColumn (column, index);
}
- /*
- * Bug in GTK3. The column header has the wrong CSS styling if it is hidden
- * when inserting to the tree widget. The fix is to hide the column only
- * after it is inserted.
- * Bug 393729
- */
- gtk_tree_view_column_set_visible(column.handle, false);
long /*int*/ boxHandle = gtk_box_new (GTK.GTK_ORIENTATION_HORIZONTAL, false, 3);
if (boxHandle == 0) error (SWT.ERROR_NO_HANDLES);
long /*int*/ labelHandle = GTK.gtk_label_new_with_mnemonic (null);
@@ -1111,7 +1106,7 @@ void destroyItem (TableColumn column) {
}
GTK.gtk_tree_view_set_model (handle, newModel);
setModel (newModel);
- createColumn (null, 0); // Reached when disposing last TableColumn java Object. Created so a column would exist without a TableColumn java object.
+ createColumn (null, 0);
} else {
for (int i=0; i<itemCount; i++) {
TableItem item = items [i];
@@ -2283,10 +2278,6 @@ void drawInheritedBackground (long /*int*/ eventPtr, long /*int*/ cairo) {
@Override
long /*int*/ gtk_draw (long /*int*/ widget, long /*int*/ cairo) {
- if (GTK.GTK3 && !lazyInitializationOccured) {
- lazyInitializationOccured = true;
- delayedInitialization(handle);
- }
if ((state & OBSCURED) != 0) return 0;
drawInheritedBackground (0, cairo);
return super.gtk_draw (widget, cairo);
@@ -2364,7 +2355,7 @@ void gtk_widget_size_request (long /*int*/ widget, GtkRequisition requisition) {
boolean fixVisible = columns != 0;
while (list != 0) {
long /*int*/ column = OS.g_list_data (list);
- if (gtk_tree_view_column_get_visible (column)) {
+ if (GTK.gtk_tree_view_column_get_visible (column)) {
fixVisible = false;
break;
}
@@ -2373,18 +2364,18 @@ void gtk_widget_size_request (long /*int*/ widget, GtkRequisition requisition) {
long /*int*/ columnHandle = 0;
if (fixVisible) {
columnHandle = OS.g_list_data (columns);
- gtk_tree_view_column_set_visible (columnHandle, true);
+ GTK.gtk_tree_view_column_set_visible (columnHandle, true);
}
super.gtk_widget_size_request (widget, requisition);
if (fixVisible) {
- gtk_tree_view_column_set_visible (columnHandle, false);
+ GTK.gtk_tree_view_column_set_visible (columnHandle, false);
}
if (columns != 0) OS.g_list_free (columns);
}
void hideFirstColumn () {
long /*int*/ firstColumn = GTK.gtk_tree_view_get_column (handle, 0);
- gtk_tree_view_column_set_visible (firstColumn, false);
+ GTK.gtk_tree_view_column_set_visible (firstColumn, false);
}
@Override
@@ -4081,10 +4072,10 @@ boolean showFirstColumn () {
int columnCount = Math.max (1, this.columnCount);
for (int i=0; i<columnCount; i++) {
long /*int*/ column = GTK.gtk_tree_view_get_column (handle, i);
- if (gtk_tree_view_column_get_visible (column)) return false;
+ if (GTK.gtk_tree_view_column_get_visible (column)) return false;
}
long /*int*/ firstColumn = GTK.gtk_tree_view_get_column (handle, 0);
- gtk_tree_view_column_set_visible (firstColumn, true);
+ GTK.gtk_tree_view_column_set_visible (firstColumn, true);
return true;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java
index a092fc8232..84b8fccd21 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java
@@ -202,7 +202,6 @@ void createWidget (int index) {
@Override
void deregister() {
- parent.gtk_tree_view_column_set_visible(this.handle, true); // Bug 399522. Stop Acessibiliity throwing a critical warning due to column being invisible.
super.deregister ();
display.removeWidget (handle);
if (buttonHandle != 0) display.removeWidget (buttonHandle);
@@ -327,7 +326,7 @@ public int getWidth () {
int getWidthInPixels () {
checkWidget();
- if (!parent.gtk_tree_view_column_get_visible (handle)) {
+ if (!GTK.gtk_tree_view_column_get_visible (handle)) {
return 0;
}
if (useFixedWidth) return GTK.gtk_tree_view_column_get_fixed_width (handle);
@@ -716,20 +715,18 @@ public void setWidth (int width) {
void setWidthInPixels (int width) {
checkWidget();
if (width < 0) return;
-
+ if (width == lastWidth) return;
+ if (width > 0) {
+ useFixedWidth = true;
+ GTK.gtk_tree_view_column_set_fixed_width (handle, width);
+ }
/*
* Bug in GTK. For some reason, calling gtk_tree_view_column_set_visible()
* when the parent is not realized fails to show the column. The fix is to
* ensure that the table has been realized.
*/
if (width != 0) GTK.gtk_widget_realize (parent.handle);
- parent.gtk_tree_view_column_set_visible(this.handle, width != 0);
-
- if (width == lastWidth) return;
- if (width > 0) {
- useFixedWidth = true;
- GTK.gtk_tree_view_column_set_fixed_width (handle, width);
- }
+ GTK.gtk_tree_view_column_set_visible (handle, width != 0);
lastWidth = width;
/*
* Bug in GTK. When the column is made visible the event window of column
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
index c6031d2cc8..587911a2da 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
@@ -359,7 +359,7 @@ Rectangle getBoundsinPixels () {
rect.width = Math.max (0, right - rect.x);
}
}
- int width = parent.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
+ int width = GTK.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
Rectangle r = new Rectangle (rect.x, rect.y, width, rect.height + 1);
return r;
}
@@ -428,7 +428,7 @@ Rectangle getBoundsInPixels (int index) {
rect.x += x [0] + w [0];
rect.width -= x [0] + w [0];
}
- int width = parent.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
+ int width = GTK.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
Rectangle r = new Rectangle (rect.x, rect.y, width, rect.height + 1);
return r;
}
@@ -643,7 +643,7 @@ Rectangle getImageBoundsInPixels (int index) {
rect.x += x [0];
}
rect.width = w [0];
- int width = parent.gtk_tree_view_column_get_visible (column) ? rect.width : 0;
+ int width = GTK.gtk_tree_view_column_get_visible (column) ? rect.width : 0;
return new Rectangle (rect.x, rect.y, width, rect.height + 1);
}
@@ -811,7 +811,7 @@ Rectangle getTextBoundsInPixels (int index) {
rect.width = Math.max (0, right - rect.x);
}
}
- int width = parent.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
+ int width = GTK.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
return new Rectangle (rect.x, rect.y, width, rect.height + 1);
}
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 1842b84ab3..b26870ed8a 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
@@ -726,7 +726,12 @@ void createColumn (TreeColumn column, int index) {
GTK.gtk_tree_view_column_set_clickable (columnHandle, true);
GTK.gtk_tree_view_column_set_min_width (columnHandle, 0);
GTK.gtk_tree_view_insert_column (handle, columnHandle, index);
-
+ /*
+ * Bug in GTK3. The column header has the wrong CSS styling if it is hidden
+ * when inserting to the tree widget. The fix is to hide the column only
+ * after it is inserted.
+ */
+ if (columnCount != 0) GTK.gtk_tree_view_column_set_visible (columnHandle, false);
if (column != null) {
column.handle = columnHandle;
column.modelIndex = modelIndex;
@@ -796,6 +801,7 @@ void createItem (TreeColumn column, int index) {
if (columnCount == 0) {
column.handle = GTK.gtk_tree_view_get_column (handle, 0);
GTK.gtk_tree_view_column_set_sizing (column.handle, GTK.GTK_TREE_VIEW_COLUMN_FIXED);
+ GTK.gtk_tree_view_column_set_visible (column.handle, false);
column.modelIndex = FIRST_COLUMN;
createRenderers (column.handle, column.modelIndex, true, column.style);
column.customDraw = firstCustomDraw;
@@ -803,12 +809,6 @@ void createItem (TreeColumn column, int index) {
} else {
createColumn (column, index);
}
- /*
- * Bug in GTK3. The column header has the wrong CSS styling if it is hidden
- * when inserting to the tree widget. The fix is to hide the column only
- * after it is inserted. Bug 393729.
- */
- gtk_tree_view_column_set_visible (column.handle, false);
long /*int*/ boxHandle = gtk_box_new (GTK.GTK_ORIENTATION_HORIZONTAL, false, 3);
if (boxHandle == 0) error (SWT.ERROR_NO_HANDLES);
long /*int*/ labelHandle = GTK.gtk_label_new_with_mnemonic (null);
@@ -2311,10 +2311,6 @@ void drawInheritedBackground (long /*int*/ eventPtr, long /*int*/ cairo) {
@Override
long /*int*/ gtk_draw (long /*int*/ widget, long /*int*/ cairo) {
- if (GTK.GTK3 && !lazyInitializationOccured) {
- lazyInitializationOccured = true;
- delayedInitialization(handle);
- }
if ((state & OBSCURED) != 0) return 0;
drawInheritedBackground (0, cairo);
return super.gtk_draw (widget, cairo);
@@ -2504,7 +2500,7 @@ void gtk_widget_size_request (long /*int*/ widget, GtkRequisition requisition) {
boolean fixVisible = columns != 0;
while (list != 0) {
long /*int*/ column = OS.g_list_data (list);
- if (gtk_tree_view_column_get_visible (column)) {
+ if (GTK.gtk_tree_view_column_get_visible (column)) {
fixVisible = false;
break;
}
@@ -2513,18 +2509,18 @@ void gtk_widget_size_request (long /*int*/ widget, GtkRequisition requisition) {
long /*int*/ columnHandle = 0;
if (fixVisible) {
columnHandle = OS.g_list_data (columns);
- gtk_tree_view_column_set_visible (columnHandle, true);
+ GTK.gtk_tree_view_column_set_visible (columnHandle, true);
}
super.gtk_widget_size_request (widget, requisition);
if (fixVisible) {
- gtk_tree_view_column_set_visible (columnHandle, false);
+ GTK.gtk_tree_view_column_set_visible (columnHandle, false);
}
if (columns != 0) OS.g_list_free (columns);
}
void hideFirstColumn () {
long /*int*/ firstColumn = GTK.gtk_tree_view_get_column (handle, 0);
- gtk_tree_view_column_set_visible (firstColumn, false);
+ GTK.gtk_tree_view_column_set_visible (firstColumn, false);
}
@Override
@@ -3966,10 +3962,10 @@ boolean showFirstColumn () {
int columnCount = Math.max (1, this.columnCount);
for (int i=0; i<columnCount; i++) {
long /*int*/ column = GTK.gtk_tree_view_get_column (handle, i);
- if (gtk_tree_view_column_get_visible (column)) return false;
+ if (GTK.gtk_tree_view_column_get_visible (column)) return false;
}
long /*int*/ firstColumn = GTK.gtk_tree_view_get_column (handle, 0);
- gtk_tree_view_column_set_visible (firstColumn, true);
+ GTK.gtk_tree_view_column_set_visible (firstColumn, true);
return true;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java
index 470e9fa1ca..811a73dc68 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java
@@ -204,7 +204,6 @@ void createWidget (int index) {
@Override
void deregister() {
- parent.gtk_tree_view_column_set_visible(this.handle, true); // Bug 399522. Stop Acessibiliity throwing a critical warning due to column being invisible.
super.deregister ();
display.removeWidget (handle);
if (buttonHandle != 0) display.removeWidget (buttonHandle);
@@ -329,7 +328,7 @@ public int getWidth () {
int getWidthInPixels () {
checkWidget();
- if (!parent.gtk_tree_view_column_get_visible (handle)) {
+ if (!GTK.gtk_tree_view_column_get_visible (handle)) {
return 0;
}
if (useFixedWidth) return GTK.gtk_tree_view_column_get_fixed_width (handle);
@@ -702,18 +701,18 @@ public void setWidth (int width) {
void setWidthInPixels (int width) {
checkWidget();
if (width < 0) return;
+ if (width == lastWidth) return;
+ if (width > 0) {
+ useFixedWidth = true;
+ GTK.gtk_tree_view_column_set_fixed_width (handle, width);
+ }
/*
* Bug in GTK. For some reason, calling gtk_tree_view_column_set_visible()
* when the parent is not realized fails to show the column. The fix is to
* ensure that the table has been realized.
*/
if (width != 0) GTK.gtk_widget_realize (parent.handle);
- parent.gtk_tree_view_column_set_visible (handle, width != 0);
- if (width == lastWidth) return;
- if (width > 0) {
- useFixedWidth = true;
- GTK.gtk_tree_view_column_set_fixed_width (handle, width);
- }
+ GTK.gtk_tree_view_column_set_visible (handle, width != 0);
lastWidth = width;
/*
* Bug in GTK. When the column is made visible the event window of column
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
index 66307f812e..074a3763b5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
@@ -481,7 +481,7 @@ Rectangle getBoundsInPixels (int index) {
rect.x += x [0] + w [0];
rect.width -= x [0] + w [0];
}
- int width = parent.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
+ int width = GTK.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
Rectangle r = new Rectangle (rect.x, rect.y, width, rect.height + 1);
return r;
}
@@ -545,7 +545,7 @@ Rectangle getBoundsInPixels () {
rect.width = Math.max (0, right - rect.x);
}
}
- int width = parent.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
+ int width = GTK.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
Rectangle r = new Rectangle (rect.x, rect.y, width, rect.height + 1);
return r;
}
@@ -788,7 +788,7 @@ Rectangle getImageBoundsInPixels (int index) {
rect.x += x [0];
}
rect.width = w [0];
- int width = parent.gtk_tree_view_column_get_visible (column) ? rect.width : 0;
+ int width = GTK.gtk_tree_view_column_get_visible (column) ? rect.width : 0;
return new Rectangle (rect.x, rect.y, width, rect.height + 1);
}
@@ -1030,7 +1030,7 @@ Rectangle getTextBoundsInPixels (int index) {
rect.width = Math.max (0, right - rect.x);
}
}
- int width = parent.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
+ int width = GTK.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
return new Rectangle (rect.x, rect.y, width, rect.height + 1);
}

Back to the top