aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/multiple
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-09-29 16:00:17 +1000
committerinmarket <andrewh@inmarket.com.au>2014-09-29 16:00:17 +1000
commita9e802395eff4517e79701ff210048b732c4b189 (patch)
tree284dbb6a52bb567e38047a1f983d15b34c6246d5 /drivers/multiple
parent6b158b8a0bc28a5edebc4aa52c8456807dd8837e (diff)
downloaduGFX-a9e802395eff4517e79701ff210048b732c4b189.tar.gz
uGFX-a9e802395eff4517e79701ff210048b732c4b189.tar.bz2
uGFX-a9e802395eff4517e79701ff210048b732c4b189.zip
X bug fix so that window closes properly when using a window manager
Diffstat (limited to 'drivers/multiple')
-rw-r--r--drivers/multiple/X/gdisp_lld_X.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/multiple/X/gdisp_lld_X.c b/drivers/multiple/X/gdisp_lld_X.c
index e6136b49..6e0233ba 100644
--- a/drivers/multiple/X/gdisp_lld_X.c
+++ b/drivers/multiple/X/gdisp_lld_X.c
@@ -81,6 +81,7 @@ static XEvent evt;
static Colormap cmap;
static XVisualInfo vis;
static XContext cxt;
+static Atom wmDelete;
typedef struct xPriv {
Pixmap pix;
@@ -103,6 +104,12 @@ static void ProcessEvent(GDisplay *g, xPriv *priv) {
XCloseDisplay(dis);
exit(0);
break;
+ case ClientMessage:
+ if ((Atom)evt.xclient.data.l[0] == wmDelete) {
+ XCloseDisplay(dis);
+ exit(0);
+ }
+ break;
case Expose:
XCopyArea(dis, priv->pix, evt.xexpose.window, priv->gc,
evt.xexpose.x, evt.xexpose.y,
@@ -184,6 +191,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
dis = XOpenDisplay(0);
scr = DefaultScreen(dis);
cxt = XUniqueContext();
+ wmDelete = XInternAtom(dis, "WM_DELETE_WINDOW", False);
XSetIOErrorHandler(FatalXIOError);
#if GDISP_FORCE_24BIT
@@ -227,6 +235,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
XSync(dis, TRUE);
XSaveContext(dis, priv->win, cxt, (XPointer)g);
+ XSetWMProtocols(dis, priv->win, &wmDelete, 1);
{
char buf[132];