34#include <X11/extensions/shape.h>
41#include "ctwm_atoms.h"
45# include "ewmh_atoms.h"
85static void DealWithNonSensicalGeometries(Display *
dpy, Window vroot,
121 short restore_icon_x, restore_icon_y;
122 bool restore_iconified =
false;
123 bool restore_icon_info_present =
false;
125 bool restoredFromPrevSession =
false;
126 int saved_occupation = 0;
127 bool random_placed =
false;
134 fprintf(stderr,
"AddWindow: w = 0x%x\n", w);
153 if(tmp_win == NULL) {
154 fprintf(stderr,
"%s: Unable to allocate memory to manage window ID %lx.\n",
204 XSelectInput(
dpy, tmp_win->
w, PropertyChangeMask);
205 XGetWindowAttributes(
dpy, tmp_win->
w, &tmp_win->
attr);
234 namelen = strlen(tmp_win->
name);
238 XGetClassHint(
dpy, tmp_win->
w, &tmp_win->
class);
239 if(tmp_win->
class.res_name == NULL) {
242 if(tmp_win->
class.res_class == NULL) {
248 XA_CTWM_WM_ICON_NAME);
251 XA__NET_WM_ICON_NAME);
259#define CHKL(lst) IsInList(Scr->lst, tmp_win)
274 if(
CHKL(IgnoreTransientL)) {
285 short saved_x, saved_y;
286 unsigned short saved_width, saved_height;
287 bool width_ever_changed_by_user;
288 bool height_ever_changed_by_user;
291 &saved_x, &saved_y, &saved_width, &saved_height,
292 &restore_iconified, &restore_icon_info_present,
293 &restore_icon_x, &restore_icon_y,
294 &width_ever_changed_by_user,
295 &height_ever_changed_by_user,
296 &saved_occupation)) {
298 restoredFromPrevSession =
true;
300 tmp_win->
attr.x = saved_x;
301 tmp_win->
attr.y = saved_y;
306 if(width_ever_changed_by_user) {
307 tmp_win->
attr.width = saved_width;
310 if(height_ever_changed_by_user) {
311 tmp_win->
attr.height = saved_height;
324 if(tmp_win->
attr.width >
Scr->MaxWindowWidth) {
325 tmp_win->
attr.width =
Scr->MaxWindowWidth;
327 if(tmp_win->
attr.height >
Scr->MaxWindowHeight) {
328 tmp_win->
attr.height =
Scr->MaxWindowHeight;
340 fprintf(stderr,
"Failed allocating memory for hints!\n");
351 if(restore_iconified) {
352 tmp_win->
wmhints->initial_state = IconicState;
353 tmp_win->
wmhints->flags |= StateHint;
356 if(restore_icon_info_present) {
357 tmp_win->
wmhints->icon_x = restore_icon_x;
358 tmp_win->
wmhints->icon_y = restore_icon_y;
359 tmp_win->
wmhints->flags |= IconPositionHint;
374 ||
CHKL(AlwaysSqueezeToGravityL);
385 Scr->NumAutoRaises++;
390 Scr->NumAutoLowers++;
394 if(
CHKL(OpaqueMoveList)) {
397 else if(
CHKL(NoOpaqueMoveList)) {
402 if(
CHKL(OpaqueResizeList)) {
405 else if(
CHKL(NoOpaqueResizeList)) {
417 bool ibum =
CHKL(IconifyByUn);
423 ibum =
Scr->IconifyByUnmapping;
441 if(!t && tmp_win->
group) {
457 if(
CHKL(WindowRingL) ||
463 && !
CHKL(WindowRingExcludeL))) {
534 else if(
Scr->ClientBorderWidth) {
561 if(
Scr->NoTitlebar) {
564 if(
CHKL(MakeTitle)) {
584 else if(have_title) {
612 if(
CHKL(StartIconified)) {
613 tmp_win->
wmhints->initial_state = IconicState;
614 tmp_win->
wmhints->flags |= StateHint;
622 if(restoredFromPrevSession) {
659 else if(tmp_win->
hints.flags & USPosition) {
662 else if(tmp_win->
hints.flags & PPosition) {
667 && (tmp_win->
attr.x != 0 || tmp_win->
attr.y != 0)) {
735 (
unsigned int *) &tmp_win->
attr.width,
736 (
unsigned int *) &tmp_win->
attr.height);
738 if(mask & XNegative) {
739 tmp_win->
attr.x +=
Scr->rootw - tmp_win->
attr.width;
741 if(mask & YNegative) {
742 tmp_win->
attr.y +=
Scr->rooth - tmp_win->
attr.height;
759 vroot = winbox->window;
780 ((tmp_win->
wmhints->initial_state == IconicState) ||
786 "DEBUG[RandomPlacement]: win: %dx%d+%d+%d, screen: %dx%d, title height: %d, random: +%d+%d\n",
787 tmp_win->
attr.width, tmp_win->
attr.height,
796 if(
Scr->RandomDisplacementX >= 0) {
802 if(
Scr->RandomDisplacementY >= 0) {
807 -
Scr->BorderBottom - 5;
814 if(
Scr->RandomDisplacementX >= 0
816 >
Scr->rootw -
Scr->BorderRight - 5)) {
833 if(
Scr->RandomDisplacementY >= 0
835 >
Scr->rooth -
Scr->BorderBottom - 5)) {
846 -
Scr->BorderBottom - 5;
857 if(
Scr->DontMoveOff) {
862 "DEBUG[DontMoveOff]: win: %dx%d+%d+%d, screen: %dx%d, bw2: %d, bw3D: %d\n",
863 tmp_win->
attr.width, tmp_win->
attr.height,
873 if((tmp_win->
attr.x + tmp_win->
attr.width) >
Scr->rootw) {
874 available =
Scr->rootw - tmp_win->
attr.width
878 fprintf(stderr,
"DEBUG[DontMoveOff]: availableX: %d\n",
895 tmp_win->
attr.x = available / 2;
903 if((tmp_win->
attr.y + tmp_win->
attr.height) >
Scr->rooth) {
904 available =
Scr->rooth - tmp_win->
attr.height
909 fprintf(stderr,
"DEBUG[DontMoveOff]: availableY: %d\n",
932 "DEBUG[DontMoveOff]: win: %dx%d+%d+%d, screen: %dx%d\n",
933 tmp_win->
attr.width, tmp_win->
attr.height,
949 random_placed =
true;
951 else if(!(tmp_win->
wmhints->flags & StateHint &&
952 tmp_win->
wmhints->initial_state == IconicState)) {
954 bool firsttime =
true;
972 if(!XQueryPointer(
dpy,
Scr->Root, &qproot,
979 qpmask &= (Button1Mask | Button2Mask | Button3Mask |
980 Button4Mask | Button5Mask);
986 if(qproot !=
Scr->Root) {
988 for(scrnum = 0; scrnum <
NumScreens; scrnum++) {
989 if(qproot == RootWindow(
dpy, scrnum)) {
998 vroot =
Scr->currentvs->window;
1004 vroot = winbox->window;
1018 stat = XGrabPointer(
dpy, vroot, False,
1019 ButtonPressMask | ButtonReleaseMask |
1020 PointerMotionMask | PointerMotionHintMask,
1021 GrabModeAsync, GrabModeAsync,
1023 if(stat == GrabSuccess) {
1029 XRectangle ink_rect;
1030 XRectangle logical_rect;
1032 XmbTextExtents(
Scr->SizeFont.font_set,
1033 tmp_win->
name, namelen,
1034 &ink_rect, &logical_rect);
1038 XmbTextExtents(
Scr->SizeFont.font_set,
1039 ": ", 2, NULL, &logical_rect);
1040 Scr->SizeStringOffset = width + logical_rect.width;
1046 XMapRaised(
dpy,
Scr->SizeWindow);
1048 FB(
Scr->DefaultC.fore,
Scr->DefaultC.back);
1049 XmbDrawImageString(
dpy,
Scr->SizeWindow,
Scr->SizeFont.font_set,
1052 tmp_win->
name, namelen);
1066 XmbDrawImageString(
dpy,
Scr->SizeWindow,
Scr->SizeFont.font_set,
1067 Scr->NormalGC, width,
1079 if(
Scr->OpenWindowTimeout) {
1080 const int fd = ConnectionNumber(
dpy);
1081 while(!XCheckMaskEvent(
dpy, ButtonMotionMask | ButtonPressMask, &event)) {
1083 struct timeval timeout = {
1084 .tv_sec =
Scr->OpenWindowTimeout,
1090 found = select(fd + 1, &mask, NULL, NULL, &timeout);
1101 XMaskEvent(
dpy, ButtonPressMask | PointerMotionMask, &event);
1103 if(event.type == MotionNotify) {
1105 while(XCheckMaskEvent(
dpy,
1106 ButtonMotionMask | ButtonPressMask, &event))
1107 if(event.type == ButtonPress) {
1112 if(event.type == ButtonPress) {
1113 AddingX =
event.xbutton.x_root;
1114 AddingY =
event.xbutton.y_root;
1118 if(
Scr->PackNewWindows) {
1123 if(
Scr->DontMoveOff) {
1129 if(event.type != MotionNotify) {
1137 if(
Scr->PackNewWindows) {
1140 if(
Scr->DontMoveOff) {
1150 if(event.xbutton.button == Button2) {
1152 XRectangle logical_rect;
1154 XmbTextExtents(
Scr->SizeFont.font_set,
1155 ": ", 2, NULL, &logical_rect);
1156 Scr->SizeStringOffset = width + logical_rect.width;
1162 XmbDrawImageString(
dpy,
Scr->SizeWindow,
Scr->SizeFont.font_set,
1163 Scr->NormalGC, width,
1167 int dx = (tmp_win->
attr.width / 4);
1168 int dy = (tmp_win->
attr.height / 4);
1170#define HALF_AVE_CURSOR_SIZE 8
1171 if(dx < HALF_AVE_CURSOR_SIZE + Scr->BorderLeft) {
1174 if(dy < HALF_AVE_CURSOR_SIZE + Scr->BorderTop) {
1177#undef HALF_AVE_CURSOR_SIZE
1186 if(dx > 0 && dy > 0) {
1187 XWarpPointer(
dpy, None, None, 0, 0, 0, 0, dx, dy);
1191 XWarpPointer(
dpy, None, vroot, 0, 0, 0, 0,
1200 ButtonReleaseMask | ButtonMotionMask, &event);
1202 if(event.type == MotionNotify) {
1204 while(XCheckMaskEvent(
dpy,
1205 ButtonMotionMask | ButtonReleaseMask, &event))
1206 if(event.type == ButtonRelease) {
1212 if(event.type == ButtonRelease) {
1217 if(event.type != MotionNotify) {
1245 else if(event.xbutton.button == Button3) {
1247 int max_bottom, max_right;
1267 XMaskEvent(
dpy, ButtonReleaseMask, &event);
1270 XMaskEvent(
dpy, ButtonReleaseMask, &event);
1274 XUnmapWindow(
dpy,
Scr->SizeWindow);
1276 XUngrabPointer(
dpy, CurrentTime);
1299 fprintf(stderr,
" position window %d, %d %dx%d\n",
1302 tmp_win->
attr.width,
1303 tmp_win->
attr.height);
1311 if(!
Scr->ClientBorderWidth) {
1312 int delta = tmp_win->
attr.border_width - tmp_win->
frame_bw -
1314 tmp_win->
attr.x += gravx * delta;
1315 tmp_win->
attr.y += gravy * delta;
1334 XRectangle logical_rect;
1335 XmbTextExtents(
Scr->TitleBarFont.font_set, tmp_win->
name, namelen,
1336 NULL, &logical_rect);
1343 XSetWindowBorderWidth(
dpy, tmp_win->
w, 0);
1350#define SETC(lst, save) GetColorFromList(Scr->lst, tmp_win->name, \
1351 &tmp_win->class, &tmp_win->save)
1356 SETC(BorderColorL, borderC.fore);
1357 SETC(BorderColorL, borderC.back);
1361 SETC(BorderTileForegroundL, border_tile.fore);
1362 SETC(BorderTileBackgroundL, border_tile.back);
1366 SETC(TitleForegroundL, title.fore);
1367 SETC(TitleBackgroundL, title.back);
1372 if(
Scr->use3Dtitles && !
Scr->BeNiceToColormap) {
1375 if(
Scr->use3Dborders && !
Scr->BeNiceToColormap) {
1414 tmp_win->
next =
Scr->FirstWindow;
1415 if(
Scr->FirstWindow != NULL) {
1416 Scr->FirstWindow->prev = tmp_win;
1418 tmp_win->
prev = NULL;
1419 Scr->FirstWindow = tmp_win;
1436 unsigned long valuemask;
1437 XSetWindowAttributes attributes;
1467 int min_x, min_y, max_bottom, max_right;
1492 layout =
Scr->Layout;
1497 &min_y, &max_bottom);
1499 &min_x, &max_right);
1506 if(area.
x > max_right || area.
y > max_bottom ||
1507 area.
x + area.
width <= min_x ||
1508 area.
y + area.
height <= min_y) {
1516 DealWithNonSensicalGeometries(
dpy, vroot, tmp_win);
1523 valuemask = CWBackPixmap | CWBorderPixel | CWBackPixel
1524 | CWCursor | CWEventMask;
1525 attributes.background_pixmap = None;
1528 attributes.cursor =
Scr->FrameCursor;
1529 attributes.event_mask = (SubstructureRedirectMask
1530 | ButtonPressMask | ButtonReleaseMask
1531 | EnterWindowMask | LeaveWindowMask
1538 if(
Scr->BorderCursors) {
1539 attributes.event_mask |= PointerMotionMask;
1546 if(tmp_win->
attr.save_under) {
1547 attributes.save_under = True;
1548 valuemask |= CWSaveUnder;
1550 if(tmp_win->
hints.flags & PWinGravity) {
1551 attributes.win_gravity = tmp_win->
hints.win_gravity;
1552 valuemask |= CWWinGravity;
1557 tmp_win->
frame = XCreateWindow(
dpy, vroot,
1562 Scr->d_depth, CopyFromParent,
1563 Scr->d_visual, valuemask, &attributes);
1564 if(
Scr->NameDecorations) {
1565 XStoreName(
dpy, tmp_win->
frame,
"CTWM frame");
1574 unsigned long valuemask;
1575 XSetWindowAttributes attributes;
1583 valuemask = (CWEventMask | CWDontPropagate
1584 | CWBorderPixel | CWBackPixel);
1585 attributes.event_mask = (KeyPressMask | ButtonPressMask
1586 | ButtonReleaseMask | ExposureMask);
1587 attributes.do_not_propagate_mask = PointerMotionMask;
1589 attributes.background_pixel = tmp_win->
title.
back;
1595 tmp_win->
attr.width,
1597 Scr->d_depth, CopyFromParent,
1598 Scr->d_visual, valuemask, &attributes);
1599 if(
Scr->NameDecorations) {
1600 XStoreName(
dpy, tmp_win->
title_w,
"CTWM titlebar");
1619 if(
Scr->use3Dtitles && (
Scr->Monochrome != COLOR)) {
1633 tmp_win->
gray = None;
1665 unsigned long valuemask;
1666 XSetWindowAttributes attributes;
1668 valuemask = (CWEventMask | CWDontPropagate);
1669 attributes.event_mask = (StructureNotifyMask | PropertyChangeMask
1670 | ColormapChangeMask | VisibilityChangeMask
1672 | EnterWindowMask | LeaveWindowMask);
1673 attributes.do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask
1674 | PointerMotionMask;
1675 XChangeWindowAttributes(
dpy, tmp_win->
w, valuemask, &attributes);
1696 int xws, yws, xbs, ybs;
1697 unsigned wws, hws, wbs, hbs;
1698 int boundingShaped, clipShaped;
1700 XShapeSelectInput(
dpy, tmp_win->
w, ShapeNotifyMask);
1701 XShapeQueryExtents(
dpy, tmp_win->
w,
1702 &boundingShaped, &xws, &yws, &wws, &hws,
1703 &clipShaped, &xbs, &ybs, &wbs, &hbs);
1704 tmp_win->
wShaped = boundingShaped;
1719 XAddToSaveSet(
dpy, tmp_win->
w);
1777#define SETCTXS(win) do { \
1778 XSaveContext(dpy, win, TwmContext, (XPointer) tmp_win); \
1779 XSaveContext(dpy, win, ScreenContext, (XPointer) Scr); \
1789 int nb =
Scr->TBInfo.nleft +
Scr->TBInfo.nright;
1793 for(i = 0; i < nb; i++) {
1897#define grabbutton(button, modifier, window, pointer_mode) \
1898 XGrabButton (dpy, button, modifier, window, \
1899 True, ButtonPressMask | ButtonReleaseMask, \
1900 pointer_mode, GrabModeAsync, None, \
1907 unsigned int ModifierMask[8] = { ShiftMask, ControlMask, LockMask,
1908 Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask,
1912 for(tmp =
Scr->FuncButtonRoot.next; tmp != NULL; tmp = tmp->
next) {
1918 for(i = 0 ; i < 8 ; i++) {
1919 if((
Scr->IgnoreModifier & ModifierMask [i]) && !(tmp->
mods & ModifierMask [i]))
1921 tmp_win->
frame, GrabModeAsync);
1924 if(
Scr->ClickToFocus) {
1925 grabbutton(AnyButton, None, tmp_win->
w, GrabModeSync);
1926 for(i = 0 ; i < 8 ; i++) {
1927 grabbutton(AnyButton, ModifierMask [i], tmp_win->
w, GrabModeSync);
1930 else if(
Scr->RaiseOnClick) {
1931 grabbutton(
Scr->RaiseOnClickButton, None, tmp_win->
w, GrabModeSync);
1932 for(i = 0 ; i < 8 ; i++) {
1934 ModifierMask [i], tmp_win->
w, GrabModeSync);
1951#define grabkey(funckey, modifier, window) \
1952 XGrabKey(dpy, funckey->keycode, funckey->mods | modifier, window, True, \
1953 GrabModeAsync, GrabModeAsync);
1954#define ungrabkey(funckey, modifier, window) \
1955 XUngrabKey (dpy, funckey->keycode, funckey->mods | modifier, window);
1962 unsigned int ModifierMask[8] = { ShiftMask, ControlMask, LockMask,
1963 Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask,
1967 for(tmp =
Scr->FuncKeyRoot.next; tmp != NULL; tmp = tmp->
next) {
1971#define AltMask (Alt1Mask | Alt2Mask | Alt3Mask | Alt4Mask | Alt5Mask)
1979 for(i = 0 ; i < 8 ; i++) {
1980 if((
Scr->IgnoreModifier & ModifierMask [i]) &&
1981 !(tmp->
mods & ModifierMask [i])) {
1982 grabkey(tmp, ModifierMask [i], tmp_win->
w);
1988 if(!tmp_win->
icon || tmp_win->
icon->
w) {
1994 for(i = 0 ; i < 8 ; i++) {
1995 if((
Scr->IgnoreModifier & ModifierMask [i]) &&
1996 !(tmp->
mods & ModifierMask [i])) {
2009 for(i = 0 ; i < 8 ; i++) {
2010 if((
Scr->IgnoreModifier & ModifierMask [i]) &&
2011 !(tmp->
mods & ModifierMask [i])) {
2019 for(i = 0 ; i < 8 ; i++) {
2020 if((
Scr->IgnoreModifier & ModifierMask [i]) &&
2021 !(tmp->
mods & ModifierMask [i])) {
2022 grabkey(tmp, ModifierMask [i], tmp_win->
w);
2028 for(i = 0 ; i < 8 ; i++) {
2029 if((
Scr->IgnoreModifier & ModifierMask [i]) &&
2030 !(tmp->
mods & ModifierMask [i])) {
2038 for(i = 0 ; i < 8 ; i++) {
2039 if((
Scr->IgnoreModifier & ModifierMask [i]) &&
2040 !(tmp->
mods & ModifierMask [i])) {
2047#ifdef EWMH_DESKTOP_ROOT
2055 for(i = 0 ; i < 8 ; i++) {
2056 if((
Scr->IgnoreModifier & ModifierMask [i]) &&
2057 !(tmp->
mods & ModifierMask [i])) {
2058 grabkey(tmp, ModifierMask [i], tmp_win->
w);
2072 for(tmp =
Scr->FuncKeyRoot.next; tmp != NULL; tmp = tmp->
next) {
2074 for(p =
Scr->iconmgr; p != NULL; p = p->
next) {
2077 for(i = 0 ; i < 8 ; i++) {
2078 if((
Scr->IgnoreModifier & ModifierMask [i]) &&
2079 !(tmp->
mods & ModifierMask [i])) {
2108DealWithNonSensicalGeometries(Display *mydpy, Window vroot,
2122 if(!(XGetGeometry(mydpy, vroot, &vvroot, &
x, &
y, &w, &h, &j, &j))) {
2126 myvs = findIfVScreenOf(
x,
y);
2135 for(vs = myvs->
next; vs; vs = vs->
next) {
2139 for(vs =
Scr->vScreenList; vs && vs != myvs; vs = vs->
next) {
2144 tmp_win->
frame_x -= abs(dropx);
void GrabButtons(TwmWindow *tmp_win)
#define grabbutton(button, modifier, window, pointer_mode)
void GrabKeys(TwmWindow *tmp_win)
#define ungrabkey(funckey, modifier, window)
#define HALF_AVE_CURSOR_SIZE
#define grabkey(funckey, modifier, window)
TwmWindow * AddWindow(Window w, AWType wtype, IconMgr *iconp, VirtualScreen *vs)
void SetPropsIfCaptiveCtwm(TwmWindow *win)
bool RedirectToCaptive(Window window)
void FetchWmColormapWindows(TwmWindow *tmp)
void UninstallRootColormap(void)
void InstallRootColormap(void)
#define FB(fix_fore, fix_back)
#define ALLOW_DEAD_STORE(x)
int NumScreens
How many Screens are on our display.
void FixRootEvent(XEvent *e)
void EwmhSet_NET_FRAME_EXTENTS(TwmWindow *twm_win)
Set _NET_FRAME_EXTENTS property.
bool EwmhHasBorder(TwmWindow *twm_win)
bool EwmhOnWindowRing(TwmWindow *twm_win)
void EwmhGetProperties(TwmWindow *twm_win)
bool EwmhHasTitle(TwmWindow *twm_win)
#define EWMH_STATE_SHADED
int frame_x
X position on screen of frame.
Window hilite_wl
Left hilite window in titlebar.
Window lolite_wl
Left lolite window in titlebar.
unsigned int title_width
Width of the full title bar.
Window hilite_wr
Right hilite window in titlebar.
int title_x
X coord of window title relative to title_w.
int frame_y
Y position on screen of frame.
unsigned int name_width
width of name text
Window frame
The X window for the overall frame.
Window lolite_wr
Right lolite window in titlebar.
int frame_bw
2d border width.
TBWindow * titlebuttons
Button windows in the titlebar.
unsigned int title_height
Height of the full title bar.
Window title_w
The title bar Window.
unsigned int frame_width
Width of frame.
Pixmap gray
Pixmap to which the border is set to when window isn't focused.
unsigned int frame_height
Height of frame.
int frame_bw3D
3d border width.
int title_y
Y coord of window title relative to title_w.
WList * AddIconManager(TwmWindow *tmp_win)
Pixmap mk_blackgray_pixmap(const char *which, Drawable dw, unsigned long fg, unsigned long bg)
void * LookInListWin(name_list *list_head, TwmWindow *twin)
int mwm_has_border(MotifWmHints *hints)
bool mwm_sets_title(MotifWmHints *hints)
bool GetMWMHints(Window w, MotifWmHints *mwmHints)
bool mwm_has_title(MotifWmHints *hints)
void SetupOccupation(TwmWindow *twm_win, int occupation_hint)
void OtpAdd(TwmWindow *twm_win, WinType wintype)
RArea RAreaNew(int x, int y, int width, int height)
Construct an RArea from given components.
void RLayoutFindTopBottomEdges(const RLayout *self, const RArea *area, int *top, int *bottom)
Figure the position (or nearest practical position) of an area in our screen layout,...
int RLayoutFindMonitorRightEdge(const RLayout *self, const RArea *area)
Find the right edge of the left-most monitor that contains the most of a given RArea.
int RLayoutFindMonitorBottomEdge(const RLayout *self, const RArea *area)
Find the bottom edge of the top-most monitor that contains the most of a given RArea.
void RLayoutFindLeftRightEdges(const RLayout *self, const RArea *area, int *left, int *right)
Figure the position (or nearest practical position) of an area in our screen layout,...
#define SIZE_VINDENT
Internal padding in the size window.
#define SIZE_HINDENT
Internal padding in the size window.
int GetWindowConfig(TwmWindow *theWindow, short *x, short *y, unsigned short *width, unsigned short *height, bool *iconified, bool *icon_info_present, short *icon_x, short *icon_y, bool *width_ever_changed_by_user, bool *height_ever_changed_by_user, int *occupation)
struct IconMgr * next
Next iconmgr in this workspace.
A particular extent of space.
The layout of our display.
char * ctwm_wm_icon_name
Icon name from override CTWM_WM_ICON_NAME property.
char * wm_name
Name from ICCCM WM_NAME property.
char * wm_icon_name
Icon name from WM_ICON_NAME property.
char * ctwm_wm_name
Name from override CTWM_WM_NAME property.
bool cursor_valid
Whether curs_x and curs_y are usable.
unsigned int width
Saved width.
Info and control for every X Window we take over.
ColorPair border_tile
ColorPair for non-focused window borders.
struct TwmWindow * next
Next TwmWindow on the Screen.
bool iswspmgr
This is a workspace manager window.
bool OpaqueMove
Move opaquely.
bool titlehighlight
Should I highlight the title bar?
bool wShaped
This window is Shape'd.
bool isiconmgr
This is an icon manager window.
XWMHints * wmhints
Window manager hints.
bool heightEverChangedByUser
Has TwmWindow::attr height ever changed? Used only in sessions.
bool iconified
Has the window ever been iconified?
bool OpaqueResize
Resize opaquely.
Window w
The actual X Window handle.
bool auto_raise
Should we auto-raise this window ?
bool nameChanged
Has TwmWindow::name ever changed? Used only in session saving.
bool stackmode
Honor stackmode requests.
bool istransient
This is a transient window.
int zoomed
ZOOM_NONE || function causing zoom.
int old_bw
Original window border width before we took it over and made our own bordering.
struct TwmWindow::_ring ring
Window ring connectivity. "
char * name
Current window name. Points into TwmWindow::names.
bool auto_lower
Should we auto-lower this window ?
struct Icon * icon
The current icon.
bool squeeze_info_copied
Should ->squeeze_info be free()'d?
bool widthEverChangedByUser
Has TwmWindow::attr width ever changed? Used only in sessions.
bool AlwaysSqueezeToGravity
SqueezeInfo * squeeze_info
Control info for title squeezing.
bool hasfocusvisible
The window visibly has focus.
struct VirtualScreen * vs
Where the window is currently mapped (may be NULL).
bool mapped
Is the window mapped ?
bool icon_on
Is the icon visible.
XClassHint class
Window class info. From XGetClassHint().
XSizeHints hints
Window size hints.
Colormaps cmaps
colormaps for this application
ColorPair borderC
ColorPair for focused window borders.
struct IconMgr * iconmgrp
Pointer to the icon manager structure, for windows that are icon managers.
ColorPair title
ColorPair for various other titlebar bits.
struct VirtualScreen * savevs
Where the window would be.
struct VirtualScreen * parent_vs
Where the window is parented. Always set.
struct TwmWindow::_savegeometry savegeometry
Saved window geometry. "
struct TwmWindow::_names names
Various sources of window/icon names. "
struct TwmWindow * prev
Previous TwmWindow on the Screen.
XWindowAttributes attr
Window attributes from XGetWindowAttributes().
Window transientfor
What window it's transient for.
bool UnmapByMovingFarAway
Window group
Window group, from WM hints.
bool iconify_by_unmapping
Unmap window to iconify it.
bool isoccupy
This is an Occupy window.
bool highlight
Should highlight this window.
bool isicon
Is the window an icon now ?
bool squeezed
Is the window squeezed ?
struct VirtualScreen * next
struct WindowBox WindowBox
void GetShadeColors(ColorPair *cp)
Try and create a 'shaded' version of a color for prettier UI.
void CreateWindowTitlebarButtons(TwmWindow *tmp_win)
void ComputeTitleLocation(TwmWindow *tmp)
void SetupFrame(TwmWindow *tmp_win, int x, int y, int w, int h, int bw, bool sendEvent)
void SetFocusVisualAttributes(TwmWindow *tmp_win, bool focus)
void MoveOutline(Window root, int x, int y, int width, int height, int bw, int th)
void AutoSqueeze(TwmWindow *tmp_win)
bool PlaceWindowInRegion(TwmWindow *tmp_win, int *final_x, int *final_y)
void ConstrainSize(TwmWindow *tmp_win, unsigned int *widthp, unsigned int *heightp)
void AddEndResize(TwmWindow *tmp_win)
void AddStartResize(TwmWindow *tmp_win, int x, int y, int w, int h)
void DoResize(int x_root, int y_root, TwmWindow *tmp_win)
void savegeometry(TwmWindow *tmp_win)
void UnlinkWindowFromRing(TwmWindow *win)
void AddWindowToRing(TwmWindow *win)
#define InitWindowNotOnRing(win)
void GetWindowSizeHints(TwmWindow *tmp)
bool set_window_name(TwmWindow *win)
[Re]set a window's name.
XWMHints * munge_wmhints(TwmWindow *win, XWMHints *hints)
Perform whatever adaptations of WM_HINTS info we do.
void DisplayPosition(const TwmWindow *_unused_tmp_win, int x, int y)
bool visible(const TwmWindow *tmp_win)
void MoveResizeSizeWindow(int x, int y, unsigned int width, unsigned int height)
TwmWindow * GetTwmWindow(Window w)
void ConstrainByBorders(TwmWindow *twmwin, int *left, int width, int *top, int height)
XWMHints * gen_synthetic_wmhints(TwmWindow *win)
void FetchWmProtocols(TwmWindow *tmp)
void TryToGrid(TwmWindow *tmp_win, int *x, int *y)
void TryToPack(TwmWindow *tmp_win, int *x, int *y)
char * GetWMPropertyString(Window w, Atom prop)
void GetGravityOffsets(TwmWindow *tmp, int *xp, int *yp)
bool set_window_icon_name(TwmWindow *win)
[Re]set a window's icon name.
WindowBox * findWindowBox(TwmWindow *twmwin)
void ConstrainedToWinBox(TwmWindow *twmwin, int x, int y, int *nx, int *ny)
void WMapAddWindow(TwmWindow *win)
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.