summaryrefslogtreecommitdiff
path: root/apps/x11_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/x11_main.c')
-rw-r--r--apps/x11_main.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/apps/x11_main.c b/apps/x11_main.c
index 1ca6449e..2a9fd096 100644
--- a/apps/x11_main.c
+++ b/apps/x11_main.c
@@ -2,8 +2,6 @@
#include "mupdf.h"
#include "pdfapp.h"
-#include "x11_icon.xbm"
-
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
@@ -14,6 +12,20 @@
#include <sys/types.h>
#include <unistd.h>
+#define mupdf_icon_bitmap_16_width 16
+#define mupdf_icon_bitmap_16_height 16
+static unsigned char mupdf_icon_bitmap_16_bits[] = {
+ 0x00, 0x00, 0x00, 0x1e, 0x00, 0x2b, 0x80, 0x55, 0x8c, 0x62, 0x8c, 0x51,
+ 0x9c, 0x61, 0x1c, 0x35, 0x3c, 0x1f, 0x3c, 0x0f, 0xfc, 0x0f, 0xec, 0x0d,
+ 0xec, 0x0d, 0xcc, 0x0c, 0xcc, 0x0c, 0x00, 0x00 };
+
+#define mupdf_icon_bitmap_16_mask_width 16
+#define mupdf_icon_bitmap_16_mask_height 16
+static unsigned char mupdf_icon_bitmap_16_mask_bits[] = {
+ 0x00, 0x1e, 0x00, 0x3f, 0x80, 0x7f, 0xce, 0xff, 0xde, 0xff, 0xde, 0xff,
+ 0xfe, 0xff, 0xfe, 0x7f, 0xfe, 0x3f, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f,
+ 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f, 0xce, 0x1c };
+
#ifndef timeradd
#define timeradd(a, b, result) \
do { \
@@ -55,7 +67,7 @@ static Atom WM_DELETE_WINDOW;
static int x11fd;
static int xscr;
static Window xwin;
-static Pixmap xicon;
+static Pixmap xicon, xmask;
static GC xgc;
static XEvent xevt;
static int mapped = 0;
@@ -159,12 +171,19 @@ static void winopen(void)
wmhints = XAllocWMHints();
if (wmhints)
{
- wmhints->flags = IconPixmapHint;
+ wmhints->flags = IconPixmapHint | IconMaskHint;
xicon = XCreateBitmapFromData(xdpy, xwin,
- (char *) gs_l_xbm_bits, gs_l_xbm_width, gs_l_xbm_height);
- if (xicon)
+ (char*)mupdf_icon_bitmap_16_bits,
+ mupdf_icon_bitmap_16_width,
+ mupdf_icon_bitmap_16_height);
+ xmask = XCreateBitmapFromData(xdpy, xwin,
+ (char*)mupdf_icon_bitmap_16_mask_bits,
+ mupdf_icon_bitmap_16_mask_width,
+ mupdf_icon_bitmap_16_mask_height);
+ if (xicon && xmask)
{
wmhints->icon_pixmap = xicon;
+ wmhints->icon_mask = xmask;
XSetWMHints(xdpy, xwin, wmhints);
}
XFree(wmhints);