From 3f29b45554d374bc94c3a7dc341fb3708754099d Mon Sep 17 00:00:00 2001 From: Guillaume Emont Date: Sun, 9 Nov 2008 20:55:18 +0100 Subject: [PATCH] Added a desktop->gotoOnActivate option. This option reactivates the old behaviour of _NET_ACTIVE_WINDOW. --- data/rc.xml | 3 +++ data/rc.xsd | 1 + openbox/config.c | 12 ++++++++---- openbox/config.h | 3 +++ openbox/event.c | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/data/rc.xml b/data/rc.xml index 04447f3..9acd2b8 100644 --- a/data/rc.xml +++ b/data/rc.xml @@ -123,6 +123,9 @@ 875 + no + diff --git a/data/rc.xsd b/data/rc.xsd index de227ea..9f5010c 100644 --- a/data/rc.xsd +++ b/data/rc.xsd @@ -91,6 +91,7 @@ + diff --git a/openbox/config.c b/openbox/config.c index 790b03b..258150a 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -56,10 +56,11 @@ RrFont *config_font_menuitem; RrFont *config_font_menutitle; RrFont *config_font_osd; -guint config_desktops_num; -GSList *config_desktops_names; -guint config_screen_firstdesk; -guint config_desktop_popup_time; +guint config_desktops_num; +GSList *config_desktops_names; +guint config_screen_firstdesk; +guint config_desktop_popup_time; +gboolean config_desktop_goto_on_activate; gboolean config_resize_redraw; gint config_resize_popup_show; @@ -698,6 +699,8 @@ static void parse_desktops(xmlNodePtr node, gpointer d) } if ((n = obt_parse_find_node(node, "popupTime"))) config_desktop_popup_time = obt_parse_node_int(n); + if ((n = obt_parse_find_node(node, "gotoOnActivate"))) + config_desktop_goto_on_activate = obt_parse_node_bool(n); } static void parse_resize(xmlNodePtr node, gpointer d) @@ -983,6 +986,7 @@ void config_startup(ObtParseInst *i) config_screen_firstdesk = 1; config_desktops_names = NULL; config_desktop_popup_time = 875; + config_desktop_goto_on_activate = FALSE; obt_parse_register(i, "desktops", parse_desktops, NULL); diff --git a/openbox/config.h b/openbox/config.h index 248f97b..26e515d 100644 --- a/openbox/config.h +++ b/openbox/config.h @@ -154,6 +154,9 @@ extern guint config_screen_firstdesk; extern GSList *config_desktops_names; /*! Amount of time to show the desktop switch dialog */ extern guint config_desktop_popup_time; +/*! Go to the desktop of a window when it is activated */ +extern gboolean config_desktop_goto_on_activate; + /*! The keycode of the key combo which resets the keybaord chains */ extern guint config_keyboard_reset_keycode; diff --git a/openbox/event.c b/openbox/event.c index 44b6eb7..dd69091 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1345,7 +1345,7 @@ static void event_handle_client(ObClient *client, XEvent *e) ob_debug_type(OB_DEBUG_APP_BUGS, "_NET_ACTIVE_WINDOW message for window %s is " "missing source indication"); - client_activate(client, TRUE, TRUE, TRUE, + client_activate(client, !config_desktop_goto_on_activate, TRUE, TRUE, (e->xclient.data.l[0] == 0 || e->xclient.data.l[0] == 2)); } else if (msgtype == OBT_PROP_ATOM(NET_WM_MOVERESIZE)) { -- 1.5.6.3