summaryrefslogtreecommitdiff
blob: cc742c3755fec8ffc8d0112e1c9f9a9a2be6fd90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
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 <X11/Intrinsic.h>	/* Xlib, Xutil, Xresource, Xfuncproto */
 #include <X11/cursorfont.h>
 #include <X11/keysym.h>
+#include <X11/Xmd.h>
 
 #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,