@@ -703,14 +703,16 @@ class MateTweak:
703
703
return confirmed
704
704
705
705
def replace_panel_layout (self , new_layout , called_from_api = False ):
706
- leds_enabled = self .get_bool ('org.mate.peripherals-keyboard-xkb.general' , None , 'duplicate-leds' )
707
706
icon_size = self .get_string ('org.mate.panel.menubar' , None , 'icon-size' )
708
707
item_icon_size = self .get_string ('org.mate.panel.menubar' , None , 'item-icon-size' )
709
708
710
709
print ('Switching to: ' + new_layout )
710
+ # Shutdown panel processes before switching
711
711
self .kill_process ('mate-panel' )
712
712
if self .dock and self .process_running (self .dock ):
713
713
self .kill_process (self .dock )
714
+ if self .keyboard_led_enabled :
715
+ self .set_bool ('org.mate.peripherals-keyboard-xkb.general' , None , 'duplicate-leds' , False )
714
716
715
717
if not called_from_api :
716
718
self .update_panel_layout_ui (new_layout )
@@ -763,9 +765,6 @@ class MateTweak:
763
765
if not called_from_api :
764
766
self .update_window_controls ()
765
767
766
- if leds_enabled :
767
- self .set_bool ('org.mate.peripherals-keyboard-xkb.general' , None , 'duplicate-leds' , False )
768
-
769
768
# Reset panel configuration to defaults.
770
769
self .reset_dconf_path ('/org/mate/panel/objects/' )
771
770
self .reset_dconf_path ('/org/mate/panel/toplevels/' )
@@ -815,6 +814,8 @@ class MateTweak:
815
814
# Set the new layout
816
815
subprocess .call (['mate-panel' , '--reset' ], stdout = DEVNULL , stderr = DEVNULL )
817
816
subprocess .call (['mate-panel' , '--layout' , new_layout ], stdout = DEVNULL , stderr = DEVNULL )
817
+ if self .keyboard_led_enabled :
818
+ self .set_bool ('org.mate.peripherals-keyboard-xkb.general' , None , 'duplicate-leds' , True )
818
819
self .reload_panel ()
819
820
820
821
# Brisk Menu remains running.
@@ -873,10 +874,6 @@ class MateTweak:
873
874
self .set_dconf_value ('/org/compiz/profiles/mate/plugins/core/vsize' , '1' )
874
875
print ('Set ' + str (num_workspaces ) + ' workspaces for ' + self .current_wm )
875
876
876
- if leds_enabled :
877
- time .sleep (1 )
878
- self .set_bool ('org.mate.peripherals-keyboard-xkb.general' , None , 'duplicate-leds' , True )
879
-
880
877
# Make sure the correct panel name is set
881
878
if not called_from_api :
882
879
widget = self .builder .get_object ('combobox_panels' )
0 commit comments