summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
diff options
context:
space:
mode:
authorBogdan Gheorghe <gheorghe>2009-02-13 19:29:44 +0000
committerBogdan Gheorghe <gheorghe>2009-02-13 19:29:44 +0000
commitd2e5dcd7efd5667e08cacd2f0a4973952e5a602f (patch)
treebd2fc0041301502812377895e2f28de07dffc61f /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
parent7867f4333df3401f2d9ceb7dab2dbc0c4b8c2343 (diff)
downloadeclipse.platform.swt-d2e5dcd7efd5667e08cacd2f0a4973952e5a602f.tar.gz
eclipse.platform.swt-d2e5dcd7efd5667e08cacd2f0a4973952e5a602f.tar.xz
eclipse.platform.swt-d2e5dcd7efd5667e08cacd2f0a4973952e5a602f.zip
259457 swt tray icon disappears on gnome panel restart
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
index 0d162d1e22..7ce084ceb4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
@@ -326,12 +326,19 @@ Point getLocation () {
int y = this.y;
if (item != null) {
int /*long*/ itemHandle = item.handle;
- OS.gtk_widget_realize (itemHandle);
- int /*long*/ window = OS.GTK_WIDGET_WINDOW (itemHandle);
- int [] px = new int [1], py = new int [1];
- OS.gdk_window_get_origin (window, px, py);
- x = px [0] + OS.GTK_WIDGET_WIDTH (itemHandle) / 2;
- y = py [0] + OS.GTK_WIDGET_HEIGHT (itemHandle) / 2;
+ if(OS.GTK_VERSION >= OS.VERSION (2, 10, 0)) {
+ GdkRectangle area = new GdkRectangle ();
+ OS.gtk_status_icon_get_geometry (itemHandle, 0, area, 0);
+ x = area.x + area.width / 2;
+ y = area.y + area.height / 2;
+ } else {
+ OS.gtk_widget_realize (itemHandle);
+ int /*long*/ window = OS.GTK_WIDGET_WINDOW (itemHandle);
+ int [] px = new int [1], py = new int [1];
+ OS.gdk_window_get_origin (window, px, py);
+ x = px [0] + OS.GTK_WIDGET_WIDTH (itemHandle) / 2;
+ y = py [0] + OS.GTK_WIDGET_HEIGHT (itemHandle) / 2;
+ }
}
if (x == -1 || y == -1) {
int [] px = new int [1], py = new int [1];