diff options
Diffstat (limited to 'capplets')
-rw-r--r-- | capplets/windows/mate-window-properties.c | 61 | ||||
-rw-r--r-- | capplets/windows/mate-window-properties.ui | 96 |
2 files changed, 153 insertions, 4 deletions
diff --git a/capplets/windows/mate-window-properties.c b/capplets/windows/mate-window-properties.c index d63789e9..34613d36 100644 --- a/capplets/windows/mate-window-properties.c +++ b/capplets/windows/mate-window-properties.c @@ -44,6 +44,8 @@ typedef struct static MateWindowManager *current_wm; /* may be NULL */ static GtkWidget *dialog_win; +static GObject *compositing_checkbutton; +static GObject *compositing_fast_alt_tab_checkbutton; static GObject *focus_mode_checkbutton; static GObject *autoraise_checkbutton; static GObject *autoraise_delay_slider; @@ -61,6 +63,34 @@ static int n_mouse_modifiers = 0; static void reload_mouse_modifiers (void); static void +compositing_manager_toggled_callback (GtkWidget *button, + void *data) +{ + MateWMSettings new_settings; + + new_settings.flags = MATE_WM_SETTING_COMPOSITING_MANAGER; + new_settings.compositing_manager = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)); + + if (current_wm != NULL && new_settings.compositing_manager != settings->compositing_manager) + mate_window_manager_change_settings (current_wm, &new_settings); +} + +static void +compositing_fast_alt_tab_toggled_callback (GtkWidget *button, + void *data) +{ + MateWMSettings new_settings; + + new_settings.flags = MATE_WM_SETTING_COMPOSITING_ALTTAB; + new_settings.compositing_fast_alt_tab = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)); + + if (current_wm != NULL && new_settings.compositing_fast_alt_tab != settings->compositing_fast_alt_tab) + mate_window_manager_change_settings (current_wm, &new_settings); +} + +static void mouse_focus_toggled_callback (GtkWidget *button, void *data) { @@ -150,6 +180,9 @@ update_sensitivity (void) gtk_widget_set_sensitive (GTK_WIDGET (double_click_titlebar_optionmenu), n_double_click_actions > 1); + gtk_widget_set_sensitive (GTK_WIDGET (compositing_fast_alt_tab_checkbutton), + settings->compositing_manager); + /* disable the whole dialog while no WM is running, or * a WM we don't understand is running. We should probably do * something better. I don't want to just launch the config tool @@ -163,6 +196,12 @@ static void init_settings_struct (MateWMSettings *settings) { /* Init fields that weren't initialized */ + if ((settings->flags & MATE_WM_SETTING_COMPOSITING_MANAGER) == 0) + settings->compositing_manager = FALSE; + + if ((settings->flags & MATE_WM_SETTING_COMPOSITING_ALTTAB) == 0) + settings->compositing_fast_alt_tab = FALSE; + if ((settings->flags & MATE_WM_SETTING_MOUSE_FOCUS) == 0) settings->focus_follows_mouse = FALSE; @@ -213,7 +252,10 @@ reload_settings (void) g_assert (n_mouse_modifiers > 0); if (current_wm != NULL) { - new_settings.flags = MATE_WM_SETTING_MOUSE_FOCUS | + new_settings.flags = + MATE_WM_SETTING_COMPOSITING_MANAGER | + MATE_WM_SETTING_COMPOSITING_ALTTAB | + MATE_WM_SETTING_MOUSE_FOCUS | MATE_WM_SETTING_AUTORAISE | MATE_WM_SETTING_AUTORAISE_DELAY | MATE_WM_SETTING_MOUSE_MOVE_MODIFIER | @@ -227,6 +269,14 @@ reload_settings (void) init_settings_struct (&new_settings); + if (new_settings.compositing_manager != settings->compositing_manager) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (compositing_checkbutton), + new_settings.compositing_manager); + + if (new_settings.compositing_fast_alt_tab != settings->compositing_fast_alt_tab) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (compositing_fast_alt_tab_checkbutton), + new_settings.compositing_fast_alt_tab); + if (new_settings.focus_follows_mouse != settings->focus_follows_mouse) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (focus_mode_checkbutton), new_settings.focus_follows_mouse); @@ -409,6 +459,10 @@ main (int argc, char **argv) dialog_win = GTK_WIDGET (gtk_builder_get_object (builder, "main-dialog")); + compositing_checkbutton = gtk_builder_get_object (builder, + "compositing-manager-checkbutton"); + compositing_fast_alt_tab_checkbutton = gtk_builder_get_object (builder, + "compositing-fast-alt-tab-checkbutton"); focus_mode_checkbutton = gtk_builder_get_object (builder, "focus-mode-checkbutton"); autoraise_checkbutton = gtk_builder_get_object (builder, @@ -448,6 +502,11 @@ main (int argc, char **argv) g_signal_connect (G_OBJECT (dialog_win), "destroy", G_CALLBACK (gtk_main_quit), NULL); + g_signal_connect (compositing_checkbutton, "toggled", + G_CALLBACK (compositing_manager_toggled_callback), NULL); + + g_signal_connect (compositing_fast_alt_tab_checkbutton, "toggled", + G_CALLBACK (compositing_fast_alt_tab_toggled_callback), NULL); g_signal_connect (focus_mode_checkbutton, "toggled", G_CALLBACK (mouse_focus_toggled_callback), NULL); diff --git a/capplets/windows/mate-window-properties.ui b/capplets/windows/mate-window-properties.ui index dee6e1aa..3e495b79 100644 --- a/capplets/windows/mate-window-properties.ui +++ b/capplets/windows/mate-window-properties.ui @@ -18,6 +18,96 @@ <property name="border_width">5</property> <property name="spacing">18</property> <child> + <object class="GtkVBox" id="vbox11"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Compositing Manager</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkAlignment" id="alignment6"> + <property name="visible">True</property> + <property name="left_padding">12</property> + <child> + <object class="GtkVBox" id="vbox9"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkCheckButton" id="compositing-manager-checkbutton"> + <property name="label" translatable="yes">Enable software _compositing window manager</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkAlignment" id="alignment7"> + <property name="visible">True</property> + <property name="left_padding">12</property> + <child> + <object class="GtkVBox" id="vbox10"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkCheckButton" id="compositing-fast-alt-tab-checkbutton"> + <property name="label" translatable="yes">Disable _thumbnails in Alt-Tab</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> <object class="GtkVBox" id="vbox2"> <property name="visible">True</property> <property name="spacing">6</property> @@ -158,7 +248,7 @@ <packing> <property name="expand">False</property> <property name="fill">False</property> - <property name="position">0</property> + <property name="position">1</property> </packing> </child> <child> @@ -240,7 +330,7 @@ <packing> <property name="expand">False</property> <property name="fill">False</property> - <property name="position">1</property> + <property name="position">2</property> </packing> </child> <child> @@ -316,7 +406,7 @@ <packing> <property name="expand">False</property> <property name="fill">False</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> </object> |