diff src/scrollbar-x.c @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents b8cc9ab3f761
children 11054d720c21
line wrap: on
line diff
--- a/src/scrollbar-x.c	Mon Aug 13 11:19:22 2007 +0200
+++ b/src/scrollbar-x.c	Mon Aug 13 11:20:41 2007 +0200
@@ -27,7 +27,6 @@
 #include "lisp.h"
 
 #include "console-x.h"
-#include "EmacsFrame.h"
 #include "glyphs-x.h"
 #include "gui-x.h"
 #include "scrollbar-x.h"
@@ -215,7 +214,6 @@
   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,7 +277,9 @@
 	}
 
       if (!wv->scrollbar_data) abort ();
-      free_widget_value_tree (wv);
+      xfree (wv->scrollbar_data);
+      wv->scrollbar_data = 0;
+      free_widget_value (wv);
     }
   else if (managed)
     {
@@ -406,9 +406,6 @@
     return;
 
   mirror = find_scrollbar_window_mirror (f, id);
-  if (!mirror)
-    return;
-  
   win = real_window (mirror, 1);
 
   if (NILP (win))
@@ -612,9 +609,6 @@
     return;
 
   mirror = find_scrollbar_window_mirror (f, id);
-  if (!mirror)
-    return;
-  
   win = real_window (mirror, 1);
 
   if (NILP (win))
@@ -678,6 +672,19 @@
 		    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
@@ -738,16 +745,8 @@
 }
 
 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)
@@ -755,4 +754,5 @@
 #elif defined (LWLIB_SCROLLBARS_ATHENA)
   Fprovide (intern ("athena-scrollbars"));
 #endif
+  stupid_vertical_scrollbar_drag_hack = 1;
 }