diff src/term.c @ 83323:61487e73bbc2

Cleanup: Move kboard fields from struct frame and device-specific descriptors to struct display. * src/termhooks.h (display): New field: kboard. * src/xterm.h (x_display_info): Remove kboard field. * src/termchar.h (tty_display_info): Ditto. * src/frame.h (frame): Ditto. (FRAME_KBOARD): Update. * src/dispnew.c (init_display): Don't initialize kboard. * src/frame.c (make_frame, make_initial_frame, make_terminal_frame): Ditto. * src/frame.c (make_frame_without_minibuffer, Fdelete_frame): Update kboard access. * src/keyboard.c (delete_kboard): Ditto. * src/term.c (term_init): Ditto. * src/xfns.c (Fx_create_frame, x_create_tip_frame): Ditto. * src/xselect.c (x_handle_selection_clear): Ditto. * src/xterm.c (x_term_init): Ditto. * src/term.c (init_initial_display): Initialize kboard. * src/xterm.c (x_term_init): Ditto. * src/term.c (delete_tty): Remove kboard deletion. (delete_display): Delete kboard as well. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-363
author Karoly Lorentey <lorentey@elte.hu>
date Mon, 27 Jun 2005 00:56:21 +0000
parents e235da12dd03
children 233c9974025b
line wrap: on
line diff
--- a/src/term.c	Mon Jun 27 00:39:58 2005 +0000
+++ b/src/term.c	Mon Jun 27 00:56:21 2005 +0000
@@ -2285,10 +2285,11 @@
   initial_display = create_display ();
   initial_display->type = output_initial;
   initial_display->name = xstrdup ("initial_display");
+  initial_display->kboard = initial_kboard;
 
   initial_display->delete_display_hook = &delete_initial_display;
   /* All other hooks are NULL. */
-  
+
   return initial_display;
 }
 
@@ -2682,19 +2683,19 @@
   tty->TF_teleray = tgetflag ("xt");
 
 #ifdef MULTI_KBOARD
-  tty->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
-  init_kboard (tty->kboard);
-  tty->kboard->next_kboard = all_kboards;
-  all_kboards = tty->kboard;
+  display->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
+  init_kboard (display->kboard);
+  display->kboard->next_kboard = all_kboards;
+  all_kboards = display->kboard;
+  display->kboard->reference_count++;
   /* Don't let the initial kboard remain current longer than necessary.
      That would cause problems if a file loaded on startup tries to
      prompt in the mini-buffer.  */
   if (current_kboard == initial_kboard)
-    current_kboard = tty->kboard;
-  tty->kboard->reference_count++;
+    current_kboard = display->kboard;
 #endif
 
-  term_get_fkeys (address, tty->kboard);
+  term_get_fkeys (address, display->kboard);
 
   /* Get frame size from system, or else from termcap.  */
   {
@@ -3051,13 +3052,6 @@
   if (tty->Wcm)
     xfree (tty->Wcm);
 
-#ifdef MULTI_KBOARD
-  if (tty->kboard && --tty->kboard->reference_count > 0)
-    abort ();
-  if (tty->kboard)
-    delete_kboard (tty->kboard);
-#endif
-  
   bzero (tty, sizeof (struct tty_display_info));
   xfree (tty);
   deleting_tty = 0;
@@ -3170,6 +3164,11 @@
   if (display->name)
     xfree (display->name);
   
+#ifdef MULTI_KBOARD
+  if (display->kboard && --display->kboard->reference_count == 0)
+    delete_kboard (display->kboard);
+#endif
+  
   bzero (display, sizeof (struct display));
   xfree (display);
 }