Exemple #1
0
/*
 * Change frame stacking.
 */
static void xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) {
    xp_window_changes wc;
    unsigned int mask = XP_STACKING;

    TA_SERVER();
    
    /* Stack frame below nextWid it if it exists, or raise
       frame above everything otherwise. */

    if(nextWid == NULL) {
        wc.stack_mode = XP_MAPPED_ABOVE;
        wc.sibling = 0;
    } else {
        wc.stack_mode = XP_MAPPED_BELOW;
        wc.sibling = x_cvt_vptr_to_uint(nextWid);
    }

    if(window_hash) {
        RootlessWindowRec *winRec = x_hash_table_lookup(window_hash, wid, NULL);

        if(winRec) {
            if(XQuartzIsRootless)
                wc.window_level = normal_window_levels[winRec->level];
            else if(XQuartzShieldingWindowLevel)
                wc.window_level = XQuartzShieldingWindowLevel + 1;
            else
                wc.window_level = rooted_window_levels[winRec->level];
            mask |= XP_WINDOW_LEVEL;
        }
    }

    xprConfigureWindow(x_cvt_vptr_to_uint(wid), mask, &wc);
}
Exemple #2
0
/*
 * Unmap a frame.
 */
void
xprUnmapFrame(RootlessFrameID wid)
{
    xp_window_changes wc;

    wc.stack_mode = XP_UNMAPPED;
    wc.sibling = 0;

    xprConfigureWindow((xp_window_id) wid, XP_STACKING, &wc);
}
Exemple #3
0
/*
 * Move a frame on screen.
 */
void
xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY)
{
    xp_window_changes wc;

    wc.x = newX;
    wc.y = newY;

    xprConfigureWindow((xp_window_id) wid, XP_ORIGIN, &wc);
}
Exemple #4
0
/*
 * Unmap a frame.
 */
static void
xprUnmapFrame(RootlessFrameID wid)
{
    xp_window_changes wc;

    TA_SERVER();
    
    wc.stack_mode = XP_UNMAPPED;
    wc.sibling = 0;

    xprConfigureWindow(x_cvt_vptr_to_uint(wid), XP_STACKING, &wc);
}
Exemple #5
0
/*
 * Move a frame on screen.
 */
static void
xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY)
{
    xp_window_changes wc;

    TA_SERVER();
    
    wc.x = newX;
    wc.y = newY;
    //    ErrorF("xprMoveFrame(%d, %p, %d, %d)\n", wid, pScreen, newX, newY);
    xprConfigureWindow(x_cvt_vptr_to_uint(wid), XP_ORIGIN, &wc);
}
Exemple #6
0
/*
 * Resize and move a frame.
 */
void
xprResizeFrame(RootlessFrameID wid, ScreenPtr pScreen,
               int newX, int newY, unsigned int newW, unsigned int newH,
               unsigned int gravity)
{
    xp_window_changes wc;

    wc.x = newX;
    wc.y = newY;
    wc.width = newW;
    wc.height = newH;
    wc.bit_gravity = gravity;

    /* It's unlikely that being async will save us anything here.
       But it can't hurt. */

    xprConfigureWindow((xp_window_id) wid, XP_BOUNDS, &wc);
}
Exemple #7
0
/*
 * Change the frame's shape.
 */
void
xprReshapeFrame(RootlessFrameID wid, RegionPtr pShape)
{
    xp_window_changes wc;

    if (pShape != NULL)
    {
        wc.shape_nrects = REGION_NUM_RECTS(pShape);
        wc.shape_rects = REGION_RECTS(pShape);
    }
    else
    {
        wc.shape_nrects = -1;
        wc.shape_rects = NULL;
    }

    wc.shape_tx = wc.shape_ty = 0;

    xprConfigureWindow((xp_window_id) wid, XP_SHAPE, &wc);
}
Exemple #8
0
/*
 * Change frame stacking.
 */
void
xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
{
    xp_window_changes wc;

    /* Stack frame below nextWid it if it exists, or raise
       frame above everything otherwise. */

    if (nextWid == NULL)
    {
        wc.stack_mode = XP_MAPPED_ABOVE;
        wc.sibling = 0;
    }
    else
    {
        wc.stack_mode = XP_MAPPED_BELOW;
        wc.sibling = (xp_window_id) nextWid;
    }

    xprConfigureWindow((xp_window_id) wid, XP_STACKING, &wc);
}
Exemple #9
0
/*
 * Change the frame's shape.
 */
static void
xprReshapeFrame(RootlessFrameID wid, RegionPtr pShape)
{
    xp_window_changes wc;

    TA_SERVER();
    
    if (pShape != NULL)
    {
        wc.shape_nrects = RegionNumRects(pShape);
        wc.shape_rects = RegionRects(pShape);
    }
    else
    {
        wc.shape_nrects = -1;
        wc.shape_rects = NULL;
    }

    wc.shape_tx = wc.shape_ty = 0;

    xprConfigureWindow(x_cvt_vptr_to_uint(wid), XP_SHAPE, &wc);
}