Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2010-06-15 17:57:11 +0000
committerAndrew Niefer2010-06-15 17:57:11 +0000
commit41a905b21bb776dc09b934736ac47439c774e2be (patch)
tree999ba1806d00517d9f309c318855777ba826967b /bundles
parent5eb8a23141084641ef13e94e3345c607b94d3afb (diff)
downloadrt.equinox.framework-41a905b21bb776dc09b934736ac47439c774e2be.tar.gz
rt.equinox.framework-41a905b21bb776dc09b934736ac47439c774e2be.tar.xz
rt.equinox.framework-41a905b21bb776dc09b934736ac47439c774e2be.zip
bug 316948 - use X11 calls for property change
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.c16
-rw-r--r--bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.h6
-rw-r--r--bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkInit.c6
3 files changed, 9 insertions, 19 deletions
diff --git a/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.c b/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.c
index 9aeee5f37..7352af3c6 100644
--- a/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.c
+++ b/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -134,24 +134,18 @@ static char * createSWTWindowString(char * suffix, int semaphore) {
static int setAppWindowPropertyFn() {
Window appWindow;
- GdkWindow *propWindow;
- GdkAtom propAtom;
+ Atom propAtom;
_TCHAR *propVal;
//Look for the SWT window. If it's there, set a property on it.
appWindow = gtk.XGetSelectionOwner(gtk_GDK_DISPLAY, appWindowAtom);
- //appWindow = XGetSelectionOwner(GDK_DISPLAY(), appWindowAtom);
if (appWindow) {
- propAtom = gtk.gdk_atom_intern("org.eclipse.swt.filePath.message", FALSE);
+ propAtom = gtk.XInternAtom(gtk_GDK_DISPLAY, "org.eclipse.swt.filePath.message", FALSE);
//append a colon delimiter in case more than one file gets appended to the app windows property.
propVal = concatPaths(openFilePath, _T_ECLIPSE(':'));
- propWindow = gtk.gdk_window_foreign_new(appWindow);
- if (propWindow != NULL) {
- gtk.gdk_property_change(propWindow, propAtom, propAtom, 8, GDK_PROP_MODE_APPEND, (guchar *) propVal, _tcslen(propVal));
- free(propVal);
- return 1;
- } //else the window got destroyed between XGetSelectionOwner and here (?)
+ gtk.XChangeProperty(gtk_GDK_DISPLAY, appWindow, propAtom, propAtom, 8, PropModeAppend, (unsigned char *)propVal, _tcslen(propVal));
free(propVal);
+ return 1;
}
return 0;
}
diff --git a/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.h b/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.h
index c78ceaa38..cdff7f437 100644
--- a/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.h
+++ b/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.h
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -54,12 +54,10 @@ struct GTK_PTRS {
int (*gdk_pixbuf_get_width) (const GdkPixbuf*);
int (*gdk_pixbuf_get_height) (const GdkPixbuf*);
void (*gdk_set_program_class) (const char*);
- GdkWindow* (*gdk_window_foreign_new) (GdkNativeWindow);
- void (*gdk_property_change) (GdkWindow*, GdkAtom, GdkAtom, gint, GdkPropMode, const guchar*, gint);
- GdkAtom (*gdk_atom_intern) (const gchar*, gboolean);
Window (*XGetSelectionOwner) (Display*, Atom);
void (*XSetSelectionOwner) (Display*, Atom, Window, Time);
+ void (*XChangeProperty) (Display*, Window, Atom, Atom, int, int, unsigned char *, int);
Window (*XCreateWindow) (Display*, Window, int, int, unsigned int, unsigned int, unsigned int, int, unsigned int, Visual*, unsigned long, XSetWindowAttributes*);
void (*XSync) (Display*, Bool);
int (*XDefaultScreen) (Display*);
diff --git a/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkInit.c b/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkInit.c
index c6f888cd1..f5617382a 100644
--- a/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkInit.c
+++ b/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkInit.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -44,9 +44,6 @@ static FN_TABLE gtkFunctions[] = { FN_TABLE_ENTRY(gtk_adjustment_new),
};
/* functions from libgdk-x11-2.0 */
static FN_TABLE gdkFunctions[] = { FN_TABLE_ENTRY(gdk_set_program_class),
- FN_TABLE_ENTRY(gdk_property_change),
- FN_TABLE_ENTRY(gdk_atom_intern),
- FN_TABLE_ENTRY(gdk_window_foreign_new),
FN_TABLE_ENTRY(gdk_display), /* not a function */
{ NULL, NULL }
};
@@ -72,6 +69,7 @@ static FN_TABLE gobjFunctions[] = { FN_TABLE_ENTRY(g_log_set_handler),
static FN_TABLE x11Functions[] = { FN_TABLE_ENTRY(XGetSelectionOwner),
FN_TABLE_ENTRY(XSetSelectionOwner),
FN_TABLE_ENTRY(XCreateWindow),
+ FN_TABLE_ENTRY(XChangeProperty),
FN_TABLE_ENTRY(XSync),
FN_TABLE_ENTRY(XRootWindow),
FN_TABLE_ENTRY(XDefaultScreen),

Back to the top