/** Root menu callback. */ void RunRootCommand(const MenuAction *action) { switch(action->type) { case MA_EXECUTE: RunCommand(action->data.str); break; case MA_RESTART: Restart(); break; case MA_EXIT: if(exitCommand) { Release(exitCommand); } exitCommand = CopyString(action->data.str); Exit(); break; case MA_DESKTOP: ChangeDesktop(action->data.i); break; case MA_SENDTO: case MA_LAYER: case MA_MAXIMIZE: case MA_MINIMIZE: case MA_RESTORE: case MA_SHADE: case MA_MOVE: case MA_RESIZE: case MA_KILL: case MA_CLOSE: ChooseWindow(action); break; default: Debug("invalid RunRootCommand action: %d", action->type); break; } }
/** Root menu callback. */ void RunRootCommand(MenuAction *action, unsigned button) { switch(action->type) { case MA_EXECUTE: RunCommand(action->str); break; case MA_RESTART: Restart(); break; case MA_EXIT: if(exitCommand) { Release(exitCommand); } exitCommand = CopyString(action->str); Exit(); break; case MA_DESKTOP: ChangeDesktop(action->value); break; case MA_SENDTO: case MA_LAYER: case MA_MAXIMIZE: case MA_MINIMIZE: case MA_RESTORE: case MA_SHADE: case MA_MOVE: case MA_RESIZE: case MA_KILL: case MA_CLOSE: ChooseWindow(action); break; default: break; } }