diff options
-rw-r--r-- | capplets/windows/mate-window-properties.c | 61 | ||||
-rw-r--r-- | capplets/windows/mate-window-properties.ui | 96 | ||||
-rw-r--r-- | libwindow-settings/marco-window-manager.c | 24 | ||||
-rw-r--r-- | libwindow-settings/mate-window-manager.h | 9 |
4 files changed, 184 insertions, 6 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> diff --git a/libwindow-settings/marco-window-manager.c b/libwindow-settings/marco-window-manager.c index 6562291e..2492eb99 100644 --- a/libwindow-settings/marco-window-manager.c +++ b/libwindow-settings/marco-window-manager.c @@ -174,7 +174,17 @@ marco_change_settings (MateWindowManager *wm, MarcoWindowManager *meta_wm; meta_wm = MARCO_WINDOW_MANAGER (wm); - + + if (settings->flags & MATE_WM_SETTING_COMPOSITING_MANAGER) + g_settings_set_boolean (meta_wm->p->settings, + MARCO_COMPOSITING_MANAGER_KEY, + settings->compositing_manager); + + if (settings->flags & MATE_WM_SETTING_COMPOSITING_ALTTAB) + g_settings_set_boolean (meta_wm->p->settings, + MARCO_COMPOSITING_FAST_ALT_TAB_KEY, + settings->compositing_fast_alt_tab); + if (settings->flags & MATE_WM_SETTING_MOUSE_FOCUS) g_settings_set_enum (meta_wm->p->settings, MARCO_FOCUS_KEY, @@ -232,6 +242,18 @@ marco_get_settings (MateWindowManager *wm, to_get = settings->flags; settings->flags = 0; + if (to_get & MATE_WM_SETTING_COMPOSITING_MANAGER) { + settings->compositing_manager = g_settings_get_boolean (meta_wm->p->settings, + MARCO_COMPOSITING_MANAGER_KEY); + settings->flags |= MATE_WM_SETTING_COMPOSITING_MANAGER; + } + + if (to_get & MATE_WM_SETTING_COMPOSITING_ALTTAB) { + settings->compositing_fast_alt_tab = g_settings_get_boolean (meta_wm->p->settings, + MARCO_COMPOSITING_FAST_ALT_TAB_KEY); + settings->flags |= MATE_WM_SETTING_COMPOSITING_ALTTAB; + } + if (to_get & MATE_WM_SETTING_MOUSE_FOCUS) { gint marco_focus_value; diff --git a/libwindow-settings/mate-window-manager.h b/libwindow-settings/mate-window-manager.h index b9d9a18a..9bed52e4 100644 --- a/libwindow-settings/mate-window-manager.h +++ b/libwindow-settings/mate-window-manager.h @@ -47,6 +47,8 @@ typedef enum MATE_WM_SETTING_MOUSE_MOVE_MODIFIER = 1 << 4, MATE_WM_SETTING_THEME = 1 << 5, MATE_WM_SETTING_DOUBLE_CLICK_ACTION = 1 << 6, + MATE_WM_SETTING_COMPOSITING_MANAGER = 1 << 7, + MATE_WM_SETTING_COMPOSITING_ALTTAB = 1 << 8, MATE_WM_SETTING_MASK = MATE_WM_SETTING_FONT | MATE_WM_SETTING_MOUSE_FOCUS | @@ -54,7 +56,9 @@ typedef enum MATE_WM_SETTING_AUTORAISE_DELAY | MATE_WM_SETTING_MOUSE_MOVE_MODIFIER | MATE_WM_SETTING_THEME | - MATE_WM_SETTING_DOUBLE_CLICK_ACTION + MATE_WM_SETTING_DOUBLE_CLICK_ACTION | + MATE_WM_SETTING_COMPOSITING_MANAGER | + MATE_WM_SETTING_COMPOSITING_ALTTAB } MateWMSettingsFlags; typedef struct @@ -78,6 +82,9 @@ typedef struct guint focus_follows_mouse : 1; guint autoraise : 1; + gboolean compositing_manager; + gboolean compositing_fast_alt_tab; + } MateWMSettings; #ifdef __cplusplus |