diff --git a/settings-dialogs/tweaks-settings.c b/settings-dialogs/tweaks-settings.c index 4442ba2..9c8676d 100644 --- a/settings-dialogs/tweaks-settings.c +++ b/settings-dialogs/tweaks-settings.c @@ -188,6 +188,7 @@ wm_tweaks_dialog_configure_widgets (GtkBuilder *builder) GtkWidget *placement_ratio_scale = GTK_WIDGET (gtk_builder_get_object (builder, "placement_ratio_scale")); GtkWidget *placement_center_option = GTK_WIDGET (gtk_builder_get_object (builder, "placement_center_option")); GtkWidget *placement_mouse_option = GTK_WIDGET (gtk_builder_get_object (builder, "placement_mouse_option")); + GtkWidget *constrain_windows_check = GTK_WIDGET (gtk_builder_get_object (builder, "constrain_windows_check")); /* Compositing tab */ GtkWidget *use_compositing_check = GTK_WIDGET (gtk_builder_get_object (builder, "use_compositing_check")); @@ -366,6 +367,10 @@ wm_tweaks_dialog_configure_widgets (GtkBuilder *builder) G_TYPE_INT, (GObject *) gtk_range_get_adjustment (GTK_RANGE (placement_ratio_scale)), "value"); + xfconf_g_property_bind (xfwm4_channel, + "/general/constrain_windows", + G_TYPE_BOOLEAN, + (GObject *)constrain_windows_check, "active"); /* Compositing tab */ xfconf_g_property_bind (xfwm4_channel, "/general/use_compositing", diff --git a/settings-dialogs/xfwm4-tweaks-dialog.glade b/settings-dialogs/xfwm4-tweaks-dialog.glade index a9e91ee..fab6011 100644 --- a/settings-dialogs/xfwm4-tweaks-dialog.glade +++ b/settings-dialogs/xfwm4-tweaks-dialog.glade @@ -45,7 +45,6 @@ 480 wmtweaks dialog - False Fine-tune window behaviour and effects @@ -641,6 +640,21 @@ when switching via keyboard shortcuts 2 + + + Constrain windows to the visible portion of the screen + True + True + False + True + True + + + False + False + 3 + + 4 diff --git a/src/client.c b/src/client.c index f17e885..83b9bab 100644 --- a/src/client.c +++ b/src/client.c @@ -855,6 +855,10 @@ clientMoveResizeWindow (Client * c, XWindowChanges * wc, unsigned long mask) } if (mask & (CWWidth | CWHeight)) { + if (screen_info->params->constrain_windows) { + flags |= CFG_CONSTRAINED; + } + flags |= CFG_KEEP_VISIBLE; } /* diff --git a/src/settings.c b/src/settings.c index 20efbc6..028172a 100644 --- a/src/settings.c +++ b/src/settings.c @@ -669,6 +669,7 @@ loadSettings (ScreenInfo *screen_info) {"button_spacing", NULL, G_TYPE_INT, TRUE}, {"click_to_focus", NULL, G_TYPE_BOOLEAN, TRUE}, {"focus_delay", NULL, G_TYPE_INT, TRUE}, + {"constrain_windows", NULL, G_TYPE_BOOLEAN, TRUE}, {"cycle_apps_only", NULL, G_TYPE_BOOLEAN, TRUE}, {"cycle_draw_frame", NULL, G_TYPE_BOOLEAN, TRUE}, {"cycle_hidden", NULL, G_TYPE_BOOLEAN, TRUE}, @@ -753,6 +754,8 @@ loadSettings (ScreenInfo *screen_info) getBoolValue ("box_move", rc); screen_info->params->click_to_focus = getBoolValue ("click_to_focus", rc); + screen_info->params->constrain_windows = + getBoolValue ("constrain_windows", rc); screen_info->params->cycle_apps_only = getBoolValue ("cycle_apps_only", rc); screen_info->params->cycle_minimum = @@ -1216,6 +1219,10 @@ cb_xfwm4_channel_property_changed(XfconfChannel *channel, const gchar *property_ screen_info->params->click_to_focus = g_value_get_boolean (value); update_grabs (screen_info); } + else if (!strcmp (name, "constrain_windows")) + { + screen_info->params->constrain_windows = g_value_get_boolean (value); + } else if (!strcmp (name, "focus_new")) { screen_info->params->focus_new = g_value_get_boolean (value); diff --git a/src/settings.h b/src/settings.h index 76ffa62..fdd6398 100644 --- a/src/settings.h +++ b/src/settings.h @@ -196,6 +196,7 @@ struct _XfwmParams gboolean box_move; gboolean box_resize; gboolean click_to_focus; + gboolean constrain_windows; gboolean cycle_apps_only; gboolean cycle_draw_frame; gboolean cycle_hidden;