diff -Naur AfterStep-1.8.11-orig/src/afterstep/borders.c AfterStep-1.8.11-new/src/afterstep/borders.c --- AfterStep-1.8.11-orig/src/afterstep/borders.c 2000-10-19 23:27:57.000000000 -0400 +++ AfterStep-1.8.11-new/src/afterstep/borders.c 2006-02-20 21:03:41.827876968 -0500 @@ -132,6 +132,52 @@ } } +void +SetBackgroundTexture_po (ASWindow * t, Window win, MyStyle * style, Pixmap cache) +{ + int need_to_free_cache = 0; + + if (style->texture_type == TEXTURE_SOLID) + XSetWindowBackground (dpy, win, style->colors.back); +#ifndef NO_TEXTURE + else if (style->texture_type < TEXTURE_PIXMAP) + { + /* gradients */ + if (cache == None) + { + int root_x, root_y, width, height; + XGetGeometry (dpy, win, &JunkRoot, &root_x, &root_y, &width, &height, &JunkBW, &JunkDepth); + cache = mystyle_make_pixmap_overlay (style, root_x, root_y, width, height, None); + if (cache != None) + need_to_free_cache = 1; + } + XSetWindowBackgroundPixmap (dpy, win, cache); + } + else if (style->texture_type == TEXTURE_PIXMAP) + XSetWindowBackgroundPixmap (dpy, win, style->back_icon.pix); + else if (style->texture_type >= TEXTURE_TRANSPARENT) + { + int root_x, root_y, width, height; + XGetGeometry (dpy, win, &JunkRoot, &root_x, &root_y, &width, &height, &JunkBW, &JunkDepth); + root_x += t->frame_x; + root_y += t->frame_y; + Pixmap pix = mystyle_make_pixmap_overlay (style, root_x, root_y, width, height, None); + XSetWindowBackgroundPixmap (dpy, win, pix); + XFreePixmap(dpy, pix); + } +#endif /* NO_TEXTURE */ + + XClearWindow (dpy, win); + XFlush (dpy); + + if (need_to_free_cache) + { + /* don't change the window background, or the result will be whatever + * the background is changed to here */ + XFreePixmap (dpy, cache); + } +} + /************************************************ * * * a more general version of SetTitleBackground * @@ -232,10 +278,10 @@ cache = None; /* middle bottom frame */ - SetBackgroundTexture (t, t->side, style, cache); + SetBackgroundTexture_po (t, t->side, style, cache); /* side bottom frames */ - SetBackgroundTexture (t, t->corners[0], style, cache); - SetBackgroundTexture (t, t->corners[1], style, cache); + SetBackgroundTexture_po (t, t->corners[0], style, cache); + SetBackgroundTexture_po (t, t->corners[1], style, cache); } void diff -Naur AfterStep-1.8.11-orig/src/afterstep/events.c AfterStep-1.8.11-new/src/afterstep/events.c --- AfterStep-1.8.11-orig/src/afterstep/events.c 2001-12-13 01:51:26.000000000 -0500 +++ AfterStep-1.8.11-new/src/afterstep/events.c 2006-02-20 21:03:46.383184456 -0500 @@ -1132,10 +1132,11 @@ CurrentTime); XSync (dpy, 0); - if (Context == C_TITLE) - SetTitleBar (Tmp_win, (Scr.Hilite == Tmp_win), False); - else - SetBorder (Tmp_win, (Scr.Hilite == Tmp_win), True, True, PressedW); +// if (Context == C_TITLE) +// SetTitleBar (Tmp_win, (Scr.Hilite == Tmp_win), False); +// else + // by po + SetBorder (Tmp_win, (Scr.Hilite == Tmp_win), True, True, PressedW); ButtonWindow = Tmp_win; @@ -1180,10 +1181,11 @@ PressedW = None; - if (LocalContext != C_TITLE) +// if (LocalContext != C_TITLE) + // by po: SetBorder (ButtonWindow, (Scr.Hilite == ButtonWindow), True, True, xPressedW); - else - SetTitleBar (ButtonWindow, (Scr.Hilite == ButtonWindow), False); +// else +// SetTitleBar (ButtonWindow, (Scr.Hilite == ButtonWindow), False); ButtonWindow = NULL; } diff -Naur AfterStep-1.8.11-orig/src/afterstep/functions.c AfterStep-1.8.11-new/src/afterstep/functions.c --- AfterStep-1.8.11-orig/src/afterstep/functions.c 2001-12-13 01:30:32.000000000 -0500 +++ AfterStep-1.8.11-new/src/afterstep/functions.c 2006-02-20 21:03:51.623387824 -0500 @@ -79,6 +79,79 @@ extern ASDirs as_dirs; + +int poBetween(int a, int b, int c) { + return a <= b && b < c; +} + + +// checks whether the corners of the frame of WINDOW are visible +int poOnViewport(ASWindow * window) { + int h, v; + +// printf("vp1: [%d %d] vp2: [%d %d] crnr: [%d %d]\n", viewportX[0], viewportY[0], viewportX[1], viewportY[1], window->frame_x, window->frame_y); + + for (h = 0; h <= 1; h++) + for (v = 0; v <= 1; v++) + if (poBetween(0, window->frame_x + h*window->frame_width, Scr.MyDisplayWidth) && + poBetween(0, window->frame_y + v*window->frame_height, Scr.MyDisplayHeight)) + return 1; + + return 0; +} + +// moves the focused window by a viewport +// 0 up +// 1 down +// 2 left +// 3 right +void poMoveByViewport(XEvent *eventp, Window w, ASWindow *tmp_win, int context, + int val1, int val2, int val1_unit, int val2_unit) { + int chg[2] = {0, 0}; + + if (Scr.Hilite == NULL) + return; + + if (!poOnViewport(Scr.Hilite)) + return; + + switch (val1) { + case 0: + chg[1] = -Scr.MyDisplayHeight; + break; + case 1: + chg[1] = Scr.MyDisplayHeight; + break; + case 2: + chg[0] = -Scr.MyDisplayWidth; + break; + case 3: + chg[0] = Scr.MyDisplayWidth; + break; + default: + return; + } + +/* printf("dpyW: %d, dpyH: %d\n", Scr.MyDisplayWidth, Scr.MyDisplayHeight); */ +/* printf("Vx: %d, Vy: %d\n", Scr.Vx, Scr.Vy); */ +/* printf("maxVx: %d, maxVy: %d\n", Scr.VxMax, Scr.VyMax); */ + + if (Scr.Vx + chg[0] < 0) + chg[0] = -Scr.Vx; + else if (Scr.Vx + chg[0] > Scr.VxMax) + chg[0] = Scr.VxMax - Scr.Vx; + + if (Scr.Vy + chg[1] < 0) + chg[1] = -Scr.Vy; + else if (Scr.Vy + chg[1] > Scr.VyMax) + chg[1] = Scr.VyMax - Scr.Vy; + + move_window(eventp, w, Scr.Hilite, context, Scr.Hilite->frame_x+chg[0], Scr.Hilite->frame_y+chg[1], 100, 100); + MoveViewport(Scr.Vx+chg[0], Scr.Vy+chg[1], True); +} + + + /*********************************************************************** * * Procedure: @@ -112,9 +185,17 @@ FunctionCode switch_func = func; + if (func == F_HYPERCIRCULATE) { + in_w = Scr.ASRoot.next->w; + tmp_win = Scr.ASRoot.next; + context = C_WINDOW; + } + +/* fprintf(stderr, "%d %d %d %d %lu %ld %ld %d %d %d %d\n", func, &in_w, &tmp_win, eventp, context, val1, val2, val1_unit, val2_unit, menu, Module); */ + /* Defer Execution may wish to alter this value */ w = in_w; - if (IsWindowFunc (func)) + if (IsWindowFunc (func) && func != F_HYPERCIRCULATE) { int cursor, fin_event; if (func != F_RESIZE && func != F_MOVE) @@ -342,6 +423,10 @@ XBell (dpy, Scr.screen); break; + case F_MOVEBYVIEWPORT: + poMoveByViewport(eventp, w, tmp_win, context, val1, val2, val1_unit, val2_unit); + break; + case F_SHADE: if (check_allowed_function2 (func, tmp_win)) Shade (tmp_win); @@ -361,6 +446,12 @@ FocusOn (t, 0, True); break; + case F_HYPERCIRCULATE: + t = HyperCirculate (tmp_win, action, DOWN); + if (t) + FocusOn (t, 0, True); + break; + case F_DESTROY: case F_DELETE: case F_CLOSE: @@ -790,6 +881,18 @@ return (win_selected); } +ASWindow * +Circulate (ASWindow * tmp_win, char *action, int direction) { + return PoCirculate(tmp_win, action, direction, 0); +} + +ASWindow * +HyperCirculate (ASWindow * tmp_win, char *action, int direction) { + return PoCirculate(tmp_win, action, direction, 1); +} + + + /* Circulate() ** find the next window in circulation order; if direction == DOWN, the next ** window is the window with the next highest circulate_sequence after @@ -800,7 +903,7 @@ ** returns the next window, or if no next window is found, returns NULL */ ASWindow * -Circulate (ASWindow * tmp_win, char *action, int direction) +PoCirculate (ASWindow * tmp_win, char *action, int direction, int hyper) { ASWindow *t, *target = NULL, *first = NULL, *last = NULL; @@ -813,6 +916,7 @@ if (!(t->flags & CIRCULATESKIP) && !(t->flags & NOFOCUS) && !(t->flags & WINDOWLISTSKIP) && + (hyper || poOnViewport(t)) && (AutoTabThroughDesks || t->Desk == Scr.CurrentDesk) && (!(Scr.flags & CirculateSkipIcons) || !(t->flags & ICONIFIED)) && (action == NULL || diff -Naur AfterStep-1.8.11-orig/src/afterstep/functions.h AfterStep-1.8.11-new/src/afterstep/functions.h --- AfterStep-1.8.11-orig/src/afterstep/functions.h 2000-10-19 23:27:57.000000000 -0400 +++ AfterStep-1.8.11-new/src/afterstep/functions.h 2006-02-20 21:05:07.981779584 -0500 @@ -21,7 +21,7 @@ #endif F_MOVECURSOR, F_WARP_F, - F_WARP_B, + F_WARP_B, F_WAIT, F_DESK, #ifndef NO_WINDOWLIST @@ -53,6 +53,7 @@ F_PUTONBACK, F_SETLAYER, F_TOGGLELAYER, + F_MOVEBYVIEWPORT, F_SHADE, F_DELETE, F_DESTROY, @@ -63,6 +64,7 @@ F_FOCUS, F_CHANGEWINDOW_UP, F_CHANGEWINDOW_DOWN, + F_HYPERCIRCULATE, /* from po */ F_GETHELP, F_PASTE_SELECTION, F_CHANGE_WINDOWS_DESK, diff -Naur AfterStep-1.8.11-orig/src/afterstep/menuitem.c AfterStep-1.8.11-new/src/afterstep/menuitem.c --- AfterStep-1.8.11-orig/src/afterstep/menuitem.c 2002-01-06 03:00:15.000000000 -0500 +++ AfterStep-1.8.11-new/src/afterstep/menuitem.c 2006-02-20 21:03:56.263682392 -0500 @@ -133,6 +133,7 @@ FUNC_TERM ("PutOnBack", 9, F_PUTONBACK), /* PutOnBack */ FUNC_TERM ("SetLayer", 8, F_SETLAYER), /* SetLayer layer */ FUNC_TERM ("ToggleLayer", 11, F_TOGGLELAYER), /* ToggleLayer layer1 layer2 */ + FUNC_TERM ("MoveByViewport", 14, F_MOVEBYVIEWPORT), /* Shade ["name"] */ FUNC_TERM ("Shade", 5, F_SHADE), /* Shade ["name"] */ FUNC_TERM ("Delete", 6, F_DELETE), /* Delete ["name"] */ FUNC_TERM ("Destroy", 7, F_DESTROY), /* Destroy ["name"] */ @@ -143,6 +144,7 @@ FUNC_TERM ("Focus", 5, F_FOCUS), /* Focus */ FUNC_TERM2 (NEED_WINIFNAME, "ChangeWindowUp", 14, F_CHANGEWINDOW_UP), /* ChangeWindowUp ["name" window_name ] */ FUNC_TERM2 (NEED_WINIFNAME, "ChangeWindowDown", 16, F_CHANGEWINDOW_DOWN), /* ChangeWindowDown ["name" window_name ] */ + FUNC_TERM2 (NEED_WINIFNAME, "HyperCirculate", 14, F_HYPERCIRCULATE), /* ChangeWindowDown ["name" window_name ] */ FUNC_TERM ("GetHelp", 7, F_GETHELP), /* */ FUNC_TERM ("PasteSelection", 14, F_PASTE_SELECTION), /* */ FUNC_TERM ("WindowsDesk", 11, F_CHANGE_WINDOWS_DESK), /* WindowDesk "name" new_desk */ diff -Naur AfterStep-1.8.11-orig/src/afterstep/move.c AfterStep-1.8.11-new/src/afterstep/move.c --- AfterStep-1.8.11-orig/src/afterstep/move.c 2000-10-19 23:27:57.000000000 -0400 +++ AfterStep-1.8.11-new/src/afterstep/move.c 2006-02-20 21:03:58.864287040 -0500 @@ -324,10 +324,15 @@ if (Init) { + int root_x, root_y, width, height; GC reliefGC, shadowGC; mystyle_get_global_gcs (Scr.MSFWindow, NULL, NULL, &reliefGC, &shadowGC); - mystyle_set_window_background (Scr.SizeWindow, Scr.MSFWindow); +// by po: + XGetGeometry (dpy, Scr.SizeWindow, &JunkRoot, &root_x, &root_y, &width, &height, &JunkBW, &JunkDepth); + mystyle_set_window_background_po (Scr.SizeWindow, Scr.MSFWindow, root_x, root_y, width, height); XClearWindow (dpy, Scr.SizeWindow); +// SetBackgroundTextureOverlay(NULL, Scr.SizeWindow, Scr.MSFWindow, None); +// end po. if (Scr.d_depth >= 2) RelieveWindow (tmp_win, Scr.SizeWindow, 0, 0, Scr.SizeStringWidth + SIZE_HINDENT * 2, diff -Naur AfterStep-1.8.11-orig/src/afterstep/resize.c AfterStep-1.8.11-new/src/afterstep/resize.c --- AfterStep-1.8.11-orig/src/afterstep/resize.c 2000-10-19 23:27:57.000000000 -0400 +++ AfterStep-1.8.11-new/src/afterstep/resize.c 2006-02-20 21:04:01.812838792 -0500 @@ -391,8 +391,12 @@ if (Init) { + int root_x, root_y, width, height; + XGetGeometry (dpy, Scr.SizeWindow, &JunkRoot, &root_x, &root_y, &width, &height, &JunkBW, &JunkDepth); + mystyle_set_window_background_po (Scr.SizeWindow, Scr.MSFWindow, root_x, root_y, width, height); XClearWindow (dpy, Scr.SizeWindow); - mystyle_set_window_background (Scr.SizeWindow, Scr.MSFWindow); +// XClearWindow (dpy, Scr.SizeWindow); +// mystyle_set_window_background (Scr.SizeWindow, Scr.MSFWindow); if (Scr.d_depth >= 2) { GC reliefGC, shadowGC;