DEFINES += -DDEF_MENURC="\"$(MENURC)\""
-# Uncomment to add MWM hints support
-#DEFINES += -DMWM_HINTS
-
-# Uncomment to add freetype support (requires XFree86 4.0.2 or later)
-# This needs -lXext above, even if you have disabled shape support
-DEFINES += -DXFT
-
# Uncomment for debugging info (abandon all hope, ye who enter here)
#DEFINES += -DDEBUG
wm_protos = XInternAtom(dsply, "WM_PROTOCOLS", False);
wm_delete = XInternAtom(dsply, "WM_DELETE_WINDOW", False);
wm_cmapwins = XInternAtom(dsply, "WM_COLORMAP_WINDOWS", False);
-#ifdef MWM_HINTS
- mwm_hints = XInternAtom(dsply, _XA_MWM_HINTS, False);
-#endif
XAllocNamedColor(dsply, DefaultColormap(dsply, screen), opt_border, &border_col, &dummyc);
XAllocNamedColor(dsply, DefaultColormap(dsply, screen), opt_text, &text_col, &dummyc);
static void init_position(Client *);
static void reparent(Client *);
-#ifdef MWM_HINTS
-static PropMwmHints *get_mwm_hints(Window);
-#endif
/* Set up a client structure for the new (not-yet-mapped) window. The
* confusing bit is that we have to ignore 2 unmap events if the
Client *c, *p;
XWindowAttributes attr;
XWMHints *hints;
-#ifdef MWM_HINTS
- PropMwmHints *mhints;
-#endif
long dummy;
c = (Client *)malloc(sizeof *c);
c->cmap = attr.colormap;
c->size = XAllocSizeHints();
XGetWMNormalHints(dsply, c->window, c->size, &dummy);
-#ifdef MWM_HINTS
- c->has_title = 1;
- c->has_border = 1;
-
- if ((mhints = get_mwm_hints(c->window)))
- {
- if (mhints->flags & MWM_HINTS_DECORATIONS && !(mhints->decorations & MWM_DECOR_ALL))
- {
- c->has_title = mhints->decorations & MWM_DECOR_TITLE;
- c->has_border = mhints->decorations & MWM_DECOR_BORDER;
- }
- XFree(mhints);
- }
-#endif
// XReparentWindow seems to try an XUnmapWindow, regardless of whether the reparented window is mapped or not
c->ignore_unmap++;
redraw_taskbar();
}
-/* This one does *not* free the data coming back from Xlib; it just
- * sends back the pointer to what was allocated. */
-
-#ifdef MWM_HINTS
-static PropMwmHints *get_mwm_hints(Window w)
-{
- Atom real_type;
- int real_format;
- unsigned long items_read, items_left;
- unsigned char *data;
-
- if (XGetWindowProperty(dsply, w, mwm_hints, 0L, 20L, False, mwm_hints, &real_type, &real_format, &items_read, &items_left, &data) == Success && items_read >= PROP_MWM_HINTS_ELEMENTS)
- {
- return (PropMwmHints *)data;
- }
- else
- {
- return NULL;
- }
-}
-#endif
/* Figure out where to map the window. c->x, c->y, c->width, and
* c->height actually start out with values in them (whatever the
#include <X11/keysym.h>
#include <X11/Xft/Xft.h>
-#ifdef MWM_HINTS
-// These definitions are taken from LessTif 0.95.0's MwmUtil.h.
-
-#define MWM_HINTS_FUNCTIONS (1L << 0)
-#define MWM_HINTS_DECORATIONS (1L << 1)
-#define MWM_HINTS_INPUT_MODE (1L << 2)
-#define MWM_HINTS_STATUS (1L << 3)
-
-#define MWM_DECOR_ALL (1L << 0)
-#define MWM_DECOR_BORDER (1L << 1)
-#define MWM_DECOR_RESIZEH (1L << 2)
-#define MWM_DECOR_TITLE (1L << 3)
-#define MWM_DECOR_MENU (1L << 4)
-#define MWM_DECOR_MINIMIZE (1L << 5)
-#define MWM_DECOR_MAXIMIZE (1L << 6)
-
-#define _XA_MWM_HINTS "_MOTIF_WM_HINTS"
-
-#define PROP_MWM_HINTS_ELEMENTS 5
-
-typedef struct PropMwmHints
-{
- CARD32 flags;
- CARD32 functions;
- CARD32 decorations;
- INT32 inputMode;
- CARD32 status;
-} PropMwmHints;
-#endif
-
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
#define raise_win(c) ((void) XRaiseWindow(dsply, (c)->frame))
// border width accessor to handle hints/no hints
-#ifdef MWM_HINTS
-#define BORDERWIDTH(c) ((c)->has_border ? DEF_BORDERWIDTH : 0)
-#else
#define BORDERWIDTH(c) (DEF_BORDERWIDTH)
-#endif
// bar height
#define BARHEIGHT() (xftfont->ascent + xftfont->descent + 2*SPACE + 2)
unsigned int hidden;
unsigned int was_hidden;
unsigned int focus_order;
-#ifdef MWM_HINTS
- Bool has_title, has_border;
-#endif
XftDraw *xftdraw;
} Client;
extern XColor border_col, text_col, active_col, depressed_col, inactive_col, menu_col, selected_col, empty_col;
extern Cursor resize_curs;
extern Atom wm_state, wm_change_state, wm_protos, wm_delete, wm_cmapwins;
-#ifdef MWM_HINTS
-extern Atom mwm_hints;
-#endif
extern char *opt_font, *opt_border, *opt_text, *opt_active, *opt_inactive, *opt_menu, *opt_selected, *opt_empty;
extern unsigned int numlockmask;