This commit was generated by cvs2svn to compensate for changes in r2813,
authortomo <tomo>
Tue, 14 Aug 2001 16:11:44 +0000 (16:11 +0000)
committertomo <tomo>
Tue, 14 Aug 2001 16:11:44 +0000 (16:11 +0000)
which included commits to RCS files with non-trunk default branches.

nt/ChangeLog
src/elhash.c
src/elhash.h
src/event-Xt.c
src/frame-x.c
src/glyphs-x.c
src/glyphs.h
src/menubar.c
src/window.c
tests/ChangeLog

index ac50ab0..e68d20b 100644 (file)
@@ -1,3 +1,7 @@
+2001-01-08  Martin Buchholz <martin@xemacs.org>
+
+       * XEmacs 21.2.40 is released.
+
 2000-12-31  Martin Buchholz <martin@xemacs.org>
 
        * XEmacs 21.2.39 is released.
index 2fb2c04..058fdd4 100644 (file)
@@ -434,36 +434,54 @@ compute_hash_table_derived_values (Lisp_Hash_Table *ht)
 }
 
 Lisp_Object
-make_general_lisp_hash_table (enum hash_table_test test,
-                             size_t size,
-                             double rehash_size,
-                             double rehash_threshold,
-                             enum hash_table_weakness weakness)
+make_standard_lisp_hash_table (enum hash_table_test test,
+                              size_t size,
+                              double rehash_size,
+                              double rehash_threshold,
+                              enum hash_table_weakness weakness)
 {
-  Lisp_Object hash_table;
-  Lisp_Hash_Table *ht = alloc_lcrecord_type (Lisp_Hash_Table, &lrecord_hash_table);
+  hash_table_hash_function_t hash_function =  0;
+  hash_table_test_function_t test_function = 0;
 
   switch (test)
     {
     case HASH_TABLE_EQ:
-      ht->test_function = 0;
-      ht->hash_function = 0;
+      test_function = 0;
+      hash_function = 0;
       break;
 
     case HASH_TABLE_EQL:
-      ht->test_function = lisp_object_eql_equal;
-      ht->hash_function = lisp_object_eql_hash;
+      test_function = lisp_object_eql_equal;
+      hash_function = lisp_object_eql_hash;
       break;
 
     case HASH_TABLE_EQUAL:
-      ht->test_function = lisp_object_equal_equal;
-      ht->hash_function = lisp_object_equal_hash;
+      test_function = lisp_object_equal_equal;
+      hash_function = lisp_object_equal_hash;
       break;
 
     default:
       abort ();
     }
 
+  return make_general_lisp_hash_table (hash_function, test_function,
+                                      size, rehash_size, rehash_threshold,
+                                      weakness);
+}
+
+Lisp_Object
+make_general_lisp_hash_table (hash_table_hash_function_t hash_function,
+                             hash_table_test_function_t test_function,
+                             size_t size,
+                             double rehash_size,
+                             double rehash_threshold,
+                             enum hash_table_weakness weakness)
+{
+  Lisp_Object hash_table;
+  Lisp_Hash_Table *ht = alloc_lcrecord_type (Lisp_Hash_Table, &lrecord_hash_table);
+
+  ht->test_function = test_function;
+  ht->hash_function = hash_function;
   ht->weakness = weakness;
 
   ht->rehash_size =
@@ -505,7 +523,7 @@ make_lisp_hash_table (size_t size,
                      enum hash_table_weakness weakness,
                      enum hash_table_test test)
 {
-  return make_general_lisp_hash_table (test, size, -1.0, -1.0, weakness);
+  return make_standard_lisp_hash_table (test, size, -1.0, -1.0, weakness);
 }
 
 /* Pretty reading of hash tables.
@@ -722,7 +740,7 @@ hash_table_instantiate (Lisp_Object plist)
     }
 
   /* Create the hash table.  */
-  hash_table = make_general_lisp_hash_table
+  hash_table = make_standard_lisp_hash_table
     (decode_hash_table_test (test),
      decode_hash_table_size (size),
      decode_hash_table_rehash_size (rehash_size),
@@ -872,7 +890,7 @@ if (!NILP (var)) hash_table_##var##_validate (Q##var, var, ERROR_ME);
   VALIDATE_VAR (rehash_threshold);
   VALIDATE_VAR (weakness);
 
-  return make_general_lisp_hash_table
+  return make_standard_lisp_hash_table
     (decode_hash_table_test (test),
      decode_hash_table_size (size),
      decode_hash_table_rehash_size (rehash_size),
@@ -1305,6 +1323,24 @@ finish_marking_weak_hash_tables (void)
                }
          break;
 
+         /* We seem to be sprouting new weakness types at an alarming
+            rate. At least this is not externally visible - and in
+            fact all of these KEY_CAR_* types are only used by the
+            glyph code. */
+       case HASH_TABLE_KEY_CAR_VALUE_WEAK:
+         for (; e < sentinel; e++)
+           if (!HENTRY_CLEAR_P (e))
+             {
+               if (!CONSP (e->key) || marked_p (XCAR (e->key)))
+                 {
+                   MARK_OBJ (e->key);
+                   MARK_OBJ (e->value);
+                 }
+               else if (marked_p (e->value))
+                 MARK_OBJ (e->key);
+             }
+         break;
+
        case HASH_TABLE_VALUE_CAR_WEAK:
          for (; e < sentinel; e++)
            if (!HENTRY_CLEAR_P (e))
index 04c1d03..7c4fe9c 100644 (file)
@@ -41,6 +41,7 @@ enum hash_table_weakness
   HASH_TABLE_KEY_VALUE_WEAK,
   HASH_TABLE_KEY_CAR_WEAK,
   HASH_TABLE_VALUE_CAR_WEAK,
+  HASH_TABLE_KEY_CAR_VALUE_WEAK,
   HASH_TABLE_WEAK
 };
 
@@ -66,7 +67,14 @@ typedef unsigned long (*hash_table_hash_function_t) (Lisp_Object obj);
 typedef int (*maphash_function_t) (Lisp_Object key, Lisp_Object value,
                                   void* extra_arg);
 
-Lisp_Object make_general_lisp_hash_table (enum hash_table_test test,
+Lisp_Object make_standard_lisp_hash_table (enum hash_table_test test,
+                                          size_t size,
+                                          double rehash_size,
+                                          double rehash_threshold,
+                                          enum hash_table_weakness weakness);
+
+Lisp_Object make_general_lisp_hash_table (hash_table_hash_function_t hash_function,
+                                         hash_table_test_function_t test_function,
                                          size_t size,
                                          double rehash_size,
                                          double rehash_threshold,
index b9ef392..ae62194 100644 (file)
@@ -92,6 +92,7 @@ int debug_x_events;
 
 static int process_events_occurred;
 static int tty_events_occurred;
+static Widget widget_with_focus;
 
 /* Mask of bits indicating the descriptors that we wait for input on */
 extern SELECT_TYPE input_wait_mask, process_only_mask, tty_only_mask;
@@ -1536,11 +1537,12 @@ static void
 handle_focus_event_1 (struct frame *f, int in_p)
 {
 #if XtSpecificationRelease > 5
-  Widget focus_widget = XtGetKeyboardFocusWidget (FRAME_X_TEXT_WIDGET (f));
+  widget_with_focus = XtGetKeyboardFocusWidget (FRAME_X_TEXT_WIDGET (f));
 #endif
 #ifdef HAVE_XIM
   XIM_focus_event (f, in_p);
 #endif /* HAVE_XIM */
+
   /* On focus change, clear all memory of sticky modifiers
      to avoid non-intuitive behavior. */
   clear_sticky_modifiers (XDEVICE (FRAME_DEVICE (f)));
@@ -1564,13 +1566,19 @@ handle_focus_event_1 (struct frame *f, int in_p)
      click in the frame. Why is this?  */
   if (in_p
 #if XtSpecificationRelease > 5
-      && FRAME_X_TEXT_WIDGET (f) != focus_widget
+      && FRAME_X_TEXT_WIDGET (f) != widget_with_focus
 #endif
       )
     {
       lw_set_keyboard_focus (FRAME_X_SHELL_WIDGET (f),
                             FRAME_X_TEXT_WIDGET (f));
     }
+
+  /* We have the focus now. See comment in
+     emacs_Xt_handle_widget_losing_focus (). */
+  if (in_p)
+    widget_with_focus = NULL;
+
   /* do the generic event-stream stuff. */
   {
     Lisp_Object frm;
@@ -1587,6 +1595,23 @@ handle_focus_event_1 (struct frame *f, int in_p)
   }
 }
 
+/* The idea here is that when a widget glyph gets unmapped we don't
+   want the focus to stay with it if it has focus - because it may
+   well just get deleted next andthen we have lost the focus until the
+   user does something. So handle_focus_event_1 records the widget
+   with keyboard focus when FocusOut is processed, and then, when a
+   widget gets unmapped, it calls this function to restore focus if
+   appropriate. */
+void emacs_Xt_handle_widget_losing_focus (struct frame* f, Widget losing_widget);
+void
+emacs_Xt_handle_widget_losing_focus (struct frame* f, Widget losing_widget)
+{
+  if (losing_widget == widget_with_focus)
+    {
+      handle_focus_event_1 (f, 1);
+    }
+}
+
 /* This is called from the external-widget code */
 
 void emacs_Xt_handle_focus_event (XEvent *event);
index dbd70cb..23ef070 100644 (file)
@@ -2654,7 +2654,7 @@ x_focus_on_frame (struct frame *f)
   XFlush (XtDisplay (shell_widget)); /* hey, I'd like to DEBUG this... */
 }
 
-/* Destroy the X window of frame S.  */
+/* Destroy the X window of frame F.  */
 static void
 x_delete_frame (struct frame *f)
 {
index e0fa2d2..0451996 100644 (file)
@@ -156,6 +156,8 @@ static void
 update_tab_widget_face (widget_value* wv,
                        Lisp_Image_Instance* ii, Lisp_Object domain);
 #endif
+void
+emacs_Xt_handle_widget_losing_focus (struct frame* f, Widget losing_widget);
 
 #include "bitmaps.h"
 
@@ -2130,6 +2132,12 @@ x_unmap_subwindow (Lisp_Image_Instance *p)
     }
   else                         /* must be a widget */
     {
+      /* Since we are being unmapped we want the enclosing frame to
+        get focus. The losing with simple scrolling but is the safest
+        thing to do. */
+      emacs_Xt_handle_widget_losing_focus 
+       ( XFRAME (IMAGE_INSTANCE_FRAME (p)),
+         IMAGE_INSTANCE_X_WIDGET_ID (p));
       XtUnmapWidget (IMAGE_INSTANCE_X_CLIPWIDGET (p));
     }
 }
@@ -2261,7 +2269,7 @@ x_redisplay_widget (Lisp_Image_Instance *p)
     }
 
   /* Adjust offsets within the frame. */
