Esempio n. 1
0
/*EXTL_DOC
 * Attempt to toggle horizontal maximisation of \var{frame}.
 */
EXTL_EXPORT_MEMBER
void frame_maximize_horiz(WFrame *frame)
{
    WRegion *mp=REGION_MANAGER(frame);
    int ox, ow;

    if(frame->flags&FRAME_MIN_HORIZ || frame->flags&FRAME_MAXED_HORIZ){
        if(frame->flags&FRAME_SAVED_HORIZ){
            if(mp!=NULL && region_managed_maximize(mp, (WRegion*)frame, HORIZONTAL, VERIFY))
                region_managed_maximize(mp, (WRegion*)frame, HORIZONTAL, RESTORE);
            else
                rqw(frame, frame->saved_geom.x, frame->saved_geom.w);
        }
        frame->flags&=~(FRAME_MAXED_HORIZ|FRAME_SAVED_HORIZ);
        region_goto((WRegion*)frame);
        return;
    }

    if(mp==NULL)
        return;

    ox=REGION_GEOM(frame).x;
    ow=REGION_GEOM(frame).w;

    region_managed_maximize(mp, (WRegion*)frame, HORIZONTAL, SAVE);
    rqw(frame, 0, REGION_GEOM(mp).w);
    region_managed_maximize(mp, (WRegion*)frame, HORIZONTAL, RM_KEEP);

    frame->flags|=(FRAME_MAXED_HORIZ|FRAME_SAVED_HORIZ);
    frame->saved_geom.x=ox;
    frame->saved_geom.w=ow;

    region_goto((WRegion*)frame);
}
Esempio n. 2
0
/*EXTL_DOC
 * Go to and return to a previously active region (if any).
 * 
 * Note that this function is asynchronous; the region will not
 * actually have received the focus when this function returns.
 */
EXTL_EXPORT
WRegion *ioncore_goto_previous()
{
    WRegion *next;
    
    if(ioncore_g.focuslist==NULL)
        return NULL;

    /* We're trying to access the focus list from lua (likely from the UI). I
     * thus force any pending focuslist updates to complete now */
    region_focuslist_awaiting_insertion_trigger();
    
    /* Find the first region on focus history list that isn't currently
     * active.
     */
    for(next=ioncore_g.focuslist->active_next;
        next!=NULL; 
        next=next->active_next){
        
        if(!REGION_IS_ACTIVE(next))
            break;
    }
    
    if(next!=NULL)
        region_goto(next);
    
    return next;
}
Esempio n. 3
0
bool grouppholder_do_goto(WGroupPHolder *ph)
{
    return (ph->group!=NULL
            ? region_goto((WRegion*)ph->group)
            : (ph->recreate_pholder!=NULL
               ? pholder_do_goto(ph->recreate_pholder)
               : FALSE));
}
Esempio n. 4
0
/*EXTL_DOC
 * Go to first region on activity list.
 */
EXTL_EXPORT
bool ioncore_goto_activity()
{
    WRegion *reg=ioncore_activity_first();

    if(reg!=NULL)
        return region_goto(reg);
    else
        return FALSE;
}
Esempio n. 5
0
bool pholder_attach_mcfgoto(WPHolder *ph, int flags, WRegion *reg)
{
    bool cf=region_may_control_focus(reg);

    if(!pholder_attach(ph, flags, reg))
        return FALSE;

    if(cf)
        region_goto(reg);

    return TRUE;
}
Esempio n. 6
0
/*EXTL_DOC
 * Attempt to toggle vertical maximisation of \var{frame}.
 */
EXTL_EXPORT_MEMBER
void frame_maximize_vert(WFrame *frame)
{
    WRegion *mp=REGION_MANAGER(frame);
    int oy, oh;

    if(frame->flags&FRAME_SHADED || frame->flags&FRAME_MAXED_VERT){
        if(frame->flags&FRAME_SHADED)
            frame->flags|=FRAME_SHADED_TOGGLE;
        if(frame->flags&FRAME_SAVED_VERT){
            if(mp!=NULL && region_managed_maximize(mp, (WRegion*)frame, VERTICAL, VERIFY))
                region_managed_maximize(mp, (WRegion*)frame, VERTICAL, RESTORE);
            else
                rqh(frame, frame->saved_geom.y, frame->saved_geom.h);
        }
        frame->flags&=~(FRAME_MAXED_VERT|FRAME_SAVED_VERT|FRAME_SHADED_TOGGLE);
        region_goto((WRegion*)frame);
        return;
    }

    if(mp==NULL)
        return;

    oy=REGION_GEOM(frame).y;
    oh=REGION_GEOM(frame).h;

    region_managed_maximize(mp, (WRegion*)frame, VERTICAL, SAVE);
    rqh(frame, 0, REGION_GEOM(mp).h);
    region_managed_maximize(mp, (WRegion*)frame, VERTICAL, RM_KEEP);

    frame->flags|=(FRAME_MAXED_VERT|FRAME_SAVED_VERT);
    frame->saved_geom.y=oy;
    frame->saved_geom.h=oh;

    region_goto((WRegion*)frame);
}
Esempio n. 7
0
static void netwm_active_window_rq(WClientWin *cwin, 
                                   const XClientMessageEvent *ev)
{
    long source=ev->data.l[0];
    /**
     * By default we ignore non-pager activity requests, as they're known to 
     * steal focus from newly-created windows :(
     */
    bool ignore=source!=SOURCE_PAGER;
    
    extl_table_gets_b(cwin->proptab, "ignore_net_active_window", &ignore);
    
    if(!ignore)
        region_goto((WRegion*)cwin);
    else
        region_set_activity((WRegion*)cwin, SETPARAM_SET);
}