summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeron Johnson <deron.johnson@sun.com>2005-01-12 00:37:52 +0000
committerDeron Johnson <deron.johnson@sun.com>2005-01-12 00:37:52 +0000
commit156f55909f27fed5707f0595acd52a166977db17 (patch)
tree1d8566f92734aed8c589e749ea620b915b20a2f1
parent1d28c83f85f207107ad4ed773a8ac51fcb3212f1 (diff)
downloadxserver-156f55909f27fed5707f0595acd52a166977db17.tar.gz
dev-0-6-1-17: Fix 209: Some windows don't receive initial input focus.
-rw-r--r--dix/events.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/dix/events.c b/dix/events.c
index f2684e84a..a848b1e1c 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/dix/events.c,v 1.6.4.1.2.4 2004/12/23 23:50:21 deronj Exp $ */
+/* $XdotOrg: xc/programs/Xserver/dix/events.c,v 1.6.4.1.10.1 2005/01/10 03:45:03 deronj Exp $ */
/* $XFree86: xc/programs/Xserver/dix/events.c,v 3.51 2004/01/12 17:04:52 tsi Exp $ */
/************************************************************
@@ -1103,7 +1103,7 @@ lgeTryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
int destination;
destination = lgeDSCaresAboutEvent (pEvents, &win);
-
+
if (destination != SEND_TO_NORMAL_CLIENT && win == lgeGrabAllWindowEvents.window) {
/*
** Send events to grabbing client client. Use a null grab pointer
@@ -1948,9 +1948,25 @@ MaybeDeliverEventsToClient(pWin, pEvents, count, filter, dontClient)
#ifdef LG3D
+/*
+** Returns true if the event type is one which was generated
+** by an input device. These are the only types of events
+** which been sent to the Display Server so they are the only
+** types of events which have the event field already set.
+**
+** TODO: this macro does not yet support XINPUT devices.
+*/
+
+#define EVENT_IS_DEVICE_EVENT(e) \
+ ((e)->u.u.type == KeyPress || \
+ (e)->u.u.type == KeyRelease || \
+ (e)->u.u.type == ButtonPress || \
+ (e)->u.u.type == ButtonRelease || \
+ (e)->u.u.type == MotionNotify)
+
/* Returns True if the event occurred above a 3D object rather than a native window */
#define EVENT_IS_3D(e) \
- ((e)->u.keyButtonPointer.event == lgeDisplayServerPRW)
+ (EVENT_IS_DEVICE_EVENT(e) && (e)->u.keyButtonPointer.event == lgeDisplayServerPRW)
/*
TODO: it's not clear whether this routine deals with grabs properly.
@@ -2021,7 +2037,7 @@ lgeFixUpEventFromWindow(
if (!EVENT_IS_3D(xE)) {
eventWindowOld = XE_KBPTR.event;
XE_KBPTR.event = pWin->drawable.id;
- /*ErrorF("new event window = %d\n", XE_KBPTR.event);*/
+ /*ErrorF("new event window = %d\n", XE_KBPTR.event);*/
}
if (sprite.hot.pScreen != pWin->drawable.pScreen)
@@ -5207,7 +5223,7 @@ WriteEventsToClient(pClient, count, events)
if (print_events_all ||
/* TODO: these indices are now out of date; update them */
(print_events_to_ds && pClient->index == 4) ||
- (print_events_to_wm && pClient->index == 5) ||
+ (print_events_to_wm && pClient->index == 9) ||
(print_events_to_app && pClient->index == 6)) {
xEvent *ev;