Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java13
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java13
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java25
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java15
8 files changed, 7 insertions, 89 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
index 2f77e37cd4..494906358b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
@@ -1749,10 +1749,8 @@ public Menu getMenuBar () {
public int getDismissalAlignment () {
checkDevice ();
int [] buffer = new int [1];
- if (OS.GTK_VERSION >= OS.VERSION (2, 6, 0)) {
- long /*int*/ settings = OS.gtk_settings_get_default ();
- OS.g_object_get (settings, OS.gtk_alternative_button_order, buffer, 0);
- }
+ long /*int*/ settings = OS.gtk_settings_get_default ();
+ OS.g_object_get (settings, OS.gtk_alternative_button_order, buffer, 0);
return buffer [0] == 1 ? SWT.LEFT : SWT.RIGHT;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java
index 5162d1d075..fbc2776b82 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java
@@ -648,18 +648,7 @@ long /*int*/ gtk_hide (long /*int*/ widget) {
if ((style & SWT.POP_UP) != 0) {
if (display.activeShell != null) display.activeShell = getShell ();
}
- if (OS.GTK_VERSION >= OS.VERSION (2, 6, 0)) {
- sendEvent (SWT.Hide);
- } else {
- /*
- * Bug in GTK. In GTK 2.4 and earlier
- * a crash could occur if a menu item
- * was disposed within gtk_hide. The
- * workaroud is to post the event instead
- * of send it on these platforms
- */
- postEvent (SWT.Hide);
- }
+ sendEvent (SWT.Hide);
if (OS.ubuntu_menu_proxy_get() != 0) {
MenuItem[] items = getItems();
for (int i=0; i<items.length; i++) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java
index ad7d0cfeec..6891f4e187 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java
@@ -531,9 +531,7 @@ long /*int*/ gtk_event_after (long /*int*/ widget, long /*int*/ gdkEvent) {
void hookEvents () {
super.hookEvents ();
- if (OS.GTK_VERSION >= OS.VERSION (2, 6, 0)) {
- OS.g_signal_connect_closure (handle, OS.change_value, display.closures [CHANGE_VALUE], false);
- }
+ OS.g_signal_connect_closure (handle, OS.change_value, display.closures [CHANGE_VALUE], false);
OS.g_signal_connect_closure (adjustmentHandle, OS.value_changed, display.closures [VALUE_CHANGED], false);
OS.g_signal_connect_closure_by_id (handle, display.signalIds [EVENT_AFTER], 0, display.closures [EVENT_AFTER], false);
OS.g_signal_connect_closure_by_id (handle, display.signalIds [BUTTON_PRESS_EVENT], 0, display.closures [BUTTON_PRESS_EVENT], false);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java
index a907244316..bb3b795a66 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java
@@ -239,9 +239,7 @@ long /*int*/ gtk_event_after (long /*int*/ widget, long /*int*/ gdkEvent) {
void hookEvents () {
super.hookEvents ();
- if (OS.GTK_VERSION >= OS.VERSION (2, 6, 0)) {
- OS.g_signal_connect_closure (handle, OS.change_value, display.closures [CHANGE_VALUE], false);
- }
+ OS.g_signal_connect_closure (handle, OS.change_value, display.closures [CHANGE_VALUE], false);
OS.g_signal_connect_closure (handle, OS.value_changed, display.closures [VALUE_CHANGED], false);
}
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 b3c8825a72..73539b72cd 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
@@ -2837,13 +2837,6 @@ void reskinChildren (int flags) {
boolean searchEnabled () {
/* Disable searching when using VIRTUAL */
if ((style & SWT.VIRTUAL) != 0) return false;
- if (OS.GTK_VERSION < OS.VERSION (2, 6, 0)) {
- int mask = SWT.PRIMARY_MODAL | SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL;
- Shell shell = getShell();
- if ((shell.style & mask) != 0) {
- return false;
- }
- }
return true;
}
@@ -3038,12 +3031,6 @@ int setBounds (int x, int y, int width, int height, boolean move, boolean resize
* after it has been resized.
*/
OS.gtk_widget_realize (handle);
- /*
- * Bug in GTK. An empty GtkTreeView fails to repaint the focus rectangle
- * correctly when resized on versions before 2.6.0. The fix is to force
- * the widget to redraw.
- */
- if (OS.GTK_VERSION < OS.VERSION (2, 6, 0) && itemCount == 0) redraw (false);
return result;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
index 46cf274a2f..08fc1a6f7f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
@@ -847,9 +847,7 @@ public Point getCaretLocation () {
checkWidget ();
if ((style & SWT.SINGLE) != 0) {
int index = OS.gtk_editable_get_position (handle);
- if (OS.GTK_VERSION >= OS.VERSION (2, 6, 0)) {
- index = OS.gtk_entry_text_index_to_layout_index (handle, index);
- }
+ index = OS.gtk_entry_text_index_to_layout_index (handle, index);
int [] offset_x = new int [1], offset_y = new int [1];
OS.gtk_entry_get_layout_offsets (handle, offset_x, offset_y);
long /*int*/ layout = OS.gtk_entry_get_layout (handle);
@@ -1962,18 +1960,6 @@ void register () {
void releaseWidget () {
super.releaseWidget ();
fixIM ();
- if (OS.GTK_VERSION < OS.VERSION (2, 6, 0)) {
- /*
- * Bug in GTK. Any text copied into the clipboard will be lost when
- * the GtkTextView is destroyed. The fix is to paste the contents as
- * the widget is being destroyed to reference the text buffer, keeping
- * it around until ownership of the clipboard is lost.
- */
- if ((style & SWT.MULTI) != 0) {
- long /*int*/ clipboard = OS.gtk_clipboard_get (OS.GDK_NONE);
- OS.gtk_text_buffer_paste_clipboard (bufferHandle, clipboard, null, OS.gtk_text_view_get_editable (handle));
- }
- }
message = null;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
index 2e038b6a53..af4a1a302c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
@@ -390,30 +390,7 @@ ToolItem [] _getTabItemList () {
long /*int*/ gtk_key_press_event (long /*int*/ widget, long /*int*/ eventPtr) {
if (!hasFocus ()) return 0;
long /*int*/ result = super.gtk_key_press_event (widget, eventPtr);
- if (result != 0) return result;
- GdkEventKey gdkEvent = new GdkEventKey ();
- OS.memmove (gdkEvent, eventPtr, GdkEventKey.sizeof);
- switch (gdkEvent.keyval) {
- case OS.GDK_Down: {
- if (OS.GTK_VERSION < OS.VERSION (2, 6, 0) && (currentFocusItem != null) && (currentFocusItem.style & SWT.DROP_DOWN) != 0) {
- Event event = new Event ();
- event.detail = SWT.ARROW;
- long /*int*/ topHandle = currentFocusItem.topHandle ();
- GtkAllocation allocation = new GtkAllocation ();
- gtk_widget_get_allocation (topHandle, allocation);
- event.x = allocation.x;
- event.y = allocation.y + allocation.height;
- if ((style & SWT.MIRRORED) != 0) event.x = getClientWidth() - allocation.width - event.x;
- currentFocusItem.sendSelectionEvent (SWT.Selection, event, false);
- /*
- * Stop GTK from processing the event further as key_down binding
- * will move the focus to the next item.
- */
- return 1;
- }
- }
- default: return result;
- }
+ return result;
}
long /*int*/ gtk_focus (long /*int*/ widget, long /*int*/ directionType) {
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 f8158c4313..f207856f76 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
@@ -2839,13 +2839,6 @@ void reskinChildren (int flags) {
boolean searchEnabled () {
/* Disable searching when using VIRTUAL */
if ((style & SWT.VIRTUAL) != 0) return false;
- if (OS.GTK_VERSION < OS.VERSION (2, 6, 0)) {
- int mask = SWT.PRIMARY_MODAL | SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL;
- Shell shell = getShell();
- if ((shell.style & mask) != 0) {
- return false;
- }
- }
return true;
}
/**
@@ -3005,14 +2998,6 @@ int setBounds (int x, int y, int width, int height, boolean move, boolean resize
* after it has been resized.
*/
OS.gtk_widget_realize (handle);
- /*
- * Bug in GTK. An empty GtkTreeView fails to repaint the focus rectangle
- * correctly when resized on versions before 2.6.0. The fix is to force
- * the widget to redraw.
- */
- if (OS.GTK_VERSION < OS.VERSION (2, 6, 0) && OS.gtk_tree_model_iter_n_children (modelHandle, 0) == 0) {
- redraw (false);
- }
return result;
}

Back to the top