File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ const LOCATE_POINTER_SCHEMA = "org.cinnamon.muffin"
1010var locatePointer = class {
1111 constructor ( ) {
1212 this . _enabledSettings = new Gio . Settings ( { schema_id : LOCATE_POINTER_ENABLED_SCHEMA } ) ;
13+ this . _enabledSettings . connect ( 'changed::locate-pointer' , this . _updateKey . bind ( this ) ) ;
1314 this . _keySettings = new Gio . Settings ( { schema_id : LOCATE_POINTER_SCHEMA } ) ;
1415 this . _keySettings . connect ( 'changed::locate-pointer-key' , this . _updateKey . bind ( this ) ) ;
1516 this . _updateKey ( ) ;
@@ -19,14 +20,15 @@ var locatePointer = class {
1920 }
2021
2122 _updateKey ( ) {
22- let modifierKey = this . _keySettings . get_string ( 'locate-pointer-key' ) ;
23- Main . keybindingManager . addHotKey ( 'locate-pointer' , modifierKey , ( ) => { this . show ( ) } ) ;
23+ if ( this . _enabledSettings . get_boolean ( "locate-pointer" ) ) {
24+ let modifierKey = this . _keySettings . get_string ( 'locate-pointer-key' ) ;
25+ Main . keybindingManager . addHotKey ( 'locate-pointer' , modifierKey , ( ) => { this . show ( ) } ) ;
26+ } else {
27+ Main . keybindingManager . removeHotKey ( 'locate-pointer' ) ;
28+ }
2429 }
2530
2631 show ( ) {
27- if ( ! this . _enabledSettings . get_boolean ( "locate-pointer" ) )
28- return ;
29-
3032 let [ x , y , mods ] = global . get_pointer ( ) ;
3133 this . _ripples . playAnimation ( x , y ) ;
3234 }
You can’t perform that action at this time.
0 commit comments