From eb039dc872e4ffc14ef0e0d5fc58305713f6e1be Mon Sep 17 00:00:00 2001 From: Mike Small Date: Thu, 23 Aug 2018 00:27:04 -0400 Subject: [PATCH] Remove opaquemove option. Always use wire frame. --- man/twmruined.man | 10 ++---- src/events.c | 16 +++------ src/menus.c | 86 +++++++++++++++++++---------------------------- src/parse.c | 6 ---- src/screen.h | 1 - src/twm.c | 1 - 6 files changed, 40 insertions(+), 80 deletions(-) diff --git a/man/twmruined.man b/man/twmruined.man index 9d5f6cd..9aa162e 100644 --- a/man/twmruined.man +++ b/man/twmruined.man @@ -508,7 +508,7 @@ titlebuttons and bindings. This option should only be used if the startup file contains a completely new set of bindings and definitions. .IP "\fBNoGrabServer\fP" 8 This variable indicates that \fItwmruined\fP should not grab the server -when popping up menus and moving opaque windows. +when popping up menus. .IP "\fBNoMenuShadows\fP" 8 This variable indicates that menus should not have drop shadows drawn behind them. This is typically used with slower servers since it speeds up menu @@ -550,11 +550,6 @@ the pointer is moved quickly and \fItwmruined\fP is slow to respond, input can b directed to the old window instead of the new. This option is typically used to prevent this ``input lag'' and to work around bugs in older applications that have problems with focus events. -.IP "\fBOpaqueMove\fP" 8 -This variable indicates that the \fBf.move\fP function should actually move -the window instead of just an outline so that the user can immediately see -what the window will look like in the new position. This option is typically -used on fast displays (particularly if \fBNoGrabServer\fP is set). .IP "\fBPriority\fP \fIpriority\fP" 8 This variable sets \fItwmruined\fP's priority. \fIpriority\fP should be an unquoted, signed number (e.g. 999). This variable has an effect only @@ -881,8 +876,7 @@ This function lowers the selected window. This function invokes the menu specified by the argument \fIstring\fP. Cascaded menus may be built by nesting calls to \fBf.menu\fP. .IP "\fBf.move\fP" 8 -This function drags an outline of the selected window (or the window itself -if the \fBOpaqueMove\fP variable is set) until the invoking pointer button +This function drags an outline of the selected window until the invoking pointer button is released. Double clicking within the number of milliseconds given by \fBConstrainedMoveTime\fP warps the pointer to the center of the window and diff --git a/src/events.c b/src/events.c index 45fc80f..8e201b8 100644 --- a/src/events.c +++ b/src/events.c @@ -1520,13 +1520,10 @@ HandleButtonRelease(void) else XMoveWindow (dpy, DragWindow, xl, yt); - if (!Scr->NoRaiseMove && !Scr->OpaqueMove) /* opaque already did */ + if (!Scr->NoRaiseMove) XRaiseWindow(dpy, DragWindow); - if (!Scr->OpaqueMove) - UninstallRootColormap(); - else - XSync(dpy, 0); + UninstallRootColormap(); if (Scr->NumAutoRaises) { enter_flag = TRUE; @@ -1669,22 +1666,17 @@ HandleButtonPress(void) if (ButtonPressed != -1 && !InfoLines) /* want menus if we have info box */ { - /* we got another butt press in addition to one still held + /* we got another button press in addition to one still held * down, we need to cancel the operation we were doing */ Cancel = TRUE; CurrentDragX = origDragX; CurrentDragY = origDragY; if (!menuFromFrameOrWindowOrTitlebar) { - if (Scr->OpaqueMove && DragWindow != None) { - XMoveWindow (dpy, DragWindow, origDragX, origDragY); - } else { MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0); - } } XUnmapWindow(dpy, Scr->SizeWindow); - if (!Scr->OpaqueMove) - UninstallRootColormap(); + UninstallRootColormap(); ResizeWindow = None; DragWindow = None; cur = LeftButt; diff --git a/src/menus.c b/src/menus.c index 4283b4b..fdc9c11 100644 --- a/src/menus.c +++ b/src/menus.c @@ -1474,9 +1474,7 @@ ExecuteFunction(int func, const char *action, Window w, TwmWindow *tmp_win, EventHandler[EnterNotify] = HandleUnknown; EventHandler[LeaveNotify] = HandleUnknown; - if (!Scr->NoGrabServer || !Scr->OpaqueMove) { - XGrabServer(dpy); - } + XGrabServer(dpy); XGrabPointer(dpy, eventp->xbutton.root, True, ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | PointerMotionMask, /* PointerMotionHintMask */ @@ -1540,32 +1538,29 @@ ExecuteFunction(int func, const char *action, Window w, TwmWindow *tmp_win, } last_time = eventp->xbutton.time; - if (!Scr->OpaqueMove) + InstallRootColormap(); + if (!Scr->MoveDelta) { - InstallRootColormap(); - if (!Scr->MoveDelta) - { - /* - * Draw initial outline. This was previously done the - * first time though the outer loop by dropping out of - * the XCheckMaskEvent inner loop down to one of the - * MoveOutline's below. - */ - MoveOutline(rootw, - origDragX - JunkBW, origDragY - JunkBW, - DragWidth + 2 * JunkBW, DragHeight + 2 * JunkBW, - tmp_win->frame_bw, - moving_icon ? 0 : tmp_win->title_height); - /* - * This next line causes HandleReleaseNotify to call - * XRaiseWindow(). This is solely to preserve the - * previous behaviour that raises a window being moved - * on button release even if you never actually moved - * any distance (unless you move less than MoveDelta or - * NoRaiseMove is set or OpaqueMove is set). - */ - DragWindow = w; - } + /* + * Draw initial outline. This was previously done the + * first time though the outer loop by dropping out of + * the XCheckMaskEvent inner loop down to one of the + * MoveOutline's below. + */ + MoveOutline(rootw, + origDragX - JunkBW, origDragY - JunkBW, + DragWidth + 2 * JunkBW, DragHeight + 2 * JunkBW, + tmp_win->frame_bw, + moving_icon ? 0 : tmp_win->title_height); + /* + * This next line causes HandleReleaseNotify to call + * XRaiseWindow(). This is solely to preserve the + * previous behaviour that raises a window being moved + * on button release even if you never actually moved + * any distance (unless you move less than MoveDelta or + * NoRaiseMove is set). + */ + DragWindow = w; } /* @@ -1609,10 +1604,7 @@ ExecuteFunction(int func, const char *action, Window w, TwmWindow *tmp_win, /* test to see if we have a second button press to abort move */ if (!menuFromFrameOrWindowOrTitlebar && !MovedFromKeyPress) { if (Event.type == ButtonPress && DragWindow != None) { - if (Scr->OpaqueMove) - XMoveWindow (dpy, DragWindow, origDragX, origDragY); - else - MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0); + MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0); DragWindow = None; } } @@ -1631,9 +1623,8 @@ ExecuteFunction(int func, const char *action, Window w, TwmWindow *tmp_win, if (Cancel) { WindowMoved = FALSE; - if (!Scr->OpaqueMove) - UninstallRootColormap(); - return TRUE; /* XXX should this be FALSE? */ + UninstallRootColormap(); + return TRUE; /* XXX should this be FALSE? */ } if (Event.type == releaseEvent) { @@ -1642,7 +1633,7 @@ ExecuteFunction(int func, const char *action, Window w, TwmWindow *tmp_win, ((CurrentDragX != origDragX || CurrentDragY != origDragY))) tmp_win->icon_moved = TRUE; - if (!Scr->OpaqueMove && menuFromFrameOrWindowOrTitlebar) + if (menuFromFrameOrWindowOrTitlebar) XMoveWindow(dpy, DragWindow, Event.xbutton.x_root - DragWidth / 2, Event.xbutton.y_root - DragHeight / 2); @@ -1665,9 +1656,6 @@ ExecuteFunction(int func, const char *action, Window w, TwmWindow *tmp_win, WindowMoved = TRUE; DragWindow = w; - if (!Scr->NoRaiseMove && Scr->OpaqueMove) /* can't restore... */ - XRaiseWindow(dpy, DragWindow); - if (ConstMove) { switch (ConstMoveDir) @@ -1720,12 +1708,9 @@ ExecuteFunction(int func, const char *action, Window w, TwmWindow *tmp_win, } CurrentDragX = xl; CurrentDragY = yt; - if (Scr->OpaqueMove) - XMoveWindow(dpy, DragWindow, xl, yt); - else - MoveOutline(eventp->xmotion.root, xl, yt, w, h, - tmp_win->frame_bw, - moving_icon ? 0 : tmp_win->title_height); + MoveOutline(eventp->xmotion.root, xl, yt, w, h, + tmp_win->frame_bw, + moving_icon ? 0 : tmp_win->title_height); } } else if (DragWindow != None) @@ -1760,19 +1745,16 @@ ExecuteFunction(int func, const char *action, Window w, TwmWindow *tmp_win, CurrentDragX = xl; CurrentDragY = yt; - if (Scr->OpaqueMove) - XMoveWindow(dpy, DragWindow, xl, yt); - else - MoveOutline(eventp->xmotion.root, xl, yt, w, h, - tmp_win->frame_bw, - moving_icon ? 0 : tmp_win->title_height); + MoveOutline(eventp->xmotion.root, xl, yt, w, h, + tmp_win->frame_bw, + moving_icon ? 0 : tmp_win->title_height); } } MovedFromKeyPress = False; - if (!Scr->OpaqueMove && DragWindow == None) + if (DragWindow == None) UninstallRootColormap(); break; diff --git a/src/parse.c b/src/parse.c index a93fe10..cfc8fc6 100644 --- a/src/parse.c +++ b/src/parse.c @@ -312,7 +312,6 @@ typedef struct _TwmKeyword { #define kw0_NoDefaults 1 #define kw0_AutoRelativeResize 2 #define kw0_ForceIcons 3 -#define kw0_OpaqueMove 5 #define kw0_InterpolateMenuColors 6 #define kw0_NoVersion 7 #define kw0_NoGrabServer 9 @@ -509,7 +508,6 @@ static TwmKeyword keytable[] = { { "notitle", NO_TITLE, 0 }, { "notitlefocus", KEYWORD, kw0_NoTitleFocus }, { "noversion", KEYWORD, kw0_NoVersion }, - { "opaquemove", KEYWORD, kw0_OpaqueMove }, { "pointerbackground", CKEYWORD, kwc_PointerBackground }, { "pointerforeground", CKEYWORD, kwc_PointerForeground }, { "priority", NKEYWORD, kwn_Priority }, @@ -593,10 +591,6 @@ int do_single_keyword (int keyword) if (Scr->FirstTime) Scr->ForceIcon = TRUE; return 1; - case kw0_OpaqueMove: - Scr->OpaqueMove = TRUE; - return 1; - case kw0_InterpolateMenuColors: if (Scr->FirstTime) Scr->InterpolateMenuColors = TRUE; return 1; diff --git a/src/screen.h b/src/screen.h index edf6bfa..2fce2b7 100644 --- a/src/screen.h +++ b/src/screen.h @@ -211,7 +211,6 @@ typedef struct ScreenInfo short BackingStore; /* use backing store for menus */ short SaveUnder; /* use save under's for menus */ short RandomPlacement; /* randomly place windows that no give hints */ - short OpaqueMove; /* move the window rather than outline */ short StackMode; /* should we honor stack mode requests */ short MoveDelta; /* number of pixels before f.move starts */ short ZoomCount; /* zoom outline count */ diff --git a/src/twm.c b/src/twm.c index 1957255..38c9586 100644 --- a/src/twm.c +++ b/src/twm.c @@ -721,7 +721,6 @@ InitVariables(void) Scr->BackingStore = TRUE; Scr->SaveUnder = TRUE; Scr->RandomPlacement = FALSE; - Scr->OpaqueMove = FALSE; Scr->StackMode = TRUE; Scr->MoveDelta = 1; /* so that f.deltastop will work */ Scr->ZoomCount = 8;