#include "events-mod.h"
-static void enqueue_Xt_dispatch_event (Lisp_Object event);
static void handle_focus_event_1 (struct frame *f, int in_p);
static struct event_stream *Xt_event_stream;
/* Do we accept events sent by other clients? */
int x_allow_sendevents;
-int modifier_keys_are_sticky;
-
#ifdef DEBUG_XEMACS
int x_debug_events;
#endif
#ifdef HAVE_XIM
XIM_focus_event (f, in_p);
#endif /* HAVE_XIM */
-
/* On focus change, clear all memory of sticky modifiers
to avoid non-intuitive behavior. */
clear_sticky_modifiers (XDEVICE (FRAME_DEVICE (f)));
break;
case CreateNotify:
- printf ("window created\n");
break;
+
default:
break;
}
static Lisp_Object dispatch_event_queue, dispatch_event_queue_tail;
-static void
+void
enqueue_Xt_dispatch_event (Lisp_Object event)
{
enqueue_event (event, &dispatch_event_queue, &dispatch_event_queue_tail);
\f
/************************************************************************/
+/* handle focus changes for native widgets */
+/************************************************************************/
+static void
+emacs_Xt_event_widget_focus_in (Widget w,
+ XEvent *event,
+ String *params,
+ Cardinal *num_params)
+{
+ struct frame* f =
+ x_any_widget_or_parent_to_frame (get_device_from_display (event->xany.display), w);
+
+ XtSetKeyboardFocus (FRAME_X_SHELL_WIDGET (f), w);
+}
+
+static void
+emacs_Xt_event_widget_focus_out (Widget w,
+ XEvent *event,
+ String *params,
+ Cardinal *num_params)
+{
+}
+
+static XtActionsRec widgetActionsList[] =
+{
+ {"widget-focus-in", emacs_Xt_event_widget_focus_in },
+ {"widget-focus-out", emacs_Xt_event_widget_focus_out },
+};
+
+static void
+emacs_Xt_event_add_widget_actions (XtAppContext ctx)
+{
+ XtAppAddActions (ctx, widgetActionsList, 2);
+}
+
+\f
+/************************************************************************/
/* initialization */
/************************************************************************/
dispatch_event_queue_tail = Qnil;
pdump_wire (&dispatch_event_queue_tail);
- DEFVAR_BOOL ("modifier-keys-are-sticky", &modifier_keys_are_sticky /*
-*Non-nil makes modifier keys sticky.
-This means that you can release the modifier key before pressing down
-the key that you wish to be modified. Although this is non-standard
-behavior, it is recommended because it reduces the strain on your hand,
-thus reducing the incidence of the dreaded Emacs-pinky syndrome.
-*/ );
- modifier_keys_are_sticky = 0;
-
DEFVAR_BOOL ("x-allow-sendevents", &x_allow_sendevents /*
*Non-nil means to allow synthetic events. Nil means they are ignored.
Beware: allowing emacs to process SendEvents opens a big security hole.
NULL, 0,
XtCacheByDisplay, EmacsFreeXIMStyles);
#endif /* XIM_XLIB */
+ /* Add extra actions to native widgets to handle focus and friends. */
+ emacs_Xt_event_add_widget_actions (Xt_app_con);
/* insert the visual inheritance patch/hack described above */
orig_shell_init_proc = shellClassRec.core_class.initialize;