+Sun Dec 15 18:47:30 2002 Owen Taylor <otaylor@redhat.com>
+
+ Some fixes for modal hint setting based on a patch
+ from Arvind Samptur (#100416)
+
+ * gtk/gtkdialog.c (gtk_dialog_run): Call gtk_window_set_modal
+ before showing the window for efficiency.
+
+ * gtk/gtkwindow.c (gtk_window_realize): Ignore the EWMH
+ constraint that the transient-for hint must always be
+ set on windows with the modal hint and just always set
+ the modal hint.
+
+ * gtk/gtkwindow.c (gtk_window_set_modal): Update the
+ modal hint on the GdkWindow when the window is realized.
+
Sun Dec 15 18:39:09 2002 Owen Taylor <otaylor@redhat.com>
* configure.in: Hard-code GTK_BINARY_VERSION=2.2.0 for
+Sun Dec 15 18:47:30 2002 Owen Taylor <otaylor@redhat.com>
+
+ Some fixes for modal hint setting based on a patch
+ from Arvind Samptur (#100416)
+
+ * gtk/gtkdialog.c (gtk_dialog_run): Call gtk_window_set_modal
+ before showing the window for efficiency.
+
+ * gtk/gtkwindow.c (gtk_window_realize): Ignore the EWMH
+ constraint that the transient-for hint must always be
+ set on windows with the modal hint and just always set
+ the modal hint.
+
+ * gtk/gtkwindow.c (gtk_window_set_modal): Update the
+ modal hint on the GdkWindow when the window is realized.
+
Sun Dec 15 18:39:09 2002 Owen Taylor <otaylor@redhat.com>
* configure.in: Hard-code GTK_BINARY_VERSION=2.2.0 for
+Sun Dec 15 18:47:30 2002 Owen Taylor <otaylor@redhat.com>
+
+ Some fixes for modal hint setting based on a patch
+ from Arvind Samptur (#100416)
+
+ * gtk/gtkdialog.c (gtk_dialog_run): Call gtk_window_set_modal
+ before showing the window for efficiency.
+
+ * gtk/gtkwindow.c (gtk_window_realize): Ignore the EWMH
+ constraint that the transient-for hint must always be
+ set on windows with the modal hint and just always set
+ the modal hint.
+
+ * gtk/gtkwindow.c (gtk_window_set_modal): Update the
+ modal hint on the GdkWindow when the window is realized.
+
Sun Dec 15 18:39:09 2002 Owen Taylor <otaylor@redhat.com>
* configure.in: Hard-code GTK_BINARY_VERSION=2.2.0 for
+Sun Dec 15 18:47:30 2002 Owen Taylor <otaylor@redhat.com>
+
+ Some fixes for modal hint setting based on a patch
+ from Arvind Samptur (#100416)
+
+ * gtk/gtkdialog.c (gtk_dialog_run): Call gtk_window_set_modal
+ before showing the window for efficiency.
+
+ * gtk/gtkwindow.c (gtk_window_realize): Ignore the EWMH
+ constraint that the transient-for hint must always be
+ set on windows with the modal hint and just always set
+ the modal hint.
+
+ * gtk/gtkwindow.c (gtk_window_set_modal): Update the
+ modal hint on the GdkWindow when the window is realized.
+
Sun Dec 15 18:39:09 2002 Owen Taylor <otaylor@redhat.com>
* configure.in: Hard-code GTK_BINARY_VERSION=2.2.0 for
+Sun Dec 15 18:47:30 2002 Owen Taylor <otaylor@redhat.com>
+
+ Some fixes for modal hint setting based on a patch
+ from Arvind Samptur (#100416)
+
+ * gtk/gtkdialog.c (gtk_dialog_run): Call gtk_window_set_modal
+ before showing the window for efficiency.
+
+ * gtk/gtkwindow.c (gtk_window_realize): Ignore the EWMH
+ constraint that the transient-for hint must always be
+ set on windows with the modal hint and just always set
+ the modal hint.
+
+ * gtk/gtkwindow.c (gtk_window_set_modal): Update the
+ modal hint on the GdkWindow when the window is realized.
+
Sun Dec 15 18:39:09 2002 Owen Taylor <otaylor@redhat.com>
* configure.in: Hard-code GTK_BINARY_VERSION=2.2.0 for
+Sun Dec 15 18:47:30 2002 Owen Taylor <otaylor@redhat.com>
+
+ Some fixes for modal hint setting based on a patch
+ from Arvind Samptur (#100416)
+
+ * gtk/gtkdialog.c (gtk_dialog_run): Call gtk_window_set_modal
+ before showing the window for efficiency.
+
+ * gtk/gtkwindow.c (gtk_window_realize): Ignore the EWMH
+ constraint that the transient-for hint must always be
+ set on windows with the modal hint and just always set
+ the modal hint.
+
+ * gtk/gtkwindow.c (gtk_window_set_modal): Update the
+ modal hint on the GdkWindow when the window is realized.
+
Sun Dec 15 18:39:09 2002 Owen Taylor <otaylor@redhat.com>
* configure.in: Hard-code GTK_BINARY_VERSION=2.2.0 for
g_object_ref (dialog);
- if (!GTK_WIDGET_VISIBLE (dialog))
- gtk_widget_show (GTK_WIDGET (dialog));
-
was_modal = GTK_WINDOW (dialog)->modal;
if (!was_modal)
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
+ if (!GTK_WIDGET_VISIBLE (dialog))
+ gtk_widget_show (GTK_WIDGET (dialog));
+
response_handler =
g_signal_connect (dialog,
"response",
{
g_return_if_fail (GTK_IS_WINDOW (window));
- window->modal = modal != FALSE;
+ modal = modal != FALSE;
+ if (window->modal == modal)
+ return;
+
+ window->modal = modal;
/* adjust desired modality state */
- if (GTK_WIDGET_VISIBLE (window) && window->modal)
- gtk_grab_add (GTK_WIDGET (window));
- else
- gtk_grab_remove (GTK_WIDGET (window));
+ if (GTK_WIDGET_REALIZED (window))
+ {
+ GtkWidget *widget = GTK_WIDGET (window);
+
+ if (window->modal)
+ gdk_window_set_modal_hint (widget->window, TRUE);
+ else
+ gdk_window_set_modal_hint (widget->window, FALSE);
+ }
+
+ if (GTK_WIDGET_VISIBLE (window))
+ {
+ if (window->modal)
+ gtk_grab_add (GTK_WIDGET (window));
+ else
+ gtk_grab_remove (GTK_WIDGET (window));
+ }
g_object_notify (G_OBJECT (window), "modal");
}
if (gtk_window_get_skip_taskbar_hint (window))
gdk_window_set_skip_taskbar_hint (widget->window, TRUE);
- /* transient_for must be set to allow the modal hint */
- if (window->transient_parent && window->modal)
+ if (window->modal)
gdk_window_set_modal_hint (widget->window, TRUE);
else
gdk_window_set_modal_hint (widget->window, FALSE);