@@ -694,6 +694,9 @@ class MateTweak:
694
694
item_icon_size = self .get_string ('org.mate.panel.menubar' , None , 'item-icon-size' )
695
695
696
696
print ('Switching to: ' + new_layout )
697
+ self .kill_process ('mate-panel' )
698
+ if self .dock and self .process_running (self .dock ):
699
+ self .kill_process (self .dock )
697
700
698
701
if not called_from_api :
699
702
self .update_panel_layout_ui (new_layout )
@@ -780,6 +783,31 @@ class MateTweak:
780
783
cmd = 'dconf load /org/mate/panel/ < /usr/share/mate-panel/layouts/' + new_layout + '.panel'
781
784
subprocess .call (cmd , shell = True , stdout = DEVNULL , stderr = DEVNULL )
782
785
786
+ # Determine if maximised windows should be undecorated
787
+ if self .maximus_available :
788
+ layout_name_is_special = self .is_panel_layout_name_special (new_layout , ['netbook' ])
789
+ custom_settings = self .get_panel_layout_section_settings (new_layout , 'Customsetting maximusdecoration' , [])
790
+
791
+ # Prefer custom settings
792
+ if custom_settings .get ('mate-maximus-undecorate' ) and custom_settings .get ('mate-maximus-undecorate' ).upper () == 'TRUE' :
793
+ self .maximus_undecorate ()
794
+ elif custom_settings .get ('mate-maximus-recorded' ) and custom_settings .get ('mate-maximus-undecorate' ).upper () == 'FALSE' :
795
+ self .maximus_decorate ()
796
+ elif layout_name_is_special :
797
+ self .maximus_undecorate ()
798
+ else :
799
+ self .maximus_decorate ()
800
+
801
+ # Set the new layout
802
+ subprocess .call (['mate-panel' , '--reset' ], stdout = DEVNULL , stderr = DEVNULL )
803
+ subprocess .call (['mate-panel' , '--layout' , new_layout ], stdout = DEVNULL , stderr = DEVNULL )
804
+ self .reload_panel ()
805
+
806
+ # Brisk Menu remains running.
807
+ # So if Brisk is not in the layout being switched to, kill it.
808
+ if not self .panel_layout_uses ('BriskMenu' , new_layout ) and self .process_running ('brisk-menu' ):
809
+ self .kill_process ('brisk-menu' )
810
+
783
811
# Determine if the dock should be enabled
784
812
if os .path .exists (os .path .join ('/' ,'usr' ,'share' ,'mate-panel' ,'layouts' , new_layout + '.dock' )) and self .dock is not None :
785
813
print ('Found dock hint for ' + new_layout )
@@ -818,29 +846,6 @@ class MateTweak:
818
846
else :
819
847
self .disable_dock ()
820
848
821
- # Determine if maximised windows should be undecorated
822
- if self .maximus_available :
823
- layout_name_is_special = self .is_panel_layout_name_special (new_layout , ['netbook' ])
824
- custom_settings = self .get_panel_layout_section_settings (new_layout , 'Customsetting maximusdecoration' , [])
825
-
826
- # Prefer custom settings
827
- if custom_settings .get ('mate-maximus-undecorate' ) and custom_settings .get ('mate-maximus-undecorate' ).upper () == 'TRUE' :
828
- self .maximus_undecorate ()
829
- elif custom_settings .get ('mate-maximus-recorded' ) and custom_settings .get ('mate-maximus-undecorate' ).upper () == 'FALSE' :
830
- self .maximus_decorate ()
831
- elif layout_name_is_special :
832
- self .maximus_undecorate ()
833
- else :
834
- self .maximus_decorate ()
835
-
836
- # Set the new layout
837
- subprocess .call (['mate-panel' , '--reset' , '--layout' , new_layout ], stdout = DEVNULL , stderr = DEVNULL )
838
-
839
- # Brisk Menu remains running.
840
- # So if Brisk is not in the layout being switched to, kill it.
841
- if not self .panel_layout_uses ('BriskMenu' , new_layout ) and self .process_running ('brisk-menu' ):
842
- self .kill_process ('brisk-menu' )
843
-
844
849
# Update the Dock checkbutton UI
845
850
if not called_from_api :
846
851
self .builder .get_object ("checkbutton_dock" ).set_active (self .dock_enabled )
0 commit comments