aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2005-06-27 00:56:21 +0000
committerKaroly Lorentey2005-06-27 00:56:21 +0000
commitbedb9c0eda660f7dc516543be25db37b5f95e03b (patch)
tree7c47185d6b01dd86453399a966c29ea4dfe70f9b /src
parentd66d64bc20de2e172859b2c3f08d05bb2f813c00 (diff)
downloademacs-bedb9c0eda660f7dc516543be25db37b5f95e03b.tar.gz
emacs-bedb9c0eda660f7dc516543be25db37b5f95e03b.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/dispnew.c3
-rw-r--r--src/frame.c88
-rw-r--r--src/frame.h12
-rw-r--r--src/term.c29
-rw-r--r--src/termchar.h5
-rw-r--r--src/termhooks.h5
-rw-r--r--src/xfns.c16
-rw-r--r--src/xselect.c2
-rw-r--r--src/xterm.c22
-rw-r--r--src/xterm.h3
10 files changed, 73 insertions, 112 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index cc9e6152d1a..6a95d2e38d3 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6734,9 +6734,6 @@ For types not defined in VMS, use define emacs_term \"TYPE\".\n\
6734 abort (); 6734 abort ();
6735 f->output_method = d->type; 6735 f->output_method = d->type;
6736 f->display = d; 6736 f->display = d;
6737#ifdef MULTI_KBOARD
6738 f->kboard = d->display_info.tty->kboard;
6739#endif
6740 6737
6741 d->reference_count++; 6738 d->reference_count++;
6742 d->display_info.tty->top_frame = selected_frame; 6739 d->display_info.tty->top_frame = selected_frame;
diff --git a/src/frame.c b/src/frame.c
index 6a54e26121f..52ae3191299 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -303,9 +303,6 @@ make_frame (mini_p)
303 f->menu_bar_items_used = 0; 303 f->menu_bar_items_used = 0;
304 f->buffer_predicate = Qnil; 304 f->buffer_predicate = Qnil;
305 f->buffer_list = Qnil; 305 f->buffer_list = Qnil;
306#ifdef MULTI_KBOARD
307 f->kboard = initial_kboard;
308#endif
309 f->namebuf = 0; 306 f->namebuf = 0;
310 f->title = Qnil; 307 f->title = Qnil;
311 f->menu_bar_window = Qnil; 308 f->menu_bar_window = Qnil;
@@ -425,7 +422,7 @@ make_frame_without_minibuffer (mini_window, kb, display)
425 422
426#ifdef MULTI_KBOARD 423#ifdef MULTI_KBOARD
427 if (!NILP (mini_window) 424 if (!NILP (mini_window)
428 && XFRAME (XWINDOW (mini_window)->frame)->kboard != kb) 425 && XFRAME (XWINDOW (mini_window)->frame)->display->kboard != kb)
429 error ("Frame and minibuffer must be on the same display"); 426 error ("Frame and minibuffer must be on the same display");
430#endif 427#endif
431 428
@@ -552,10 +549,6 @@ make_initial_frame (void)
552 FRAME_CAN_HAVE_SCROLL_BARS (f) = 0; 549 FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
553 FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none; 550 FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
554 551
555#ifdef MULTI_KBOARD
556 f->kboard = initial_kboard;
557#endif
558
559 return f; 552 return f;
560} 553}
561 554
@@ -622,10 +615,6 @@ make_terminal_frame (struct display *display)
622 FRAME_CAN_HAVE_SCROLL_BARS (f) = 0; 615 FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
623 FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none; 616 FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
624 617
625#ifdef MULTI_KBOARD
626 f->kboard = FRAME_TTY (f)->kboard;
627#endif
628
629 /* Set the top frame to the newly created frame. */ 618 /* Set the top frame to the newly created frame. */
630 if (FRAME_TTY (f)->top_frame 619 if (FRAME_TTY (f)->top_frame
631 && FRAME_LIVE_P (XFRAME (FRAME_TTY (f)->top_frame))) 620 && FRAME_LIVE_P (XFRAME (FRAME_TTY (f)->top_frame)))
@@ -1358,6 +1347,8 @@ The functions are run with one arg, the frame to be deleted. */)
1358{ 1347{
1359 struct frame *f; 1348 struct frame *f;
1360 struct frame *sf = SELECTED_FRAME (); 1349 struct frame *sf = SELECTED_FRAME ();
1350 struct kboard *kb;
1351
1361 int minibuffer_selected; 1352 int minibuffer_selected;
1362 1353
1363 if (EQ (frame, Qnil)) 1354 if (EQ (frame, Qnil))
@@ -1513,23 +1504,25 @@ The functions are run with one arg, the frame to be deleted. */)
1513 1504
1514 if (FRAME_DISPLAY (f)->delete_frame_hook) 1505 if (FRAME_DISPLAY (f)->delete_frame_hook)
1515 (*FRAME_DISPLAY (f)->delete_frame_hook) (f); 1506 (*FRAME_DISPLAY (f)->delete_frame_hook) (f);
1516 1507
1517 { 1508 {
1518 struct display *display = FRAME_DISPLAY (f); 1509 struct display *display = FRAME_DISPLAY (f);
1519
1520 f->output_data.nothing = 0; 1510 f->output_data.nothing = 0;
1521 f->display = 0; /* Now the frame is dead. */ 1511 f->display = 0; /* Now the frame is dead. */
1522 1512
1523 /* If needed, delete the device that this frame was on. 1513 /* If needed, delete the device that this frame was on.
1524 (This must be done after the frame is killed.) */ 1514 (This must be done after the frame is killed.) */
1525 display->reference_count--; 1515 display->reference_count--;
1526 if (display->reference_count == 0) 1516 if (display->reference_count == 0)
1527 { 1517 {
1528 if (display->delete_display_hook) 1518 kb = NULL;
1529 (*display->delete_display_hook) (display); 1519 if (display->delete_display_hook)
1530 else 1520 (*display->delete_display_hook) (display);
1531 delete_display (display); 1521 else
1532 } 1522 delete_display (display);
1523 }
1524 else
1525 kb = display->kboard;
1533 } 1526 }
1534 1527
1535 /* If we've deleted the last_nonminibuf_frame, then try to find 1528 /* If we've deleted the last_nonminibuf_frame, then try to find
@@ -1555,38 +1548,39 @@ The functions are run with one arg, the frame to be deleted. */)
1555 1548
1556 /* If there's no other frame on the same kboard, get out of 1549 /* If there's no other frame on the same kboard, get out of
1557 single-kboard state if we're in it for this kboard. */ 1550 single-kboard state if we're in it for this kboard. */
1558 { 1551 if (kb != NULL)
1559 Lisp_Object frames; 1552 {
1560 /* Some frame we found on the same kboard, or nil if there are none. */ 1553 Lisp_Object frames;
1561 Lisp_Object frame_on_same_kboard; 1554 /* Some frame we found on the same kboard, or nil if there are none. */
1555 Lisp_Object frame_on_same_kboard;
1562 1556
1563 frame_on_same_kboard = Qnil; 1557 frame_on_same_kboard = Qnil;
1564 1558
1565 for (frames = Vframe_list; 1559 for (frames = Vframe_list;
1566 CONSP (frames); 1560 CONSP (frames);
1567 frames = XCDR (frames)) 1561 frames = XCDR (frames))
1568 { 1562 {
1569 Lisp_Object this; 1563 Lisp_Object this;
1570 struct frame *f1; 1564 struct frame *f1;
1571 1565
1572 this = XCAR (frames); 1566 this = XCAR (frames);
1573 if (!FRAMEP (this)) 1567 if (!FRAMEP (this))
1574 abort (); 1568 abort ();
1575 f1 = XFRAME (this); 1569 f1 = XFRAME (this);
1576 1570
1577 if (FRAME_KBOARD (f) == FRAME_KBOARD (f1)) 1571 if (kb == FRAME_KBOARD (f1))
1578 frame_on_same_kboard = this; 1572 frame_on_same_kboard = this;
1579 } 1573 }
1580 1574
1581 if (NILP (frame_on_same_kboard)) 1575 if (NILP (frame_on_same_kboard))
1582 not_single_kboard_state (FRAME_KBOARD (f)); 1576 not_single_kboard_state (kb);
1583 } 1577 }
1584 1578
1585 1579
1586 /* If we've deleted this keyboard's default_minibuffer_frame, try to 1580 /* If we've deleted this keyboard's default_minibuffer_frame, try to
1587 find another one. Prefer minibuffer-only frames, but also notice 1581 find another one. Prefer minibuffer-only frames, but also notice
1588 frames with other windows. */ 1582 frames with other windows. */
1589 if (EQ (frame, FRAME_KBOARD (f)->Vdefault_minibuffer_frame)) 1583 if (kb != NULL && EQ (frame, kb->Vdefault_minibuffer_frame))
1590 { 1584 {
1591 Lisp_Object frames; 1585 Lisp_Object frames;
1592 1586
@@ -1612,7 +1606,7 @@ The functions are run with one arg, the frame to be deleted. */)
1612 1606
1613 /* Consider only frames on the same kboard 1607 /* Consider only frames on the same kboard
1614 and only those with minibuffers. */ 1608 and only those with minibuffers. */
1615 if (FRAME_KBOARD (f) == FRAME_KBOARD (f1) 1609 if (kb == FRAME_KBOARD (f1)
1616 && FRAME_HAS_MINIBUF_P (f1)) 1610 && FRAME_HAS_MINIBUF_P (f1))
1617 { 1611 {
1618 frame_with_minibuf = this; 1612 frame_with_minibuf = this;
@@ -1620,7 +1614,7 @@ The functions are run with one arg, the frame to be deleted. */)
1620 break; 1614 break;
1621 } 1615 }
1622 1616
1623 if (FRAME_KBOARD (f) == FRAME_KBOARD (f1)) 1617 if (kb == FRAME_KBOARD (f1))
1624 frame_on_same_kboard = this; 1618 frame_on_same_kboard = this;
1625 } 1619 }
1626 1620
@@ -1635,11 +1629,11 @@ The functions are run with one arg, the frame to be deleted. */)
1635 if (NILP (frame_with_minibuf)) 1629 if (NILP (frame_with_minibuf))
1636 abort (); 1630 abort ();
1637 1631
1638 FRAME_KBOARD (f)->Vdefault_minibuffer_frame = frame_with_minibuf; 1632 kb->Vdefault_minibuffer_frame = frame_with_minibuf;
1639 } 1633 }
1640 else 1634 else
1641 /* No frames left on this kboard--say no minibuffer either. */ 1635 /* No frames left on this kboard--say no minibuffer either. */
1642 FRAME_KBOARD (f)->Vdefault_minibuffer_frame = Qnil; 1636 kb->Vdefault_minibuffer_frame = Qnil;
1643 } 1637 }
1644 1638
1645 /* Cause frame titles to update--necessary if we now have just one frame. */ 1639 /* Cause frame titles to update--necessary if we now have just one frame. */
diff --git a/src/frame.h b/src/frame.h
index 9f0c830ca86..c4190255b72 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -292,16 +292,6 @@ struct frame
292 /* The extra width (in pixels) currently allotted for fringes. */ 292 /* The extra width (in pixels) currently allotted for fringes. */
293 int left_fringe_width, right_fringe_width; 293 int left_fringe_width, right_fringe_width;
294 294
295#ifdef MULTI_KBOARD
296 /* XXX Maybe this should be moved to struct display, too. */
297 /* A pointer to the kboard structure associated with this frame.
298 For termcap frames, it will be the same as
299 display->display_info.tty->kboard.
300 For X frames, it will be the same as
301 display->display_info.x->kboard. */
302 struct kboard *kboard;
303#endif
304
305 /* See FULLSCREEN_ enum below */ 295 /* See FULLSCREEN_ enum below */
306 int want_fullscreen; 296 int want_fullscreen;
307 297
@@ -456,7 +446,7 @@ struct frame
456}; 446};
457 447
458#ifdef MULTI_KBOARD 448#ifdef MULTI_KBOARD
459#define FRAME_KBOARD(f) ((f)->kboard) 449#define FRAME_KBOARD(f) ((f)->display->kboard)
460#else 450#else
461#define FRAME_KBOARD(f) (&the_only_kboard) 451#define FRAME_KBOARD(f) (&the_only_kboard)
462#endif 452#endif
diff --git a/src/term.c b/src/term.c
index 55d1741873c..8f541816798 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2285,10 +2285,11 @@ init_initial_display (void)
2285 initial_display = create_display (); 2285 initial_display = create_display ();
2286 initial_display->type = output_initial; 2286 initial_display->type = output_initial;
2287 initial_display->name = xstrdup ("initial_display"); 2287 initial_display->name = xstrdup ("initial_display");
2288 initial_display->kboard = initial_kboard;
2288 2289
2289 initial_display->delete_display_hook = &delete_initial_display; 2290 initial_display->delete_display_hook = &delete_initial_display;
2290 /* All other hooks are NULL. */ 2291 /* All other hooks are NULL. */
2291 2292
2292 return initial_display; 2293 return initial_display;
2293} 2294}
2294 2295
@@ -2682,19 +2683,19 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
2682 tty->TF_teleray = tgetflag ("xt"); 2683 tty->TF_teleray = tgetflag ("xt");
2683 2684
2684#ifdef MULTI_KBOARD 2685#ifdef MULTI_KBOARD
2685 tty->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); 2686 display->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
2686 init_kboard (tty->kboard); 2687 init_kboard (display->kboard);
2687 tty->kboard->next_kboard = all_kboards; 2688 display->kboard->next_kboard = all_kboards;
2688 all_kboards = tty->kboard; 2689 all_kboards = display->kboard;
2690 display->kboard->reference_count++;
2689 /* Don't let the initial kboard remain current longer than necessary. 2691 /* Don't let the initial kboard remain current longer than necessary.
2690 That would cause problems if a file loaded on startup tries to 2692 That would cause problems if a file loaded on startup tries to
2691 prompt in the mini-buffer. */ 2693 prompt in the mini-buffer. */
2692 if (current_kboard == initial_kboard) 2694 if (current_kboard == initial_kboard)
2693 current_kboard = tty->kboard; 2695 current_kboard = display->kboard;
2694 tty->kboard->reference_count++;
2695#endif 2696#endif
2696 2697
2697 term_get_fkeys (address, tty->kboard); 2698 term_get_fkeys (address, display->kboard);
2698 2699
2699 /* Get frame size from system, or else from termcap. */ 2700 /* Get frame size from system, or else from termcap. */
2700 { 2701 {
@@ -3051,13 +3052,6 @@ delete_tty (struct display *display)
3051 if (tty->Wcm) 3052 if (tty->Wcm)
3052 xfree (tty->Wcm); 3053 xfree (tty->Wcm);
3053 3054
3054#ifdef MULTI_KBOARD
3055 if (tty->kboard && --tty->kboard->reference_count > 0)
3056 abort ();
3057 if (tty->kboard)
3058 delete_kboard (tty->kboard);
3059#endif
3060
3061 bzero (tty, sizeof (struct tty_display_info)); 3055 bzero (tty, sizeof (struct tty_display_info));
3062 xfree (tty); 3056 xfree (tty);
3063 deleting_tty = 0; 3057 deleting_tty = 0;
@@ -3170,6 +3164,11 @@ delete_display (struct display *display)
3170 if (display->name) 3164 if (display->name)
3171 xfree (display->name); 3165 xfree (display->name);
3172 3166
3167#ifdef MULTI_KBOARD
3168 if (display->kboard && --display->kboard->reference_count == 0)
3169 delete_kboard (display->kboard);
3170#endif
3171
3173 bzero (display, sizeof (struct display)); 3172 bzero (display, sizeof (struct display));
3174 xfree (display); 3173 xfree (display);
3175} 3174}
diff --git a/src/termchar.h b/src/termchar.h
index 5502ca22949..58d0ba24232 100644
--- a/src/termchar.h
+++ b/src/termchar.h
@@ -70,11 +70,6 @@ struct tty_display_info
70 /* The previous terminal frame we displayed on this tty. */ 70 /* The previous terminal frame we displayed on this tty. */
71 struct frame *previous_terminal_frame; 71 struct frame *previous_terminal_frame;
72 72
73#ifdef MULTI_KBOARD
74 /* The terminal's keyboard object. */
75 struct kboard *kboard;
76#endif
77
78 /* Strings, numbers and flags taken from the termcap entry. */ 73 /* Strings, numbers and flags taken from the termcap entry. */
79 74
80 char *TS_ins_line; /* "al" */ 75 char *TS_ins_line; /* "al" */
diff --git a/src/termhooks.h b/src/termhooks.h
index 788b57e9d1e..86e9fd3469b 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -295,6 +295,11 @@ struct display
295 /* The name of the display device. Do not use this to identify the display. */ 295 /* The name of the display device. Do not use this to identify the display. */
296 char *name; 296 char *name;
297 297
298#ifdef MULTI_KBOARD
299 /* The device's keyboard object. */
300 struct kboard *kboard;
301#endif
302
298 /* Display-type dependent data shared amongst all frames on this display. */ 303 /* Display-type dependent data shared amongst all frames on this display. */
299 union display_info 304 union display_info
300 { 305 {
diff --git a/src/xfns.c b/src/xfns.c
index 2910d0f3cd4..a8fa726f23d 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3014,7 +3014,7 @@ This function is an internal primitive--use `make-frame' instead. */)
3014 display = Qnil; 3014 display = Qnil;
3015 dpyinfo = check_x_display_info (display); 3015 dpyinfo = check_x_display_info (display);
3016#ifdef MULTI_KBOARD 3016#ifdef MULTI_KBOARD
3017 kb = dpyinfo->kboard; 3017 kb = dpyinfo->frame_display->kboard;
3018#else 3018#else
3019 kb = &the_only_kboard; 3019 kb = &the_only_kboard;
3020#endif 3020#endif
@@ -3086,9 +3086,6 @@ This function is an internal primitive--use `make-frame' instead. */)
3086 image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount; 3086 image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount;
3087 dpyinfo_refcount = dpyinfo->reference_count; 3087 dpyinfo_refcount = dpyinfo->reference_count;
3088#endif /* GLYPH_DEBUG */ 3088#endif /* GLYPH_DEBUG */
3089#ifdef MULTI_KBOARD
3090 FRAME_KBOARD (f) = kb;
3091#endif
3092 3089
3093 /* These colors will be set anyway later, but it's important 3090 /* These colors will be set anyway later, but it's important
3094 to get the color reference counts right, so initialize them! */ 3091 to get the color reference counts right, so initialize them! */
@@ -4598,20 +4595,12 @@ x_create_tip_frame (dpyinfo, parms, text)
4598 int width, height; 4595 int width, height;
4599 int count = SPECPDL_INDEX (); 4596 int count = SPECPDL_INDEX ();
4600 struct gcpro gcpro1, gcpro2, gcpro3; 4597 struct gcpro gcpro1, gcpro2, gcpro3;
4601 struct kboard *kb;
4602 int face_change_count_before = face_change_count; 4598 int face_change_count_before = face_change_count;
4603 Lisp_Object buffer; 4599 Lisp_Object buffer;
4604 struct buffer *old_buffer; 4600 struct buffer *old_buffer;
4605 4601
4606 check_x (); 4602 check_x ();
4607 4603
4608
4609#ifdef MULTI_KBOARD
4610 kb = dpyinfo->kboard;
4611#else
4612 kb = &the_only_kboard;
4613#endif
4614
4615 /* Get the name of the frame to use for resource lookup. */ 4604 /* Get the name of the frame to use for resource lookup. */
4616 name = x_get_arg (dpyinfo, parms, Qname, "name", "Name", RES_TYPE_STRING); 4605 name = x_get_arg (dpyinfo, parms, Qname, "name", "Name", RES_TYPE_STRING);
4617 if (!STRINGP (name) 4606 if (!STRINGP (name)
@@ -4662,9 +4651,6 @@ x_create_tip_frame (dpyinfo, parms, text)
4662 image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount; 4651 image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount;
4663 dpyinfo_refcount = dpyinfo->reference_count; 4652 dpyinfo_refcount = dpyinfo->reference_count;
4664#endif /* GLYPH_DEBUG */ 4653#endif /* GLYPH_DEBUG */
4665#ifdef MULTI_KBOARD
4666 FRAME_KBOARD (f) = kb;
4667#endif
4668 f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; 4654 f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window;
4669 f->output_data.x->explicit_parent = 0; 4655 f->output_data.x->explicit_parent = 0;
4670 4656
diff --git a/src/xselect.c b/src/xselect.c
index b0bd0bc97c9..c60c12c3b67 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1010,7 +1010,7 @@ x_handle_selection_clear (event)
1010 to see if this Emacs job now owns the selection 1010 to see if this Emacs job now owns the selection
1011 through that display. */ 1011 through that display. */
1012 for (t_dpyinfo = x_display_list; t_dpyinfo; t_dpyinfo = t_dpyinfo->next) 1012 for (t_dpyinfo = x_display_list; t_dpyinfo; t_dpyinfo = t_dpyinfo->next)
1013 if (t_dpyinfo->kboard == dpyinfo->kboard) 1013 if (t_dpyinfo->frame_display->kboard == dpyinfo->frame_display->kboard)
1014 { 1014 {
1015 Window owner_window 1015 Window owner_window
1016 = XGetSelectionOwner (t_dpyinfo->display, selection); 1016 = XGetSelectionOwner (t_dpyinfo->display, selection);
diff --git a/src/xterm.c b/src/xterm.c
index 71e1e2de1e8..68d2e46cc77 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10277,30 +10277,30 @@ x_term_init (display_name, xrm_option, resource_name)
10277 SDATA (display_name))) 10277 SDATA (display_name)))
10278 break; 10278 break;
10279 if (share) 10279 if (share)
10280 dpyinfo->kboard = share->kboard; 10280 display->kboard = share->frame_display->kboard;
10281 else 10281 else
10282 { 10282 {
10283 dpyinfo->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); 10283 display->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
10284 init_kboard (dpyinfo->kboard); 10284 init_kboard (display->kboard);
10285 if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound)) 10285 if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound))
10286 { 10286 {
10287 char *vendor = ServerVendor (dpy); 10287 char *vendor = ServerVendor (dpy);
10288 UNBLOCK_INPUT; 10288 UNBLOCK_INPUT;
10289 dpyinfo->kboard->Vsystem_key_alist 10289 display->kboard->Vsystem_key_alist
10290 = call1 (Qvendor_specific_keysyms, 10290 = call1 (Qvendor_specific_keysyms,
10291 build_string (vendor ? vendor : "")); 10291 build_string (vendor ? vendor : ""));
10292 BLOCK_INPUT; 10292 BLOCK_INPUT;
10293 } 10293 }
10294 10294
10295 dpyinfo->kboard->next_kboard = all_kboards; 10295 display->kboard->next_kboard = all_kboards;
10296 all_kboards = dpyinfo->kboard; 10296 all_kboards = display->kboard;
10297 /* Don't let the initial kboard remain current longer than necessary. 10297 /* Don't let the initial kboard remain current longer than necessary.
10298 That would cause problems if a file loaded on startup tries to 10298 That would cause problems if a file loaded on startup tries to
10299 prompt in the mini-buffer. */ 10299 prompt in the mini-buffer. */
10300 if (current_kboard == initial_kboard) 10300 if (current_kboard == initial_kboard)
10301 current_kboard = dpyinfo->kboard; 10301 current_kboard = display->kboard;
10302 } 10302 }
10303 dpyinfo->kboard->reference_count++; 10303 display->kboard->reference_count++;
10304 } 10304 }
10305#endif 10305#endif
10306 10306
@@ -10677,10 +10677,6 @@ x_delete_display (dpyinfo)
10677 XrmDestroyDatabase (dpyinfo->xrdb); 10677 XrmDestroyDatabase (dpyinfo->xrdb);
10678#endif 10678#endif
10679#endif 10679#endif
10680#ifdef MULTI_KBOARD
10681 if (--dpyinfo->kboard->reference_count == 0)
10682 delete_kboard (dpyinfo->kboard);
10683#endif
10684#ifdef HAVE_X_I18N 10680#ifdef HAVE_X_I18N
10685 if (dpyinfo->xim) 10681 if (dpyinfo->xim)
10686 xim_close_dpy (dpyinfo); 10682 xim_close_dpy (dpyinfo);
@@ -10811,6 +10807,8 @@ x_create_frame_display (struct x_display_info *dpyinfo)
10811 display->type = output_x_window; 10807 display->type = output_x_window;
10812 display->display_info.x = dpyinfo; 10808 display->display_info.x = dpyinfo;
10813 dpyinfo->frame_display = display; 10809 dpyinfo->frame_display = display;
10810
10811 /* kboard is initialized in x_term_init. */
10814 10812
10815 display->clear_frame_hook = x_clear_frame; 10813 display->clear_frame_hook = x_clear_frame;
10816 display->ins_del_lines_hook = x_ins_del_lines; 10814 display->ins_del_lines_hook = x_ins_del_lines;
diff --git a/src/xterm.h b/src/xterm.h
index 5f568af935a..85cfe942586 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -327,9 +327,6 @@ struct x_display_info
327 /* Atom used in toolkit scroll bar client messages. */ 327 /* Atom used in toolkit scroll bar client messages. */
328 Atom Xatom_Scrollbar; 328 Atom Xatom_Scrollbar;
329 329
330#ifdef MULTI_KBOARD
331 struct kboard *kboard;
332#endif
333 int cut_buffers_initialized; /* Whether we're sure they all exist */ 330 int cut_buffers_initialized; /* Whether we're sure they all exist */
334 331
335 /* The frame (if any) which has the X window that has keyboard focus. 332 /* The frame (if any) which has the X window that has keyboard focus.