diff options
author | Owen Taylor <otaylor@redhat.com> | 1998-09-15 15:25:26 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1998-09-15 15:25:26 +0000 |
commit | ec576b8f55648c19383dbdae44a809bdb5e58350 (patch) | |
tree | 41f6d229da0022d9f89ebce6a88db327b746ab2b | |
parent | 8aa4520763ed0fd39b05a847f6d144843b549c21 (diff) | |
download | gtk+-ec576b8f55648c19383dbdae44a809bdb5e58350.tar.gz |
Keep a list of directories in which we never want to stat the entries
Tue Sep 15 11:30:03 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: Keep a list of directories in which we never
want to stat the entries (like /afs), and assume everything in
those directories is a subdirectory.
- When following a path, try to open components even when
we don't find them in their parent's directory to
support automounters.
Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (adjust_adj): Change the way we
set the adjustments on resize so that it tries to
keep the beginning of the text in approximately
the same place.
Removed assertion that the above change made invalid.
Fri Sep 11 15:36:33 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully
now at least compiles again.
* gdk/gdk.c (gdk_event_translate): Don't pass events
on destroyed widgets to the gdk_input layer.
-rw-r--r-- | ChangeLog | 42 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 42 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 42 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 42 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 42 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 42 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 42 | ||||
-rw-r--r-- | gdk/gdk.c | 5 | ||||
-rw-r--r-- | gdk/gdkinputgxi.h | 31 | ||||
-rw-r--r-- | gdk/gdkinputxfree.h | 2 | ||||
-rw-r--r-- | gdk/x11/gdkinput-gxi.c | 31 | ||||
-rw-r--r-- | gdk/x11/gdkinput-xfree.c | 2 | ||||
-rw-r--r-- | gdk/x11/gdkmain-x11.c | 5 | ||||
-rw-r--r-- | gtk/gtkfilesel.c | 134 | ||||
-rw-r--r-- | gtk/gtktext.c | 104 |
15 files changed, 474 insertions, 134 deletions
@@ -1,3 +1,42 @@ +Tue Sep 15 11:30:03 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkfilesel.c: Keep a list of directories in which we never + want to stat the entries (like /afs), and assume everything in + those directories is a subdirectory. + + - When following a path, try to open components even when + we don't find them in their parent's directory to + support automounters. + +Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c (adjust_adj): Change the way we + set the adjustments on resize so that it tries to + keep the beginning of the text in approximately + the same place. + + Removed assertion that the above change made invalid. + +Fri Sep 11 15:36:33 1998 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully + now at least compiles again. + + * gdk/gdk.c (gdk_event_translate): Don't pass events + on destroyed widgets to the gdk_input layer. + +Thu Sep 10 22:19:35 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c: - Save first_cut_pixels when switching + sizes, so that if we switch to the _same_ size, + we don't move lines around. + + - Make sure that the text area always has a size of at + least 1x1, then do all computations when realized. + + - When fetching lines in recompute_geometry, make + sure we fetch enough lines to cover the screen. + Sat Sep 5 16:01:19 1998 Owen Taylor <otaylor@gtk.org> * gdk/gdkinputxfree.h gdk/gdk.c gdk/gdkinputgxi.h: @@ -8,7 +47,7 @@ Sat Sep 5 16:01:19 1998 Owen Taylor <otaylor@gtk.org> Thu Sep 3 19:45:34 1998 Owen Taylor <otaylor@redhat.com> - * gtk/gtkthemes.c: Use g_module instead of dlopen(); + * gtk/gtkthemes.c: Use g_module instead of dlopen() Thu Sep 3 19:30:11 1998 Owen Taylor <otaylor@redhat.com> @@ -33,7 +72,6 @@ Mon Aug 31 15:33:13 1998 Owen Taylor <otaylor@redhat.com> non-themes branch. (This does break bin compat within the themes branch.) ->>>>>>> 1.554.2.31 Sun Aug 30 16:48:27 1998 Owen Taylor <otaylor@gtk.org> * gtk/gtklabel.c (gtk_label_set): Eliminate a diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index cbbd5f735e..cf9f8410cd 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,42 @@ +Tue Sep 15 11:30:03 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkfilesel.c: Keep a list of directories in which we never + want to stat the entries (like /afs), and assume everything in + those directories is a subdirectory. + + - When following a path, try to open components even when + we don't find them in their parent's directory to + support automounters. + +Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c (adjust_adj): Change the way we + set the adjustments on resize so that it tries to + keep the beginning of the text in approximately + the same place. + + Removed assertion that the above change made invalid. + +Fri Sep 11 15:36:33 1998 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully + now at least compiles again. + + * gdk/gdk.c (gdk_event_translate): Don't pass events + on destroyed widgets to the gdk_input layer. + +Thu Sep 10 22:19:35 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c: - Save first_cut_pixels when switching + sizes, so that if we switch to the _same_ size, + we don't move lines around. + + - Make sure that the text area always has a size of at + least 1x1, then do all computations when realized. + + - When fetching lines in recompute_geometry, make + sure we fetch enough lines to cover the screen. + Sat Sep 5 16:01:19 1998 Owen Taylor <otaylor@gtk.org> * gdk/gdkinputxfree.h gdk/gdk.c gdk/gdkinputgxi.h: @@ -8,7 +47,7 @@ Sat Sep 5 16:01:19 1998 Owen Taylor <otaylor@gtk.org> Thu Sep 3 19:45:34 1998 Owen Taylor <otaylor@redhat.com> - * gtk/gtkthemes.c: Use g_module instead of dlopen(); + * gtk/gtkthemes.c: Use g_module instead of dlopen() Thu Sep 3 19:30:11 1998 Owen Taylor <otaylor@redhat.com> @@ -33,7 +72,6 @@ Mon Aug 31 15:33:13 1998 Owen Taylor <otaylor@redhat.com> non-themes branch. (This does break bin compat within the themes branch.) ->>>>>>> 1.554.2.31 Sun Aug 30 16:48:27 1998 Owen Taylor <otaylor@gtk.org> * gtk/gtklabel.c (gtk_label_set): Eliminate a diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index cbbd5f735e..cf9f8410cd 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,42 @@ +Tue Sep 15 11:30:03 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkfilesel.c: Keep a list of directories in which we never + want to stat the entries (like /afs), and assume everything in + those directories is a subdirectory. + + - When following a path, try to open components even when + we don't find them in their parent's directory to + support automounters. + +Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c (adjust_adj): Change the way we + set the adjustments on resize so that it tries to + keep the beginning of the text in approximately + the same place. + + Removed assertion that the above change made invalid. + +Fri Sep 11 15:36:33 1998 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully + now at least compiles again. + + * gdk/gdk.c (gdk_event_translate): Don't pass events + on destroyed widgets to the gdk_input layer. + +Thu Sep 10 22:19:35 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c: - Save first_cut_pixels when switching + sizes, so that if we switch to the _same_ size, + we don't move lines around. + + - Make sure that the text area always has a size of at + least 1x1, then do all computations when realized. + + - When fetching lines in recompute_geometry, make + sure we fetch enough lines to cover the screen. + Sat Sep 5 16:01:19 1998 Owen Taylor <otaylor@gtk.org> * gdk/gdkinputxfree.h gdk/gdk.c gdk/gdkinputgxi.h: @@ -8,7 +47,7 @@ Sat Sep 5 16:01:19 1998 Owen Taylor <otaylor@gtk.org> Thu Sep 3 19:45:34 1998 Owen Taylor <otaylor@redhat.com> - * gtk/gtkthemes.c: Use g_module instead of dlopen(); + * gtk/gtkthemes.c: Use g_module instead of dlopen() Thu Sep 3 19:30:11 1998 Owen Taylor <otaylor@redhat.com> @@ -33,7 +72,6 @@ Mon Aug 31 15:33:13 1998 Owen Taylor <otaylor@redhat.com> non-themes branch. (This does break bin compat within the themes branch.) ->>>>>>> 1.554.2.31 Sun Aug 30 16:48:27 1998 Owen Taylor <otaylor@gtk.org> * gtk/gtklabel.c (gtk_label_set): Eliminate a diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index cbbd5f735e..cf9f8410cd 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,42 @@ +Tue Sep 15 11:30:03 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkfilesel.c: Keep a list of directories in which we never + want to stat the entries (like /afs), and assume everything in + those directories is a subdirectory. + + - When following a path, try to open components even when + we don't find them in their parent's directory to + support automounters. + +Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c (adjust_adj): Change the way we + set the adjustments on resize so that it tries to + keep the beginning of the text in approximately + the same place. + + Removed assertion that the above change made invalid. + +Fri Sep 11 15:36:33 1998 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully + now at least compiles again. + + * gdk/gdk.c (gdk_event_translate): Don't pass events + on destroyed widgets to the gdk_input layer. + +Thu Sep 10 22:19:35 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c: - Save first_cut_pixels when switching + sizes, so that if we switch to the _same_ size, + we don't move lines around. + + - Make sure that the text area always has a size of at + least 1x1, then do all computations when realized. + + - When fetching lines in recompute_geometry, make + sure we fetch enough lines to cover the screen. + Sat Sep 5 16:01:19 1998 Owen Taylor <otaylor@gtk.org> * gdk/gdkinputxfree.h gdk/gdk.c gdk/gdkinputgxi.h: @@ -8,7 +47,7 @@ Sat Sep 5 16:01:19 1998 Owen Taylor <otaylor@gtk.org> Thu Sep 3 19:45:34 1998 Owen Taylor <otaylor@redhat.com> - * gtk/gtkthemes.c: Use g_module instead of dlopen(); + * gtk/gtkthemes.c: Use g_module instead of dlopen() Thu Sep 3 19:30:11 1998 Owen Taylor <otaylor@redhat.com> @@ -33,7 +72,6 @@ Mon Aug 31 15:33:13 1998 Owen Taylor <otaylor@redhat.com> non-themes branch. (This does break bin compat within the themes branch.) ->>>>>>> 1.554.2.31 Sun Aug 30 16:48:27 1998 Owen Taylor <otaylor@gtk.org> * gtk/gtklabel.c (gtk_label_set): Eliminate a diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index cbbd5f735e..cf9f8410cd 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,42 @@ +Tue Sep 15 11:30:03 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkfilesel.c: Keep a list of directories in which we never + want to stat the entries (like /afs), and assume everything in + those directories is a subdirectory. + + - When following a path, try to open components even when + we don't find them in their parent's directory to + support automounters. + +Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c (adjust_adj): Change the way we + set the adjustments on resize so that it tries to + keep the beginning of the text in approximately + the same place. + + Removed assertion that the above change made invalid. + +Fri Sep 11 15:36:33 1998 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully + now at least compiles again. + + * gdk/gdk.c (gdk_event_translate): Don't pass events + on destroyed widgets to the gdk_input layer. + +Thu Sep 10 22:19:35 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c: - Save first_cut_pixels when switching + sizes, so that if we switch to the _same_ size, + we don't move lines around. + + - Make sure that the text area always has a size of at + least 1x1, then do all computations when realized. + + - When fetching lines in recompute_geometry, make + sure we fetch enough lines to cover the screen. + Sat Sep 5 16:01:19 1998 Owen Taylor <otaylor@gtk.org> * gdk/gdkinputxfree.h gdk/gdk.c gdk/gdkinputgxi.h: @@ -8,7 +47,7 @@ Sat Sep 5 16:01:19 1998 Owen Taylor <otaylor@gtk.org> Thu Sep 3 19:45:34 1998 Owen Taylor <otaylor@redhat.com> - * gtk/gtkthemes.c: Use g_module instead of dlopen(); + * gtk/gtkthemes.c: Use g_module instead of dlopen() Thu Sep 3 19:30:11 1998 Owen Taylor <otaylor@redhat.com> @@ -33,7 +72,6 @@ Mon Aug 31 15:33:13 1998 Owen Taylor <otaylor@redhat.com> non-themes branch. (This does break bin compat within the themes branch.) ->>>>>>> 1.554.2.31 Sun Aug 30 16:48:27 1998 Owen Taylor <otaylor@gtk.org> * gtk/gtklabel.c (gtk_label_set): Eliminate a diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index cbbd5f735e..cf9f8410cd 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,42 @@ +Tue Sep 15 11:30:03 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkfilesel.c: Keep a list of directories in which we never + want to stat the entries (like /afs), and assume everything in + those directories is a subdirectory. + + - When following a path, try to open components even when + we don't find them in their parent's directory to + support automounters. + +Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c (adjust_adj): Change the way we + set the adjustments on resize so that it tries to + keep the beginning of the text in approximately + the same place. + + Removed assertion that the above change made invalid. + +Fri Sep 11 15:36:33 1998 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully + now at least compiles again. + + * gdk/gdk.c (gdk_event_translate): Don't pass events + on destroyed widgets to the gdk_input layer. + +Thu Sep 10 22:19:35 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c: - Save first_cut_pixels when switching + sizes, so that if we switch to the _same_ size, + we don't move lines around. + + - Make sure that the text area always has a size of at + least 1x1, then do all computations when realized. + + - When fetching lines in recompute_geometry, make + sure we fetch enough lines to cover the screen. + Sat Sep 5 16:01:19 1998 Owen Taylor <otaylor@gtk.org> * gdk/gdkinputxfree.h gdk/gdk.c gdk/gdkinputgxi.h: @@ -8,7 +47,7 @@ Sat Sep 5 16:01:19 1998 Owen Taylor <otaylor@gtk.org> Thu Sep 3 19:45:34 1998 Owen Taylor <otaylor@redhat.com> - * gtk/gtkthemes.c: Use g_module instead of dlopen(); + * gtk/gtkthemes.c: Use g_module instead of dlopen() Thu Sep 3 19:30:11 1998 Owen Taylor <otaylor@redhat.com> @@ -33,7 +72,6 @@ Mon Aug 31 15:33:13 1998 Owen Taylor <otaylor@redhat.com> non-themes branch. (This does break bin compat within the themes branch.) ->>>>>>> 1.554.2.31 Sun Aug 30 16:48:27 1998 Owen Taylor <otaylor@gtk.org> * gtk/gtklabel.c (gtk_label_set): Eliminate a diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index cbbd5f735e..cf9f8410cd 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,42 @@ +Tue Sep 15 11:30:03 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkfilesel.c: Keep a list of directories in which we never + want to stat the entries (like /afs), and assume everything in + those directories is a subdirectory. + + - When following a path, try to open components even when + we don't find them in their parent's directory to + support automounters. + +Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c (adjust_adj): Change the way we + set the adjustments on resize so that it tries to + keep the beginning of the text in approximately + the same place. + + Removed assertion that the above change made invalid. + +Fri Sep 11 15:36:33 1998 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully + now at least compiles again. + + * gdk/gdk.c (gdk_event_translate): Don't pass events + on destroyed widgets to the gdk_input layer. + +Thu Sep 10 22:19:35 1998 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c: - Save first_cut_pixels when switching + sizes, so that if we switch to the _same_ size, + we don't move lines around. + + - Make sure that the text area always has a size of at + least 1x1, then do all computations when realized. + + - When fetching lines in recompute_geometry, make + sure we fetch enough lines to cover the screen. + Sat Sep 5 16:01:19 1998 Owen Taylor <otaylor@gtk.org> * gdk/gdkinputxfree.h gdk/gdk.c gdk/gdkinputgxi.h: @@ -8,7 +47,7 @@ Sat Sep 5 16:01:19 1998 Owen Taylor <otaylor@gtk.org> Thu Sep 3 19:45:34 1998 Owen Taylor <otaylor@redhat.com> - * gtk/gtkthemes.c: Use g_module instead of dlopen(); + * gtk/gtkthemes.c: Use g_module instead of dlopen() Thu Sep 3 19:30:11 1998 Owen Taylor <otaylor@redhat.com> @@ -33,7 +72,6 @@ Mon Aug 31 15:33:13 1998 Owen Taylor <otaylor@redhat.com> non-themes branch. (This does break bin compat within the themes branch.) ->>>>>>> 1.554.2.31 Sun Aug 30 16:48:27 1998 Owen Taylor <otaylor@gtk.org> * gtk/gtklabel.c (gtk_label_set): Eliminate a @@ -2494,6 +2494,7 @@ gdk_event_translate (GdkEvent *event, /* Tell XInput stuff about it if appropriate */ if (window_private && + !window_private->destroyed && (window_private->extension_events != 0) && gdk_input_vtable.enter_event) gdk_input_vtable.enter_event (&xevent->xcrossing, window); @@ -2924,7 +2925,8 @@ gdk_event_translate (GdkEvent *event, if (window_private) { - if ((window_private->extension_events != 0) && + if (!window_private->destroyed && + (window_private->extension_events != 0) && gdk_input_vtable.configure_event) gdk_input_vtable.configure_event (&xevent->xconfigure, window); @@ -3287,6 +3289,7 @@ gdk_event_translate (GdkEvent *event, /* something else - (e.g., a Xinput event) */ if (window_private && + !window_private->destroyed && (window_private->extension_events != 0) && gdk_input_vtable.other_event) return_val = gdk_input_vtable.other_event(event, xevent, window); diff --git a/gdk/gdkinputgxi.h b/gdk/gdkinputgxi.h index b4f3312838..d9d351c92e 100644 --- a/gdk/gdkinputgxi.h +++ b/gdk/gdkinputgxi.h @@ -591,10 +591,9 @@ gdk_input_gxi_grab_pointer (GdkWindow * window, GdkWindow * confine_to, guint32 time) { - GdkInputWindow *input_window, *new_window; GList *tmp_list; + GdkInputWindow *input_window; GdkDevicePrivate *gdkdev; - GList *tmp_list; tmp_list = gdk_input_windows; while (tmp_list) @@ -602,27 +601,25 @@ gdk_input_gxi_grab_pointer (GdkWindow * window, input_window = (GdkInputWindow *)tmp_list->data; if (input_window->window == window) - new_window = input_window; - else (input_window->grabbed) + input_window->grabbed = TRUE; + else if (input_window->grabbed) input_window->grabbed = FALSE; - tmp_list = gdk_input_devices; - while (tmp_list) - { - gdkdev = (GdkDevicePrivate *)tmp_list->data; - if (gdkdev->info.deviceid != GDK_CORE_POINTER && - gdkdev->xdevice && - (gdkdev->button_state != 0)) - gdkdev->button_state = 0; - - tmp_list = tmp_list->next; - } - + tmp_list = tmp_list->next; + } + + tmp_list = gdk_input_devices; + while (tmp_list) + { + gdkdev = (GdkDevicePrivate *)tmp_list->data; + if (gdkdev->info.deviceid != GDK_CORE_POINTER && + gdkdev->xdevice && + (gdkdev->button_state != 0)) + gdkdev->button_state = 0; tmp_list = tmp_list->next; } - new_window->grabbed = TRUE; return Success; } diff --git a/gdk/gdkinputxfree.h b/gdk/gdkinputxfree.h index 997fdd207b..7b69d6197f 100644 --- a/gdk/gdkinputxfree.h +++ b/gdk/gdkinputxfree.h @@ -173,7 +173,7 @@ gdk_input_xfree_configure_event (XConfigureEvent *xevent, GdkWindow *window) static void gdk_input_xfree_enter_event (XCrossingEvent *xevent, - GdkWindow *window) + GdkWindow *window) { GdkInputWindow *input_window; gint root_x, root_y; diff --git a/gdk/x11/gdkinput-gxi.c b/gdk/x11/gdkinput-gxi.c index b4f3312838..d9d351c92e 100644 --- a/gdk/x11/gdkinput-gxi.c +++ b/gdk/x11/gdkinput-gxi.c @@ -591,10 +591,9 @@ gdk_input_gxi_grab_pointer (GdkWindow * window, GdkWindow * confine_to, guint32 time) { - GdkInputWindow *input_window, *new_window; GList *tmp_list; + GdkInputWindow *input_window; GdkDevicePrivate *gdkdev; - GList *tmp_list; tmp_list = gdk_input_windows; while (tmp_list) @@ -602,27 +601,25 @@ gdk_input_gxi_grab_pointer (GdkWindow * window, input_window = (GdkInputWindow *)tmp_list->data; if (input_window->window == window) - new_window = input_window; - else (input_window->grabbed) + input_window->grabbed = TRUE; + else if (input_window->grabbed) input_window->grabbed = FALSE; - tmp_list = gdk_input_devices; - while (tmp_list) - { - gdkdev = (GdkDevicePrivate *)tmp_list->data; - if (gdkdev->info.deviceid != GDK_CORE_POINTER && - gdkdev->xdevice && - (gdkdev->button_state != 0)) - gdkdev->button_state = 0; - - tmp_list = tmp_list->next; - } - + tmp_list = tmp_list->next; + } + + tmp_list = gdk_input_devices; + while (tmp_list) + { + gdkdev = (GdkDevicePrivate *)tmp_list->data; + if (gdkdev->info.deviceid != GDK_CORE_POINTER && + gdkdev->xdevice && + (gdkdev->button_state != 0)) + gdkdev->button_state = 0; tmp_list = tmp_list->next; } - new_window->grabbed = TRUE; return Success; } diff --git a/gdk/x11/gdkinput-xfree.c b/gdk/x11/gdkinput-xfree.c index 997fdd207b..7b69d6197f 100644 --- a/gdk/x11/gdkinput-xfree.c +++ b/gdk/x11/gdkinput-xfree.c @@ -173,7 +173,7 @@ gdk_input_xfree_configure_event (XConfigureEvent *xevent, GdkWindow *window) static void gdk_input_xfree_enter_event (XCrossingEvent *xevent, - GdkWindow *window) + GdkWindow *window) { GdkInputWindow *input_window; gint root_x, root_y; diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c index 4ae5b22fc4..0ad75d3ae2 100644 --- a/gdk/x11/gdkmain-x11.c +++ b/gdk/x11/gdkmain-x11.c @@ -2494,6 +2494,7 @@ gdk_event_translate (GdkEvent *event, /* Tell XInput stuff about it if appropriate */ if (window_private && + !window_private->destroyed && (window_private->extension_events != 0) && gdk_input_vtable.enter_event) gdk_input_vtable.enter_event (&xevent->xcrossing, window); @@ -2924,7 +2925,8 @@ gdk_event_translate (GdkEvent *event, if (window_private) { - if ((window_private->extension_events != 0) && + if (!window_private->destroyed && + (window_private->extension_events != 0) && gdk_input_vtable.configure_event) gdk_input_vtable.configure_event (&xevent->xconfigure, window); @@ -3287,6 +3289,7 @@ gdk_event_translate (GdkEvent *event, /* something else - (e.g., a Xinput event) */ if (window_private && + !window_private->destroyed && (window_private->extension_events != 0) && gdk_input_vtable.other_event) return_val = gdk_input_vtable.other_event(event, xevent, window); diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c index f8903fbea8..e6d7ff34b4 100644 --- a/gtk/gtkfilesel.c +++ b/gtk/gtkfilesel.c @@ -245,13 +245,18 @@ static gchar* cmpl_completion_fullname (gchar*, CompletionState* cm static CompletionDir* open_ref_dir (gchar* text_to_complete, gchar** remaining_text, CompletionState* cmpl_state); +static gboolean check_dir (gchar *dir_name, + struct stat *result, + gboolean *stat_subdirs); static CompletionDir* open_dir (gchar* dir_name, CompletionState* cmpl_state); static CompletionDir* open_user_dir (gchar* text_to_complete, CompletionState *cmpl_state); static CompletionDir* open_relative_dir (gchar* dir_name, CompletionDir* dir, CompletionState *cmpl_state); -static CompletionDirSent* open_new_dir (gchar* dir_name, struct stat* sbuf); +static CompletionDirSent* open_new_dir (gchar* dir_name, + struct stat* sbuf, + gboolean stat_subdirs); static gint correct_dir_fullname (CompletionDir* cmpl_dir); static gint correct_parent (CompletionDir* cmpl_dir, struct stat *sbuf); @@ -1890,7 +1895,7 @@ open_relative_dir(gchar* dir_name, /* after the cache lookup fails, really open a new directory */ static CompletionDirSent* -open_new_dir(gchar* dir_name, struct stat* sbuf) +open_new_dir(gchar* dir_name, struct stat* sbuf, gboolean stat_subdirs) { CompletionDirSent* sent; DIR* directory; @@ -1968,12 +1973,17 @@ open_new_dir(gchar* dir_name, struct stat* sbuf) path_buf[path_buf_len] = '/'; strcpy(path_buf + path_buf_len + 1, dirent_ptr->d_name); - if(stat(path_buf, &ent_sbuf) >= 0 && S_ISDIR(ent_sbuf.st_mode)) - sent->entries[i].is_dir = 1; + if (stat_subdirs) + { + if(stat(path_buf, &ent_sbuf) >= 0 && S_ISDIR(ent_sbuf.st_mode)) + sent->entries[i].is_dir = 1; + else + /* stat may fail, and we don't mind, since it could be a + * dangling symlink. */ + sent->entries[i].is_dir = 0; + } else - /* stat may fail, and we don't mind, since it could be a - * dangling symlink. */ - sent->entries[i].is_dir = 0; + sent->entries[i].is_dir = 1; } qsort(sent->entries, sent->entry_count, sizeof(CompletionDirEntry), compare_cmpl_dir); @@ -1983,19 +1993,69 @@ open_new_dir(gchar* dir_name, struct stat* sbuf) return sent; } +static gboolean +check_dir(gchar *dir_name, struct stat *result, gboolean *stat_subdirs) +{ + /* A list of directories that we know only contain other directories. + * Trying to stat every file in these directories would be very + * expensive. + */ + + static struct { + gchar *name; + gboolean present; + struct stat statbuf; + } no_stat_dirs[] = { + { "/afs", FALSE, { 0 } }, + }; + + static gint n_no_stat_dirs = sizeof(no_stat_dirs) / sizeof(no_stat_dirs[0]); + static gboolean initialized = FALSE; + + gint i; + + if (!initialized) + { + initialized = TRUE; + for (i=0; i<n_no_stat_dirs; i++) + { + if (stat(no_stat_dirs[i].name, &no_stat_dirs[i].statbuf) == 0) + no_stat_dirs[i].present = TRUE; + } + } + + if(stat(dir_name, result) < 0) + { + cmpl_errno = errno; + return FALSE; + } + + *stat_subdirs = TRUE; + for (i=0; i<n_no_stat_dirs; i++) + { + if (no_stat_dirs[i].present && + (no_stat_dirs[i].statbuf.st_dev == result->st_dev) && + (no_stat_dirs[i].statbuf.st_ino == result->st_ino)) + { + *stat_subdirs = FALSE; + break; + } + } + + return TRUE; +} + /* open a directory by absolute pathname */ static CompletionDir* open_dir(gchar* dir_name, CompletionState* cmpl_state) { struct stat sbuf; + gboolean stat_subdirs; CompletionDirSent *sent; GList* cdsl; - if(stat(dir_name, &sbuf) < 0) - { - cmpl_errno = errno; - return NULL; - } + if (!check_dir (dir_name, &sbuf, &stat_subdirs)) + return NULL; cdsl = cmpl_state->directory_sent_storage; @@ -2011,7 +2071,7 @@ open_dir(gchar* dir_name, CompletionState* cmpl_state) cdsl = cdsl->next; } - sent = open_new_dir(dir_name, &sbuf); + sent = open_new_dir(dir_name, &sbuf, stat_subdirs); if (sent) { cmpl_state->directory_sent_storage = @@ -2317,13 +2377,14 @@ find_completion_dir(gchar* text_to_complete, { gchar* first_slash = strchr(text_to_complete, '/'); CompletionDir* dir = cmpl_state->reference_dir; + CompletionDir* next; *remaining_text = text_to_complete; while(first_slash) { gint len = first_slash - *remaining_text; gint found = 0; - gint found_index = -1; + gchar *found_name = NULL; /* Quiet gcc */ gint i; gchar* pat_buf = g_new (gchar, len + 1); @@ -2344,40 +2405,37 @@ find_completion_dir(gchar* text_to_complete, else { found = 1; - found_index = i; + found_name = dir->sent->entries[i].entry_name; } } } - if(found) + if (!found) { - CompletionDir* next = open_relative_dir(dir->sent->entries[found_index].entry_name, - dir, cmpl_state); - - if(!next) - { - g_free (pat_buf); - return NULL; - } - - next->cmpl_parent = dir; - - dir = next; - - if(!correct_dir_fullname(dir)) - { - g_free(pat_buf); - return NULL; - } - - *remaining_text = first_slash + 1; - first_slash = strchr(*remaining_text, '/'); + /* Perhaps we are trying to open an automount directory */ + found_name = pat_buf; } - else + + next = open_relative_dir(found_name, dir, cmpl_state); + + if(!next) { g_free (pat_buf); return NULL; } + + next->cmpl_parent = dir; + + dir = next; + + if(!correct_dir_fullname(dir)) + { + g_free(pat_buf); + return NULL; + } + + *remaining_text = first_slash + 1; + first_slash = strchr(*remaining_text, '/'); g_free (pat_buf); } diff --git a/gtk/gtktext.c b/gtk/gtktext.c index 9422e6afd6..9a5ad072ef 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -580,6 +580,7 @@ gtk_text_init (GtkText *text) text->tab_stops = g_list_prepend (text->tab_stops, (void*)8); text->line_start_cache = NULL; + text->first_cut_pixels = 0; text->line_wrap = TRUE; text->word_wrap = FALSE; @@ -884,6 +885,7 @@ gtk_text_forward_delete (GtkText *text, compute_lines_pixels (text, nchars, &old_lines, &old_height); } + /* FIXME, or resizing after deleting will be odd */ if (text->point.index < text->first_line_start_index) { if (text->point.index + nchars >= text->first_line_start_index) @@ -1092,8 +1094,8 @@ gtk_text_realize (GtkWidget *widget) attributes.x = (widget->style->klass->xthickness + TEXT_BORDER_ROOM); attributes.y = (widget->style->klass->ythickness + TEXT_BORDER_ROOM); - attributes.width = widget->allocation.width - attributes.x * 2; - attributes.height = widget->allocation.height - attributes.y * 2; + attributes.width = MAX (1, (gint)widget->allocation.width - (gint)attributes.x * 2); + attributes.height = MAX (1, (gint)widget->allocation.height - (gint)attributes.y * 2); text->text_area = gdk_window_new (widget->window, &attributes, attributes_mask); gdk_window_set_user_data (text->text_area, text); @@ -1192,8 +1194,7 @@ gtk_text_realize (GtkWidget *widget) if (editable->selection_start_pos != editable->selection_end_pos) gtk_editable_claim_selection (editable, TRUE, GDK_CURRENT_TIME); - if ((widget->allocation.width > 1) || (widget->allocation.height > 1)) - recompute_geometry (text); + recompute_geometry (text); } static void @@ -1211,8 +1212,7 @@ gtk_text_style_set (GtkWidget *widget, gdk_window_set_background (widget->window, &widget->style->base[GTK_STATE_NORMAL]); gdk_window_set_background (text->text_area, &widget->style->base[GTK_STATE_NORMAL]); - if ((widget->allocation.width > 1) || (widget->allocation.height > 1)) - recompute_geometry (text); + recompute_geometry (text); } if (text->current_font) @@ -1424,10 +1424,10 @@ gtk_text_size_allocate (GtkWidget *widget, gdk_window_move_resize (text->text_area, widget->style->klass->xthickness + TEXT_BORDER_ROOM, widget->style->klass->ythickness + TEXT_BORDER_ROOM, - widget->allocation.width - (widget->style->klass->xthickness + - TEXT_BORDER_ROOM) * 2, - widget->allocation.height - (widget->style->klass->ythickness + - TEXT_BORDER_ROOM) * 2); + MAX (1, (gint)widget->allocation.width - (gint)(widget->style->klass->xthickness + + (gint)TEXT_BORDER_ROOM) * 2), + MAX (1, (gint)widget->allocation.height - (gint)(widget->style->klass->ythickness + + (gint)TEXT_BORDER_ROOM) * 2)); #ifdef USE_XIM if (editable->ic && (gdk_ic_get_style (editable->ic) & GDK_IM_PREEDIT_POSITION)) @@ -2058,11 +2058,8 @@ gtk_text_adjustment (GtkAdjustment *adjustment, g_return_if_fail (text != NULL); g_return_if_fail (GTK_IS_TEXT (text)); - /* Just ignore it if we haven't been size-allocated yet, or - * if something weird has happened */ - if ((text->line_start_cache == NULL) || - (GTK_WIDGET (text)->allocation.height <= 1) || - (GTK_WIDGET (text)->allocation.width <= 1)) + /* Just ignore it if we haven't been size-allocated and realized yet */ + if (text->line_start_cache == NULL) return; if (adjustment == text->hadj) @@ -3529,8 +3526,6 @@ find_cursor (GtkText* text, gboolean scroll) { find_line_containing_point (text, text->cursor_mark.index, scroll); - g_assert (text->cursor_mark.index >= text->first_line_start_index); - if (text->current_line) find_cursor_at_line (text, &CACHE_DATA(text->current_line), @@ -4091,12 +4086,27 @@ adjust_adj (GtkText* text, GtkAdjustment* adj) static gint set_vertical_scroll_iterator (GtkText* text, LineParams* lp, void* data) { - gint *pixel_count = (gint*) data; + SetVerticalScrollData *svdata = (SetVerticalScrollData *) data; - if (text->first_line_start_index == lp->start.index) - text->vadj->value = (float) *pixel_count; + if ((text->first_line_start_index >= lp->start.index) && + (text->first_line_start_index <= lp->end.index)) + { + svdata->mark = lp->start; - *pixel_count += LINE_HEIGHT (*lp); + if (text->first_line_start_index == lp->start.index) + { + text->first_onscreen_ver_pixel = svdata->pixel_height + text->first_cut_pixels; + } + else + { + text->first_onscreen_ver_pixel = svdata->pixel_height; + text->first_cut_pixels = 0; + } + + text->vadj->value = (float) text->first_onscreen_ver_pixel; + } + + svdata->pixel_height += LINE_HEIGHT (*lp); return FALSE; } @@ -4107,9 +4117,6 @@ set_vertical_scroll_find_iterator (GtkText* text, LineParams* lp, void* data) SetVerticalScrollData *svdata = (SetVerticalScrollData *) data; gint return_val; - if (svdata->last_didnt_wrap) - svdata->last_line_start = lp->start.index; - if (svdata->pixel_height <= (gint) text->vadj->value && svdata->pixel_height + LINE_HEIGHT(*lp) > (gint) text->vadj->value) { @@ -4117,7 +4124,7 @@ set_vertical_scroll_find_iterator (GtkText* text, LineParams* lp, void* data) text->first_cut_pixels = (gint)text->vadj->value - svdata->pixel_height; text->first_onscreen_ver_pixel = svdata->pixel_height; - text->first_line_start_index = svdata->last_line_start; + text->first_line_start_index = lp->start.index; return_val = TRUE; } @@ -4128,11 +4135,6 @@ set_vertical_scroll_find_iterator (GtkText* text, LineParams* lp, void* data) return_val = FALSE; } - if (!lp->wraps) - svdata->last_didnt_wrap = TRUE; - else - svdata->last_didnt_wrap = FALSE; - return return_val; } @@ -4142,12 +4144,12 @@ set_vertical_scroll (GtkText* text) GtkPropertyMark mark = find_mark (text, 0); SetVerticalScrollData data; gint height; - gint pixel_count = 0; gint orig_value; - line_params_iterate (text, &mark, NULL, FALSE, &pixel_count, set_vertical_scroll_iterator); + data.pixel_height = 0; + line_params_iterate (text, &mark, NULL, FALSE, &data, set_vertical_scroll_iterator); - text->vadj->upper = (float) pixel_count; + text->vadj->upper = (float) data.pixel_height; orig_value = (gint) text->vadj->value; gdk_window_get_size (text->text_area, NULL, &height); @@ -4159,7 +4161,6 @@ set_vertical_scroll (GtkText* text) text->vadj->value = MAX (text->vadj->value, 0.0); text->last_ver_value = (gint)text->vadj->value; - text->first_cut_pixels = 0; gtk_signal_emit_by_name (GTK_OBJECT (text->vadj), "changed"); @@ -4172,13 +4173,9 @@ set_vertical_scroll (GtkText* text) line_params_iterate (text, &mark, NULL, FALSE, &data, set_vertical_scroll_find_iterator); - - return data.mark; - } - else - { - return find_mark (text, text->first_line_start_index); } + + return data.mark; } static void @@ -4441,7 +4438,8 @@ find_line_params (GtkText* text, ch_width = find_char_width (text, &lp.end, &tab_mark); - if (ch_width + lp.pixel_width > max_display_pixels) + if ((ch_width + lp.pixel_width > max_display_pixels) && + (lp.end.index > lp.start.index)) { lp.wraps = 1; @@ -5048,12 +5046,30 @@ recompute_geometry (GtkText* text) decrement_mark (&mark); gdk_window_get_size (text->text_area, &width, &height); - + + /* Fetch an entire line, to make sure that we get all the text + * we backed over above, in addition to enough text to fill up + * the space vertically + */ + new_lines = fetch_lines (text, &mark, NULL, - FetchLinesPixels, - height + text->first_cut_pixels); + FetchLinesCount, + 1); + + mark = CACHE_DATA (g_list_last (new_lines)).end; + if (!LAST_INDEX (text, mark)) + { + advance_mark (&mark); + + new_lines = g_list_concat (new_lines, + fetch_lines (text, + &mark, + NULL, + FetchLinesPixels, + height + text->first_cut_pixels)); + } /* Now work forward to the actual first onscreen line */ |