summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-08-01 13:58:16 -0400
committerAnatoly Spektor <aspektor@redhat.com>2012-08-01 13:58:16 -0400
commit4822314ab37f47dfb0b0f799d5608b1664eacde8 (patch)
treebcdd7ac28510d74c6247a8695fa62ac645a7bd5a
parent375e534d1f3805575df67c40094cfde8f02ce40a (diff)
parentf1673e5c2c5db30d58829f2b5e01e44a00b773f5 (diff)
downloadeclipse.platform.swt-4822314ab37f47dfb0b0f799d5608b1664eacde8.tar.gz
eclipse.platform.swt-4822314ab37f47dfb0b0f799d5608b1664eacde8.tar.xz
eclipse.platform.swt-4822314ab37f47dfb0b0f799d5608b1664eacde8.zip
Merge branch 'master' of http://git.eclipse.org/gitroot/platform/eclipse.platform.swt.git
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java19
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java8
29 files changed, 75 insertions, 57 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
index 8cef1d312e..155d1a0b2c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
@@ -1683,18 +1683,6 @@ JNIEXPORT void JNICALL OS_NATIVE(_1GTK_1WIDGET_1SET_1FLAGS)
}
#endif
-#ifndef NO__1GTK_1WIDGET_1STATE
-JNIEXPORT jint JNICALL OS_NATIVE(_1GTK_1WIDGET_1STATE)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- jint rc = 0;
- OS_NATIVE_ENTER(env, that, _1GTK_1WIDGET_1STATE_FUNC);
- rc = (jint)GTK_WIDGET_STATE(arg0);
- OS_NATIVE_EXIT(env, that, _1GTK_1WIDGET_1STATE_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO__1GTK_1WIDGET_1UNSET_1FLAGS
JNIEXPORT void JNICALL OS_NATIVE(_1GTK_1WIDGET_1UNSET_1FLAGS)
(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
@@ -15486,6 +15474,26 @@ JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1widget_1get_1events)
}
#endif
+#ifndef NO__1gtk_1widget_1get_1mapped
+JNIEXPORT jboolean JNICALL OS_NATIVE(_1gtk_1widget_1get_1mapped)
+ (JNIEnv *env, jclass that, jintLong arg0)
+{
+ jboolean rc = 0;
+ OS_NATIVE_ENTER(env, that, _1gtk_1widget_1get_1mapped_FUNC);
+/*
+ rc = (jboolean)gtk_widget_get_mapped(arg0);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_widget_get_mapped)
+ if (fp) {
+ rc = (jboolean)((jboolean (CALLING_CONVENTION*)(jintLong))fp)(arg0);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, _1gtk_1widget_1get_1mapped_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO__1gtk_1widget_1get_1modifier_1style
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1widget_1get_1modifier_1style)
(JNIEnv *env, jclass that, jintLong arg0)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
index 7996ea0d06..7656883294 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
@@ -204,6 +204,7 @@
#define gtk_widget_set_tooltip_text_LIB LIB_GTK
#define gtk_widget_set_has_window_LIB LIB_GTK
#define gtk_fixed_set_has_window_LIB LIB_GTK
+#define gtk_widget_get_mapped_LIB LIB_GTK
#define gdk_pango_context_set_colormap_LIB LIB_GDK
#define gdk_x11_screen_get_window_manager_name_LIB LIB_GDK
#define gdk_x11_screen_lookup_visual_LIB LIB_GDK
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
index bedece6c8d..4468de2f88 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
@@ -167,7 +167,6 @@ char * OS_nativeFunctionNames[] = {
"_1GTK_1WIDGET_1MAPPED",
"_1GTK_1WIDGET_1SENSITIVE",
"_1GTK_1WIDGET_1SET_1FLAGS",
- "_1GTK_1WIDGET_1STATE",
"_1GTK_1WIDGET_1UNSET_1FLAGS",
"_1GTK_1WIDGET_1VISIBLE",
"_1G_1OBJECT_1CLASS",
@@ -1227,6 +1226,7 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1widget_1get_1child_1visible",
"_1gtk_1widget_1get_1default_1style",
"_1gtk_1widget_1get_1events",
+ "_1gtk_1widget_1get_1mapped",
"_1gtk_1widget_1get_1modifier_1style",
"_1gtk_1widget_1get_1pango_1context",
"_1gtk_1widget_1get_1parent",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
index c1af2f83cb..da5dd954ae 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
@@ -175,7 +175,6 @@ typedef enum {
_1GTK_1WIDGET_1MAPPED_FUNC,
_1GTK_1WIDGET_1SENSITIVE_FUNC,
_1GTK_1WIDGET_1SET_1FLAGS_FUNC,
- _1GTK_1WIDGET_1STATE_FUNC,
_1GTK_1WIDGET_1UNSET_1FLAGS_FUNC,
_1GTK_1WIDGET_1VISIBLE_FUNC,
_1G_1OBJECT_1CLASS_FUNC,
@@ -1235,6 +1234,7 @@ typedef enum {
_1gtk_1widget_1get_1child_1visible_FUNC,
_1gtk_1widget_1get_1default_1style_FUNC,
_1gtk_1widget_1get_1events_FUNC,
+ _1gtk_1widget_1get_1mapped_FUNC,
_1gtk_1widget_1get_1modifier_1style_FUNC,
_1gtk_1widget_1get_1pango_1context_FUNC,
_1gtk_1widget_1get_1parent_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index 972e477b83..b13bdeadd2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -1635,15 +1635,6 @@ public static final int GTK_WIDGET_FLAGS(int /*long*/ wid) {
lock.unlock();
}
}
-public static final native int _GTK_WIDGET_STATE(int /*long*/ wid);
-public static final int GTK_WIDGET_STATE(int /*long*/ wid) {
- lock.lock();
- try {
- return _GTK_WIDGET_STATE(wid);
- } finally {
- lock.unlock();
- }
-}
public static final native boolean _GTK_WIDGET_HAS_DEFAULT(int /*long*/ wid);
public static final boolean GTK_WIDGET_HAS_DEFAULT(int /*long*/ wid) {
lock.lock();
@@ -12147,6 +12138,16 @@ public static final int /*long*/ gtk_widget_get_modifier_style(int /*long*/ widg
lock.unlock();
}
}
+/** @method flags=dynamic */
+public static final native boolean _gtk_widget_get_mapped(int /*long*/ widget);
+public static final boolean gtk_widget_get_mapped(int /*long*/ widget) {
+ lock.lock();
+ try {
+ return _gtk_widget_get_mapped(widget);
+ } finally {
+ lock.unlock();
+ }
+}
/** @param widget cast=(GtkWidget *) */
public static final native int /*long*/ _gtk_widget_get_pango_context(int /*long*/ widget);
public static final int /*long*/ gtk_widget_get_pango_context(int /*long*/ widget) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
index dfcdd99dfb..2e1a82bf05 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
@@ -258,7 +258,7 @@ void createHandle (int index) {
int bits = SWT.ARROW | SWT.TOGGLE | SWT.CHECK | SWT.RADIO | SWT.PUSH;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- setHasWindow (fixedHandle, true);
+ gtk_widget_set_has_window (fixedHandle, true);
switch (style & bits) {
case SWT.ARROW:
int arrow_type = OS.GTK_ARROW_UP;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
index 6675b4eb88..84c8c8fbf2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
@@ -366,7 +366,7 @@ void createHandle (int index) {
state |= HANDLE | MENU;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- setHasWindow (fixedHandle, true);
+ gtk_widget_set_has_window (fixedHandle, true);
int /*long*/ oldList = OS.gtk_window_list_toplevels ();
if ((style & SWT.READ_ONLY) != 0) {
handle = OS.gtk_combo_box_new_text ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
index 5e8837eb58..442febd3f1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
@@ -262,7 +262,7 @@ void createHandle (int index, boolean fixed, boolean scrolled) {
if (fixed) {
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- setHasWindow (fixedHandle, true);
+ gtk_widget_set_has_window (fixedHandle, true);
}
int /*long*/ vadj = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 10);
if (vadj == 0) error (SWT.ERROR_NO_HANDLES);
@@ -273,7 +273,7 @@ void createHandle (int index, boolean fixed, boolean scrolled) {
}
handle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
- setHasWindow (handle, true);
+ gtk_widget_set_has_window (handle, true);
OS.GTK_WIDGET_SET_FLAGS(handle, OS.GTK_CAN_FOCUS);
if ((style & SWT.EMBEDDED) == 0) {
if ((state & CANVAS) != 0) {
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 f0f82958f7..7bdb801a71 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
@@ -971,14 +971,6 @@ public Point getLocation () {
return new Point (x, y);
}
-void setHasWindow (int /*long*/ fixedHandle, boolean value) {
- if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
- OS.gtk_widget_set_has_window (fixedHandle, value);
- } else {
- OS.gtk_fixed_set_has_window (fixedHandle, value);
- }
-}
-
/**
* Sets the receiver's location to the point specified by
* the arguments which are relative to the receiver's
@@ -2314,7 +2306,7 @@ int /*long*/ fixedMapProc (int /*long*/ widget) {
int /*long*/ widgets = widgetList;
while (widgets != 0) {
int /*long*/ child = OS.g_list_data (widgets);
- if (OS.GTK_WIDGET_VISIBLE (child) && OS.gtk_widget_get_child_visible (child) && !OS.GTK_WIDGET_MAPPED (child)) {
+ if (OS.GTK_WIDGET_VISIBLE (child) && OS.gtk_widget_get_child_visible (child) && !gtk_widget_get_mapped (child)) {
OS.gtk_widget_map (child);
}
widgets = OS.g_list_next (widgets);
@@ -3211,6 +3203,14 @@ int /*long*/ gtk_visibility_notify_event (int /*long*/ widget, int /*long*/ even
return 0;
}
+void gtk_widget_set_has_window (int /*long*/ fixedHandle, boolean value) {
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
+ OS.gtk_widget_set_has_window (fixedHandle, value);
+ } else {
+ OS.gtk_fixed_set_has_window (fixedHandle, value);
+ }
+}
+
void gtk_widget_size_request (int /*long*/ widget, GtkRequisition requisition) {
OS.gtk_widget_size_request (widget, requisition);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
index faf9d4e623..e65d539966 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
@@ -339,7 +339,7 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- setHasWindow (fixedHandle, true);
+ gtk_widget_set_has_window (fixedHandle, true);
handle = OS.gtk_calendar_new ();
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
OS.gtk_container_add (fixedHandle, handle);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java
index 4e7dc8b203..c6f7003860 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java
@@ -129,7 +129,7 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- setHasWindow (fixedHandle, true);
+ gtk_widget_set_has_window (fixedHandle, true);
handle = OS.gtk_vbox_new (false, 0);
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
if ((style & SWT.V_SCROLL) != 0) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java
index 2cd37168d6..3da092920c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java
@@ -122,7 +122,7 @@ void createHandle(int index) {
state |= HANDLE | THEME_BACKGROUND;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- setHasWindow (fixedHandle, true);
+ gtk_widget_set_has_window (fixedHandle, true);
handle = OS.gtk_frame_new (null);
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
labelHandle = OS.gtk_label_new (null);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
index 838e3f5658..7f38f41c50 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
@@ -202,7 +202,7 @@ void createHandle (int index) {
state |= HANDLE | THEME_BACKGROUND;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- setHasWindow (fixedHandle, true);
+ gtk_widget_set_has_window (fixedHandle, true);
if ((style & SWT.SEPARATOR) != 0) {
if ((style & SWT.HORIZONTAL)!= 0) {
handle = OS.gtk_hseparator_new ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java
index a044cf94a8..55feedb94f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java
@@ -145,7 +145,7 @@ void createHandle(int index) {
state |= HANDLE | THEME_BACKGROUND;
handle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
- setHasWindow (handle, true);
+ gtk_widget_set_has_window (handle, true);
OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
layout = new TextLayout (display);
linkColor = new Color (display, LINK_FOREGROUND);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
index 00098d0079..0aa8fbe8e1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
@@ -189,7 +189,7 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- setHasWindow (fixedHandle, true);
+ gtk_widget_set_has_window (fixedHandle, true);
scrolledHandle = OS.gtk_scrolled_window_new (0, 0);
if (scrolledHandle == 0) error (SWT.ERROR_NO_HANDLES);
/*
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 8bd103943e..70c058ee71 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
@@ -193,7 +193,7 @@ static int checkStyle (int style) {
}
void _setVisible (boolean visible) {
- if (visible == OS.GTK_WIDGET_MAPPED (handle)) return;
+ if (visible == gtk_widget_get_mapped (handle)) return;
if (visible) {
sendEvent (SWT.Show);
if (getItemCount () != 0) {
@@ -372,7 +372,7 @@ void fixMenus (Decorations newParent) {
/*public*/ Rectangle getBounds () {
checkWidget();
- if (!OS.GTK_WIDGET_MAPPED (handle)) {
+ if (!gtk_widget_get_mapped (handle)) {
return new Rectangle (0, 0, 0, 0);
}
int /*long*/ window = OS.GTK_WIDGET_WINDOW (handle);
@@ -639,7 +639,7 @@ public boolean getVisible () {
}
}
}
- return OS.GTK_WIDGET_MAPPED (handle);
+ return gtk_widget_get_mapped (handle);
}
int /*long*/ gtk_hide (int /*long*/ widget) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
index 69f6ae0f87..5ea35ee1c4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
@@ -319,7 +319,7 @@ int /*long*/ getAccelGroup () {
/*public*/ Rectangle getBounds () {
checkWidget();
- if (!OS.GTK_WIDGET_MAPPED (handle)) {
+ if (!gtk_widget_get_mapped (handle)) {
return new Rectangle (0, 0, 0, 0);
}
int x = OS.GTK_WIDGET_X (handle);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
index 5e14f6c08d..ffae259736 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
@@ -83,7 +83,7 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- setHasWindow (fixedHandle, true);
+ gtk_widget_set_has_window (fixedHandle, true);
handle = OS.gtk_progress_bar_new ();
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
OS.gtk_container_add (fixedHandle, handle);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java
index 4fd1a6d7d8..94e31dba50 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java
@@ -136,7 +136,7 @@ void createHandle (int index) {
state |= HANDLE | THEME_BACKGROUND;
handle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
- setHasWindow (handle, true);
+ gtk_widget_set_has_window (handle, true);
OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
int type = (style & SWT.VERTICAL) != 0 ? OS.GDK_SB_H_DOUBLE_ARROW : OS.GDK_SB_V_DOUBLE_ARROW;
defaultCursor = OS.gdk_cursor_new (type);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java
index b70d28f496..79d7416dd9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java
@@ -125,7 +125,7 @@ void createHandle (int index) {
state |= HANDLE | THEME_BACKGROUND;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- setHasWindow (fixedHandle, true);
+ gtk_widget_set_has_window (fixedHandle, true);
int /*long*/ hAdjustment = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 0);
if (hAdjustment == 0) error (SWT.ERROR_NO_HANDLES);
if ((style & SWT.HORIZONTAL) != 0) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
index deed81c947..2a62e480cc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
@@ -2005,7 +2005,7 @@ public void setVisible (boolean visible) {
updateModal ();
}
showWithParent = visible;
- if ((OS.GTK_WIDGET_MAPPED (shellHandle) == visible)) return;
+ if (gtk_widget_get_mapped (shellHandle) == visible) return;
if (visible) {
if (center && !moved) {
center ();
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 5f07dba751..e2386d1aed 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
@@ -152,7 +152,7 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- setHasWindow (fixedHandle, true);
+ gtk_widget_set_has_window (fixedHandle, true);
int /*long*/ hAdjustment = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 10);
if (hAdjustment == 0) error (SWT.ERROR_NO_HANDLES);
if ((style & SWT.HORIZONTAL) != 0) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
index d4519ffbc7..fbb57ce8d4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
@@ -290,7 +290,7 @@ void createHandle (int index) {
state |= HANDLE | MENU;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- setHasWindow (fixedHandle, true);
+ gtk_widget_set_has_window (fixedHandle, true);
int /*long*/ adjustment = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 0);
if (adjustment == 0) error (SWT.ERROR_NO_HANDLES);
handle = OS.gtk_spin_button_new (adjustment, climbRate, 0);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
index 913fc2a312..1ef9cfdba7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
@@ -184,7 +184,7 @@ public Rectangle computeTrim (int x, int y, int width, int height) {
void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
- setHasWindow (fixedHandle, true);
+ gtk_widget_set_has_window (fixedHandle, true);
handle = OS.gtk_notebook_new ();
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
OS.gtk_container_add (fixedHandle, handle);
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 2bd49193ad..e60becf080 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
@@ -593,7 +593,7 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- setHasWindow (fixedHandle, true);
+ gtk_widget_set_has_window (fixedHandle, true);
scrolledHandle = OS.gtk_scrolled_window_new (0, 0);
if (scrolledHandle == 0) error (SWT.ERROR_NO_HANDLES);
int /*long*/ [] types = getColumnTypes (1);
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 2236f34d6f..002686946c 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
@@ -193,7 +193,7 @@ void createHandle (int index) {
}
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- setHasWindow (fixedHandle, true);
+ gtk_widget_set_has_window (fixedHandle, true);
if ((style & SWT.SINGLE) != 0) {
handle = OS.gtk_entry_new ();
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
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 55e3ee97e9..74c851dba6 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
@@ -130,7 +130,7 @@ void createHandle (int index) {
state |= HANDLE | THEME_BACKGROUND;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- setHasWindow (fixedHandle, true);
+ gtk_widget_set_has_window (fixedHandle, true);
handle = OS.gtk_toolbar_new ();
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
OS.gtk_container_add (fixedHandle, handle);
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 04dcaec65e..f46c23ffb9 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
@@ -698,7 +698,7 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- setHasWindow (fixedHandle, true);
+ gtk_widget_set_has_window (fixedHandle, true);
scrolledHandle = OS.gtk_scrolled_window_new (0, 0);
if (scrolledHandle == 0) error (SWT.ERROR_NO_HANDLES);
int /*long*/ [] types = getColumnTypes (1);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
index eb3bbcd8c5..778e9bb987 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
@@ -898,6 +898,14 @@ int /*long*/ gtk_visibility_notify_event (int /*long*/ widget, int /*long*/ even
return 0;
}
+boolean gtk_widget_get_mapped (int /*long*/ widget) {
+ if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) {
+ return OS.gtk_widget_get_mapped (widget);
+ } else {
+ return OS.GTK_WIDGET_MAPPED (widget);
+ }
+}
+
int /*long*/ gtk_window_state_event (int /*long*/ widget, int /*long*/ event) {
return 0;
}