RCS file: RCS/events.c,v retrieving revision 1.1 diff -c -r1.1 events.c *** /tmp/,RCSt1007576 Mon Jun 25 16:19:16 1990 --- events.c Sat Jun 23 17:18:31 1990 *************** *** 510,516 **** /* weed out the functions that don't make sense to execute * from a key press */ ! if (key->func == F_MOVE || key->func == F_RESIZE) return; if (key->cont != C_NAME) --- 510,517 ---- /* weed out the functions that don't make sense to execute * from a key press */ ! if (key->func == F_MOVE || key->func == F_RESIZE || ! key->func == F_NEWICONIFY) return; if (key->cont != C_NAME) *************** *** 1505,1511 **** { Action = ActiveItem->action; if (ActiveItem->func == F_MOVE || ! ActiveItem->func == F_FORCEMOVE) ButtonPressed = -1; ExecuteFunction(ActiveItem->func, ActiveItem->action, ButtonWindow ? ButtonWindow->frame : NULL, --- 1506,1513 ---- { Action = ActiveItem->action; if (ActiveItem->func == F_MOVE || ! ActiveItem->func == F_FORCEMOVE || ! ActiveItem->func == F_NEWICONIFY) ButtonPressed = -1; ExecuteFunction(ActiveItem->func, ActiveItem->action, ButtonWindow ? ButtonWindow->frame : NULL, =================================================================== RCS file: RCS/menus.c,v retrieving revision 1.1 diff -c -r1.1 menus.c *** /tmp/,RCSt1007576 Mon Jun 25 16:20:06 1990 --- menus.c Sat Jun 23 17:46:59 1990 *************** *** 62,67 **** --- 62,68 ---- MenuRoot *ActiveMenu = NULL; /* the active menu */ MenuItem *ActiveItem = NULL; /* the active menu item */ int MoveFunction; /* either F_MOVE or F_FORCEMOVE */ + /* or F_NEWICONIFY */ int WindowMoved = FALSE; int ConstMove = FALSE; /* constrained move variables */ *************** *** 1354,1362 **** return TRUE; fullzoom(tmp_win, func); break; ! case F_MOVE: case F_FORCEMOVE: if (DeferExecution(context, func, Scr->MoveCursor)) return TRUE; --- 1355,1398 ---- return TRUE; fullzoom(tmp_win, func); break; ! ! case F_PUSHUP: ! case F_PUSHDOWN: ! case F_PUSHRIGHT: ! case F_PUSHLEFT: ! if (DeferExecution(context, func, Scr->MoveCursor)) ! return TRUE; ! { ! int dx = 0, dy = 0; ! switch (func) { ! case F_PUSHUP: ! dy = -1; ! break; ! case F_PUSHDOWN: ! dy = 1; ! break; ! case F_PUSHRIGHT: ! dx = 1; ! break; ! case F_PUSHLEFT: ! dy = -1; ! break; ! } ! if (Scr->PushRelative) { ! dx = dx * (tmp_win->frame_width / Scr->Push); ! dy = dy * (tmp_win->frame_height / Scr->Push); ! } else { ! dx = dx * Scr->Push; ! dy = dy * Scr->Push; ! } ! SetupWindow(tmp_win, tmp_win->frame_x+dx, tmp_win->frame_y+dy, ! tmp_win->frame_width, tmp_win->frame_height, -1); ! } ! break; ! case F_MOVE: case F_FORCEMOVE: + case F_NEWICONIFY: if (DeferExecution(context, func, Scr->MoveCursor)) return TRUE; *************** *** 1378,1384 **** ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | PointerMotionHintMask, GrabModeAsync, GrabModeAsync, ! Scr->Root, Scr->MoveCursor, CurrentTime); if (context == C_ICON && tmp_win->icon_w) { --- 1414,1421 ---- ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | PointerMotionHintMask, GrabModeAsync, GrabModeAsync, ! (func == F_NEWICONIFY) ? None : Scr->Root, ! Scr->MoveCursor, CurrentTime); if (context == C_ICON && tmp_win->icon_w) { *************** *** 1397,1402 **** --- 1434,1442 ---- w = tmp_win->frame; } + if (func == F_NEWICONIFY) + DragX = DragY = 0; + DragWindow = None; XGetGeometry(dpy, w, &JunkRoot, &origDragX, &origDragY, *************** *** 1521,1526 **** --- 1561,1572 ---- if (Event.type == ButtonRelease) { MoveOutline(rootw, 0, 0, 0, 0, 0, 0); + if (WindowMoved && func == F_NEWICONIFY) { + if (tmp_win->icon) + DeIconify(tmp_win); + else + Iconify(tmp_win, 0, 0); + } if (moving_icon && ((CurrentDragX != origDragX || CurrentDragY != origDragY))) *************** *** 1541,1546 **** --- 1587,1613 ---- abs(eventp->xmotion.y_root - origY) < Scr->MoveDelta) continue; + if (!WindowMoved && func == F_NEWICONIFY) { + if (tmp_win->icon) { + if (context == C_ICON) + context = C_WINDOW; + w = tmp_win->frame; + } else { + if (tmp_win->icon_w == NULL) + CreateIconWindow(tmp_win, + eventp->xbutton.x_root, + eventp->xbutton.y_root); + moving_icon = TRUE; + context = C_ICON; + w = tmp_win->icon_w; + } + MoveFunction = F_MOVE; + XGetGeometry(dpy, w, &JunkRoot, &origDragX, &origDragY, + (unsigned int *)&DragWidth, + (unsigned int *)&DragHeight, &JunkBW, + &JunkDepth); + } + WindowMoved = TRUE; DragWindow = w; *************** *** 1599,1605 **** } CurrentDragX = xl; CurrentDragY = yt; ! if (Scr->OpaqueMove) XMoveWindow(dpy, DragWindow, xl, yt); else MoveOutline(eventp->xmotion.root, xl, yt, w, h, --- 1666,1672 ---- } CurrentDragX = xl; CurrentDragY = yt; ! if (Scr->OpaqueMove && (func != F_NEWICONIFY)) XMoveWindow(dpy, DragWindow, xl, yt); else MoveOutline(eventp->xmotion.root, xl, yt, w, h, *************** *** 1634,1640 **** CurrentDragX = xl; CurrentDragY = yt; ! if (Scr->OpaqueMove) XMoveWindow(dpy, DragWindow, xl, yt); else MoveOutline(eventp->xmotion.root, xl, yt, w, h, --- 1701,1707 ---- CurrentDragX = xl; CurrentDragY = yt; ! if (Scr->OpaqueMove && (func != F_NEWICONIFY)) XMoveWindow(dpy, DragWindow, xl, yt); else MoveOutline(eventp->xmotion.root, xl, yt, w, h, *************** *** 2092,2097 **** --- 2159,2165 ---- case F_RESIZE: case F_MOVE: case F_FORCEMOVE: + case F_NEWICONIFY: case F_DEICONIFY: case F_ICONIFY: case F_RAISELOWER: =================================================================== RCS file: RCS/parse.c,v retrieving revision 1.1 diff -c -r1.1 parse.c *** /tmp/,RCSt1007576 Mon Jun 25 16:20:52 1990 --- parse.c Sat Jun 23 17:40:00 1990 *************** *** 314,320 **** --- 314,324 ---- #define kw0_NoCaseSensitive 23 #define kw0_NoRaiseOnWarp 24 #define kw0_WarpUnmapped 25 + /* New - TYT */ + #define kw0_PushRelative 26 + #define kw0_UwmResize 27 + #define kws_UsePPosition 1 #define kws_IconFont 2 #define kws_ResizeFont 3 *************** *** 334,339 **** --- 338,345 ---- #define kwn_BorderWidth 7 #define kwn_IconBorderWidth 8 #define kwn_TitleButtonBorderWidth 9 + /* New --- TYT */ + #define kwn_Push 10 #define kwcl_BorderColor 1 #define kwcl_IconManagerHighlight 2 *************** *** 421,429 **** --- 427,440 ---- { "f.lower", FKEYWORD, F_LOWER }, { "f.menu", FSKEYWORD, F_MENU }, { "f.move", FKEYWORD, F_MOVE }, + { "f.newiconify", FKEYWORD, F_NEWICONIFY }, { "f.nexticonmgr", FKEYWORD, F_NEXTICONMGR }, { "f.nop", FKEYWORD, F_NOP }, { "f.previconmgr", FKEYWORD, F_PREVICONMGR }, + { "f.pushdown", FKEYWORD, F_PUSHDOWN }, + { "f.pushleft", FKEYWORD, F_PUSHLEFT }, + { "f.pushright", FKEYWORD, F_PUSHRIGHT }, + { "f.pushup", FKEYWORD, F_PUSHUP }, { "f.quit", FKEYWORD, F_QUIT }, { "f.raise", FKEYWORD, F_RAISE }, { "f.raiselower", FKEYWORD, F_RAISELOWER }, *************** *** 514,519 **** --- 525,532 ---- { "noversion", KEYWORD, kw0_NoVersion }, { "opaquemove", KEYWORD, kw0_OpaqueMove }, { "pixmaps", PIXMAPS, 0 }, + { "push", NKEYWORD, kwn_Push }, + { "pushrelative", KEYWORD, kw0_PushRelative }, { "r", ROOT, 0 }, { "randomplacement", KEYWORD, kw0_RandomPlacement }, { "resize", RESIZE, 0 }, *************** *** 540,545 **** --- 553,559 ---- { "titlepadding", NKEYWORD, kwn_TitlePadding }, { "unknownicon", SKEYWORD, kws_UnknownIcon }, { "usepposition", SKEYWORD, kws_UsePPosition }, + { "uwmresize", KEYWORD, kw0_UwmResize }, { "w", WINDOW, 0 }, { "wait", WAIT, 0 }, { "warpcursor", WARP_CURSOR, 0 }, *************** *** 687,692 **** --- 701,714 ---- case kw0_WarpUnmapped: Scr->WarpUnmapped = TRUE; return 1; + + case kw0_PushRelative: + Scr->PushRelative = TRUE; + return 1; + + case kw0_UwmResize: + Scr->UwmResize = TRUE; + return 1; } return 0; *************** *** 802,807 **** --- 824,832 ---- if (Scr->FirstTime) Scr->TBInfo.border = num; return 1; + case kwn_Push: + Scr->Push = num; + return 1; } return 0; =================================================================== RCS file: RCS/parse.h,v retrieving revision 1.1 diff -c -r1.1 parse.h *** /tmp/,RCSt1007576 Mon Jun 25 16:21:03 1990 --- parse.h Sat Jun 23 17:33:45 1990 *************** *** 90,95 **** --- 90,100 ---- #define F_CUTFILE 43 #define F_SHOWLIST 44 #define F_HIDELIST 45 + #define F_NEWICONIFY 46 + #define F_PUSHRIGHT 47 + #define F_PUSHLEFT 48 + #define F_PUSHUP 49 + #define F_PUSHDOWN 50 #define F_MENU 101 /* string */ #define F_WARPTO 102 /* string */ =================================================================== RCS file: RCS/resize.c,v retrieving revision 1.1 diff -c -r1.1 resize.c *** /tmp/,RCSt1007576 Mon Jun 25 16:21:07 1990 --- resize.c Sat Jun 23 17:32:33 1990 *************** *** 139,144 **** --- 139,145 ---- { Window junkRoot; unsigned int junkbw, junkDepth; + int sizex, sizey, size_width, size_height; ResizeWindow = tmp_win->frame; XGrabServer(dpy); *************** *** 162,171 **** if (Scr->AutoRelativeResize && !fromtitlebar) do_auto_clamp (tmp_win, evp); Scr->SizeStringOffset = SIZE_HINDENT; ! XResizeWindow (dpy, Scr->SizeWindow, ! Scr->SizeStringWidth + SIZE_HINDENT * 2, ! Scr->SizeFont.height + SIZE_VINDENT * 2); XMapRaised(dpy, Scr->SizeWindow); InstallRootColormap(); last_width = 0; --- 163,194 ---- if (Scr->AutoRelativeResize && !fromtitlebar) do_auto_clamp (tmp_win, evp); + /* + * New code to position to the sizing window somewhere sane + */ + + size_width = Scr->SizeStringWidth + SIZE_HINDENT * 2; + size_height = Scr->SizeFont.height + SIZE_VINDENT * 2; + if (Scr->UwmResize) { + sizex = tmp_win->frame_x + (tmp_win->frame_width - size_width)/2; + sizey = tmp_win->frame_y + (tmp_win->frame_height - size_height)/2; + if (clampTop) + sizey = tmp_win->frame_y + tmp_win->frame_height + - size_height; + if (clampBottom) + sizey = tmp_win->frame_y; + if (clampLeft) + sizex = tmp_win->frame_x + tmp_win->frame_width + - size_width; + if (clampRight) + sizex = tmp_win->frame_x; + } else + sizex = sizey = 0; + + XMoveWindow(dpy, Scr->SizeWindow, sizex, sizey); + Scr->SizeStringOffset = SIZE_HINDENT; ! XResizeWindow (dpy, Scr->SizeWindow, size_width, size_height); XMapRaised(dpy, Scr->SizeWindow); InstallRootColormap(); last_width = 0; *************** *** 418,423 **** --- 441,447 ---- fprintf(stderr, "EndResize\n"); #endif + XMoveWindow(dpy, Scr->SizeWindow, 0, 0); /* Restore location of window */ MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0); XUnmapWindow(dpy, Scr->SizeWindow); =================================================================== RCS file: RCS/screen.h,v retrieving revision 1.1 diff -c -r1.1 screen.h *** /tmp/,RCSt1007576 Mon Jun 25 16:21:20 1990 --- screen.h Sat Jun 23 17:29:38 1990 *************** *** 202,207 **** --- 202,208 ---- int TitlePadding; /* distance between items in titlebar */ int ButtonIndent; /* amount to shrink buttons on each side */ int NumAutoRaises; /* number of autoraise windows on screen */ + int Push; /* How much we should push windows - TYT */ short NoDefaults; /* do not add in default UI stuff */ short UsePPosition; /* what do with PPosition, see values below */ short AutoRelativeResize; /* start resize relative to position in quad */ *************** *** 240,246 **** short FirstTime; /* first time we've read .twmrc */ short CaseSensitive; /* be case-sensitive when sorting names */ short WarpUnmapped; /* allow warping to unmapped windows */ ! FuncKey FuncKeyRoot; } ScreenInfo; --- 241,250 ---- short FirstTime; /* first time we've read .twmrc */ short CaseSensitive; /* be case-sensitive when sorting names */ short WarpUnmapped; /* allow warping to unmapped windows */ ! short PushRelative; /* Push windows relative to their size */ ! short UwmResize; /* Resize windows uwm style */ ! /* (with the sizing window in the */ ! /* right place) */ FuncKey FuncKeyRoot; } ScreenInfo; =================================================================== RCS file: RCS/twm.c,v retrieving revision 1.1 diff -c -r1.1 twm.c *** /tmp/,RCSt1007576 Mon Jun 25 16:21:30 1990 --- twm.c Sat Jun 23 17:30:03 1990 *************** *** 626,631 **** --- 626,635 ---- Scr->HaveFonts = FALSE; /* i.e. not loaded yet */ Scr->CaseSensitive = TRUE; Scr->WarpUnmapped = FALSE; + /* NEW - TYT */ + Scr->UwmResize = FALSE; + Scr->PushRelative = FALSE; + Scr->Push = 1; /* setup default fonts; overridden by defaults from system.twmrc */ #define DEFAULT_NICE_FONT "variable"