From 1ab8a3b281b7cad5ab826cca4f09cdb1ea561468 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Sat, 23 Jan 2021 20:25:16 +0100 Subject: 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 Closes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/504 --- settings-dialogs/tweaks-settings.c | 13 +++++++++++++ settings-dialogs/xfwm4-settings.c | 12 +++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'settings-dialogs') diff --git a/settings-dialogs/tweaks-settings.c b/settings-dialogs/tweaks-settings.c index 3291201d8..898c65a5f 100644 --- a/settings-dialogs/tweaks-settings.c +++ b/settings-dialogs/tweaks-settings.c @@ -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 */ diff --git a/settings-dialogs/xfwm4-settings.c b/settings-dialogs/xfwm4-settings.c index 34f9d82b2..b43757c74 100644 --- a/settings-dialogs/xfwm4-settings.c +++ b/settings-dialogs/xfwm4-settings.c @@ -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 -- cgit v1.2.1