home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
x
/
volume13
/
tvtwm
/
patch6
/
patch.6
Wrap
Text File
|
1991-07-05
|
16KB
|
588 lines
tvtwm patch 6
The complete tar file includes a new utility called swmxlate. It can
be used to translate relative corrdinates into absolute coordinates. One
possible use would be:
xterm -geom `swmxlate -geom +200+100`
This would position the xterm at location +200+100 relative to where the
virtual desktop is currently positioned.
This patch fixes the following problems:
1. Fixes "phantom window frame" problems.
2. Bug fixes to window move cleanup.
3. Added gridded movement in panner. Try starting a pan operation and then
hold down the shift key. (Salvador Pinto Abreu spa@fct.unl.pt)
4. Fixes the crash problem when multiple mouse buttons are pressed.
diff -c old/events.c new/events.c
*** old/events.c Tue Apr 23 08:17:12 1991
--- new/events.c Wed Jun 12 09:06:08 1991
***************
*** 33,38 ****
--- 33,41 ----
* twm event handling
*
* $Log: events.c,v $
+ * Revision 10.0 91/06/12 09:05:31 toml
+ * Revision bump
+ *
* Revision 9.0 91/04/23 07:40:32 toml
* Revision bump
*
diff -c old/icons.c new/icons.c
*** old/icons.c Tue Apr 23 08:17:13 1991
--- new/icons.c Wed Jun 12 09:06:09 1991
***************
*** 26,31 ****
--- 26,34 ----
* Icon releated routines
*
* $Log: icons.c,v $
+ * Revision 10.0 91/06/12 09:05:35 toml
+ * Revision bump
+ *
* Revision 9.0 91/04/23 07:40:37 toml
* Revision bump
*
diff -c old/menus.c new/menus.c
*** old/menus.c Tue Apr 23 08:17:14 1991
--- new/menus.c Wed Jun 12 09:06:10 1991
***************
*** 33,38 ****
--- 33,44 ----
* twm menu code
*
* $Log: menus.c,v $
+ * Revision 10.0 91/06/12 09:05:38 toml
+ * Revision bump
+ *
+ * Revision 9.1 91/05/14 11:27:44 toml
+ * Fixed crash problem and removed #include "malloc.h"
+ *
* Revision 9.0 91/04/23 07:40:40 toml
* Revision bump
*
***************
*** 94,100 ****
#include "vdt.h"
#include "add_window.h"
#include "patchlevel.h"
- #include "malloc.h"
#include <X11/Xmu/CharSet.h>
extern XEvent Event;
--- 100,105 ----
***************
*** 569,576 ****
}
! /* if we haven't recieved the enter notify yet, wait */
! if (ActiveMenu && !ActiveMenu->entered)
continue;
done = FALSE;
--- 574,581 ----
}
! /* if we haven't received the enter notify yet, wait */
! if (!ActiveMenu || !ActiveMenu->entered)
continue;
done = FALSE;
diff -c old/move.c new/move.c
*** old/move.c Tue Apr 23 08:17:15 1991
--- new/move.c Wed Jun 12 09:06:10 1991
***************
*** 327,340 ****
/* put up the initial outline if adding a window */
if (*first && adding)
! doMove(tmp_win, window, *x_root, *y_root, &xdest, &ydest);
while (True) {
getPointer(outlineWindow, x_root, y_root, cancel, &done, first, adding, pulldown);
! if (done)
break;
if (!*cancel)
! doMove(tmp_win, window, *x_root, *y_root, &xdest, &ydest, panner);
}
*x_root = xdest;
--- 327,342 ----
/* put up the initial outline if adding a window */
if (*first && adding)
! doMove(tmp_win, window, *x_root, *y_root, &xdest, &ydest, True);
while (True) {
getPointer(outlineWindow, x_root, y_root, cancel, &done, first, adding, pulldown);
! if (done) {
! doMove(tmp_win, window, *x_root, *y_root, &xdest, &ydest, panner, False);
break;
+ }
if (!*cancel)
! doMove(tmp_win, window, *x_root, *y_root, &xdest, &ydest, panner, True);
}
*x_root = xdest;
***************
*** 342,348 ****
}
static void
! doMove(tmp_win, window, x_root, y_root, x_dest, y_dest, panner)
TwmWindow *tmp_win;
Window window;
int x_root;
--- 344,350 ----
}
static void
! doMove(tmp_win, window, x_root, y_root, x_dest, y_dest, panner, paint)
TwmWindow *tmp_win;
Window window;
int x_root;
***************
*** 350,355 ****
--- 352,358 ----
int *x_dest;
int *y_dest;
int panner;
+ int paint;
{
int xl, yt;
int deltax, deltay;
***************
*** 385,422 ****
yt = vdty + Scr->MyDisplayHeight - dragHeight;
}
! if (Scr->VirtualDesktop && Scr->OpaqueMove && !tmp_win->sticky) {
! if (panner == IN_PANNER) {
! if (window == tmp_win->virtualWindow) {
! actual = tmp_win->frame;
! virtual = tmp_win->virtualWindow;
}
! else {
! actual = tmp_win->icon_w;
! virtual = tmp_win->virtualIcon;
! }
! }
! else {
! if (window == tmp_win->frame) {
! actual = tmp_win->frame;
! virtual = tmp_win->virtualWindow;
! }
! else {
! actual = tmp_win->icon_w;
! virtual = tmp_win->virtualIcon;
! }
! }
! if (panner == IN_PANNER)
! XMoveWindow(dpy, actual, xl*Scr->PannerScale, yt*Scr->PannerScale);
! else
! XMoveWindow(dpy, virtual, xl/Scr->PannerScale, yt/Scr->PannerScale);
}
- if (Scr->OpaqueMove)
- XMoveWindow(dpy, window, xl, yt);
- else
- MoveOutline(outlineWindow, xl, yt, dragWidth, dragHeight, 0, titleHeight);
-
*x_dest = xl;
*y_dest = yt;
}
--- 388,427 ----
yt = vdty + Scr->MyDisplayHeight - dragHeight;
}
! if (paint) {
! if (Scr->VirtualDesktop && Scr->OpaqueMove && !tmp_win->sticky) {
! if (panner == IN_PANNER) {
! if (window == tmp_win->virtualWindow) {
! actual = tmp_win->frame;
! virtual = tmp_win->virtualWindow;
! }
! else {
! actual = tmp_win->icon_w;
! virtual = tmp_win->virtualIcon;
! }
! }
! else {
! if (window == tmp_win->frame) {
! actual = tmp_win->frame;
! virtual = tmp_win->virtualWindow;
! }
! else {
! actual = tmp_win->icon_w;
! virtual = tmp_win->virtualIcon;
! }
! }
! if (panner == IN_PANNER)
! XMoveWindow(dpy, actual, xl*Scr->PannerScale, yt*Scr->PannerScale);
! else
! XMoveWindow(dpy, virtual, xl/Scr->PannerScale, yt/Scr->PannerScale);
}
!
! if (Scr->OpaqueMove)
! XMoveWindow(dpy, window, xl, yt);
! else
! MoveOutline(outlineWindow, xl, yt, dragWidth, dragHeight, 0, titleHeight);
}
*x_dest = xl;
*y_dest = yt;
}
***************
*** 434,439 ****
--- 439,445 ----
Window junkChild;
int doingFine;
XEvent event,bakevent;
+
int xdest, ydest;
unsigned mask;
static int buttons;
***************
*** 445,451 ****
doingFine = True;
while (doingFine) {
! XNextEvent(dpy, &event);
switch (event.type) {
case ButtonPress:
if (pulldown) {
--- 451,458 ----
doingFine = True;
while (doingFine) {
! XMaskEvent(dpy, ButtonPressMask|ButtonReleaseMask|PointerMotionMask|
! EnterWindowMask|LeaveWindowMask|ExposureMask, &event);
switch (event.type) {
case ButtonPress:
if (pulldown) {
***************
*** 534,543 ****
doingFine = False;
}
break;
! default: bakevent = Event;
! Event=event;
! DispatchEvent();
! Event=bakevent;
}
}
}
--- 541,554 ----
doingFine = False;
}
break;
!
! /* handle other generic events here */
! case Expose:
! bakevent = Event;
! Event=event;
! DispatchEvent();
! Event=bakevent;
! break;
}
}
}
diff -c old/patchlevel.h new/patchlevel.h
*** old/patchlevel.h Tue Apr 23 08:17:15 1991
--- new/patchlevel.h Wed Jun 12 09:06:10 1991
***************
*** 1 ****
! #define PATCHLEVEL 5
--- 1 ----
! #define PATCHLEVEL 6
diff -c old/resize.c new/resize.c
*** old/resize.c Tue Apr 23 08:17:16 1991
--- new/resize.c Wed Jun 12 09:06:11 1991
***************
*** 33,38 ****
--- 33,41 ----
* window resizing borrowed from the "wm" window manager
*
* $Log: resize.c,v $
+ * Revision 10.0 91/06/12 09:05:43 toml
+ * Revision bump
+ *
* Revision 9.0 91/04/23 07:40:45 toml
* Revision bump
*
diff -c old/tvtwm.man new/tvtwm.man
*** old/tvtwm.man Tue Apr 23 08:17:17 1991
--- new/tvtwm.man Wed Jun 12 09:06:12 1991
***************
*** 717,723 ****
.IP "\fBPannerGeometry\fP \fIstring\fP" 8
This variable specifies the position of the Virtual Desktop panner.
The default geometry is "-0-0".
! .IP \"fBPannerOpaqueScroll\fP" 8
This variable causes the panner to scroll the Virtual Desktop
opaquely. This variable only takes effect if the \fBStickyAbove\fP
variable is also set.
--- 717,723 ----
.IP "\fBPannerGeometry\fP \fIstring\fP" 8
This variable specifies the position of the Virtual Desktop panner.
The default geometry is "-0-0".
! .IP "\fBPannerOpaqueScroll\fP" 8
This variable causes the panner to scroll the Virtual Desktop
opaquely. This variable only takes effect if the \fBStickyAbove\fP
variable is also set.
***************
*** 810,816 ****
is given, only those windows will be started iconic. This is useful for
programs that do not support an \fI-iconic\fP command line option or
resource.
! .IP \"fBStayUpMenus" 8
This variable alters menu interaction. By default, a menu item is selected
when a mouse button is released over it. This variable causes menu itmes to
be selected on the next button press event.
--- 810,816 ----
is given, only those windows will be started iconic. This is useful for
programs that do not support an \fI-iconic\fP command line option or
resource.
! .IP "\fBStayUpMenus\fP" 8
This variable alters menu interaction. By default, a menu item is selected
when a mouse button is released over it. This variable causes menu itmes to
be selected on the next button press event.
diff -c old/twm.c new/twm.c
*** old/twm.c Tue Apr 23 08:17:17 1991
--- new/twm.c Wed Jun 12 09:06:12 1991
***************
*** 33,38 ****
--- 33,41 ----
* twm - "Tom's Window Manager"
*
* $Log: twm.c,v $
+ * Revision 10.0 91/06/12 09:05:48 toml
+ * Revision bump
+ *
* Revision 9.0 91/04/23 07:40:51 toml
* Revision bump
*
diff -c old/vdt.c new/vdt.c
*** old/vdt.c Tue Apr 23 08:17:17 1991
--- new/vdt.c Wed Jun 12 09:06:12 1991
***************
*** 28,33 ****
--- 28,39 ----
* $XConsortium: vdt.c,v 1.140 90/03/23 11:42:33 jim Exp $
*
* $Log: vdt.c,v $
+ * Revision 10.0 91/06/12 09:05:53 toml
+ * Revision bump
+ *
+ * Revision 9.1 91/06/12 08:39:24 toml
+ * Added patch to do gridded movement in panner
+ *
* Revision 9.0 91/04/23 07:40:54 toml
* Revision bump
*
***************
*** 666,672 ****
--- 672,681 ----
while (XCheckTypedWindowEvent (dpy, Scr->Panner, Expose, &dummy)) ;
}
+ #define GridMask (ShiftMask | ControlMask | Mod1Mask | Mod2Mask)
+
static int pannerButton = 0;
+ static int use_grid = 0;
void
HandlePannerButtonPress(ev)
***************
*** 691,696 ****
--- 700,707 ----
{
if (ev->xbutton.button == pannerButton) {
pannerButton = 0;
+ use_grid = ev->xmotion.state & GridMask;
+
XDrawRectangle(dpy, Scr->Panner, Scr->DrawGC,
Scr->PannerOutlineX, Scr->PannerOutlineY,
Scr->PannerOutlineWidth, Scr->PannerOutlineHeight);
***************
*** 699,709 ****
Scr->PannerOutlineX, Scr->PannerOutlineY,
Scr->PannerOutlineWidth, Scr->PannerOutlineHeight);
! MoveDesktop(Scr->PannerOutlineX * Scr->PannerScale,
! Scr->PannerOutlineY * Scr->PannerScale);
}
}
void
HandlePannerMotionNotify(ev)
XEvent *ev;
--- 710,737 ----
Scr->PannerOutlineX, Scr->PannerOutlineY,
Scr->PannerOutlineWidth, Scr->PannerOutlineHeight);
! if (use_grid) {
! int xx = Scr->PannerOutlineX * Scr->PannerScale;
! int yy = Scr->PannerOutlineY * Scr->PannerScale;
!
! xx = xx - xx % Scr->MyDisplayWidth;
! yy = yy - yy % Scr->MyDisplayHeight;
! MoveDesktop(xx, yy);
! }
! else {
! MoveDesktop(Scr->PannerOutlineX*Scr->PannerScale,
! Scr->PannerOutlineY*Scr->PannerScale);
! }
}
}
+ static int TRUNCATE(pos, grid)
+ int pos, grid;
+ {
+ pos *= Scr->PannerScale;
+ return ((pos - pos % grid) + Scr->PannerScale - 1) / Scr->PannerScale;
+ }
+
void
HandlePannerMotionNotify(ev)
XEvent *ev;
***************
*** 712,751 ****
int deltaX, deltaY;
int newOutlineX, newOutlineY;
! /* get rid of the last outline */
! XDrawRectangle(dpy, Scr->Panner, Scr->DrawGC,
! Scr->PannerOutlineX, Scr->PannerOutlineY,
! Scr->PannerOutlineWidth, Scr->PannerOutlineHeight);
/* figure out the position of the next outline */
deltaX = ev->xmotion.x - pointerX;
deltaY = ev->xmotion.y - pointerY;
! newOutlineX = Scr->PannerOutlineX + deltaX;
! newOutlineY = Scr->PannerOutlineY + deltaY;
if (newOutlineX < 0)
newOutlineX = 0;
if (newOutlineY < 0)
newOutlineY = 0;
if ((newOutlineX + Scr->PannerOutlineWidth) >= Scr->PannerWidth)
newOutlineX = Scr->PannerWidth - Scr->PannerOutlineWidth - 1;
if ((newOutlineY + Scr->PannerOutlineHeight) >= Scr->PannerHeight)
newOutlineY = Scr->PannerHeight - Scr->PannerOutlineHeight - 1;
! pointerX = ev->xmotion.x;
! pointerY = ev->xmotion.y;
! Scr->PannerOutlineX = newOutlineX;
! Scr->PannerOutlineY = newOutlineY;
! /* draw the new outline */
! XDrawRectangle(dpy, Scr->Panner, Scr->DrawGC,
! Scr->PannerOutlineX, Scr->PannerOutlineY,
! Scr->PannerOutlineWidth, Scr->PannerOutlineHeight);
while(XCheckTypedEvent(dpy,MotionNotify,&dummyev));
! if (Scr->PannerOpaqueScroll && Scr->StickyAbove)
! MoveDesktop(Scr->PannerOutlineX*Scr->PannerScale,
! Scr->PannerOutlineY*Scr->PannerScale);
}
--- 740,811 ----
int deltaX, deltaY;
int newOutlineX, newOutlineY;
! use_grid = ev->xmotion.state & GridMask;
/* figure out the position of the next outline */
deltaX = ev->xmotion.x - pointerX;
deltaY = ev->xmotion.y - pointerY;
! if (use_grid) {
! newOutlineX = ev->xmotion.x;
! newOutlineY = ev->xmotion.y;
! }
! else {
! newOutlineX = Scr->PannerOutlineX + deltaX;
! newOutlineY = Scr->PannerOutlineY + deltaY;
! }
if (newOutlineX < 0)
newOutlineX = 0;
if (newOutlineY < 0)
newOutlineY = 0;
+
+ if (use_grid) {
+ newOutlineX = TRUNCATE (newOutlineX, Scr->MyDisplayWidth);
+ newOutlineY = TRUNCATE (newOutlineY, Scr->MyDisplayHeight);
+ }
+
if ((newOutlineX + Scr->PannerOutlineWidth) >= Scr->PannerWidth)
newOutlineX = Scr->PannerWidth - Scr->PannerOutlineWidth - 1;
if ((newOutlineY + Scr->PannerOutlineHeight) >= Scr->PannerHeight)
newOutlineY = Scr->PannerHeight - Scr->PannerOutlineHeight - 1;
! if (Scr->PannerOutlineX != newOutlineX ||
! Scr->PannerOutlineY != newOutlineY) {
! pointerX = ev->xmotion.x;
! pointerY = ev->xmotion.y;
! /* get rid of the last outline */
! XDrawRectangle(dpy, Scr->Panner, Scr->DrawGC,
! Scr->PannerOutlineX, Scr->PannerOutlineY,
! Scr->PannerOutlineWidth, Scr->PannerOutlineHeight);
!
! Scr->PannerOutlineX = newOutlineX;
! Scr->PannerOutlineY = newOutlineY;
!
! /* draw the new outline */
! XDrawRectangle(dpy, Scr->Panner, Scr->DrawGC,
! Scr->PannerOutlineX, Scr->PannerOutlineY,
! Scr->PannerOutlineWidth, Scr->PannerOutlineHeight);
! }
while(XCheckTypedEvent(dpy,MotionNotify,&dummyev));
!
! if ((Scr->PannerOpaqueScroll && Scr->StickyAbove) ||
! (Scr->PannerOutlineX != newOutlineX ||
! Scr->PannerOutlineY != newOutlineY)) {
! if (use_grid) {
! int xx = Scr->PannerOutlineX * Scr->PannerScale;
! int yy = Scr->PannerOutlineY * Scr->PannerScale;
!
! xx = xx - xx % Scr->MyDisplayWidth;
! yy = yy - yy % Scr->MyDisplayHeight;
! MoveDesktop(xx, yy);
! }
! else {
! MoveDesktop(Scr->PannerOutlineX*Scr->PannerScale,
! Scr->PannerOutlineY*Scr->PannerScale);
! }
! }
}
diff -c old/version.c new/version.c
*** old/version.c Tue Apr 23 08:17:18 1991
--- new/version.c Wed Jun 12 09:06:13 1991
***************
*** 26,30 ****
/*****************************************************************************/
/* char *Version = "MIT X Consortium, R4"; */
! char *Version = "$Revision: 9.0 $";
--- 26,30 ----
/*****************************************************************************/
/* char *Version = "MIT X Consortium, R4"; */
! char *Version = "$Revision: 10.0 $";