[openbox] Disable shrink with GrowToEdge?

James Robertson j at mesrobertson.com
Fri Nov 11 19:25:10 EST 2011


> Would happily accept patch to turn this off by default and enable it with
> an option via bug tracker.
>

I'm not a C programmer. I did look at growtoedge.c and with my *very*
limited knowledge and was wondering if it would be a case of placing lines
130 to 164 in an if statement?

e.g. if you had an option "use_shrink_with_growtoedge" set to either true
of false from rc.xml it may look something like this (I have no idea how
rc.xml is sourced).  You will have to excuse my amateur analysis if it's
totally wrong.

If this variable was unset I imagine it would be off (FALSE) by default?

    /* we couldn't grow, so try shrink! */
    if use_shrink_with_growtoedge {
        opp = (o->dir == OB_DIRECTION_NORTH ? OB_DIRECTION_SOUTH :
               (o->dir == OB_DIRECTION_SOUTH ? OB_DIRECTION_NORTH :
                (o->dir == OB_DIRECTION_EAST ? OB_DIRECTION_WEST :
                 OB_DIRECTION_EAST)));
        client_find_resize_directional(data->client, opp, FALSE,
                                       &x, &y, &w, &h);
        switch (opp) {
        case OB_DIRECTION_NORTH:
            half = data->client->area.y + data->client->area.height / 2;
            if (y > half) {
                h += y - half;
                y = half;
            }
            break;
        case OB_DIRECTION_SOUTH:
            half = data->client->area.height / 2;
            if (h < half)
                h = half;
            break;
        case OB_DIRECTION_WEST:
            half = data->client->area.x + data->client->area.width / 2;
            if (x > half) {
                w += x - half;
                x = half;
            }
            break;
        case OB_DIRECTION_EAST:
            half = data->client->area.width / 2;
            if (w < half)
                w = half;
            break;
        default: g_assert_not_reached();
        }
        if (do_grow(data, x, y, w, h))
            return FALSE;
    }

If I'm on the right track I may see if I can figure it all out.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/openbox/attachments/20111112/3b68a136/attachment.htm>


More information about the openbox mailing list