Commit 1ab8a3b2 authored by Olivier Fourdan's avatar Olivier Fourdan 🛠

settings: Enable either windows wrap or tiling

Both options are incompatible, make sure to allow either one or the
other, but not both.
Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <fourdan@xfce.org>
Closes: #504
parent 80498847
Pipeline #6205 passed with stages
in 3 minutes and 10 seconds
......@@ -147,6 +147,15 @@ cb_urgent_blink_button_toggled (GtkToggleButton *toggle, GtkWidget *repeat_urgen
gtk_widget_set_sensitive (repeat_urgent_blink, gtk_toggle_button_get_active (toggle));
}
static void
cb_tile_on_move_check_toggled (GtkToggleButton *toggle, XfconfChannel *channel)
{
if (gtk_toggle_button_get_active (toggle))
{
xfconf_channel_set_bool (channel, "/general/wrap_windows", FALSE);
}
}
static void
cb_borderless_maximize_button_toggled (GtkToggleButton *toggle, GtkWidget *titleless_maximize_check)
{
......@@ -302,6 +311,10 @@ wm_tweaks_dialog_configure_widgets (GtkBuilder *builder)
"toggled",
G_CALLBACK (cb_urgent_blink_button_toggled),
repeat_urgent_blink);
g_signal_connect (G_OBJECT (tile_on_move_check),
"toggled",
G_CALLBACK (cb_tile_on_move_check_toggled),
xfwm4_channel);
/* Bind easy properties */
/* Cycling tab */
......
......@@ -164,6 +164,8 @@ static void xfwm_settings_click_to_focus_property_changed (XfconfChan
const gchar *property,
const GValue *value,
XfwmSettings *settings);
static void cb_wrap_windows_toggled (GtkToggleButton *toggle,
XfconfChannel *channel);
static void xfwm_settings_initialize_shortcuts (XfwmSettings *settings);
static void xfwm_settings_reload_shortcuts (XfwmSettings *settings);
static void xfwm_settings_shortcut_added (XfceShortcutsProvider *provider,
......@@ -617,6 +619,9 @@ xfwm_settings_constructed (GObject *object)
snap_to_border_check, "active");
xfconf_g_property_bind (settings->priv->wm_channel, "/general/snap_to_windows", G_TYPE_BOOLEAN,
snap_to_window_check, "active");
g_signal_connect (G_OBJECT (wrap_windows_check), "toggled",
G_CALLBACK (cb_wrap_windows_toggled),
settings->priv->wm_channel);
/* Load shortcuts */
xfwm_settings_initialize_shortcuts (settings);
......@@ -1575,7 +1580,6 @@ xfwm_settings_double_click_action_property_changed (XfconfChannel *channel,
}
static void
xfwm_settings_click_to_focus_property_changed (XfconfChannel *channel,
const gchar *property,
......@@ -1611,6 +1615,12 @@ xfwm_settings_click_to_focus_property_changed (XfconfChannel *channel,
}
static void
cb_wrap_windows_toggled (GtkToggleButton *toggle, XfconfChannel *channel)
{
if (gtk_toggle_button_get_active (toggle))
xfconf_channel_set_bool (channel, "/general/tile_on_move", FALSE);
}
static void
......
......@@ -790,7 +790,8 @@ clientMoveTile (Client *c, XfwmEventMotion *event)
screen_info = c->screen_info;
if (!screen_info->params->tile_on_move)
/* We cannot tile windows if wrapping is enabled */
if (!screen_info->params->tile_on_move || screen_info->params->wrap_windows)
{
return FALSE;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment