--- scale.c.orig 2007-10-06 23:54:11.000000000 -0400 +++ scale.c 2007-10-06 23:43:27.000000000 -0400 @@ -35,6 +35,7 @@ #include #define EDGE_STATE (CompActionStateInitEdge) +#define BUTTON_STATE (CompActionStateInitButton) #define WIN_X(w) ((w)->attrib.x - (w)->input.left) #define WIN_Y(w) ((w)->attrib.y - (w)->input.top) @@ -1239,10 +1240,16 @@ ss->type = ScaleTypeNormal; return scaleInitiateCommon (s, action, state, option, nOption); } - else if ((state & EDGE_STATE) && ss->state == SCALE_STATE_WAIT) - { + else if (state & EDGE_STATE){ + if(ss->state == SCALE_STATE_WAIT){ + if (ss->type == ScaleTypeNormal) + return scaleTerminate (s->display, action, 0, option, nOption); + } + } + /* If it gets triggered and scale is already in session, close */ + else if (ss->state == SCALE_STATE_WAIT || ss->state == SCALE_STATE_OUT){ if (ss->type == ScaleTypeNormal) - return scaleTerminate (s->display, action, 0, option, nOption); + return scaleTerminate (s->display, action, 0, option, nOption); } } @@ -1271,10 +1278,16 @@ ss->type = ScaleTypeAll; return scaleInitiateCommon (s, action, state, option, nOption); } - else if ((state & EDGE_STATE) && ss->state == SCALE_STATE_WAIT) - { + else if (state & EDGE_STATE){ + if(ss->state == SCALE_STATE_WAIT){ + if (ss->type == ScaleTypeAll) + return scaleTerminate (s->display, action, 0, option, nOption); + } + } + /* If it gets triggered and scale is already in session, close */ + else if (ss->state == SCALE_STATE_WAIT || ss->state == SCALE_STATE_OUT){ if (ss->type == ScaleTypeAll) - return scaleTerminate (s->display, action, 0, option, nOption); + return scaleTerminate (s->display, action, 0, option, nOption); } } @@ -1312,10 +1325,16 @@ return scaleInitiateCommon (s, action, state, option, nOption); } } - else if ((state & EDGE_STATE) && ss->state == SCALE_STATE_WAIT) - { + else if (state & EDGE_STATE){ + if(ss->state == SCALE_STATE_WAIT){ + if (ss->type == ScaleTypeGroup) + return scaleTerminate (s->display, action, 0, option, nOption); + } + } + /* If it gets triggered and scale is already in session, close */ + else if (ss->state == SCALE_STATE_WAIT || ss->state == SCALE_STATE_OUT){ if (ss->type == ScaleTypeGroup) - return scaleTerminate (s->display, action, 0, option, nOption); + return scaleTerminate (s->display, action, 0, option, nOption); } } @@ -1344,10 +1363,16 @@ ss->type = ScaleTypeOutput; return scaleInitiateCommon (s, action, state, option, nOption); } - else if ((state & EDGE_STATE) && ss->state == SCALE_STATE_WAIT) - { + else if (state & EDGE_STATE){ + if(ss->state == SCALE_STATE_WAIT){ + if (ss->type == ScaleTypeOutput) + return scaleTerminate (s->display, action, 0, option, nOption); + } + } + /* If it gets triggered and scale is already in session, close */ + else if (ss->state == SCALE_STATE_WAIT || ss->state == SCALE_STATE_OUT){ if (ss->type == ScaleTypeOutput) - return scaleTerminate (s->display, action, 0, option, nOption); + return scaleTerminate (s->display, action, 0, option, nOption); } } @@ -1915,18 +1940,18 @@ { "abi", "int", 0, 0, 0 }, { "index", "int", 0, 0, 0 }, { "initiate_edge", "edge", 0, scaleInitiate, scaleTerminate }, - { "initiate_button", "button", 0, scaleInitiate, scaleTerminate }, + { "initiate_button", "button", 0, scaleInitiate, 0 }, { "initiate_key", "key", 0, scaleInitiate, scaleTerminate }, { "initiate_all_edge", "edge", 0, scaleInitiateAll, scaleTerminate }, - { "initiate_all_button", "button", 0, scaleInitiateAll, scaleTerminate }, + { "initiate_all_button", "button", 0, scaleInitiateAll, 0 }, { "initiate_all_key", "key", 0, scaleInitiateAll, scaleTerminate }, { "initiate_group_edge", "edge", 0, scaleInitiateGroup, scaleTerminate }, { "initiate_group_button", "button", 0, - scaleInitiateGroup, scaleTerminate }, + scaleInitiateGroup, 0 }, { "initiate_group_key", "key", 0, scaleInitiateGroup, scaleTerminate }, { "initiate_output_edge", "edge", 0, scaleInitiateOutput, scaleTerminate }, { "initiate_output_button", "button", 0, - scaleInitiateOutput, scaleTerminate }, + scaleInitiateOutput, 0 }, { "initiate_output_key", "key", 0, scaleInitiateOutput, scaleTerminate }, { "show_desktop", "bool", 0, 0, 0 }, { "relayout_slots", "action", 0, scaleRelayoutSlots, 0 }