X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Factions%2Fdesktop.c;h=9c8d2a7b207d56d18a7d214b74b991c2a5552cbf;hb=1666d285d744173e03c585dd6525219732ba313a;hp=10b31acd535c9fc6b086e106a8a007a312333b71;hpb=d179d6428ae585a3b8a13479bfe4586e41de2ff9;p=chaz%2Fopenbox diff --git a/openbox/actions/desktop.c b/openbox/actions/desktop.c index 10b31acd..9c8d2a7b 100644 --- a/openbox/actions/desktop.c +++ b/openbox/actions/desktop.c @@ -6,6 +6,7 @@ typedef enum { LAST, + CURRENT, RELATIVE, ABSOLUTE } SwitchType; @@ -168,6 +169,8 @@ static gpointer setup_func(xmlNodePtr node, gchar *s = obt_xml_node_string(n); if (!g_ascii_strcasecmp(s, "last")) o->type = LAST; + else if (!g_ascii_strcasecmp(s, "current")) + o->type = CURRENT; else if (!g_ascii_strcasecmp(s, "next")) { o->type = RELATIVE; o->u.rel.linear = TRUE; @@ -272,6 +275,9 @@ static gboolean run_func(ObActionsData *data, gpointer options) case LAST: d = screen_last_desktop; break; + case CURRENT: + d = screen_desktop; + break; case ABSOLUTE: d = o->u.abs.desktop; break; @@ -283,7 +289,9 @@ static gboolean run_func(ObActionsData *data, gpointer options) g_assert_not_reached(); } - if (d < screen_num_desktops && d != screen_desktop) { + if (d < screen_num_desktops && + (d != screen_desktop || + (data->client && data->client->desktop != screen_desktop))) { gboolean go = TRUE; actions_client_move(data, TRUE); @@ -316,7 +324,7 @@ static gboolean i_input_func(guint initial_state, if (e->type == KeyRelease) { /* remove from the state the mask of the modifier key being released, if it is a modifier key being released that is */ - mods &= ~obt_keyboard_keycode_to_modmask(e->xkey.keycode); + mods &= ~obt_keyboard_keyevent_to_modmask(e); } if (e->type == KeyPress) { @@ -327,7 +335,7 @@ static gboolean i_input_func(guint initial_state, return FALSE; /* There were no modifiers and they pressed enter */ - else if (sym == XK_Return && !initial_state) + else if ((sym == XK_Return || sym == XK_KP_Enter) && !initial_state) return FALSE; } /* They released the modifiers */