-  if (XFRAME (IMAGE_INSTANCE_FRAME (p))->frame_changed)
+  if (XFRAME (IMAGE_INSTANCE_FRAME (p))->size_changed)
     {
       Arg al[2];
       XtSetArg (al [0], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (p));
index 056cc23..c279f54 100644 (file)
@@ -327,6 +327,8 @@ do {                                                                        \
 #define IIFORMAT_INHERITS_SHARED_DEVMETHOD(type, from, format, m, fromformat) \
   (type##_##format##_image_instantiator_methods->m##_method = from##_##fromformat##_##m)
 
+#define INSTANTIATOR_TYPE(inst) (XVECTOR_DATA ((inst))[0])
+
 struct image_instantiator_methods *
 decode_device_ii_format (Lisp_Object device, Lisp_Object format,
                         Error_behavior errb);
@@ -374,6 +376,7 @@ int layout_layout (Lisp_Object image_instance,
                   int width, int height, int xoffset, int yoffset,
                   Lisp_Object domain);
 int invalidate_glyph_geometry_maybe (Lisp_Object glyph_or_ii, struct window* w);
+Lisp_Object make_image_instance_cache_hash_table (void);
 
 DECLARE_DOESNT_RETURN (incompatible_image_types (Lisp_Object instantiator,
                                                  int given_dest_mask,
index 7332455..d0d60d7 100644 (file)
@@ -115,9 +115,6 @@ menubar_visible_p_changed (Lisp_Object specifier, struct window *w,
                           Lisp_Object oldval)
 {
   MARK_MENUBAR_CHANGED;
-  /* This is to force subwindow offsets to be recalculated - see
-     x_redisplay_widget (). */
-  MARK_FRAME_CHANGED (WINDOW_XFRAME (w));
 }
 
 static void
index ef0cf7f..7790ce7 100644 (file)
@@ -281,9 +281,8 @@ allocate_window (void)
   p->face_cachels     = Dynarr_new (face_cachel);
   p->glyph_cachels    = Dynarr_new (glyph_cachel);
   p->line_start_cache = Dynarr_new (line_start_cache);
-  p->subwindow_instance_cache = make_lisp_hash_table (30,
-                                                     HASH_TABLE_KEY_VALUE_WEAK,
-                                                     HASH_TABLE_EQ);
+  p->subwindow_instance_cache = make_image_instance_cache_hash_table ();
+
   p->line_cache_last_updated = Qzero;
   INIT_DISP_VARIABLE (last_point_x, 0);
   INIT_DISP_VARIABLE (last_point_y, 0);
@@ -3604,9 +3603,7 @@ make_dummy_parent (Lisp_Object window)
   p->face_cachels     = Dynarr_new (face_cachel);
   p->glyph_cachels    = Dynarr_new (glyph_cachel);
   p->subwindow_instance_cache =
-    make_lisp_hash_table (30,
-                         HASH_TABLE_KEY_VALUE_WEAK,
-                         HASH_TABLE_EQ);
+    make_image_instance_cache_hash_table ();
 
   /* Put new into window structure in place of window */
   replace_window (window, new);
@@ -5478,9 +5475,8 @@ by `current-window-configuration' (which see).
             set. */
          if (NILP (w->subwindow_instance_cache))
            w->subwindow_instance_cache =
-             make_lisp_hash_table (30,
-                                   HASH_TABLE_KEY_VALUE_WEAK,
-                                   HASH_TABLE_EQ);
+             make_image_instance_cache_hash_table ();
+
          SET_LAST_MODIFIED (w, 1);
          SET_LAST_FACECHANGE (w);
          w->config_mark = 0;
@@ -5861,14 +5857,20 @@ its value is -not- saved.
   /*
   config->frame_width = FRAME_WIDTH (f);
   config->frame_height = FRAME_HEIGHT (f); */
-  /* When using `push-window-configuration', often the minibuffer ends
+  /* #### When using `push-window-configuration', often the minibuffer ends
      up as the selected window because functions run as the result of
      user interaction e.g. hyper-apropos. It seems to me the sensible
-     thing to do is not record the minibuffer here. */
+     thing to do is not record the minibuffer here. 
+
+     #### Unfortunately this is a change to previous behaviour, however logical
+     it may be, so revert for the moment. */
+#if 0
   if (FRAME_MINIBUF_ONLY_P (f) || minibuf_level)
     config->current_window = FRAME_SELECTED_WINDOW (f);
   else
     config->current_window = FRAME_LAST_NONMINIBUF_WINDOW (f);
+#endif
+  config->current_window = FRAME_SELECTED_WINDOW (f);
   XSETBUFFER (config->current_buffer, current_buffer);
   config->minibuffer_scroll_window = Vminibuffer_scroll_window;
   config->root_window = FRAME_ROOT_WINDOW (f);
index 863abf1..74bfcd5 100644 (file)
@@ -1,3 +1,7 @@
+2001-01-08  Martin Buchholz <martin@xemacs.org>
+
+       * XEmacs 21.2.40 is released.
+
 2000-12-31  Martin Buchholz <martin@xemacs.org>
 
        * XEmacs 21.2.39 is released.