summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>2004-12-09 16:09:13 +0000
committerbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>2004-12-09 16:09:13 +0000
commit0374b876444bcf121fbf7c871ea03adc4a2b5a52 (patch)
tree8d2d07a9ced54448d01d58d2ee2484bce4927f1d /test
parent3ddca6c4b31b295234d674b24d78ddf68206340e (diff)
downloadat-spi2-core-0374b876444bcf121fbf7c871ea03adc4a2b5a52.tar.gz
Revved to 1.6.2.
git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@726 e2bd861d-eb25-0410-b326-f6ed22b6b98c
Diffstat (limited to 'test')
-rw-r--r--test/login-helper-server-test.c59
1 files changed, 56 insertions, 3 deletions
diff --git a/test/login-helper-server-test.c b/test/login-helper-server-test.c
index ba6a2748..b7c53c89 100644
--- a/test/login-helper-server-test.c
+++ b/test/login-helper-server-test.c
@@ -1,5 +1,8 @@
#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,
@@ -12,6 +15,12 @@ static LoginHelperDeviceReqFlags test_get_device_reqs (LoginHelper *helper);
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)
{
@@ -24,7 +33,7 @@ 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));
@@ -72,6 +81,10 @@ main (int argc, char **argv)
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 ();
}
@@ -96,11 +109,51 @@ test_set_safe (LoginHelper *helper, gboolean safe)
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);
}