emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/src xterm.c


From: Chong Yidong
Subject: [Emacs-diffs] emacs/src xterm.c
Date: Sat, 13 Dec 2008 05:44:38 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      08/12/13 05:44:38

Modified files:
        src            : xterm.c 

Log message:
        (struct xim_inst_t): Definition moved to xterm.h.
        (xim_initialize): Save pointer to callback function data.
        (xim_close_dpy): Free callback function data.  Call XCloseIM,
        reverting 2008-11-04 change by David Smith.
        (x_term_init): Don't initialize the image cache here; it will be
        done in init_frame_faces.  Remove ancient "null_pixel" cruft.
        (x_delete_display): Free x_dnd_atoms member.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/xterm.c?cvsroot=emacs&r1=1.1015&r2=1.1016

Patches:
Index: xterm.c
===================================================================
RCS file: /sources/emacs/emacs/src/xterm.c,v
retrieving revision 1.1015
retrieving revision 1.1016
diff -u -b -r1.1015 -r1.1016
--- xterm.c     3 Dec 2008 04:10:37 -0000       1.1015
+++ xterm.c     13 Dec 2008 05:44:38 -0000      1.1016
@@ -8184,6 +8184,8 @@
 #ifdef HAVE_XIM
   if (use_xim)
     {
+      if (dpyinfo->xim)
+       XCloseIM (dpyinfo->xim);
       xim = XOpenIM (dpyinfo->display, dpyinfo->xrdb, resource_name,
                     EMACS_CLASS);
       dpyinfo->xim = xim;
@@ -8213,12 +8215,6 @@
 
 #ifdef HAVE_X11R6_XIM
 
-struct xim_inst_t
-{
-  struct x_display_info *dpyinfo;
-  char *resource_name;
-};
-
 /* XIM instantiate callback function, which is called whenever an XIM
    server is available.  DISPLAY is the display of the XIM.
    CLIENT_DATA contains a pointer to an xim_inst_t structure created
@@ -8282,6 +8278,7 @@
      struct x_display_info *dpyinfo;
      char *resource_name;
 {
+  dpyinfo->xim = NULL;
 #ifdef HAVE_XIM
   if (use_xim)
     {
@@ -8289,8 +8286,8 @@
       struct xim_inst_t *xim_inst;
       int len;
 
-      dpyinfo->xim = NULL;
       xim_inst = (struct xim_inst_t *) xmalloc (sizeof (struct xim_inst_t));
+      dpyinfo->xim_callback_data = xim_inst;
       xim_inst->dpyinfo = dpyinfo;
       len = strlen (resource_name);
       xim_inst->resource_name = (char *) xmalloc (len + 1);
@@ -8303,14 +8300,10 @@
                                         least, hence the configure test.  */
                                      (XRegisterIMInstantiateCallback_arg6) 
xim_inst);
 #else /* not HAVE_X11R6_XIM */
-      dpyinfo->xim = NULL;
       xim_open_dpy (dpyinfo, resource_name);
 #endif /* not HAVE_X11R6_XIM */
-
     }
-  else
 #endif /* HAVE_XIM */
-    dpyinfo->xim = NULL;
 }
 
 
@@ -8328,11 +8321,11 @@
        XUnregisterIMInstantiateCallback (dpyinfo->display, dpyinfo->xrdb,
                                          NULL, EMACS_CLASS,
                                          xim_instantiate_callback, NULL);
-#else /* not HAVE_X11R6_XIM */
-      /* If we have X11R6 xim, this causes a double-free.  */
+      xfree (dpyinfo->xim_callback_data->resource_name);
+      xfree (dpyinfo->xim_callback_data);
+#endif /* HAVE_X11R6_XIM */
       if (dpyinfo->display)
        XCloseIM (dpyinfo->xim);
-#endif /* HAVE_X11R6_XIM */
       dpyinfo->xim = NULL;
       XFree (dpyinfo->xim_styles);
     }
@@ -10242,7 +10235,6 @@
   dpyinfo->x_focus_frame = 0;
   dpyinfo->x_focus_event_frame = 0;
   dpyinfo->x_highlight_frame = 0;
-  dpyinfo->terminal->image_cache = make_image_cache ();
   dpyinfo->wm_type = X_WMTYPE_UNKNOWN;
 
   /* See if we can construct pixel values from RGB values.  */
@@ -10370,17 +10362,6 @@
   dpyinfo->connection = connection;
 
   {
-    char null_bits[1];
-
-    null_bits[0] = 0x00;
-
-    dpyinfo->null_pixel
-      = XCreatePixmapFromBitmapData (dpyinfo->display, dpyinfo->root_window,
-                                    null_bits, 1, 1, (long) 0, (long) 0,
-                                    1);
-  }
-
-  {
     extern int gray_bitmap_width, gray_bitmap_height;
     extern char *gray_bitmap_bits;
     dpyinfo->gray
@@ -10549,6 +10530,7 @@
 #endif
 
   xfree (dpyinfo->x_id_name);
+  xfree (dpyinfo->x_dnd_atoms);
   xfree (dpyinfo->color_cells);
   xfree (dpyinfo);
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]