(no subject)



WINDOWID seems like the only way you could even think about doing it.
It's basically a big hack, there is no clean way to do big hacks.

This works great in Linux RH5.2 but in RH 6.0 with Gnome
apparently I am not so lucky.

Have you figured out what goes wrong?

The WINDOWID variable is indeed defined, and the value I get
from my app is the same I get with printenv WINDOID. However,
when I press the button, XRaiseWindow(display, console) is not
executed, for some reason.

I have all my stuff only in this RH5.2, so what I did was to
compile statically, ftp to a friend's computer and run it.
As it is slightly dificult to test this myself at the moment,
I prepared this test with 38 lines which shows the problem.
With RH5.2 this raises and lowers the parent xterm, with RH6.0
nothing happens. I am wondering if this has something to do
with the static compilation... Would someone be so kind to
compile and run this test in Gnome, to see what happens?
Carlos

------------------------------------------------------------
#include <gtk/gtk.h>
#include <gdk/gdkx.h>

Display *display;
Window console;

void handle_console_button (GtkWidget *widget, gpointer data)
{
static gint flag = 1;

if (flag > 0) XRaiseWindow(display, console);
else XLowerWindow(display, console);
flag *= -1;
}

int main (int argc, char **argv)
{
char *windowid;
GtkWidget *window;
GtkWidget *button;

gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_usize (window, 400, 400);
button = gtk_button_new_with_label("Press to raise parent Xterm");
gtk_container_add (GTK_CONTAINER (window), button);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (handle_console_button), NULL);
gtk_widget_show(button);
gtk_widget_show(window);

windowid = (char *) getenv("WINDOWID");
console = (Window) atoi(windowid);
display = GDK_WINDOW_XDISPLAY(window->window);
gtk_main();
}




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]