diff -ru3 openbox-3.2-vanilla/openbox/client.c openbox-3.2-tr1/openbox/client.c --- openbox-3.2-vanilla/openbox/client.c 2004-03-31 09:40:06.000000000 +0200 +++ openbox-3.2-tr1/openbox/client.c 2004-09-13 16:41:07.000000000 +0200 @@ -79,7 +79,14 @@ void client_startup(gboolean reconfig) { - if (reconfig) return; + if (reconfig) + { + GList *it; + for (it = client_list; it; it = g_list_next(it)) + client_set_opacity(it->data, + (it->data == focus_client) ? config_opacity_focus : config_opacity_nofocus); + return; + } client_set_list(); } @@ -389,6 +396,10 @@ /* this has to happen after we're in the client_list */ screen_update_areas(); + /* Update opacity */ + client_set_opacity(self, + (focus_client == self) ? config_opacity_focus : config_opacity_nofocus); + /* update the list hints */ client_set_list(); @@ -3330,3 +3341,10 @@ { return self->group && self->group->members->next; } + +void client_set_opacity(ObClient *self, guint opacity) +{ + if(self->frame && self->frame->window != None) + PROP_SET32(self->frame->window, net_wm_window_opacity, cardinal, + (double)0xffffffff * opacity / 100.0); +} diff -ru3 openbox-3.2-vanilla/openbox/client.h openbox-3.2-tr1/openbox/client.h --- openbox-3.2-vanilla/openbox/client.h 2004-03-21 02:03:00.000000000 +0100 +++ openbox-3.2-tr1/openbox/client.h 2004-09-13 16:15:42.000000000 +0200 @@ -565,4 +565,6 @@ gboolean client_has_group_siblings(ObClient *self); +void client_set_opacity(ObClient *self, guint opacity); + #endif diff -ru3 openbox-3.2-vanilla/openbox/config.c openbox-3.2-tr1/openbox/config.c --- openbox-3.2-vanilla/openbox/config.c 2004-04-17 14:12:49.000000000 +0200 +++ openbox-3.2-tr1/openbox/config.c 2004-09-13 16:04:03.000000000 +0200 @@ -73,6 +73,9 @@ gint config_resist_win; gint config_resist_edge; +guint config_opacity_focus; +guint config_opacity_nofocus; + /* @@ -219,6 +222,19 @@ config_focus_last = parse_bool(doc, n); } +static void parse_opacity(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, + gpointer d) +{ + xmlNodePtr n; + + node = node->children; + + if ((n = parse_find_node("focus", node))) + config_opacity_focus = parse_int(doc, n); + if ((n = parse_find_node("nofocus", node))) + config_opacity_nofocus = parse_int(doc, n); +} + static void parse_placement(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, gpointer d) { @@ -570,7 +586,7 @@ config_dock_hide_delay = 300; config_dock_app_move_button = 2; /* middle */ config_dock_app_move_modifiers = 0; - + parse_register(i, "dock", parse_dock, NULL); translate_key("C-g", &config_keyboard_reset_state, @@ -599,6 +615,11 @@ config_menu_files = NULL; parse_register(i, "menu", parse_menu, NULL); + + config_opacity_focus = 80; + config_opacity_nofocus = 50; + + parse_register(i, "opacity", parse_opacity, NULL); } void config_shutdown() diff -ru3 openbox-3.2-vanilla/openbox/config.h openbox-3.2-tr1/openbox/config.h --- openbox-3.2-vanilla/openbox/config.h 2004-03-21 21:06:40.000000000 +0100 +++ openbox-3.2-tr1/openbox/config.h 2004-09-13 15:55:31.000000000 +0200 @@ -116,6 +116,9 @@ /*! User-specified menu files */ extern GSList *config_menu_files; +extern guint config_opacity_focus; +extern guint config_opacity_nofocus; + void config_startup(struct _ObParseInst *i); void config_shutdown(); diff -ru3 openbox-3.2-vanilla/openbox/focus.c openbox-3.2-tr1/openbox/focus.c --- openbox-3.2-vanilla/openbox/focus.c 2004-03-31 11:56:01.000000000 +0200 +++ openbox-3.2-tr1/openbox/focus.c 2004-09-13 16:22:15.000000000 +0200 @@ -193,10 +193,13 @@ /* in the middle of cycling..? kill it. */ if (focus_cycle_target) focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE); - + + if(focus_client) + client_set_opacity(focus_client, config_opacity_nofocus); + old = focus_client; focus_client = client; - + /* move to the top of the list */ if (client != NULL) push_to_top(client); @@ -206,6 +209,8 @@ active = client ? client->window : None; PROP_SET32(RootWindow(ob_display, ob_screen), net_active_window, window, active); + if(client) + client_set_opacity(client, config_opacity_focus); } } diff -ru3 openbox-3.2-vanilla/openbox/prop.c openbox-3.2-tr1/openbox/prop.c --- openbox-3.2-vanilla/openbox/prop.c 2004-03-21 02:03:00.000000000 +0100 +++ openbox-3.2-tr1/openbox/prop.c 2004-09-13 14:24:14.000000000 +0200 @@ -151,6 +151,8 @@ CREATE(openbox_pid, "_OPENBOX_PID"); CREATE(ob_wm_state_undecorated, "_OB_WM_STATE_UNDECORATED"); + + CREATE(net_wm_window_opacity, "_NET_WM_WINDOW_OPACITY"); } #include diff -ru3 openbox-3.2-vanilla/openbox/prop.h openbox-3.2-tr1/openbox/prop.h --- openbox-3.2-vanilla/openbox/prop.h 2004-03-21 02:03:00.000000000 +0100 +++ openbox-3.2-tr1/openbox/prop.h 2004-09-13 14:21:46.000000000 +0200 @@ -164,6 +164,10 @@ Atom openbox_pid; Atom ob_wm_state_undecorated; + + /* xcompmgr opacity hint */ + Atom net_wm_window_opacity; + } Atoms; Atoms prop_atoms;