~ctwm/ctwm/trunk

« back to all changes in this revision

Viewing changes to iconmgr.c

  • Committer: Richard Levitte
  • Author(s): Claude Lecommandeur
  • Date: 2003-02-02 17:06:24 UTC
  • Revision ID: richard@levitte.org-20030202170624-ufdh8dgunc7nfrg7
Tags: ctwm-3.4
CTWM version 3.4

Monotone-Parent: c700ef3475b277d9b00913b22b99fdfe49782d14
Monotone-Revision: 1be23fb8d6d29219f3dc9717e362a5814b7eb554

Show diffs side-by-side

added added

removed removed

Lines of Context:
390
390
/***********************************************************************
391
391
 *
392
392
 *  Procedure:
 
393
 *      MoveMappedIconManager - move the pointer around in an icon manager
 
394
 *
 
395
 *  Inputs:
 
396
 *      dir     - one of the following:
 
397
 *                      F_FORWMAPICONMGR        - forward in the window list
 
398
 *                      F_BACKMAPICONMGR        - backward in the window list
 
399
 *
 
400
 *  Special Considerations:
 
401
 *      none
 
402
 *
 
403
 ***********************************************************************
 
404
 */
 
405
 
 
406
void MoveMappedIconManager(dir)
 
407
    int dir;
 
408
{
 
409
    IconMgr *ip;
 
410
    WList *tmp = NULL;
 
411
    WList *orig = NULL;
 
412
    int got_it;
 
413
 
 
414
    if (!Current) return;
 
415
 
 
416
    ip = Current->iconmgr;
 
417
 
 
418
    got_it = 0;
 
419
    tmp = Current;
 
420
    orig = Current;
 
421
 
 
422
    while(!got_it) {
 
423
        switch(dir)
 
424
        {
 
425
            case F_FORWMAPICONMGR:
 
426
                if ((tmp = tmp->next) == NULL)
 
427
                    tmp = ip->first;
 
428
                break;
 
429
 
 
430
            case F_BACKMAPICONMGR:
 
431
                if ((tmp = tmp->prev) == NULL)
 
432
                    tmp = ip->last;
 
433
                break;
 
434
        }
 
435
        if (tmp->twm->mapped) {
 
436
            got_it = 1;
 
437
            break;
 
438
        }
 
439
        if (tmp == orig)
 
440
            break;
 
441
    }
 
442
 
 
443
    if (!got_it)
 
444
    {
 
445
        fprintf (stderr, "%s:  unable to find open window in icon manager\n", 
 
446
                 ProgramName);
 
447
        return;
 
448
    }
 
449
 
 
450
    if (tmp == NULL)
 
451
      return;
 
452
 
 
453
    /* raise the frame so the icon manager is visible */
 
454
    if (ip->twm_win->mapped) {
 
455
        RaiseWindow(ip->twm_win);
 
456
        XWarpPointer(dpy, None, tmp->icon, 0,0,0,0, 5, 5);
 
457
    } else {
 
458
        if (tmp->twm->title_height) {
 
459
            int tbx = Scr->TBInfo.titlex;
 
460
            int x = tmp->twm->highlightxr;
 
461
            XWarpPointer (dpy, None, tmp->twm->title_w, 0, 0, 0, 0,
 
462
                          tbx + (x - tbx) / 2,
 
463
                          Scr->TitleHeight / 4);
 
464
        } else {
 
465
            XWarpPointer (dpy, None, tmp->twm->w, 0, 0, 0, 0, 5, 5);
 
466
        }
 
467
    }
 
468
}
 
469
 
 
470
/***********************************************************************
 
471
 *
 
472
 *  Procedure:
393
473
 *      JumpIconManager - jump from one icon manager to another,
394
474
 *              possibly even on another screen
395
475
 *
849
929
    int new_x, new_y;
850
930
    int savewidth;
851
931
    WList *tmp;
852
 
    int mask, bw;
 
932
    int mask;
853
933
    unsigned int JunkW, JunkH;
854
934
 
855
935
    if (Scr->use3Diconmanagers) {