]> git.mdlowis.com Git - proto/windowlab.git/commitdiff
removed motif hints
authorMichael D. Lowis <mike@mdlowis.com>
Thu, 23 May 2019 01:30:03 +0000 (21:30 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Thu, 23 May 2019 01:30:03 +0000 (21:30 -0400)
.gitignore
Makefile
main.c
new.c
windowlab.h

index f3ff85ba0690186528d30645506cf68ecaefb84b..3a3f3275b08ac2a21d4619affa58831119af2f79 100644 (file)
@@ -1,2 +1,3 @@
 *.o
 tags
+windowlab
index 018424ca9362dee34857a3b824e920c086c90ada..3139f414eb208d7a28ca24946c9bcd7ea694a33e 100644 (file)
--- 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 4a94d30a3a419448f1accd5c6cdc1de2b11f793a..94516a73a1b6cdceaf8444d383951afe8a4b2762 100644 (file)
--- 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 03be4df595b6c90dcbc9a2eb6c5ba795a417ce0c..6f98c96823440ebfb33c87e747be687e242a4c10 100644 (file)
--- 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
index f6412314f6a6e7be19563f44b3f1c6e298302777..a7255b650e72d20875d9b0ed522f2b61683dfa43 100644 (file)
 #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
@@ -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;