Re: Which signal just before a window is hidden?



Wolfgang Sourdeau wrote:

(BTW, what is the difference between map and realize?)

An X Window is mapped when it's displayed on screen.
A GTK widget is realized when it's structured is fully "instanciated",
that is, when the widgets properties are set and useable. Normally a
widget is realized just before it's shown.

Ok, thanks for the explanation.

I don't understand why "unmap" signal does not work then here (I mean in
the signal func the window is already unmapped). Because the source of
gtk_window_hide looks like this:

static void
gtk_window_hide (GtkWidget *widget)
{
  GtkWindow *window;

  g_return_if_fail (widget != NULL);
  g_return_if_fail (GTK_IS_WINDOW (widget));

  window = GTK_WINDOW (widget);

  GTK_WIDGET_UNSET_FLAGS (widget, GTK_VISIBLE);
  gtk_widget_unmap (widget);

  if (window->modal)
    gtk_grab_remove (widget);
}

Obviously its main work is to call gtk_widget_unmap (widget); which looks
like this:

void
gtk_widget_unmap (GtkWidget *widget)
{
  g_return_if_fail (widget != NULL);
  g_return_if_fail (GTK_IS_WIDGET (widget));
  
  if (GTK_WIDGET_MAPPED (widget))
    {
      if (GTK_WIDGET_NO_WINDOW (widget))
        gtk_widget_queue_clear_child (widget);
      gtk_signal_emit (GTK_OBJECT (widget), widget_signals[UNMAP]);
    }
}

So where is the window really unmapped? It seems not before the gtk_signal_emit
and thus my gdk_window_get_root_origin (...) should be ok.

Now I must put my own function around each and every gtk_window_hide () call
all over all source files :(

Regards,
WL




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