13#include "ctwm_atoms.h"
94 char *vsmapbuf, *vsmap;
100 if(vsmapbuf != NULL) {
104 vsmap = strtok(vsmapbuf,
",");
131 vsmap = strtok(NULL,
",");
157 if(!
Scr->workSpaceManagerActive) {
162 Scr->workSpaceMgr.windowFont.basename =
163 "-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1";
164 Scr->workSpaceMgr.buttonFont =
Scr->IconManagerFont;
165 Scr->workSpaceMgr.cp =
Scr->IconManagerC;
166 if(!
Scr->BeNiceToColormap) {
202 if(
Scr->workSpaceMgr.curImage == NULL) {
203 if(
Scr->workSpaceMgr.curPaint) {
204 XSetWindowBackground(
dpy, msw->
w,
Scr->workSpaceMgr.curColors.back);
208 XSetWindowBackgroundPixmap(
dpy, msw->
w,
Scr->workSpaceMgr.curImage->pixmap);
210 XSetWindowBorder(
dpy, msw->
w,
Scr->workSpaceMgr.curBorderColor);
211 XClearWindow(
dpy, msw->
w);
215 if(ws2->
image == NULL) {
221 XClearWindow(
dpy, vs->window);
241 XChangeProperty(
dpy,
Scr->Root, XA_WM_WORKSPACESLIST, XA_STRING, 8,
242 PropModeReplace, (
unsigned char *) wrkSpcList,
len);
256 unsigned int width, height;
260 const int vspace =
Scr->workSpaceMgr.vspace;
261 const int hspace =
Scr->workSpaceMgr.hspace;
262 const long count =
Scr->workSpaceMgr.count;
275 columns =
Scr->workSpaceMgr.columns;
278 columns = ((count - 1) / lines) + 1;
281 lines = ((count - 1) / columns) + 1;
283 Scr->workSpaceMgr.lines = lines;
284 Scr->workSpaceMgr.columns = columns;
290 unsigned int bwidth, bheight;
291 unsigned short strWid;
293 const char *geometry =
Scr->workSpaceMgr.geometry;
294 const int lines =
Scr->workSpaceMgr.lines;
295 const int columns =
Scr->workSpaceMgr.columns;
299 for(ws =
Scr->workSpaceMgr.workSpaceList; ws != NULL; ws = ws->
next) {
301 XRectangle logical_rect;
303 const MyFont font =
Scr->workSpaceMgr.buttonFont;
306 &inc_rect, &logical_rect);
307 wid = logical_rect.width;
317 if(geometry != NULL) {
321 bwidth = strWid + 10;
326 if(mask & WidthValue) {
327 bwidth = (width - (columns * hspace)) / columns;
329 if(mask & HeightValue) {
330 bheight = (height - (lines * vspace)) / lines;
334 width = columns * (bwidth + hspace);
335 height = lines * (bheight + vspace);
342 if(!(mask & YValue)) {
346 if(mask & YNegative) {
356 if(mask & XNegative) {
358 gravity = (mask & YNegative) ? SouthEastGravity : NorthEastGravity;
361 gravity = (mask & YNegative) ? SouthWestGravity : NorthWestGravity;
365 x = (vs->
w - width) / 2;
366 gravity = (mask & YValue) ? ((mask & YNegative) ?
367 SouthGravity : NorthGravity) : SouthGravity;
372 bwidth = strWid + 2 *
Scr->WMgrButtonShadowDepth + 6;
374 width = columns * (bwidth + hspace);
375 height = lines * (bheight + vspace);
376 x = (vs->
w - width) / 2;
378 gravity = NorthWestGravity;
391 vs->
wsw->
w = XCreateSimpleWindow(
dpy,
Scr->Root,
x,
y, width, height, 0,
392 Scr->Black,
Scr->workSpaceMgr.cp.back);
401 for(ws =
Scr->workSpaceMgr.workSpaceList; ws != NULL; ws = ws->
next) {
405 const unsigned long border =
Scr->workSpaceMgr.defBorderColor;
416 bsw->
w = XCreateSimpleWindow(
dpy, vs->
wsw->
w,
417 Dummy, Dummy, Dummy, Dummy,
420 msw->
w = XCreateSimpleWindow(
dpy, vs->
wsw->
w,
421 Dummy, Dummy, Dummy, Dummy,
426 XMapWindow(
dpy, bsw->
w);
429 XMapWindow(
dpy, msw->
w);
435 if(ws->
image == NULL ||
Scr->NoImagesInWorkSpaceManager) {
443 if(
Scr->workSpaceMgr.defImage == NULL ||
Scr->NoImagesInWorkSpaceManager) {
444 XSetWindowBackground(
dpy, msw->
w,
Scr->workSpaceMgr.defColors.back);
447 XSetWindowBackgroundPixmap(
dpy, msw->
w,
Scr->workSpaceMgr.defImage->pixmap);
455 XClearWindow(
dpy, bsw->
w);
462 XSizeHints sizehints;
464 const int lines =
Scr->workSpaceMgr.lines;
465 const int columns =
Scr->workSpaceMgr.columns;
466 const char *name =
Scr->workSpaceMgr.name;
467 const char *icon_name =
Scr->workSpaceMgr.icon_name;
469 sizehints.flags = USPosition | PBaseSize | PMinSize | PResizeInc
473 sizehints.base_width = columns * hspace;
474 sizehints.base_height = lines * vspace;
475 sizehints.width_inc = columns;
476 sizehints.height_inc = lines;
477 sizehints.min_width = columns * (hspace + 2);
478 sizehints.min_height = lines * (vspace + 2);
479 sizehints.win_gravity = gravity;
481 wmhints.flags = InputHint | StateHint;
482 wmhints.input = True;
483 wmhints.initial_state = NormalState;
485 XmbSetWMProperties(
dpy, vs->
wsw->
w, name, icon_name, NULL, 0,
486 &sizehints, &wmhints, NULL);
494 fprintf(stderr,
"cannot create workspace manager window, exiting...\n");
498 tmp_win->
attr.width = width;
499 tmp_win->
attr.height = height;
509 XWindowAttributes wattr;
510 XSetWindowAttributes attr;
511 unsigned long attrmask;
513 attr.cursor =
Scr->ButtonCursor;
514 attr.win_gravity = gravity;
515 attrmask = CWCursor | CWWinGravity;
516 XChangeWindowAttributes(
dpy, vs->
wsw->
w, attrmask, &attr);
518 XGetWindowAttributes(
dpy, vs->
wsw->
w, &wattr);
519 attrmask = wattr.your_event_mask | KeyPressMask | KeyReleaseMask
521 XSelectInput(
dpy, vs->
wsw->
w, attrmask);
543 for(
WorkSpace *ws =
Scr->workSpaceMgr.workSpaceList; ws != NULL;
545 Window buttonw = vs->
wsw->
bswl[ws->number]->
w;
546 Window mapsubw = vs->
wsw->
mswl[ws->number]->
w;
548 XSelectInput(
dpy, buttonw, ButtonPressMask | ButtonReleaseMask
553 XSelectInput(
dpy, mapsubw, ButtonPressMask | ButtonReleaseMask);
567 if(ws->
image == NULL) {
573 XClearWindow(
dpy,
Scr->Root);
594 const int neww = win->
attr.width;
595 const int newh = win->
attr.height;
596 const int hspace =
Scr->workSpaceMgr.hspace;
597 const int vspace =
Scr->workSpaceMgr.vspace;
598 const int lines =
Scr->workSpaceMgr.lines;
599 const int columns =
Scr->workSpaceMgr.columns;
600 const int bwidth = (neww - (columns * hspace)) / columns;
601 const int bheight = (newh - (lines * vspace)) / lines;
602 const int wwidth = neww / columns;
603 const int wheight = newh / lines;
604 const float wf = (float)(wwidth - 2) / (float) vs->
w;
605 const float hf = (float)(wheight - 2) / (float) vs->
h;
623 for(ws =
Scr->workSpaceMgr.workSpaceList; ws != NULL; ws = ws->
next) {
628 XMoveResizeWindow(
dpy, bsw->
w,
629 i * (bwidth + hspace) + (hspace / 2),
630 j * (bheight + vspace) + (vspace / 2),
635 msw->
y = j * wheight;
636 XMoveResizeWindow(
dpy, msw->
w, msw->
x, msw->
y, wwidth - 2, wheight - 2);
644 wl->x = (int)(tmp_win->
frame_x * wf);
645 wl->y = (int)(tmp_win->
frame_y * hf);
646 wl->width = (
unsigned int)((tmp_win->
frame_width * wf) + 0.5);
647 wl->height = (
unsigned int)((tmp_win->
frame_height * hf) + 0.5);
648 XMoveResizeWindow(
dpy, wl->w, wl->x, wl->y, wl->width, wl->height);
687 for(ws =
Scr->workSpaceMgr.workSpaceList; ws != NULL; ws = ws->
next) {
723 for(ws =
Scr->workSpaceMgr.workSpaceList; ws != NULL; ws = ws->
next) {
725 if(event->xexpose.window == buttonw) {
748 (XPointer *) &wl) == XCNOENT) {
781 for(ws =
Scr->workSpaceMgr.workSpaceList; ws != NULL; ws = ws->
next) {
797 for(ws =
Scr->workSpaceMgr.workSpaceList; ws != NULL; ws = ws->
next) {
826 keysym = XLookupKeysym((XKeyEvent *) event, 0);
830 if(keysym == XK_Control_L || keysym == XK_Control_R) {
832 if(!
Scr->DontToggleWorkspaceManagerState) {
846 KeySym keysym = XLookupKeysym((XKeyEvent *) event, 0);
850 if(keysym == XK_Control_L || keysym == XK_Control_R) {
852 if(!
Scr->DontToggleWorkspaceManagerState) {
868 for(ws =
Scr->workSpaceMgr.workSpaceList; ws != NULL; ws = ws->
next) {
889 nkeys = XLookupString(&(event->xkey), keys, 16, NULL, NULL);
892 nlen = strlen(ws->
label);
893 newname = malloc(nlen + nkeys + 1);
894 strcpy(newname, ws->
label);
897 for(
int i = 0 ; i < nkeys ; i++) {
898 unsigned char k = keys[i];
904 else if((k == 127) || (k == 8)) {
922 newname[nlen] =
'\0';
957 Position newX = 0, newY = 0, winX = 0, winY = 0;
958 bool alreadyvivible, realmovemode;
962 const Window parent =
event->xbutton.window;
963 const Window sw =
event->xbutton.subwindow;
964 const Time etime =
event->xbutton.time;
965 const unsigned int button =
event->xbutton.button;
966 const unsigned int modifier =
event->xbutton.
state;
972 for(ws =
Scr->workSpaceMgr.workSpaceList; ws != NULL; ws = ws->
next) {
989 for(oldws =
Scr->workSpaceMgr.workSpaceList ; oldws != NULL ;
990 oldws = oldws->
next) {
1004 if(sw == (Window) 0) {
1031 realmovemode =
false;
1032 if(
Scr->ReallyMoveInWorkspaceManager) {
1033 if(!(modifier & ShiftMask)) {
1034 realmovemode =
true;
1037 else if(modifier & ShiftMask) {
1038 realmovemode =
true;
1047 if(
Scr->OpaqueMoveThreshold >= 200) {
1048 Scr->OpaqueMove =
true;
1052 const unsigned long scrsz = vs->
w * vs->
h;
1053 const float sf =
Scr->OpaqueMoveThreshold / 100.0;
1054 if(winsz > (scrsz * sf)) {
1055 Scr->OpaqueMove =
false;
1058 Scr->OpaqueMove =
true;
1063 Scr->OpaqueMove =
false;
1083 XUnmapWindow(
dpy, sw);
1099 XSetWindowAttributes attrs;
1103 XGetGeometry(
dpy, sw, &junkW, &X0, &Y0, &W0, &H0, &bw, &
JunkDepth);
1112 mw->
w, X0, Y0, &X1, &Y1, &junkW);
1119 attrs.event_mask = ExposureMask;
1120 attrs.background_pixel = wl->
cp.
back;
1121 attrs.border_pixel = wl->
cp.
back;
1122 w = XCreateWindow(
dpy, mw->
w, X1, Y1, W0, H0, bw,
1123 CopyFromParent, CopyFromParent, CopyFromParent,
1124 CWEventMask | CWBackPixel | CWBorderPixel,
1137 if(realmovemode &&
Scr->ShowWinWhenMovingInWmgr) {
1138 if(
Scr->OpaqueMove) {
1179 const float wf = (float)(mw->
wwidth - 1) / (float) vs->
w;
1180 const float hf = (float)(mw->
wheight - 1) / (float) vs->
h;
1186 XTranslateCoordinates(
dpy,
Scr->Root, sw, event->xbutton.x_root,
1187 event->xbutton.y_root,
1196 XGrabPointer(
dpy, mw->
w, False,
1197 ButtonPressMask | ButtonMotionMask | ButtonReleaseMask,
1198 GrabModeAsync, GrabModeAsync, mw->
w,
Scr->MoveCursor,
1202 alreadyvivible =
false;
1208 XMaskEvent(
dpy, ButtonPressMask | ButtonMotionMask |
1209 ButtonReleaseMask | ExposureMask, &ev);
1210 switch(ev.xany.type) {
1213 if(ev.xexpose.window == w) {
1230 case ButtonRelease : {
1235 if(ev.xbutton.button != button) {
1249 newX = ev.xbutton.x;
1250 newY = ev.xbutton.y;
1254 case MotionNotify : {
1257 newX = ev.xmotion.x;
1258 newY = ev.xmotion.y;
1271 for(cws =
Scr->workSpaceMgr.workSpaceList ;
1276 && (newX < msw->
x + mw->
wwidth)
1278 && (newY < msw->
y + mw->
wheight)) {
1303 XTranslateCoordinates(
dpy, mw->
w, msw->
w,
1304 winX, winY, &XSW, &YSW, &junkW);
1312 winX = (int)(XSW / wf);
1313 winY = (int)(YSW / hf);
1322 if(
Scr->DontMoveOff) {
1326 if((winX < Scr->BorderLeft) && ((
Scr->MoveOffResistance < 0) ||
1327 (winX >
Scr->BorderLeft -
Scr->MoveOffResistance))) {
1328 winX =
Scr->BorderLeft;
1329 newX = msw->
x + XW +
Scr->BorderLeft * mw->
wwidth / vs->
w;
1331 if(((winX + width) > vs->
w -
Scr->BorderRight) &&
1332 ((
Scr->MoveOffResistance < 0) ||
1333 ((winX + width) < vs->
w -
Scr->BorderRight +
Scr->MoveOffResistance))) {
1334 winX = vs->
w -
Scr->BorderRight - width;
1336 (1 -
Scr->BorderRight / (double) vs->
w) - wl->
width + XW - 2;
1338 if((winY < Scr->BorderTop) && ((
Scr->MoveOffResistance < 0) ||
1339 (winY >
Scr->BorderTop -
Scr->MoveOffResistance))) {
1340 winY =
Scr->BorderTop;
1341 newY = msw->
y + YW +
Scr->BorderTop * mw->
height / vs->
h;
1343 if(((winY + height) > vs->
h -
Scr->BorderBottom) &&
1344 ((
Scr->MoveOffResistance < 0) ||
1345 ((winY + height) < vs->
h -
Scr->BorderBottom +
Scr->MoveOffResistance))) {
1346 winY = vs->
h -
Scr->BorderBottom - height;
1348 * (1 -
Scr->BorderBottom / (double) vs->
h)
1364 if(
Scr->ShowWinWhenMovingInWmgr) {
1376 if(alreadyvivible) {
1380 if(
Scr->OpaqueMove) {
1381 XMoveWindow(
dpy, win->
frame, winX, winY);
1393 alreadyvivible =
true;
1407 if(!alreadyvivible) {
1421 (startincurrent && (button == 1))) {
1422 if(
Scr->OpaqueMove) {
1424 XMoveWindow(
dpy, win->
frame, winX, winY);
1429 alreadyvivible =
false;
1438 if(
Scr->OpaqueMove) {
1439 XMoveWindow(
dpy, win->
frame, winX, winY);
1457 XMoveWindow(
dpy, w, newX - XW, newY - YW);
1471 if(
Scr->ShowWinWhenMovingInWmgr || alreadyvivible) {
1475 if(!
Scr->OpaqueMove) {
1487 lastev.xbutton.subwindow = (Window) 0;
1488 lastev.xbutton.window = parent;
1489 XPutBackEvent(
dpy, &lastev);
1492 XUngrabPointer(
dpy, CurrentTime);
1511 if((lastev.xbutton.time - etime) < 250) {
1512 KeyCode control_L_code, control_R_code;
1516 XMapWindow(
dpy, sw);
1517 XDestroyWindow(
dpy, w);
1519 if(!
Scr->DontWarpCursorInWMap) {
1558 control_L_code = XKeysymToKeycode(
dpy, XStringToKeysym(
"Control_L"));
1559 control_R_code = XKeysymToKeycode(
dpy, XStringToKeysym(
"Control_R"));
1560 XQueryKeymap(
dpy, keys);
1561 if((keys [control_L_code / 8] & ((
char) 0x80 >> (control_L_code % 8))) ||
1562 keys [control_R_code / 8] & ((
char) 0x80 >> (control_R_code % 8))) {
1570 for(newws =
Scr->workSpaceMgr.workSpaceList ; newws != NULL ;
1571 newws = newws->
next) {
1573 if((newX >= msw->
x) && (newX < msw->
x + mw->
wwidth) &&
1574 (newY >= msw->
y) && (newY < msw->
y + mw->
wheight)) {
1585 if((newws == NULL) || (newws == oldws) ||
1587 XMapWindow(
dpy, sw);
1593 occupation |= (1 << newws->
number);
1594 occupation &= ~(1 << oldws->
number);
1616 if((newws == NULL) || (newws == oldws) ||
1645 XDestroyWindow(
dpy, w);
1669 for(vs =
Scr->vScreenList; vs != NULL; vs = vs->
next) {
1670 for(ws =
Scr->workSpaceMgr.workSpaceList; ws != NULL; ws = ws->
next) {
1680 if(!handleraise ||
Scr->NoRaiseDeicon) {
1681 XMapWindow(
dpy, wl->
w);
1684 XMapRaised(
dpy, wl->
w);
1745 for(vs =
Scr->vScreenList; vs != NULL; vs = vs->
next) {
1746 for(ws =
Scr->workSpaceMgr.workSpaceList; ws != NULL; ws = ws->
next) {
1749 XUnmapWindow(
dpy, wl->
w);
1781 if(win ==
Scr->workSpaceMgr.occupyWindow->twm_win) {
1791 for(vs =
Scr->vScreenList; vs != NULL; vs = vs->
next) {
1796 float wf = (float)(wsw->
wwidth - 2) / (float) vs->
w;
1797 float hf = (float)(wsw->
wheight - 2) / (float) vs->
h;
1803 for(ws =
Scr->workSpaceMgr.workSpaceList; ws != NULL; ws = ws->
next) {
1807 if(win == wl->twm_win) {
1809 wl->x = (int)(
x * wf);
1810 wl->y = (int)(
y * hf);
1814 XMoveWindow(
dpy, wl->w, wl->x, wl->y);
1817 wl->width = (
unsigned int)((w * wf) + 0.5);
1818 wl->height = (
unsigned int)((h * hf) + 0.5);
1819 if(!
Scr->use3Dwmap) {
1826 if(wl->height < 1) {
1829 XMoveResizeWindow(
dpy, wl->w, wl->x, wl->y,
1830 wl->width, wl->height);
1856 for(ws =
Scr->workSpaceMgr.workSpaceList; ws != NULL; ws = ws->
next) {
1887 Window
root, parent;
1888 Window *children, *smallws;
1889 unsigned int nchildren;
1893 XQueryTree(
dpy,
Scr->Root, &
root, &parent, &children, &nchildren);
1900 smallws = calloc(nchildren,
sizeof(Window));
1908 for(
int i = nchildren - 1; i >= 0; i--) {
1916 if(win == NULL || win->
frame != children[i] || !
OCCUPY(win, ws)) {
1922 fprintf(
tracefile,
"WMapRestack : w = %lx, win = %p\n",
1923 children[i], (
void *)win);
1928 for(wl = msw->
wl; wl != NULL; wl = wl->
next) {
1931 fprintf(
tracefile,
"WMapRestack : wl = %p, twm_win = %p\n",
1932 (
void *)wl, (
void *)wl->
twm_win);
1938 smallws[j++] = wl->
w;
1949 XRestackWindows(
dpy, smallws, j);
1979 for(vs =
Scr->vScreenList; vs != NULL; vs = vs->
next) {
1980 for(ws =
Scr->workSpaceMgr.workSpaceList; ws != NULL; ws = ws->
next) {
2022 const MyFont font =
Scr->workSpaceMgr.windowFont;
2025 XClearWindow(
dpy, window);
2029 XRectangle inc_rect;
2030 XRectangle logical_rect;
2033 XFontStruct **xfonts;
2037 XmbTextExtents(font.
font_set, label, strlen(label),
2038 &inc_rect, &logical_rect);
2039 strwid = logical_rect.width;
2040 strhei = logical_rect.height;
2046 if(strhei > height) {
2050 x = (width - strwid) / 2;
2055 fnum = XFontsOfFontSet(font.
font_set, &xfonts, &font_names);
2056 for(i = 0, descent = 0; i < fnum; i++) {
2058 descent = ((descent < (xfonts[i]->max_bounds.descent)) ?
2059 (xfonts[i]->max_bounds.descent) : descent);
2062 y = ((height + strhei) / 2) - descent;
2066 if(
Scr->use3Dwmap) {
2072 XFillRectangle(
dpy, window,
Scr->NormalGC, 0, 0, width, height);
2077 if(
Scr->Monochrome != COLOR) {
2079 label, strlen(label));
2083 label, strlen(label));
2107 for(ws =
Scr->workSpaceMgr.workSpaceList; ws != NULL; ws = ws->
next) {
2130 if(
Scr->workSpaceMgr.windowcpgiven) {
2131 cp.
back =
Scr->workSpaceMgr.windowcp.back;
2134 cp.
fore =
Scr->workSpaceMgr.windowcp.fore;
2138 if(
Scr->use3Dwmap && !
Scr->BeNiceToColormap) {
2146 const float wf = (float)(vs->wsw->wwidth - 2) / (float) vs->w;
2147 const float hf = (float)(vs->wsw->wheight - 2) / (float) vs->h;
2151 wl = malloc(
sizeof(
struct winList));
2162 if(!
Scr->use3Dwmap) {
2175 wl->
w = XCreateSimpleWindow(
dpy, msw->
w, wl->
x, wl->
y,
2181 XSetWindowAttributes attr;
2182 unsigned long attrmask;
2185 attrmask = CWCursor;
2187 if(
Scr->BackingStore) {
2188 attr.backing_store = WhenMapped;
2189 attrmask |= CWBackingStore;
2192 XChangeWindowAttributes(
dpy, wl->
w, attrmask, &attr);
2196 XSelectInput(
dpy, wl->
w, ExposureMask);
2197 XSaveContext(
dpy, wl->
w,
TwmContext, (XPointer) vs->wsw->twm_win);
2211 XMapWindow(
dpy, wl->
w);
2228 for(ws =
Scr->workSpaceMgr.workSpaceList; ws != NULL; ws = ws->
next) {
2263 for(vs =
Scr->vScreenList; vs != NULL; vs = vs->
next) {
2267 for(
WinList *wl = *prev ; wl != NULL ; wl = wl->
next) {
2268 if(win != wl->twm_win) {
2280 XDestroyWindow(
dpy, wl->w);
2333 if(win ==
Scr->workSpaceMgr.occupyWindow->twm_win) {
2339 if(
Scr->workSpaceMgr.noshowoccupyall &&
TwmWindow * AddWindow(Window w, AWType wtype, IconMgr *iconp, VirtualScreen *vs)
#define FB(fix_fore, fix_back)
void NewFontCursor(Cursor *cp, const char *str)
void Draw3DBorder(Window w, int x, int y, int width, int height, int bw, ColorPair cp, ButtonState state, bool fill, bool forcebw)
void PaintWsButton(PWBType which, VirtualScreen *vs, Window w, char *label, ColorPair cp, ButtonState state)
VirtualScreen * vScreenList
Linked list of per-VS info.
int frame_x
X position on screen of frame.
int frame_y
Y position on screen of frame.
Window frame
The X window for the overall frame.
int frame_bw
2d border width.
unsigned int title_height
Height of the full title bar.
unsigned int frame_width
Width of frame.
unsigned int frame_height
Height of frame.
int frame_bw3D
3d border width.
bool GetColorFromList(name_list *list_head, char *name, XClassHint *class, Pixel *ptr)
void ChangeOccupation(TwmWindow *tmp_win, int newoccupation)
int GetPropertyFromMask(unsigned int mask, char **prop)
void ResizeOccupyWindow(TwmWindow *win)
void OtpRaise(TwmWindow *twm_win, WinType wintype)
Info and control for each X Screen we control.
WorkSpaceMgr workSpaceMgr
Info about the WorkSpaceManager (and Occupy window) for the screen.
Info and control for every X Window we take over.
bool iswspmgr
This is a workspace manager window.
bool OpaqueMove
Move opaquely.
bool isiconmgr
This is an icon manager window.
bool istransient
This is a transient window.
char * name
Current window name. Points into TwmWindow::names.
char * icon_name
Current icon name. Points into TwmWindow::names.
int occupation
Workspaces the window is in (bitmap).
struct VirtualScreen * vs
Where the window is currently mapped (may be NULL).
bool mapped
Is the window mapped ?
XClassHint class
Window class info. From XGetClassHint().
ColorPair title
ColorPair for various other titlebar bits.
XWindowAttributes attr
Window attributes from XGetWindowAttributes().
struct VirtualScreen * next
struct WorkSpaceWindow * wsw
void GetShadeColors(ColorPair *cp)
Try and create a 'shaded' version of a color for prettier UI.
char * CtwmGetVScreenMap(Display *display, Window rootw)
void Vanish(VirtualScreen *vs, TwmWindow *tmp_win)
void DisplayWin(VirtualScreen *vs, TwmWindow *tmp_win)
void SetupWindow(TwmWindow *tmp_win, int x, int y, int w, int h, int bw)
void MoveOutline(Window root, int x, int y, int width, int height, int bw, int th)
TwmWindow * GetTwmWindow(Window w)
void SetMapStateProp(TwmWindow *tmp_win, int state)
void WarpToWindow(TwmWindow *t, bool must_raise)
void WMapLower(TwmWindow *win)
void WMapRedrawName(VirtualScreen *vs, WinList *wl)
void WMapAddWindowToWorkspace(TwmWindow *win, WorkSpace *ws)
void WMapDeIconify(TwmWindow *win)
void WMapIconify(TwmWindow *win)
void WMgrToggleState(VirtualScreen *vs)
void WMapRemoveWindow(TwmWindow *win)
static void WMapRedrawWindow(Window window, int width, int height, ColorPair cp, const char *label)
static void wmap_mapwin_backend(TwmWindow *win, bool handleraise)
void WMapRestack(WorkSpace *ws)
void WMapSetupWindow(TwmWindow *win, int x, int y, int w, int h)
void InitWorkSpaceManagerContext(void)
void WMapRaiseLower(TwmWindow *win)
void WMgrHandleKeyPressEvent(VirtualScreen *vs, XEvent *event)
static void CreateWorkSpaceManagerWindow(VirtualScreen *vs)
static XContext MapWListContext
void WMapUpdateIconName(TwmWindow *win)
void WMapMapWindow(TwmWindow *win)
void CreateWorkSpaceManager(void)
void WMgrSetButtonsState(VirtualScreen *vs)
bool WMapWindowMayBeAdded(TwmWindow *win)
static void PaintWorkSpaceManagerBorder(VirtualScreen *vs)
void ConfigureWorkSpaceManager(ScreenInfo *scr)
Prep up structures for WSM windows in each VS.
void WMapAddWindow(TwmWindow *win)
void WMapRemoveWindowFromWorkspace(TwmWindow *win, WorkSpace *ws)
void WMgrSetMapState(VirtualScreen *vs)
void WMapRaise(TwmWindow *win)
void PaintWorkSpaceManager(VirtualScreen *vs)
void WMgrHandleExposeEvent(VirtualScreen *vs, XEvent *event)
void WMgrHandleKeyReleaseEvent(VirtualScreen *vs, XEvent *event)
static void InvertColorPair(ColorPair *cp)
static void ResizeWorkSpaceManager(VirtualScreen *vs, TwmWindow *win)
void WMgrHandleButtonEvent(VirtualScreen *vs, XEvent *event)
void GotoWorkSpace(VirtualScreen *vs, WorkSpace *ws)
WorkSpace * GetWorkspace(const char *wname)
int RLayoutXParseGeometry(RLayout *layout, const char *geometry, int *x, int *y, unsigned int *width, unsigned int *height)
Parse an X Geometry out to get the positions and sizes.