]> Dogcows Code - chaz/openbox/commitdiff
some nice options for the menus, warpPointer, xorStyle (better name wanted for this...
authorMikael Magnusson <mikachu@comhem.se>
Sat, 20 Mar 2004 22:53:16 +0000 (22:53 +0000)
committerMikael Magnusson <mikachu@comhem.se>
Sat, 20 Mar 2004 22:53:16 +0000 (22:53 +0000)
openbox/config.c
openbox/config.h
openbox/event.c
openbox/menuframe.c

index 293174df695cb3ff7957307f20e95b36b9d19336..49105411791504317351e2b1103d43fb0e44bcbd 100644 (file)
@@ -59,6 +59,11 @@ guint config_keyboard_reset_state;
 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 @@ static void parse_menu(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
                                                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 @@ void config_startup(ObParseInst *i)
 
     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);
index 63ea5a6d7f146267813c5f27e74f5e6fc25e94f9..59ac554297a81d93b80ffcf43c20a75f3c64347f 100644 (file)
@@ -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;
 
index a1c7e1f5ee907f3400be3bb268ca9e9782472c69..0c843ac73ea097ca1cf44098e60e0c60022d88d6 100644 (file)
@@ -531,7 +531,7 @@ static void event_process(const XEvent *ec, gpointer data)
 
                 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);
 
index 03e6162104f05889dd6f550701295ad98850e516..a05479351f77f9344b8ea682f7a12fa5a0edc818 100644 (file)
@@ -217,11 +217,15 @@ void menu_frame_move_on_screen(ObMenuFrame *self)
     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);
     }
 }
 
This page took 0.029473 seconds and 4 git commands to generate.