X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fscrollbar-x.c;h=554be5d3ef2efaf3283ed8f8f6f24adcb990b6e8;hb=9816585ded614fa87be5a2ecfda6dc16c60beb2c;hp=01dea889e28cccea84a7f271fea9d45229c6e000;hpb=6883ee56ec887c2c48abe5b06b5e66aa74031910;p=chise%2Fxemacs-chise.git- diff --git a/src/scrollbar-x.c b/src/scrollbar-x.c index 01dea88..554be5d 100644 --- a/src/scrollbar-x.c +++ b/src/scrollbar-x.c @@ -1,6 +1,6 @@ /* scrollbar implementation -- X interface. Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. - Copyright (C) 1994 Amdhal Corporation. + Copyright (C) 1994 Amdahl Corporation. Copyright (C) 1995 Sun Microsystems, Inc. Copyright (C) 1995 Darrell Kindred . @@ -27,9 +27,8 @@ Boston, MA 02111-1307, USA. */ #include "lisp.h" #include "console-x.h" -#include "glyphs-x.h" #include "EmacsFrame.h" -#include "EmacsManager.h" +#include "glyphs-x.h" #include "gui-x.h" #include "scrollbar-x.h" @@ -216,6 +215,7 @@ scrollbar_instance_to_widget_value (struct scrollbar_instance *instance) wv->scrollbar_data = xnew (scrollbar_values); wv->name = SCROLLBAR_X_NAME (instance); + wv->name = xstrdup (wv->name); wv->value = 0; wv->key = 0; wv->enabled = instance->scrollbar_is_active; @@ -279,9 +279,7 @@ x_update_scrollbar_instance_status (struct window *w, int active, int size, } if (!wv->scrollbar_data) abort (); - xfree (wv->scrollbar_data); - wv->scrollbar_data = 0; - free_widget_value (wv); + free_widget_value_tree (wv); } else if (managed) { @@ -408,6 +406,9 @@ x_update_vertical_scrollbar_callback (Widget widget, LWLIB_ID id, return; mirror = find_scrollbar_window_mirror (f, id); + if (!mirror) + return; + win = real_window (mirror, 1); if (NILP (win)) @@ -611,6 +612,9 @@ x_update_horizontal_scrollbar_callback (Widget widget, LWLIB_ID id, return; mirror = find_scrollbar_window_mirror (f, id); + if (!mirror) + return; + win = real_window (mirror, 1); if (NILP (win)) @@ -674,19 +678,6 @@ x_scrollbar_pointer_changed_in_window (struct window *w) 0, (Window) NULL); } -/* Called directly from x_any_window_to_frame in frame-x.c */ -EMACS_INT -x_window_is_scrollbar (struct frame *f, Window win) -{ - if (!FRAME_X_P (f)) - return 0; - - if (f->mirror_dirty) - update_frame_window_mirror (f); - return (EMACS_INT) x_scrollbar_loop (X_WINDOW_IS_SCROLLBAR, f->root_window, - f->root_mirror, 0, win); -} - /* Make sure that all scrollbars on frame are up-to-date. Called directly from x_set_frame_properties in frame-x.c*/ void @@ -747,8 +738,16 @@ console_type_create_scrollbar_x (void) } void +reinit_vars_of_scrollbar_x (void) +{ + stupid_vertical_scrollbar_drag_hack = 1; +} + +void vars_of_scrollbar_x (void) { + reinit_vars_of_scrollbar_x (); + #if defined (LWLIB_SCROLLBARS_LUCID) Fprovide (intern ("lucid-scrollbars")); #elif defined (LWLIB_SCROLLBARS_MOTIF) @@ -756,5 +755,4 @@ vars_of_scrollbar_x (void) #elif defined (LWLIB_SCROLLBARS_ATHENA) Fprovide (intern ("athena-scrollbars")); #endif - stupid_vertical_scrollbar_drag_hack = 1; }