aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2010-01-15 23:49:37 -0500
committerStefan Monnier2010-01-15 23:49:37 -0500
commit523ae620e8b915eb52101fd5808e1cff67cd559a (patch)
tree2e1e245304a8b794aa04ebf78bdebcca7ba739fa /src
parent045b9da7879353dfcba2264cfcd0ba0353669846 (diff)
downloademacs-523ae620e8b915eb52101fd5808e1cff67cd559a.tar.gz
emacs-523ae620e8b915eb52101fd5808e1cff67cd559a.zip
(x_term_init): Instead of inhibiting GC while running Lisp
code, link the new kboard into all_kboard before running Lisp code, and protect the new terminal with GCPRO (Bug#5365). (x_term_init): Remove unused var `atom'. (x_delete_display, x_delete_terminal): Remove unused var `i'.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/xterm.c28
2 files changed, 26 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 98489e1d71d..9cbab2b4d98 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12010-01-16 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * xterm.c (x_term_init): Instead of inhibiting GC while running Lisp
4 code, link the new kboard into all_kboard before running Lisp code,
5 and protect the new terminal with GCPRO (Bug#5365).
6 (x_term_init): Remove unused var `atom'.
7 (x_delete_display, x_delete_terminal): Remove unused var `i'.
8
12010-01-15 Jan Djärv <jan.h.d@swipnet.se> 92010-01-15 Jan Djärv <jan.h.d@swipnet.se>
2 10
3 * xfns.c (x_get_current_desktop, x_get_desktop_workarea): New functions. 11 * xfns.c (x_get_current_desktop, x_get_desktop_workarea): New functions.
diff --git a/src/xterm.c b/src/xterm.c
index 72dff200d82..b541683e5ad 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -9821,7 +9821,7 @@ x_wm_set_icon_pixmap (f, pixmap_id)
9821{ 9821{
9822 Pixmap icon_pixmap, icon_mask; 9822 Pixmap icon_pixmap, icon_mask;
9823 9823
9824#ifndef USE_X_TOOLKIT 9824#if !defined USE_X_TOOLKIT && !defined USE_GTK
9825 Window window = FRAME_OUTER_WINDOW (f); 9825 Window window = FRAME_OUTER_WINDOW (f);
9826#endif 9826#endif
9827 9827
@@ -10076,7 +10076,6 @@ x_term_init (display_name, xrm_option, resource_name)
10076 int argc; 10076 int argc;
10077 char *argv[NUM_ARGV]; 10077 char *argv[NUM_ARGV];
10078 char **argv2 = argv; 10078 char **argv2 = argv;
10079 GdkAtom atom;
10080 guint id; 10079 guint id;
10081#ifndef HAVE_GTK_MULTIDISPLAY 10080#ifndef HAVE_GTK_MULTIDISPLAY
10082 if (!EQ (Vinitial_window_system, Qx)) 10081 if (!EQ (Vinitial_window_system, Qx))
@@ -10215,25 +10214,36 @@ x_term_init (display_name, xrm_option, resource_name)
10215 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); 10214 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
10216 init_kboard (terminal->kboard); 10215 init_kboard (terminal->kboard);
10217 terminal->kboard->Vwindow_system = Qx; 10216 terminal->kboard->Vwindow_system = Qx;
10217
10218 /* Add the keyboard to the list before running Lisp code (via
10219 Qvendor_specific_keysyms below), since these are not traced
10220 via terminals but only through all_kboards. */
10221 terminal->kboard->next_kboard = all_kboards;
10222 all_kboards = terminal->kboard;
10223
10218 if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound)) 10224 if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound))
10219 { 10225 {
10220 char *vendor = ServerVendor (dpy); 10226 char *vendor = ServerVendor (dpy);
10221 /* Temporarily hide the partially initialized terminal, 10227
10222 but make sure it doesn't get garbage collected. */ 10228 /* Protect terminal from GC before removing it from the
10223 int count = inhibit_garbage_collection (); 10229 list of terminals. */
10230 struct gcpro gcpro1;
10231 Lisp_Object gcpro_term;
10232 XSETTERMINAL (gcpro_term, terminal);
10233 GCPRO1 (gcpro_term);
10234
10235 /* Temporarily hide the partially initialized terminal. */
10224 terminal_list = terminal->next_terminal; 10236 terminal_list = terminal->next_terminal;
10225 UNBLOCK_INPUT; 10237 UNBLOCK_INPUT;
10226 terminal->kboard->Vsystem_key_alist 10238 terminal->kboard->Vsystem_key_alist
10227 = call1 (Qvendor_specific_keysyms, 10239 = call1 (Qvendor_specific_keysyms,
10228 vendor ? build_string (vendor) : empty_unibyte_string); 10240 vendor ? build_string (vendor) : empty_unibyte_string);
10229 BLOCK_INPUT; 10241 BLOCK_INPUT;
10230 unbind_to (count, Qnil);
10231 terminal->next_terminal = terminal_list; 10242 terminal->next_terminal = terminal_list;
10232 terminal_list = terminal; 10243 terminal_list = terminal;
10244 UNGCPRO;
10233 } 10245 }
10234 10246
10235 terminal->kboard->next_kboard = all_kboards;
10236 all_kboards = terminal->kboard;
10237 /* Don't let the initial kboard remain current longer than necessary. 10247 /* Don't let the initial kboard remain current longer than necessary.
10238 That would cause problems if a file loaded on startup tries to 10248 That would cause problems if a file loaded on startup tries to
10239 prompt in the mini-buffer. */ 10249 prompt in the mini-buffer. */
@@ -10582,7 +10592,6 @@ void
10582x_delete_display (dpyinfo) 10592x_delete_display (dpyinfo)
10583 struct x_display_info *dpyinfo; 10593 struct x_display_info *dpyinfo;
10584{ 10594{
10585 int i;
10586 struct terminal *t; 10595 struct terminal *t;
10587 10596
10588 /* Close all frames and delete the generic struct terminal for this 10597 /* Close all frames and delete the generic struct terminal for this
@@ -10734,7 +10743,6 @@ void
10734x_delete_terminal (struct terminal *terminal) 10743x_delete_terminal (struct terminal *terminal)
10735{ 10744{
10736 struct x_display_info *dpyinfo = terminal->display_info.x; 10745 struct x_display_info *dpyinfo = terminal->display_info.x;
10737 int i;
10738 10746
10739 /* Protect against recursive calls. delete_frame in 10747 /* Protect against recursive calls. delete_frame in
10740 delete_terminal calls us back when it deletes our last frame. */ 10748 delete_terminal calls us back when it deletes our last frame. */