#include <libbonobo.h>
#include <login-helper/login-helper.h>
+#include <gtk/gtkwindow.h>
+#include <gdk/gdkx.h>
+#include <X11/Xatom.h>
static void test_init_login_helper_vpointers (LoginHelper *helper,
gpointer test_set_safe,
static Window* test_get_raise_windows (LoginHelper *helper);
+static void test_post_window (void);
+
+static void test_set_wm_dock (void);
+
+static GtkWidget *mainwin = NULL;
+
int
main (int argc, char **argv)
{
g_error ("Could not initialize oaf / Bonobo");
}
- obj_id = "OAFIID:GNOME_GOK:1.0"; /* just for testing, stolen from GOK */
+ obj_id = "OAFIID:GNOME_TEST:1.0"; /* just for testing, install manually */
helper = BONOBO_OBJECT (g_object_new (LOGIN_HELPER_TYPE, NULL));
test_init_login_helper_vpointers ((LoginHelper*)helper, test_set_safe, test_get_device_reqs, test_get_raise_windows);
+ gtk_init (&argc, &argv);
+
+ test_post_window ();
+
bonobo_main ();
}
static LoginHelperDeviceReqFlags
test_get_device_reqs (LoginHelper *helper)
{
- return 0;
+ return LOGIN_HELPER_POST_WINDOWS;
}
static Window*
test_get_raise_windows (LoginHelper *helper)
{
- return NULL;
+ Window *winlist = g_new0 (Window, 2);
+ winlist[0] = GDK_WINDOW_XWINDOW (mainwin->window);
+ winlist[1] = None;
+ return winlist;
+}
+
+
+void
+test_set_wm_dock ()
+{
+ Atom atom_type[1], atom_window_type;
+
+ gtk_widget_hide (mainwin);
+
+ gdk_error_trap_push ();
+ atom_window_type = gdk_x11_get_xatom_by_name ("_NET_WM_WINDOW_TYPE");
+
+ atom_type[0] = gdk_x11_get_xatom_by_name ("_NET_WM_WINDOW_TYPE_DOCK");
+
+ XChangeProperty (GDK_WINDOW_XDISPLAY (mainwin->window),
+ GDK_WINDOW_XWINDOW (mainwin->window),
+ atom_window_type,
+ XA_ATOM, 32, PropModeReplace,
+ (guchar *) &atom_type, 1);
+ gdk_error_trap_pop ();
+
+ gtk_widget_show (mainwin);
+
+}
+
+static void
+test_post_window ()
+{
+ mainwin = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+
+ gtk_window_set_screen (GTK_WINDOW (mainwin), gdk_screen_get_default ());
+
+ /* gtk_window_set_keep_above (GTK_WINDOW (mainwin), true); optional */
+ /* test_set_wm_dock (); optional */
+
+ gtk_widget_show_all (mainwin);
}