diff --git a/ChangeLog b/ChangeLog index 6f46320f1c..bd83d00b8d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Mon Jan 19 09:16:38 1998 Tim Janik + + * gtk/gtkmain.c (gtk_grab_add) (gtk_grab_remove): this is a stack + of grabbing widgets now, having unique entries. the GTK_HAS_GRAB + flag of a widget is set while it is on the stack (wasn't + implemented before). + Mon Jan 19 00:46:18 1998 MET Eckehard Berns * gtk/gtktoolbar.[ch]: changed diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 6f46320f1c..bd83d00b8d 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,10 @@ +Mon Jan 19 09:16:38 1998 Tim Janik + + * gtk/gtkmain.c (gtk_grab_add) (gtk_grab_remove): this is a stack + of grabbing widgets now, having unique entries. the GTK_HAS_GRAB + flag of a widget is set while it is on the stack (wasn't + implemented before). + Mon Jan 19 00:46:18 1998 MET Eckehard Berns * gtk/gtktoolbar.[ch]: changed diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 6f46320f1c..bd83d00b8d 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +Mon Jan 19 09:16:38 1998 Tim Janik + + * gtk/gtkmain.c (gtk_grab_add) (gtk_grab_remove): this is a stack + of grabbing widgets now, having unique entries. the GTK_HAS_GRAB + flag of a widget is set while it is on the stack (wasn't + implemented before). + Mon Jan 19 00:46:18 1998 MET Eckehard Berns * gtk/gtktoolbar.[ch]: changed diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 6f46320f1c..bd83d00b8d 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,10 @@ +Mon Jan 19 09:16:38 1998 Tim Janik + + * gtk/gtkmain.c (gtk_grab_add) (gtk_grab_remove): this is a stack + of grabbing widgets now, having unique entries. the GTK_HAS_GRAB + flag of a widget is set while it is on the stack (wasn't + implemented before). + Mon Jan 19 00:46:18 1998 MET Eckehard Berns * gtk/gtktoolbar.[ch]: changed diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 6f46320f1c..bd83d00b8d 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,10 @@ +Mon Jan 19 09:16:38 1998 Tim Janik + + * gtk/gtkmain.c (gtk_grab_add) (gtk_grab_remove): this is a stack + of grabbing widgets now, having unique entries. the GTK_HAS_GRAB + flag of a widget is set while it is on the stack (wasn't + implemented before). + Mon Jan 19 00:46:18 1998 MET Eckehard Berns * gtk/gtktoolbar.[ch]: changed diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 6f46320f1c..bd83d00b8d 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +Mon Jan 19 09:16:38 1998 Tim Janik + + * gtk/gtkmain.c (gtk_grab_add) (gtk_grab_remove): this is a stack + of grabbing widgets now, having unique entries. the GTK_HAS_GRAB + flag of a widget is set while it is on the stack (wasn't + implemented before). + Mon Jan 19 00:46:18 1998 MET Eckehard Berns * gtk/gtktoolbar.[ch]: changed diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 6f46320f1c..bd83d00b8d 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +Mon Jan 19 09:16:38 1998 Tim Janik + + * gtk/gtkmain.c (gtk_grab_add) (gtk_grab_remove): this is a stack + of grabbing widgets now, having unique entries. the GTK_HAS_GRAB + flag of a widget is set while it is on the stack (wasn't + implemented before). + Mon Jan 19 00:46:18 1998 MET Eckehard Berns * gtk/gtktoolbar.[ch]: changed diff --git a/config.h.in b/config.h.in index 5e547ec4d9..082633f17d 100644 --- a/config.h.in +++ b/config.h.in @@ -3,6 +3,9 @@ /* Define to empty if the keyword does not work. */ #undef const +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP + /* Define as __inline if that's what the C compiler calls it. */ #undef inline @@ -35,4 +38,8 @@ /* Define as the return type of signal handlers (int or void). */ #undef RETSIGTYPE -#undef HAVE_MMAP +/* Define if you have the getpagesize function. */ +#undef HAVE_GETPAGESIZE + +/* Define if you have the header file. */ +#undef HAVE_UNISTD_H diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index 82c71014e9..19ae056cbf 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -106,8 +106,8 @@ static GdkEvent *next_event = NULL; static GdkEvent *current_event = NULL; static GList *current_events = NULL; -static GList *grabs = NULL; /* A list of grabs. The grabbing widget - * is the first one on the list. +static GSList *grabs = NULL; /* A stack of unique grabs. The grabbing + * widget is the first one on the list. */ static GList *init_functions = NULL; /* A list of init functions. */ @@ -481,19 +481,27 @@ gtk_false (void) void gtk_grab_add (GtkWidget *widget) { - /* Place the grab on the front of the list of grabs. - */ - grabs = g_list_prepend (grabs, widget); + g_return_if_fail (widget != NULL); + + if (!GTK_WIDGET_HAS_GRAB (widget) && !GTK_OBJECT_NEED_DESTROY (widget)) + { + GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_GRAB); + + grabs = g_slist_prepend (grabs, widget); + } } void gtk_grab_remove (GtkWidget *widget) { - /* Remove the grab from the list of grabs. - * Note: the grab being removed may be in - * the middle of the list. - */ - grabs = g_list_remove (grabs, widget); + g_return_if_fail (widget != NULL); + + if (GTK_WIDGET_HAS_GRAB (widget)) + { + GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_GRAB); + + grabs = g_slist_remove (grabs, widget); + } } void diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index be4cac893e..e77904e488 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -1105,6 +1105,8 @@ gtk_widget_destroy (GtkWidget *widget) } + gtk_grab_remove (widget); + if (widget->parent) { if (!GTK_OBJECT_BEING_DESTROYED (widget->parent)) @@ -3019,8 +3021,6 @@ gtk_real_widget_destroy (GtkObject *object) if (GTK_WIDGET_RESIZE_NEEDED (widget)) g_warning ("resize needed\n"); - gtk_grab_remove (widget); - gtk_selection_remove_all (widget); if (widget->name) diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h index 13836c5e56..58c92b71b5 100644 --- a/gtk/gtkwidget.h +++ b/gtk/gtkwidget.h @@ -50,7 +50,7 @@ enum GTK_ANCHORED = 1 << 15, GTK_BASIC = 1 << 16, GTK_USER_STYLE = 1 << 17, - GTK_GRAB_ALL = 1 << 18, + GTK_HAS_GRAB = 1 << 18, GTK_REDRAW_PENDING = 1 << 19, GTK_RESIZE_PENDING = 1 << 20, GTK_RESIZE_NEEDED = 1 << 21, @@ -91,7 +91,7 @@ enum #define GTK_WIDGET_ANCHORED(obj) (GTK_OBJECT_FLAGS (obj) & GTK_ANCHORED) #define GTK_WIDGET_BASIC(obj) (GTK_OBJECT_FLAGS (obj) & GTK_BASIC) #define GTK_WIDGET_USER_STYLE(obj) (GTK_OBJECT_FLAGS (obj) & GTK_USER_STYLE) -#define GTK_WIDGET_GRAB_ALL(obj) (GTK_OBJECT_FLAGS (obj) & GTK_GRAB_ALL) +#define GTK_WIDGET_HAS_GRAB(obj) (GTK_OBJECT_FLAGS (obj) & GTK_HAS_GRAB) #define GTK_WIDGET_REDRAW_PENDING(obj) (GTK_OBJECT_FLAGS (obj) & GTK_REDRAW_PENDING) #define GTK_WIDGET_RESIZE_PENDING(obj) (GTK_OBJECT_FLAGS (obj) & GTK_RESIZE_PENDING) #define GTK_WIDGET_RESIZE_NEEDED(obj) (GTK_OBJECT_FLAGS (obj) & GTK_RESIZE_NEEDED)