? fancypants.diff
Index: openbox/client.c
===================================================================
RCS file: /cvs/cvsroot/openbox/openbox/client.c,v
retrieving revision 1.356
diff -p -u -r1.356 client.c
--- openbox/client.c	11 Jun 2006 09:47:53 -0000	1.356
+++ openbox/client.c	16 Jun 2006 19:18:02 -0000
@@ -1303,7 +1303,8 @@ void client_setup_decor_and_functions(Ob
                    (self->mwmhints.decorations & OB_MWM_DECOR_TITLE)))
                 /* if the mwm hints request no handle or title, then all
                    decorations are disabled */
-                self->decorations = config_theme_keepborder ? OB_FRAME_DECOR_BORDER : 0;
+//                self->decorations = 0;
+self->decorations = config_theme_keepborder ? OB_FRAME_DECOR_BORDER : 0;
         }
     }
 
Index: openbox/config.c
===================================================================
RCS file: /cvs/cvsroot/openbox/openbox/config.c,v
retrieving revision 1.106
diff -p -u -r1.106 config.c
--- openbox/config.c	9 Jun 2006 14:52:06 -0000	1.106
+++ openbox/config.c	16 Jun 2006 19:18:02 -0000
@@ -38,6 +38,7 @@ ObPlacePolicy config_place_policy;
 gchar   *config_theme;
 gboolean config_theme_keepborder;
 gboolean config_theme_hidedisabled;
+gboolean config_theme_hidemenuheader;
 
 gchar *config_title_layout;
 
@@ -434,6 +435,8 @@ static void parse_theme(ObParseInst *i, 
         config_theme_keepborder = parse_bool(doc, n);
     if ((n = parse_find_node("hideDisabled", node)))
         config_theme_hidedisabled = parse_bool(doc, n);
+    if ((n = parse_find_node("hideMenuHeader", node)))
+        config_theme_hidemenuheader = parse_bool(doc, n);
 }
 
 static void parse_desktops(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
@@ -739,7 +742,7 @@ void config_startup(ObParseInst *i)
     config_title_layout = g_strdup("NLIMC");
     config_theme_keepborder = TRUE;
     config_theme_hidedisabled = FALSE;
-
+    config_theme_hidemenuheader = FALSE;
     parse_register(i, "theme", parse_theme, NULL);
 
     config_desktops_num = 4;
Index: openbox/config.h
===================================================================
RCS file: /cvs/cvsroot/openbox/openbox/config.h,v
retrieving revision 1.60
diff -p -u -r1.60 config.h
--- openbox/config.h	8 Jun 2006 10:34:15 -0000	1.60
+++ openbox/config.h	16 Jun 2006 19:18:03 -0000
@@ -39,6 +39,8 @@ extern guint    config_focus_delay;
 extern gboolean config_focus_raise;
 /*! Focus the last focused window, not under the mouse, in follow mouse mode */
 extern gboolean config_focus_last;
+/* Hide the menu header? */
+extern gboolean config_theme_hidemenuheader;
 
 extern ObPlacePolicy config_place_policy;
 
Index: openbox/dock.c
===================================================================
RCS file: /cvs/cvsroot/openbox/openbox/dock.c,v
retrieving revision 1.40
diff -p -u -r1.40 dock.c
--- openbox/dock.c	25 Sep 2005 14:45:24 -0000	1.40
+++ openbox/dock.c	16 Jun 2006 19:18:03 -0000
@@ -60,7 +60,7 @@ void dock_startup(gboolean reconfig)
         XSetWindowBorderWidth(ob_display, dock->frame, ob_rr_theme->bwidth);
 
         RrAppearanceFree(dock->a_frame);
-        dock->a_frame = RrAppearanceCopy(ob_rr_theme->a_unfocused_title);
+        dock->a_frame = RrAppearanceCopy(ob_rr_theme->a_menu);
 
         stacking_add(DOCK_AS_WINDOW(dock));
 
Index: openbox/menu.c
===================================================================
RCS file: /cvs/cvsroot/openbox/openbox/menu.c,v
retrieving revision 1.108
diff -p -u -r1.108 menu.c
--- openbox/menu.c	23 Apr 2006 00:37:23 -0000	1.108
+++ openbox/menu.c	16 Jun 2006 19:18:03 -0000
@@ -314,13 +314,8 @@ void menu_show(gchar *name, gint x, gint
         }
     }
     if (!menu_frame_show(frame, NULL))
+//i can live with this: 
         menu_frame_free(frame);
