-void action_execute(union ActionData *data)
-{
- GError *e = NULL;
- gchar *cmd, **argv = 0;
- if (data->execute.path) {
- cmd = g_filename_from_utf8(data->execute.path, -1, NULL, NULL, NULL);
- if (cmd) {
- if (!g_shell_parse_argv (cmd, NULL, &argv, &e)) {
- g_message(_("Failed to execute '%s': %s"),
- cmd, e->message);
- g_error_free(e);
- } else if (data->execute.startupnotify) {
- gchar *program;
-
- program = g_path_get_basename(argv[0]);
- /* sets up the environment */
- sn_setup_spawn_environment(program,
- data->execute.name,
- data->execute.icon_name,
- /* launch it on the current
- desktop */
- screen_desktop,
- data->execute.any.time);
- if (!g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH |
- G_SPAWN_DO_NOT_REAP_CHILD,
- NULL, NULL, NULL, &e)) {
- g_message(_("Failed to execute '%s': %s"),
- cmd, e->message);
- g_error_free(e);
- sn_spawn_cancel();
- }
- unsetenv("DESKTOP_STARTUP_ID");
- g_free(program);
- g_strfreev(argv);
- } else {
- if (!g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH |
- G_SPAWN_DO_NOT_REAP_CHILD,
- NULL, NULL, NULL, &e))
- {
- g_message(_("Failed to execute '%s': %s"),
- cmd, e->message);
- g_error_free(e);
- }
- g_strfreev(argv);
- }
- g_free(cmd);
- } else {
- g_message(_("Failed to convert the path '%s' from utf8"),
- data->execute.path);
- }
- }
-}
-
-void action_activate(union ActionData *data)
-{
- if (data->client.any.c) {
- /* similar to the openbox dock for dockapps, don't let user actions
- give focus to 3rd-party docks (panels) either (unless they ask for
- it themselves). */
- if (data->client.any.c->type != OB_CLIENT_TYPE_DOCK) {
- /* if using focus_delay, stop the timer now so that focus doesn't
- go moving on us */
- event_halt_focus_delay();
-
- client_activate(data->activate.any.c, data->activate.here, TRUE);
- }
- } else {
- /* focus action on something other than a client, make keybindings
- work for this openbox instance, but don't focus any specific client
- */
- focus_nothing();
- }
-}
-
-void action_focus(union ActionData *data)
-{
- if (data->client.any.c) {
- /* similar to the openbox dock for dockapps, don't let user actions
- give focus to 3rd-party docks (panels) either (unless they ask for
- it themselves). */
- if (data->client.any.c->type != OB_CLIENT_TYPE_DOCK) {
- /* if using focus_delay, stop the timer now so that focus doesn't
- go moving on us */
- event_halt_focus_delay();
-
- client_focus(data->client.any.c);
- }
- } else {
- /* focus action on something other than a client, make keybindings
- work for this openbox instance, but don't focus any specific client
- */
- focus_nothing();
- }
-}
-
-void action_unfocus (union ActionData *data)
-{
- if (data->client.any.c == focus_client)
- focus_fallback(FALSE);
-}
-
-void action_iconify(union ActionData *data)
-{
- client_action_start(data);
- client_iconify(data->client.any.c, TRUE, TRUE);
- client_action_end(data);
-}
-
-void action_focus_order_to_bottom(union ActionData *data)
-{
- focus_order_to_bottom(data->client.any.c);
-}
-
-void action_raiselower(union ActionData *data)
-{
- ObClient *c = data->client.any.c;
- GList *it;
- gboolean raise = FALSE;
-
- for (it = stacking_list; it; it = g_list_next(it)) {
- if (WINDOW_IS_CLIENT(it->data)) {
- ObClient *cit = it->data;
-
- if (cit == c) break;
- if (client_normal(cit) == client_normal(c) &&
- cit->layer == c->layer &&
- cit->frame->visible &&
- !client_search_transient(c, cit))
- {
- if (RECT_INTERSECTS_RECT(cit->frame->area, c->frame->area)) {
- raise = TRUE;
- break;
- }
- }
- }
- }
-
- if (raise)
- action_raise(data);
- else
- action_lower(data);
-}
-
-void action_raise(union ActionData *data)
-{
- client_action_start(data);
- stacking_raise(CLIENT_AS_WINDOW(data->client.any.c));
- client_action_end(data);
-}
-