From e2423b627ef7e4d08ea0685af5e771ddd2b511ce Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 13 Dec 2012 14:04:13 +1000 Subject: Xi: don't store the window pointer in barriers, store the window ID When a client shuts down and resources are being freed, the window may have been freed already, so accessing it to get the window ID is bad. Plus, we never care about the window anyway other than for stuffing it into the event. Signed-off-by: Peter Hutterer Reviewed-by: Jasper St. Pierre --- Xi/xibarriers.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Xi') diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c index 7e8b2e6cd..171463455 100644 --- a/Xi/xibarriers.c +++ b/Xi/xibarriers.c @@ -80,7 +80,7 @@ struct PointerBarrierDevice { struct PointerBarrierClient { XID id; ScreenPtr screen; - WindowPtr window; + Window window; struct PointerBarrier barrier; struct xorg_list entry; /* num_devices/device_ids are devices the barrier applies to */ @@ -467,7 +467,7 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen, ev.barrierid = c->id; ev.dt = ms - pbd->last_timestamp; - ev.window = c->window->drawable.id; + ev.window = c->window; pbd->last_timestamp = ms; /* root x/y is filled in later */ @@ -501,7 +501,7 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen, ev.barrierid = c->id; ev.dt = ms - pbd->last_timestamp; - ev.window = c->window->drawable.id; + ev.window = c->window; pbd->last_timestamp = ms; /* root x/y is filled in later */ @@ -566,7 +566,7 @@ CreatePointerBarrierClient(ClientPtr client, cs = GetBarrierScreen(screen); ret->screen = screen; - ret->window = pWin; + ret->window = stuff->window; ret->num_devices = stuff->num_devices; if (ret->num_devices > 0) ret->device_ids = (int*)&ret[1]; @@ -656,7 +656,7 @@ BarrierFreeBarrier(void *data, XID id) /* .deviceid */ .sourceid = 0, .barrierid = c->id, - .window = c->window->drawable.id, + .window = c->window, .root = screen->root->drawable.id, .dx = 0, .dy = 0, -- cgit v1.2.3