summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-12-13 14:04:13 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-12-18 08:28:02 +1000
commite2423b627ef7e4d08ea0685af5e771ddd2b511ce (patch)
treecb6567b99441fee214325ce731358f070bd5a23c /Xi
parentf71c2f895c9e2f9d0d42feaac2a3e1d2deb71f67 (diff)
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 <peter.hutterer@who-t.net> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/xibarriers.c10
1 files changed, 5 insertions, 5 deletions
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,