From: Ian Jackson Date: Fri, 29 Nov 2013 19:38:27 +0000 (+0000) Subject: xduplic-copier: do not call XmuClientWindow on a null subwindow X-Git-Tag: debian/4.3.0~15 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-utils.git;a=commitdiff_plain;h=9a067a31050292a9b12e2fa055ca12f7ff4937e2 xduplic-copier: do not call XmuClientWindow on a null subwindow If you click on the root window, xduplic-copier gets an event with subwindow==0. Current XmuClientWindow crashes if you call it with a null window. Instead, shortcut this: look for subwindow==0 as the way to tell it's the root window. --- diff --git a/cprogs/xduplic-copier.c b/cprogs/xduplic-copier.c index 8c1da08..80374f9 100644 --- a/cprogs/xduplic-copier.c +++ b/cprogs/xduplic-copier.c @@ -144,8 +144,7 @@ static void buttonpress(XButtonEvent *e) { if (e->window != e->root) return; - sw= XmuClientWindow(display, e->subwindow); - if (!sw) { + if (!e->subwindow) { if (!rightbutton) { stopselecting(); } else { @@ -160,6 +159,8 @@ static void buttonpress(XButtonEvent *e) { return; } + sw= XmuClientWindow(display, e->subwindow); + if (sw == w) { beep(); return; } for (ownp=&headwn;