aboutsummaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--client.c87
1 files changed, 1 insertions, 86 deletions
diff --git a/client.c b/client.c
index d599684..264d025 100644
--- a/client.c
+++ b/client.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: client.c,v 1.14 2008/03/26 15:45:42 oga Exp $
+ * $Id: client.c,v 1.15 2008/04/09 18:10:47 okan Exp $
*/
#include "headers.h"
@@ -635,94 +635,9 @@ client_cyclenext(int reverse)
client_ptrwarp(sc->cycle_client);
sc->altpersist = 1; /* This is reset when alt is let go... */
- /* Draw window. */
- client_cycleinfo(sc->cycle_client);
-
return (sc->cycle_client);
}
-/*
- * XXX - have to have proper exposure handling here. we will probably
- * have to do this by registering with the event loop a function to
- * redraw, then match that on windows.
- */
-
-void
-client_cycleinfo(struct client_ctx *cc)
-{
-#define LISTSIZE 3
- int w, h, nlines, i, n, oneh, curn = -1, x, y, diff;
- struct client_ctx *ccc, *list[LISTSIZE];
- struct screen_ctx *sc = CCTOSC(cc);
- struct fontdesc *font = DefaultFont;
-
- memset(list, 0, sizeof(list));
-
- nlines = 0;
- TAILQ_FOREACH(ccc, &sc->mruq, mru_entry) {
- if (!ccc->flags & CLIENT_HIDDEN) {
- if (++nlines == LISTSIZE)
- break;
- }
- }
-
- oneh = font_ascent(font) + font_descent(font) + 1;
- h = nlines*oneh;
-
- list[1] = cc;
-
- if (nlines > 1)
- list[2] = client__cycle(cc, &client_mrunext);
- if (nlines > 2)
- list[0] = client__cycle(cc, &client_mruprev);
-
- w = 0;
- for (i = 0; i < sizeof(list)/sizeof(list[0]); i++) {
- if ((ccc = list[i]) == NULL)
- continue;
- w = MAX(w, font_width(font, ccc->name, strlen(ccc->name)));
- }
-
- w += 4;
-
- /* try to fit. */
-
- if ((x = cc->ptr.x) < 0 || (y = cc->ptr.y) < 0) {
- x = cc->geom.width / 2;
- y = cc->geom.height / 2;
- }
-
- if ((diff = cc->geom.width - (x + w)) < 0)
- x += diff;
-
- if ((diff = cc->geom.height - (y + h)) < 0)
- y += diff;
-
- /* Don't hide the beginning of the window names */
- if (x < 0)
- x = 0;
-
- XReparentWindow(X_Dpy, sc->infowin, cc->win, 0, 0);
- XMoveResizeWindow(X_Dpy, sc->infowin, x, y, w, h);
- XMapRaised(X_Dpy, sc->infowin);
- XClearWindow(X_Dpy, sc->infowin);
-
- for (i = 0, n = 0; i < sizeof(list)/sizeof(list[0]); i++) {
- if ((ccc = list[i]) == NULL)
- continue;
- font_draw(font, ccc->name, strlen(ccc->name), sc->infowin,
- 2, n*oneh + font_ascent(font) + 1);
- if (i == 1)
- curn = n;
- n++;
- }
-
- assert(curn != -1);
-
- /* Highlight the current entry. */
- XFillRectangle(X_Dpy, sc->infowin, sc->hlgc, 0, curn*oneh, w, oneh);
-}
-
struct client_ctx *
client_mrunext(struct client_ctx *cc)
{