--- scale.c.orig 2007-09-29 20:34:13.000000000 -0400 +++ scale.c 2007-09-29 20:33:43.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,6 +1240,10 @@ ss->type = ScaleTypeNormal; return scaleInitiateCommon (s, action, state, option, nOption); } + else if ((state & BUTTON_STATE) && (ss->state == SCALE_STATE_WAIT || ss->state == SCALE_STATE_OUT)){ + if (ss->type == ScaleTypeNormal) + return scaleTerminate (s->display, action, 0, option, nOption); + } else if ((state & EDGE_STATE) && ss->state == SCALE_STATE_WAIT) { if (ss->type == ScaleTypeNormal) @@ -1271,6 +1276,10 @@ ss->type = ScaleTypeAll; return scaleInitiateCommon (s, action, state, option, nOption); } + else if ((state & BUTTON_STATE) && (ss->state == SCALE_STATE_WAIT || ss->state == SCALE_STATE_OUT)){ + if (ss->type == ScaleTypeAll) + return scaleTerminate (s->display, action, 0, option, nOption); + } else if ((state & EDGE_STATE) && ss->state == SCALE_STATE_WAIT) { if (ss->type == ScaleTypeAll) @@ -1312,6 +1321,10 @@ return scaleInitiateCommon (s, action, state, option, nOption); } } + else if ((state & BUTTON_STATE) && (ss->state == SCALE_STATE_WAIT || ss->state == SCALE_STATE_OUT)){ + if (ss->type == ScaleTypeGroup) + return scaleTerminate (s->display, action, 0, option, nOption); + } else if ((state & EDGE_STATE) && ss->state == SCALE_STATE_WAIT) { if (ss->type == ScaleTypeGroup) @@ -1344,6 +1357,10 @@ ss->type = ScaleTypeOutput; return scaleInitiateCommon (s, action, state, option, nOption); } + else if ((state & BUTTON_STATE) && (ss->state == SCALE_STATE_WAIT || ss->state == SCALE_STATE_OUT)){ + if (ss->type == ScaleTypeOutput) + return scaleTerminate (s->display, action, 0, option, nOption); + } else if ((state & EDGE_STATE) && ss->state == SCALE_STATE_WAIT) { if (ss->type == ScaleTypeOutput) @@ -1915,18 +1932,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 }