summaryrefslogtreecommitdiff
path: root/apps/unix/x11pdf.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2009-07-28 14:31:07 +0200
committerTor Andersson <tor@ghostscript.com>2009-07-28 14:31:07 +0200
commita8e2a88a4b56c1e3d3e49e80cc85e8a194b75603 (patch)
treec174a875d7715f08c46b2ec5a386ffee3d2d888b /apps/unix/x11pdf.c
parentcd3a744defafb4cd5484730a5cafeac976770dee (diff)
downloadmupdf-a8e2a88a4b56c1e3d3e49e80cc85e8a194b75603.tar.xz
Set XClassHint in X11 viewer to allow window managers and other utilities like mozplugger to detect MuPDF windows.
Diffstat (limited to 'apps/unix/x11pdf.c')
-rw-r--r--apps/unix/x11pdf.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/apps/unix/x11pdf.c b/apps/unix/x11pdf.c
index 3ae1d930..ee9349af 100644
--- a/apps/unix/x11pdf.c
+++ b/apps/unix/x11pdf.c
@@ -100,7 +100,8 @@ char *winpassword(pdfapp_t *app, char *filename)
static void winopen(void)
{
- XWMHints *hints;
+ XWMHints *wmhints;
+ XClassHint *classhint;
xdpy = XOpenDisplay(nil);
if (!xdpy)
@@ -148,17 +149,26 @@ static void winopen(void)
XDefineCursor(xdpy, xwin, xcarrow);
- hints = XAllocWMHints();
- if (hints)
+ wmhints = XAllocWMHints();
+ if (wmhints)
{
- hints->flags = IconPixmapHint;
- hints->icon_pixmap = XCreateBitmapFromData(xdpy, xwin,
+ wmhints->flags = IconPixmapHint;
+ wmhints->icon_pixmap = XCreateBitmapFromData(xdpy, xwin,
(char *) gs_l_xbm_bits, gs_l_xbm_width, gs_l_xbm_height);
- if (hints->icon_pixmap)
+ if (wmhints->icon_pixmap)
{
- XSetWMHints(xdpy, xwin, hints);
+ XSetWMHints(xdpy, xwin, wmhints);
}
- XFree(hints);
+ XFree(wmhints);
+ }
+
+ classhint = XAllocClassHint();
+ if (classhint)
+ {
+ classhint->res_name = "mupdf";
+ classhint->res_class = "MuPDF";
+ XSetClassHint(xdpy, xwin, classhint);
+ XFree(classhint);
}
x11fd = ConnectionNumber(xdpy);