X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Factions%2Fcyclewindows.c;h=bbcb6585a11422e22001bf22ab8925af321c13cd;hb=4463bb6e2f038a90bf296d63ae555fc693be2778;hp=6619b387165b896bca51cde2e0000eaa7ffdfb75;hpb=43d62990e407f409f76f60a405c529f9b15d33f6;p=chaz%2Fopenbox diff --git a/openbox/actions/cyclewindows.c b/openbox/actions/cyclewindows.c index 6619b387..bbcb6585 100644 --- a/openbox/actions/cyclewindows.c +++ b/openbox/actions/cyclewindows.c @@ -11,6 +11,7 @@ typedef struct { gboolean linear; gboolean dock_windows; gboolean desktop_windows; + gboolean only_hilite_windows; gboolean all_desktops; gboolean forward; gboolean bar; @@ -43,6 +44,7 @@ static void free_func(gpointer options); static gboolean run_func(ObActionsData *data, gpointer options); static gboolean i_input_func(guint initial_state, XEvent *e, + ObtIC *ic, gpointer options, gboolean *used); static void i_cancel_func(gpointer options); @@ -64,7 +66,7 @@ static gpointer setup_func(xmlNodePtr node, xmlNodePtr n; Options *o; - o = g_new0(Options, 1); + o = g_slice_new0(Options); o->bar = TRUE; o->dialog_mode = OB_FOCUS_CYCLE_POPUP_MODE_LIST; @@ -82,6 +84,8 @@ static gpointer setup_func(xmlNodePtr node, o->raise = obt_xml_node_bool(n); if ((n = obt_xml_find_node(node, "panels"))) o->dock_windows = obt_xml_node_bool(n); + if ((n = obt_xml_find_node(node, "hilite"))) + o->only_hilite_windows = obt_xml_node_bool(n); if ((n = obt_xml_find_node(node, "desktop"))) o->desktop_windows = obt_xml_node_bool(n); if ((n = obt_xml_find_node(node, "allDesktops"))) @@ -143,7 +147,7 @@ static void free_func(gpointer options) o->actions = g_slist_delete_link(o->actions, o->actions); } - g_free(o); + g_slice_free(Options, o); } static gboolean run_func(ObActionsData *data, gpointer options) @@ -153,6 +157,7 @@ static gboolean run_func(ObActionsData *data, gpointer options) ft = focus_cycle(o->forward, o->all_desktops, + !o->only_hilite_windows, o->dock_windows, o->desktop_windows, o->linear, @@ -169,6 +174,7 @@ static gboolean run_func(ObActionsData *data, gpointer options) static gboolean i_input_func(guint initial_state, XEvent *e, + ObtIC *ic, gpointer options, gboolean *used) { @@ -179,21 +185,21 @@ 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) { + KeySym sym = obt_keyboard_keypress_to_keysym(e); + /* Escape cancels no matter what */ - if (ob_keycode_match(e->xkey.keycode, OB_KEY_ESCAPE)) { + if (sym == XK_Escape) { o->cancel = TRUE; o->state = e->xkey.state; return FALSE; } /* There were no modifiers and they pressed enter */ - else if (ob_keycode_match(e->xkey.keycode, OB_KEY_RETURN) && - !initial_state) - { + else if ((sym == XK_Return || sym == XK_KP_Enter) && !initial_state) { o->cancel = FALSE; o->state = e->xkey.state; return FALSE; @@ -224,6 +230,7 @@ static void i_post_func(gpointer options) ft = focus_cycle(o->forward, o->all_desktops, + !o->only_hilite_windows, o->dock_windows, o->desktop_windows, o->linear,