emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/xterm.c


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/src/xterm.c
Date: Tue, 04 Feb 2003 06:09:26 -0500

Index: emacs/src/xterm.c
diff -c emacs/src/xterm.c:1.768 emacs/src/xterm.c:1.769
*** emacs/src/xterm.c:1.768     Sun Jan 19 17:54:59 2003
--- emacs/src/xterm.c   Sat Jan 25 11:25:38 2003
***************
*** 10214,10219 ****
--- 10214,10245 ----
    X_EVENT_DROP
  };
  
+ /* Filter events for the current X input method.
+    DPYINFO is the display this event is for.
+    EVENT is the X event to filter.
+ 
+    Returns non-zero if the event was filtered, caller shall not process
+    this event further.
+    Returns zero if event is wasn't filtered.  */
+    
+ #ifdef HAVE_X_I18N
+ static int
+ x_filter_event (dpyinfo, event)
+      struct x_display_info *dpyinfo;
+      XEvent *event;
+ {
+   /* XFilterEvent returns non-zero if the input method has
+    consumed the event.  We pass the frame's X window to
+    XFilterEvent because that's the one for which the IC
+    was created.  */
+ 
+   struct frame *f1 = x_any_window_to_frame (dpyinfo,
+                                             event->xclient.window);
+ 
+   return XFilterEvent (event, f1 ? FRAME_X_WINDOW (f1) : None);
+ }
+ #endif
+ 
  #ifdef USE_GTK
  static struct x_display_info *current_dpyinfo;
  static struct input_event **current_bufp;
***************
*** 10233,10245 ****
    XEvent *xev = (XEvent*)gxev;
  
    if (current_numcharsp)
!     current_count += handle_one_xevent (current_dpyinfo,
!                                         xev,
!                                         current_bufp,
!                                         current_numcharsp,
!                                         &current_finish);
    else
!     x_dispatch_event (xev, GDK_DISPLAY ());
  
    if (current_finish == X_EVENT_GOTO_OUT || current_finish == X_EVENT_DROP)
      return GDK_FILTER_REMOVE;
--- 10259,10281 ----
    XEvent *xev = (XEvent*)gxev;
  
    if (current_numcharsp)
!     {
! #ifdef HAVE_X_I18N
!       /* Filter events for the current X input method.
!          GTK calls XFilterEvent but not for key press and release,
!          so we do it here.  */
!       if (xev->type == KeyPress || xev->type == KeyRelease)
!         if (x_filter_event (current_dpyinfo, xev))
!           return GDK_FILTER_REMOVE;
! #endif
!       current_count += handle_one_xevent (current_dpyinfo,
!                                           xev,
!                                           current_bufp,
!                                           current_numcharsp,
!                                           &current_finish);
!     }
    else
!     current_finish = x_dispatch_event (xev, GDK_DISPLAY ());
  
    if (current_finish == X_EVENT_GOTO_OUT || current_finish == X_EVENT_DROP)
      return GDK_FILTER_REMOVE;
***************
*** 11520,11527 ****
  
  /* Handles the XEvent EVENT on display DISPLAY.
     This is used for event loops outside the normal event handling,
!    i.e. looping while a popup menu or a dialog is posted.  */
! void
  x_dispatch_event (event, display)
       XEvent *event;
       Display *display;
--- 11556,11565 ----
  
  /* Handles the XEvent EVENT on display DISPLAY.
     This is used for event loops outside the normal event handling,
!    i.e. looping while a popup menu or a dialog is posted.
! 
!    Returns the value handle_one_xevent sets in the finish argument.  */
! int
  x_dispatch_event (event, display)
       XEvent *event;
       Display *display;
***************
*** 11530,11536 ****
    struct input_event bufp[10];
    struct input_event *bufpp = bufp;
    int numchars = 10;
!   int finish;
        
    for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next)
      if (dpyinfo->display == display)
--- 11568,11574 ----
    struct input_event bufp[10];
    struct input_event *bufpp = bufp;
    int numchars = 10;
!   int finish = X_EVENT_NORMAL;
        
    for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next)
      if (dpyinfo->display == display)
***************
*** 11547,11552 ****
--- 11585,11592 ----
        for (i = 0; i < events; ++i)
          kbd_buffer_store_event (&bufp[i]);
      }
+ 
+   return finish;
  }
  
  
***************
*** 11667,11683 ****
          XNextEvent (dpyinfo->display, &event);
  
  #ifdef HAVE_X_I18N
!         {
!           /* Filter events for the current X input method.
!              XFilterEvent returns non-zero if the input method has
!              consumed the event.  We pass the frame's X window to
!              XFilterEvent because that's the one for which the IC
!              was created.  */
!           struct frame *f1 = x_any_window_to_frame (dpyinfo,
!                                                     event.xclient.window);
!           if (XFilterEvent (&event, f1 ? FRAME_X_WINDOW (f1) : None))
!             break;
!         }
  #endif
          event_found = 1;
  
--- 11707,11715 ----
          XNextEvent (dpyinfo->display, &event);
  
  #ifdef HAVE_X_I18N
!           /* Filter events for the current X input method.  */
!           if (x_filter_event (dpyinfo, &event))
!             break;
  #endif
          event_found = 1;
  
***************
*** 13025,13031 ****
  };
  
  /* XIM instantiate callback function, which is called whenever an XIM
!    server is available.  DISPLAY is teh display of the XIM.
     CLIENT_DATA contains a pointer to an xim_inst_t structure created
     when the callback was registered.  */
  
--- 13057,13063 ----
  };
  
  /* 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
     when the callback was registered.  */
  
***************
*** 15167,15172 ****
--- 15199,15208 ----
      argv[argc++] = "--name";
      argv[argc++] = resource_name;
      
+ #ifdef HAVE_X11R5
+     XSetLocaleModifiers ("");
+ #endif
+ 
      gtk_init (&argc, &argv2);
  
      /* gtk_init does set_locale.  We must fix locale after calling it.  */




reply via email to

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