all repos — openbox @ bc0440851789c9626bc9f9d3a13a7164915bdcfa

openbox fork - make it a bit more like ryudo

some nice options for the menus, warpPointer, xorStyle (better name wanted for this :), hilightFirst and hideDelay (this was hardcoded to .25 secs earlier)
Mikael Magnusson mikachu@comhem.se
commit

bc0440851789c9626bc9f9d3a13a7164915bdcfa

parent

cd0204d6269634cad3085130dc78aed2dd9b1d55

4 files changed, 32 insertions(+), 3 deletions(-)

jump to
M openbox/config.copenbox/config.c

@@ -59,6 +59,11 @@

gint config_mouse_threshold; gint config_mouse_dclicktime; +gboolean config_menu_warppointer; +gboolean config_menu_xorstyle; +gboolean config_menu_hilightfirst; +guint config_menu_hide_delay; + GSList *config_menu_files; gint config_resist_win;

@@ -373,6 +378,14 @@ config_menu_files = g_slist_append(config_menu_files,

parse_expand_tilde(c)); g_free(c); } + if ((n = parse_find_node("warpPointer", node))) + config_menu_warppointer = parse_bool(doc, n); + if ((n = parse_find_node("xorStyle", node))) + config_menu_xorstyle = parse_bool(doc, n); + if ((n = parse_find_node("hilightFirst", node))) + config_menu_hilightfirst = parse_bool(doc, n); + if ((n = parse_find_node("hideDelay", node))) + config_menu_hide_delay = parse_int(doc, n); } }

@@ -553,6 +566,10 @@ config_resist_edge = 20;

parse_register(i, "resistance", parse_resistance, NULL); + config_menu_warppointer = TRUE; + config_menu_xorstyle = TRUE; + config_menu_hilightfirst = TRUE; + config_menu_hide_delay = 250; config_menu_files = NULL; parse_register(i, "menu", parse_menu, NULL);
M openbox/config.hopenbox/config.h

@@ -97,6 +97,14 @@ extern gint config_resist_win;

/*! Number of pixels to resist while crossing a screen's edge */ extern gint config_resist_edge; +/*! Warp near edge on menu? */ +extern gboolean config_menu_warppointer; +/*! make menus jump around a lot */ +extern gboolean config_menu_xorstyle; +/*! hilight first entry in menu */ +extern gboolean config_menu_hilightfirst; +/*! delay for hiding menu when opening */ +extern guint config_menu_hide_delay; /*! User-specified menu files */ extern GSList *config_menu_files;
M openbox/event.copenbox/event.c

@@ -531,7 +531,7 @@ }

menu_can_hide = FALSE; ob_main_loop_timeout_add(ob_main_loop, - G_USEC_PER_SEC / 4, + config_menu_hide_delay * 1000, menu_hide_delay_func, NULL, NULL);
M openbox/menuframe.copenbox/menuframe.c

@@ -217,11 +217,15 @@

if (dx || dy) { ObMenuFrame *f; - for (f = self; f; f = f->parent) + menu_frame_move(self, self->area.x + dx, self->area.y + dy); + if (!config_menu_xorstyle) + dy = 0; + for (f = self->parent; f; f = f->parent) menu_frame_move(f, f->area.x + dx, f->area.y + dy); for (f = self->child; f; f = f->child) menu_frame_move(f, f->area.x + dx, f->area.y + dy); - XWarpPointer(ob_display, None, None, 0, 0, 0, 0, dx, dy); + if (config_menu_warppointer) + XWarpPointer(ob_display, None, None, 0, 0, 0, 0, dx, dy); } }