-    else if (frame->entries) {
-        ObMenuEntryFrame *e = frame->entries->data;
-        if (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL &&
-            e->entry->data.normal.enabled)
-                menu_frame_select(frame, e);
-    }
 }
 
 static ObMenuEntry* menu_entry_new(ObMenu *menu, ObMenuEntryType type, gint id)
Index: openbox/menuframe.c
===================================================================
RCS file: /cvs/cvsroot/openbox/openbox/menuframe.c,v
retrieving revision 1.54
diff -p -u -r1.54 menuframe.c
--- openbox/menuframe.c	16 Jun 2006 12:41:39 -0000	1.54
+++ openbox/menuframe.c	16 Jun 2006 19:18:04 -0000
@@ -62,7 +62,7 @@ ObMenuFrame* menu_frame_new(ObMenu *menu
     self->type = Window_Menu;
     self->menu = menu;
     self->selected = NULL;
-    self->show_title = TRUE;
+    self->show_title = !config_theme_hidemenuheader;
     self->client = client;
 
     attr.event_mask = FRAME_EVENTMASK;
@@ -376,7 +376,7 @@ static void menu_entry_frame_render(ObMe
         XMapWindow(ob_display, self->icon);
     } else
         XUnmapWindow(ob_display, self->icon);
-
+ XFlush(ob_display);
     if (self->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU) {
         RrAppearance *bullet_a;
         XMoveResizeWindow(ob_display, self->bullet,
@@ -414,6 +414,8 @@ static void menu_frame_render(ObMenuFram
     XSetWindowBorderWidth(ob_display, self->window, ob_rr_theme->bwidth);
     XSetWindowBorder(ob_display, self->window,
                      RrColorPixel(ob_rr_theme->b_color));
+    XSetWindowBorder(ob_display, self->window,
+                     RrColorPixel(ob_rr_theme->mb_color));
 
     if (!self->parent && self->show_title) {
         XMoveWindow(ob_display, self->title, 
Index: openbox/openbox.c
===================================================================
RCS file: /cvs/cvsroot/openbox/openbox/openbox.c,v
retrieving revision 1.130
diff -p -u -r1.130 openbox.c
--- openbox/openbox.c	1 Apr 2005 13:04:55 -0000	1.130
+++ openbox/openbox.c	16 Jun 2006 19:18:05 -0000
@@ -68,6 +68,9 @@
 #  include <unistd.h>
 #endif
 #include <errno.h>
+#ifdef USE_GTK
+#   include <gtk/gtk.h>
+#endif
 
 #include <X11/cursorfont.h>
 
@@ -105,6 +108,10 @@ gint main(gint argc, gchar **argv)
     bind_textdomain_codeset(PACKAGE_NAME, "UTF-8");
     textdomain(PACKAGE_NAME);
 
+#ifdef USE_GTK
+    gtk_init (&argv, &argv);
+#endif
+
     g_set_prgname(argv[0]);
 
     if (chdir(g_get_home_dir()) == -1)
@@ -163,7 +170,7 @@ gint main(gint argc, gchar **argv)
     cursors[OB_CURSOR_BUSY] =
         XCreateFontCursor(ob_display, XC_watch);
     cursors[OB_CURSOR_MOVE] =
-        XCreateFontCursor(ob_display, XC_fleur);
+        XCreateFontCursor(ob_display, XC_plus);
     cursors[OB_CURSOR_NORTH] =
         XCreateFontCursor(ob_display, XC_top_side);
     cursors[OB_CURSOR_NORTHEAST] =
Index: openbox/place.c
===================================================================
RCS file: /cvs/cvsroot/openbox/openbox/place.c,v
retrieving revision 1.39
diff -p -u -r1.39 place.c
--- openbox/place.c	9 Jun 2006 22:35:55 -0000	1.39
+++ openbox/place.c	16 Jun 2006 19:18:05 -0000
@@ -174,6 +174,7 @@ static gint area_cmp(gconstpointer p1, g
         for (i = 1; i < screen_num_monitors; ++i)
             if (num[i] > num[most])
                 most = i;
+                g_free(num);
 
         g_free(num);
 
Index: openbox/screen.c
===================================================================
RCS file: /cvs/cvsroot/openbox/openbox/screen.c,v
retrieving revision 1.121
diff -p -u -r1.121 screen.c
--- openbox/screen.c	7 Oct 2005 17:00:35 -0000	1.121
+++ openbox/screen.c	16 Jun 2006 19:18:07 -0000
@@ -43,7 +43,7 @@
 #include <assert.h>
 
 /*! The event mask to grab on the root window */
-#define ROOT_EVENTMASK (StructureNotifyMask | PropertyChangeMask | \
+//#define ROOT_EVENTMASK (StructureNotifyMask | PropertyChangeMask | \
                         EnterWindowMask | LeaveWindowMask | \
                         SubstructureNotifyMask | SubstructureRedirectMask | \
                         ButtonPressMask | ButtonReleaseMask | ButtonMotionMask)
@@ -175,8 +175,15 @@ gboolean screen_annex()
 
     xerror_set_ignore(TRUE);
     xerror_occured = FALSE;
-    XSelectInput(ob_display, RootWindow(ob_display, ob_screen),
-                 ROOT_EVENTMASK);
+    XSelectInput(ob_display, RootWindow(ob_display, ob_screen),               
+                StructureNotifyMask | PropertyChangeMask | 
+                        EnterWindowMask | LeaveWindowMask | 
+                        SubstructureNotifyMask | SubstructureRedirectMask
+ | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask
+#ifdef HAVE_COMPOSITE_EXTENSIONS
+                ExposureMask |
+#endif
+);
     xerror_set_ignore(FALSE);
     if (xerror_occured) {
         g_warning("A window manager is already running on screen %d",
@@ -204,7 +211,7 @@ gboolean screen_annex()
                window, screen_support_win);
 
     /* set the _NET_SUPPORTED_ATOMS hint */
-    num_support = 51;
+    num_support = 50;
     i = 0;
     supported = g_new(gulong, num_support);
     supported[i++] = prop_atoms.net_current_desktop;
@@ -220,7 +227,7 @@ gboolean screen_annex()
     supported[i++] = prop_atoms.net_desktop_layout;
     supported[i++] = prop_atoms.net_showing_desktop;
     supported[i++] = prop_atoms.net_wm_name;
-    supported[i++] = prop_atoms.net_wm_visible_name;
+ //   supported[i++] = prop_atoms.net_wm_visible_name;
     supported[i++] = prop_atoms.net_wm_icon_name;
     supported[i++] = prop_atoms.net_wm_visible_icon_name;
     supported[i++] = prop_atoms.net_wm_desktop;
Index: render/color.c
===================================================================
RCS file: /cvs/cvsroot/openbox/render/color.c,v
retrieving revision 1.37
diff -p -u -r1.37 color.c
--- render/color.c	14 Mar 2006 15:27:15 -0000	1.37
+++ render/color.c	16 Jun 2006 19:18:07 -0000
@@ -23,8 +23,81 @@
 
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
+#ifdef USE_GTK
+#   include <gtk/gtk.h>
+#   include <gdk/gdk.h>
+#endif
 #include <string.h>
 
+#ifdef USE_GTK
+gchar *GtkConstToColorname (gchar *colorname)
+{
+    GtkWidget *widget;
+    GdkColor *col = NULL;
+    gchar *tmp;
+
+    gtk_rc_reparse_all ();
+    widget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+    gtk_widget_ensure_style (widget);
+
+    /* FIXME: omg, this is awful */
+    /* fg */
+    if (!g_ascii_strcasecmp (colorname, "GTK_FG_NORMAL"))
+	col = &GTK_WIDGET (widget)->style->fg[GTK_STATE_NORMAL];
+    else if (!g_ascii_strcasecmp (colorname, "GTK_FG_ACTIVE"))
+	col = &GTK_WIDGET (widget)->style->fg[GTK_STATE_ACTIVE];
+    else if (!g_ascii_strcasecmp (colorname, "GTK_FG_PRELIGHT"))
+	col = &GTK_WIDGET (widget)->style->fg[GTK_STATE_PRELIGHT];
+    else if (!g_ascii_strcasecmp (colorname, "GTK_FG_SELECTED"))
+	col = &GTK_WIDGET (widget)->style->fg[GTK_STATE_SELECTED];
+    else if (!g_ascii_strcasecmp (colorname, "GTK_FG_INSENSITIVE"))
+	col = &GTK_WIDGET (widget)->style->fg[GTK_STATE_INSENSITIVE];
+    /* bg */
+    else if (!g_ascii_strcasecmp (colorname, "GTK_BG_NORMAL"))
+	col = &GTK_WIDGET (widget)->style->bg[GTK_STATE_NORMAL];
+    else if (!g_ascii_strcasecmp (colorname, "GTK_BG_ACTIVE"))
+	col = &GTK_WIDGET (widget)->style->bg[GTK_STATE_ACTIVE];
+    else if (!g_ascii_strcasecmp (colorname, "GTK_BG_PRELIGHT"))
+	col = &GTK_WIDGET (widget)->style->bg[GTK_STATE_PRELIGHT];
+    else if (!g_ascii_strcasecmp (colorname, "GTK_BG_SELECTED"))
+	col = &GTK_WIDGET (widget)->style->bg[GTK_STATE_SELECTED];
+    else if (!g_ascii_strcasecmp (colorname, "GTK_BG_INSENSITIVE"))
+	col = &GTK_WIDGET (widget)->style->bg[GTK_STATE_INSENSITIVE];
+    /* base */
+    else if (!g_ascii_strcasecmp (colorname, "GTK_BASE_NORMAL"))
+	col = &GTK_WIDGET (widget)->style->base[GTK_STATE_NORMAL];
+    else if (!g_ascii_strcasecmp (colorname, "GTK_BASE_ACTIVE"))
+	col = &GTK_WIDGET (widget)->style->base[GTK_STATE_ACTIVE];
+    else if (!g_ascii_strcasecmp (colorname, "GTK_BASE_PRELIGHT"))
+	col = &GTK_WIDGET (widget)->style->base[GTK_STATE_PRELIGHT];
+    else if (!g_ascii_strcasecmp (colorname, "GTK_BASE_SELECTED"))
+	col = &GTK_WIDGET (widget)->style->base[GTK_STATE_SELECTED];
+    else if (!g_ascii_strcasecmp (colorname, "GTK_BASE_INSENSITIVE"))
+	col = &GTK_WIDGET (widget)->style->base[GTK_STATE_INSENSITIVE];
+    /* text */
+    else if (!g_ascii_strcasecmp (colorname, "GTK_TEXT_NORMAL"))
+	col = &GTK_WIDGET (widget)->style->text[GTK_STATE_NORMAL];
+    else if (!g_ascii_strcasecmp (colorname, "GTK_TEXT_ACTIVE"))
+	col = &GTK_WIDGET (widget)->style->text[GTK_STATE_ACTIVE];
+    else if (!g_ascii_strcasecmp (colorname, "GTK_TEXT_PRELIGHT"))
+	col = &GTK_WIDGET (widget)->style->text[GTK_STATE_PRELIGHT];
+    else if (!g_ascii_strcasecmp (colorname, "GTK_TEXT_SELECTED"))
+	col = &GTK_WIDGET (widget)->style->text[GTK_STATE_SELECTED];
+    else if (!g_ascii_strcasecmp (colorname, "GTK_TEXT_INSENSITIVE"))
+	col = &GTK_WIDGET (widget)->style->text[GTK_STATE_INSENSITIVE];
+
+    gtk_widget_destroy (widget);
+
+    if (col)
+	tmp = g_strdup_printf ("#%02x%02x%02x",
+		col->red >> 8, col->green >> 8, col->blue >> 8);
+    else
+	tmp = g_strdup ("#ffffff");
+
+    return (tmp);
+}
+#endif /* USE_GTK */
+
 void RrColorAllocateGC(RrColor *in)
 {
     XGCValues gcv;
@@ -39,19 +112,32 @@ void RrColorAllocateGC(RrColor *in)
 RrColor *RrColorParse(const RrInstance *inst, gchar *colorname)
 {
     XColor xcol;
+    RrColor *ret;
 
     g_assert(colorname != NULL);
     /* get rgb values from colorname */
 
+    /* beware! voodoo following */
+#ifdef USE_GTK
+    if (!g_ascii_strncasecmp (colorname, "GTK", 3))
+	colorname = GtkConstToColorname (colorname);
+    else
+	colorname = g_strdup (colorname);
+#endif
+
     xcol.red = 0;
     xcol.green = 0;
     xcol.blue = 0;
     xcol.pixel = 0;
-    if (!XParseColor(RrDisplay(inst), RrColormap(inst), colorname, &xcol)) {
+    if (!XParseColor(RrDisplay(inst), RrColormap(inst), colorname, &xcol))
         g_warning("unable to parse color '%s'", colorname);
-        return NULL;
-    }
-    return RrColorNew(inst, xcol.red >> 8, xcol.green >> 8, xcol.blue >> 8);
+    else
+	ret= RrColorNew(inst, xcol.red >> 8, xcol.green >> 8, xcol.blue >> 8);
+
+#ifdef USE_GTK
+    g_free (colorname);
+#endif
+    return ret;
 }
 
 /*#define NO_COLOR_CACHE*/
Index: render/gradient.c
===================================================================
RCS file: /cvs/cvsroot/openbox/render/gradient.c,v
retrieving revision 1.49
diff -p -u -r1.49 gradient.c
--- render/gradient.c	14 Jun 2006 19:47:28 -0000	1.49
+++ render/gradient.c	16 Jun 2006 19:18:08 -0000
@@ -136,11 +136,11 @@ static void highlight(RrPixel32 *x, RrPi
         down = x;
     }
     r = (*up >> RrDefaultRedOffset) & 0xFF;
-    r += r >> 1;
+    r += r >> 3;
     g = (*up >> RrDefaultGreenOffset) & 0xFF;
-    g += g >> 1;
+    g += g >> 3;
     b = (*up >> RrDefaultBlueOffset) & 0xFF;
-    b += b >> 1;
+    b += b >> 3;
     if (r > 0xFF) r = 0xFF;
     if (g > 0xFF) g = 0xFF;
     if (b > 0xFF) b = 0xFF;
@@ -148,11 +148,11 @@ static void highlight(RrPixel32 *x, RrPi
         + (b << RrDefaultBlueOffset);
   
     r = (*down >> RrDefaultRedOffset) & 0xFF;
-    r = (r >> 1) + (r >> 2);
+    r = (r >> 1) + (r >> 2) * 1.7;
     g = (*down >> RrDefaultGreenOffset) & 0xFF;
-    g = (g >> 1) + (g >> 2);
+    g = (g >> 1) + (g >> 2) * 1.7;
     b = (*down >> RrDefaultBlueOffset) & 0xFF;
-    b = (b >> 1) + (b >> 2);
+    b = (b >> 1) + (b >> 2) * 1.7;
     *down = (r << RrDefaultRedOffset) + (g << RrDefaultGreenOffset)
         + (b << RrDefaultBlueOffset);
 }
@@ -163,11 +163,11 @@ static void create_bevel_colors(RrAppear
 
     /* light color */
     r = l->surface.primary->r;
-    r += r >> 1;
+    r += r >> 3;
     g = l->surface.primary->g;
-    g += g >> 1;
+    g += g >> 3;
     b = l->surface.primary->b;
-    b += b >> 1;
+    b += b >> 3;
     if (r > 0xFF) r = 0xFF;
     if (g > 0xFF) g = 0xFF;
     if (b > 0xFF) b = 0xFF;
@@ -176,11 +176,11 @@ static void create_bevel_colors(RrAppear
 
     /* dark color */
     r = l->surface.primary->r;
-    r = (r >> 1) + (r >> 2);
+    r = (r >> 1) + (r >> 2) * 1.7;
     g = l->surface.primary->g;
-    g = (g >> 1) + (g >> 2);
+    g = (g >> 1) + (g >> 2) * 1.7;
     b = l->surface.primary->b;
-    b = (b >> 1) + (b >> 2);
+    b = (b >> 1) + (b >> 2) * 1.7;
     g_assert(!l->surface.bevel_dark);
     l->surface.bevel_dark = RrColorNew(l->inst, r, g, b);
 }
Index: render/theme.c
===================================================================
RCS file: /cvs/cvsroot/openbox/render/theme.c,v
retrieving revision 1.77
diff -p -u -r1.77 theme.c
--- render/theme.c	14 Jun 2006 19:20:46 -0000	1.77
+++ render/theme.c	16 Jun 2006 19:18:10 -0000
@@ -186,6 +186,12 @@ RrTheme* RrThemeNew(const RrInstance *in
     if (!read_color(db, inst,
                     "border.color", &theme->b_color))
         theme->b_color = RrColorNew(inst, 0, 0, 0);
+    if (!read_color(db, inst,  
+                   "menu.border.color", &theme->mb_color))
+        theme->mb_color = RrColorNew(inst, 
+                                    theme->b_color->r, 
+                                    theme->b_color->g, 
+                                    theme->b_color->b); 
     if (!read_color(db, inst,
                     "window.active.client.color",
                     &theme->cb_focused_color))
@@ -904,7 +910,7 @@ RrTheme* RrThemeNew(const RrInstance *in
             theme->padding * 2;
     }
     theme->button_size = theme->label_height - 2;
-    theme->grip_width = theme->title_height * 1.5;
+    theme->grip_width = 23;
 
     return theme;
 }
Index: render/theme.h
===================================================================
RCS file: /cvs/cvsroot/openbox/render/theme.h,v
retrieving revision 1.37
diff -p -u -r1.37 theme.h
--- render/theme.h	14 Jul 2005 20:41:24 -0000	1.37
+++ render/theme.h	16 Jun 2006 19:18:10 -0000
@@ -48,6 +48,7 @@ struct _RrTheme {
 
     /* style settings - colors */
     RrColor *b_color;
+    RrColor *mb_color;
     RrColor *cb_focused_color;
     RrColor *cb_unfocused_color;
     RrColor *title_focused_color;

