Forums » Linux

The $BROWSER not set window

Oct 03, 2004 mr_spuck link
With Metacity (ver 2.8.4) it appears behind the updater window.
And hitting the Help button multiple times opens more than one window. Might be better to just refocus the old one.

Okay both not really major things just a bit odd.
Oct 04, 2004 roguelazer link
$BROWSER is supposed to be set...
Oct 05, 2004 mr_spuck link
I know that. Though the message that tells you that isn't very helpful if it's behind the updater window.

Does it show up correctly for you if you unset $BROWSER? Maybe it's just a weirdness in metacity.
Oct 05, 2004 pod link
It happens in Openbox 3 too.
Oct 05, 2004 a1k0n link
Weird. Works ok in Fluxbox. I don't know why it would show up underneath; it's a new dialog message, created from scratch when you press the 'help' button (not before the main window pops up).

I'm open to suggestions. Here's the code for popping up the window:

void quick_message(gchar *message, gchar *title) {
GtkWidget *dialog, *label, *okay_button;

/* Create the widgets */

dialog = gtk_dialog_new();
label = gtk_label_new (message);
okay_button = gtk_button_new_with_label(" Close ");
gtk_window_set_title (GTK_WINDOW (dialog), title);
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);

/* Ensure that the dialog box is destroyed when the user clicks ok. */

gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),
okay_button, FALSE, FALSE, 0);

/* Add the label, and show everything we've added to the dialog. */

gtk_misc_set_padding(GTK_MISC(label), 20, 20);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox),
label);

gtk_signal_connect_object (GTK_OBJECT (okay_button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), (void*)dialog);

gtk_widget_show_all (dialog);
}
Oct 05, 2004 mr_spuck link
Maybe I'm on the wrong track. It's been a while since I did anything with gtk. I made a little test app, just a window with a button that calls your function.

If I create the main window with gtk_window_new(GTK_WINDOW_DIALOG) the dialog shows up behind the window. With gtk_window_new(GTK_WINDOW_TOPLEVEL) it works correctly.
Maybe that's the reason.
Oct 05, 2004 a1k0n link
Ah. That's really weird; I am indeed using GTK_WINDOW_DIALOG for the main window. Thanks for looking into it.

The next patch will include this change. You rock.
Oct 06, 2004 mr_spuck link
Nice. It works correctly now.