summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorTim Janik <timj@gtk.org>1999-02-20 20:11:23 +0000
committerTim Janik <timj@src.gnome.org>1999-02-20 20:11:23 +0000
commitb0558e089e8e06a4ed2e28ee79e2c88f1c4c0570 (patch)
treed0d6bcc0307990df23341ddf47a7431ea50083e0 /gtk
parent32b008bf5669a9c5007df2a4ea63c69698d155e8 (diff)
downloadgdk-pixbuf-b0558e089e8e06a4ed2e28ee79e2c88f1c4c0570.tar.gz
hm, set_modal doesn't really work with random gtk_grab_add/gtk_grab_remove
Sat Feb 20 20:59:25 1999 Tim Janik <timj@gtk.org> * gtk/gtkwindow.c: hm, set_modal doesn't really work with random gtk_grab_add/gtk_grab_remove calls. either the window user uses the set_modal interface or he places grab_add/grab_remove on his own. (gtk_window_set_modal): enforce modality state either way. (gtk_window_hide): revert previous change.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkwindow.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 0423f77a4..ce562e108 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -484,18 +484,13 @@ gtk_window_set_modal (GtkWindow *window,
g_return_if_fail (window != NULL);
g_return_if_fail (GTK_IS_WINDOW (window));
- modal = modal != FALSE;
+ window->modal = modal != FALSE;
- /* If the widget was showed already, adjust it's grab state */
- if (GTK_WIDGET_VISIBLE (window) && window->modal != modal)
- {
- if (modal)
- gtk_grab_add (GTK_WIDGET (window));
- else
- gtk_grab_remove (GTK_WIDGET (window));
- }
-
- 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));
}
void
@@ -787,8 +782,6 @@ gtk_window_hide (GtkWidget *widget)
GTK_WIDGET_UNSET_FLAGS (widget, GTK_VISIBLE);
gtk_widget_unmap (widget);
- window->modal = GTK_WIDGET_HAS_GRAB (window);
-
if (window->modal)
gtk_grab_remove (widget);
}