--- orig/settings-dialogs/tweaks-settings.c 2012-04-28 16:56:34.000000000 -0400 +++ patched/settings-dialogs/tweaks-settings.c 2012-10-26 15:29:18.000000000 -0400 @@ -176,6 +176,8 @@ GtkWidget *activate_action_switch_option = GTK_WIDGET (gtk_builder_get_object (builder, "activate_action_switch_option")); GtkWidget *activate_action_none_option = GTK_WIDGET (gtk_builder_get_object (builder, "activate_action_none_option")); + GtkWidget *retain_focus_when_lowering_check = GTK_WIDGET (gtk_builder_get_object (builder, "retain_focus_when_lowering_check")); + /* Accessibility tab */ GtkWidget *easy_click_combo_box = GTK_WIDGET (gtk_builder_get_object (builder, "easy_click_combo_box")); GtkWidget *raise_with_any_button_check = GTK_WIDGET (gtk_builder_get_object (builder, "raise_with_any_button_check")); @@ -325,6 +327,10 @@ "/general/focus_hint", G_TYPE_BOOLEAN, (GObject *)focus_hint_check, "active"); + xfconf_g_property_bind (xfwm4_channel, + "/general/retain_focus_when_lowering", + G_TYPE_BOOLEAN, + (GObject *)retain_focus_when_lowering_check, "active"); /* Accessibility tab */ xfconf_g_property_bind (xfwm4_channel, --- orig/settings-dialogs/xfwm4-tweaks-dialog.glade 2012-04-28 16:56:34.000000000 -0400 +++ patched/settings-dialogs/xfwm4-tweaks-dialog.glade 2012-10-26 15:25:32.000000000 -0400 @@ -255,6 +255,21 @@ 2 + + + Retain focus when _lowering window + True + True + False + True + True + + + False + False + 3 + + 1 --- orig/src/settings.c 2012-04-28 16:56:34.000000000 -0400 +++ patched/src/settings.c 2012-10-26 15:43:24.000000000 -0400 @@ -706,6 +706,7 @@ {"repeat_urgent_blink", NULL, G_TYPE_BOOLEAN, TRUE}, {"resize_opacity", NULL, G_TYPE_INT, TRUE}, {"restore_on_move", NULL, G_TYPE_BOOLEAN, TRUE}, + {"retain_focus_when_lowering", NULL, G_TYPE_BOOLEAN, TRUE}, {"scroll_workspaces", NULL, G_TYPE_BOOLEAN, TRUE}, {"shadow_delta_height", NULL, G_TYPE_INT, TRUE}, {"shadow_delta_width", NULL, G_TYPE_INT, TRUE}, @@ -793,6 +794,8 @@ getBoolValue ("urgent_blink", rc); screen_info->params->restore_on_move = getBoolValue ("restore_on_move", rc); + screen_info->params->retain_focus_when_lowering = + getBoolValue ("retain_focus_when_lowering", rc); screen_info->params->frame_opacity = CLAMP (getIntValue ("frame_opacity", rc), 0, 100); screen_info->params->inactive_opacity = @@ -1302,6 +1305,10 @@ { screen_info->params->restore_on_move = g_value_get_boolean (value); } + else if (!strcmp (name, "retain_focus_when_lowering")) + { + screen_info->params->retain_focus_when_lowering = g_value_get_boolean (value); + } else if (!strcmp (name, "scroll_workspaces")) { screen_info->params->scroll_workspaces = g_value_get_boolean (value); --- orig/src/settings.h 2012-04-28 16:56:34.000000000 -0400 +++ patched/src/settings.h 2012-10-26 15:53:54.000000000 -0400 @@ -215,6 +215,7 @@ gboolean raise_with_any_button; gboolean repeat_urgent_blink; gboolean restore_on_move; + gboolean retain_focus_when_lowering; gboolean scroll_workspaces; gboolean show_app_icon; gboolean show_dock_shadow; --- orig/src/stacking.c 2012-04-28 16:56:34.000000000 -0400 +++ patched/src/stacking.c 2012-10-26 15:45:22.000000000 -0400 @@ -521,7 +521,10 @@ */ clientApplyStackList (screen_info); clientSetNetClientList (screen_info, display_info->atoms[NET_CLIENT_LIST_STACKING], screen_info->windows_stack); - clientPassFocus (screen_info, c, NULL); + if (!screen_info->params->retain_focus_when_lowering) + { + clientPassFocus (screen_info, c, NULL); + } if (screen_info->last_raise == c) { screen_info->last_raise = NULL;