Fequal_including_properties fix
[bpt/emacs.git] / src / xterm.c
index 530bfe6..fcf5263 100644 (file)
@@ -226,7 +226,6 @@ static void x_lower_frame (struct frame *);
 static const XColor *x_color_cells (Display *, int *);
 static int x_io_error_quitter (Display *);
 static struct terminal *x_create_terminal (struct x_display_info *);
-void x_delete_terminal (struct terminal *);
 static void x_update_end (struct frame *);
 static void XTframe_up_to_date (struct frame *);
 static void x_clear_frame (struct frame *);
@@ -359,8 +358,10 @@ x_find_topmost_parent (struct frame *f)
       unsigned int nchildren;
 
       win = wi;
-      XQueryTree (dpy, win, &root, &wi, &children, &nchildren);
-      XFree (children);
+      if (XQueryTree (dpy, win, &root, &wi, &children, &nchildren))
+       XFree (children);
+      else
+       break;
     }
 
   return win;
@@ -6459,7 +6460,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
            for (i = 0, nchars = 0; i < nbytes; i++)
              {
-               if (ASCII_BYTE_P (copy_bufptr[i]))
+               if (ASCII_CHAR_P (copy_bufptr[i]))
                  nchars++;
                STORE_KEYSYM_FOR_DEBUG (copy_bufptr[i]);
              }
@@ -7583,7 +7584,7 @@ x_connection_closed (Display *dpy, const char *error_message)
 {
   struct x_display_info *dpyinfo = x_display_info_for_display (dpy);
   Lisp_Object frame, tail;
-  ptrdiff_t idx = SPECPDL_INDEX ();
+  dynwind_begin ();
 
   error_msg = alloca (strlen (error_message) + 1);
   strcpy (error_msg, error_message);
@@ -7672,7 +7673,7 @@ For details, see etc/PROBLEMS.\n",
 
   totally_unblock_input ();
 
-  unbind_to (idx, Qnil);
+  dynwind_end ();
   clear_waiting_for_input ();
 
   /* Tell GCC not to suggest attribute 'noreturn' for this function.  */
@@ -7859,11 +7860,6 @@ xim_destroy_callback (XIM xim, XPointer client_data, XPointer call_data)
 
 #endif /* HAVE_X11R6 */
 
-#ifdef HAVE_X11R6
-/* This isn't prototyped in OSF 5.0 or 5.1a.  */
-extern char *XSetIMValues (XIM, ...);
-#endif
-
 /* Open the connection to the XIM server on display DPYINFO.
    RESOURCE_NAME is the resource name Emacs uses.  */
 
@@ -9007,15 +9003,7 @@ x_make_frame_visible (struct frame *f)
           that the handler isn't always enabled here.  This is
           probably a bug.  */
        if (input_polling_used ())
-         {
-           /* It could be confusing if a real alarm arrives while
-              processing the fake one.  Turn it off and let the
-              handler reset it.  */
-           int old_poll_suppress_count = poll_suppress_count;
-           poll_suppress_count = 1;
-           poll_for_input_1 ();
-           poll_suppress_count = old_poll_suppress_count;
-         }
+          poll_for_input_1 ();
 
        if (XPending (FRAME_X_DISPLAY (f)))
          {
@@ -9779,7 +9767,7 @@ x_toggle_visible_pointer (struct frame *f, bool invisible)
   else
     XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
                   f->output_data.x->current_cursor);
-  f->pointer_invisible = invisible;  
+  f->pointer_invisible = invisible;
 }
 
 /* Setup pointer blanking, prefer Xfixes if available.  */
@@ -9969,7 +9957,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
       {
        terminal->kboard = allocate_kboard (Qx);
 
-       if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound))
+       if (!EQ (SYMBOL_FUNCTION (Qvendor_specific_keysyms), Qunbound))
          {
            char *vendor = ServerVendor (dpy);
 
@@ -10020,8 +10008,8 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
   if (lim - SBYTES (Vinvocation_name) < SBYTES (Vsystem_name))
     memory_full (SIZE_MAX);
   dpyinfo->x_id = ++x_display_id;
-  dpyinfo->x_id_name = xmalloc (SBYTES (Vinvocation_name)
-                               + SBYTES (Vsystem_name) + 2);
+  dpyinfo->x_id_name = xmalloc_atomic (SBYTES (Vinvocation_name)
+                                       + SBYTES (Vsystem_name) + 2);
   strcat (strcat (strcpy (dpyinfo->x_id_name, SSDATA (Vinvocation_name)), "@"),
          SSDATA (Vsystem_name));
 
@@ -10111,7 +10099,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
 
     XRenderQueryExtension (dpyinfo->display, &event_base, &error_base);
 
-    v = XGetDefault (dpyinfo->display, "Xft", "dpi");    
+    v = XGetDefault (dpyinfo->display, "Xft", "dpi");
     if (v != NULL && sscanf (v, "%lf", &d) == 1)
       dpyinfo->resy = dpyinfo->resx = d;
   }
@@ -10240,7 +10228,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
                                   1, 0, 1);
 
   x_setup_pointer_blanking (dpyinfo);
-  
+
 #ifdef HAVE_X_I18N
   xim_initialize (dpyinfo, resource_name);
 #endif
@@ -10556,7 +10544,7 @@ x_create_terminal (struct x_display_info *dpyinfo)
   terminal->menu_show_hook = x_menu_show;
 #if defined (USE_X_TOOLKIT) || defined (USE_GTK)
   terminal->popup_dialog_hook = xw_popup_dialog;
-#endif  
+#endif
   terminal->set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar;
   terminal->condemn_scroll_bars_hook = XTcondemn_scroll_bars;
   terminal->redeem_scroll_bar_hook = XTredeem_scroll_bar;