From: Michael D. Lowis Date: Thu, 23 May 2019 01:30:03 +0000 (-0400) Subject: removed motif hints X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=4a01f70be7c88e65be6c5841dd308cd9f946fce0;p=proto%2Fwindowlab.git removed motif hints --- diff --git a/.gitignore b/.gitignore index f3ff85b..3a3f327 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.o tags +windowlab diff --git a/Makefile b/Makefile index 018424c..3139f41 100644 --- a/Makefile +++ b/Makefile @@ -25,13 +25,6 @@ endif 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 diff --git a/main.c b/main.c index 4a94d30..94516a7 100644 --- a/main.c +++ b/main.c @@ -143,9 +143,6 @@ static void setup_display(void) 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); diff --git a/new.c b/new.c index 03be4df..6f98c96 100644 --- a/new.c +++ b/new.c @@ -22,9 +22,6 @@ 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 @@ -38,9 +35,6 @@ void make_new_client(Window w) Client *c, *p; XWindowAttributes attr; XWMHints *hints; -#ifdef MWM_HINTS - PropMwmHints *mhints; -#endif long dummy; c = (Client *)malloc(sizeof *c); @@ -76,20 +70,6 @@ void make_new_client(Window w) 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++; @@ -144,27 +124,6 @@ void make_new_client(Window w) 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 diff --git a/windowlab.h b/windowlab.h index f641231..a7255b6 100644 --- a/windowlab.h +++ b/windowlab.h @@ -38,36 +38,6 @@ #include #include -#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 @@ -129,11 +99,7 @@ typedef struct PropMwmHints #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) @@ -194,9 +160,6 @@ typedef struct Client unsigned int hidden; unsigned int was_hidden; unsigned int focus_order; -#ifdef MWM_HINTS - Bool has_title, has_border; -#endif XftDraw *xftdraw; } Client; @@ -229,9 +192,6 @@ extern GC border_gc, text_gc, active_gc, depressed_gc, inactive_gc, menu_gc, sel 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;