diff -Bru aterm-cvs/src/main.c aterm-cvs-modif/src/main.c --- aterm-cvs/src/main.c Thu Aug 14 02:02:05 2003 +++ aterm-cvs-modif/src/main.c Thu Aug 14 02:05:22 2003 @@ -434,8 +434,11 @@ Cursor cursor; XClassHint classHint; XWMHints wmHint; + Atom prop = None; int i, x, y, flags; unsigned int width, height; + MWMHints mwmhints; + #ifdef PREFER_24BIT XSetWindowAttributes attributes; XWindowAttributes gattr; @@ -464,6 +467,23 @@ } #endif + if (Options & Opt_borderLess) { + prop = XInternAtom(Xdisplay, "_MOTIF_WM_INFO", True); + if (prop == None) { +/* print_warning("Window Manager does not support MWM hints. Bypassing window manager control for borderless window.\n");*/ +#ifdef PREFER_24BIT + attributes.override_redirect = TRUE; +#endif + mwmhints.flags = 0; + } else { + mwmhints.flags = MWM_HINTS_DECORATIONS; + mwmhints.decorations = 0; + } + } else { + mwmhints.flags = 0; + } + + /* * grab colors before netscape does */ @@ -687,6 +707,12 @@ (KeyPressMask | FocusChangeMask | StructureNotifyMask | VisibilityChangeMask) ); + + if (mwmhints.flags) { + prop = XInternAtom(Xdisplay, "_MOTIF_WM_HINTS", False); + XChangeProperty(Xdisplay, TermWin.parent, prop, prop, 32, PropModeReplace, (unsigned char *) &mwmhints, PROP_MWM_HINTS_ELEMENTS); + } + /* vt cursor: Black-on-White is standard, but this is more popular */ TermWin_cursor = XCreateFontCursor(Xdisplay, XC_xterm); diff -Bru aterm-cvs/src/rxvt.h aterm-cvs-modif/src/rxvt.h --- aterm-cvs/src/rxvt.h Thu Aug 14 02:02:05 2003 +++ aterm-cvs-modif/src/rxvt.h Thu Aug 14 02:07:39 2003 @@ -140,6 +140,7 @@ #include /* Xlib, Xutil, Xresource, Xfuncproto */ #include #include +#include #include "libafterstep.h" @@ -458,6 +459,15 @@ (tmp) = (one); (one) = (two); (two) = (tmp); \ } while (0) +typedef struct _mwmhints { + CARD32 flags; + CARD32 functions; + CARD32 decorations; + INT32 input_mode; + CARD32 status; +} MWMHints; + + /* ***************************************************************************** * NORMAL DEFINES @@ -690,6 +700,7 @@ #define Opt_scrollKeypress (1LU<<12) #define Opt_transparent (1LU<<13) #define Opt_transparent_sb (1LU<<14) +#define Opt_borderLess (1LU<<16) /* place holder used for parsing command-line options */ #define Opt_Boolean (1LU<<31) @@ -778,6 +789,33 @@ * divisible by 4 (num rect) */ #define NGRX_PTS 1000 + +/* Motif window hints */ +#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) +/* bit definitions for MwmHints.functions */ +#define MWM_FUNC_ALL (1L << 0) +#define MWM_FUNC_RESIZE (1L << 1) +#define MWM_FUNC_MOVE (1L << 2) +#define MWM_FUNC_MINIMIZE (1L << 3) +#define MWM_FUNC_MAXIMIZE (1L << 4) +#define MWM_FUNC_CLOSE (1L << 5) +/* bit definitions for MwmHints.decorations */ +#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) +/* bit definitions for MwmHints.inputMode */ +#define MWM_INPUT_MODELESS 0 +#define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1 +#define MWM_INPUT_SYSTEM_MODAL 2 +#define MWM_INPUT_FULL_APPLICATION_MODAL 3 +#define PROP_MWM_HINTS_ELEMENTS 5 /* ***************************************************************************** diff -Bru aterm-cvs/src/xdefaults.c aterm-cvs-modif/src/xdefaults.c --- aterm-cvs/src/xdefaults.c Thu Aug 14 02:02:05 2003 +++ aterm-cvs-modif/src/xdefaults.c Thu Aug 14 02:08:31 2003 @@ -44,6 +44,7 @@ /* local functions referenced */ /*{{{ local variables */ +static const char *rs_borderLess = NULL; static const char *rs_loginShell = NULL; static const char *rs_utmpInhibit = NULL; static const char *rs_scrollBar = NULL; @@ -299,6 +300,7 @@ "width of border"), STRG(rs_color[Color_border], "borderColor", "bd", "color", "border color"), + BOOL(rs_borderLess, "borderLess", "bl", Opt_borderLess, "no decoration"), BOOL(rs_loginShell, "loginShell", "ls", Opt_loginShell, "login shell"), BOOL(rs_scrollBar, "scrollBar", "sb", Opt_scrollBar, "scrollbar"), BOOL(rs_scrollBar_right, "scrollBar_right", "sr", Opt_scrollBar_right,