File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -58,10 +58,15 @@ export default class KandoIntegration extends Extension {
58
58
59
59
// Exports the DBus interface.
60
60
enable ( ) {
61
+
61
62
// Do nothing on X11.
62
63
if ( ! Meta . is_wayland_compositor ( ) ) {
63
64
return ;
64
65
}
66
+
67
+ // This is used to get the desktop's text scaling factor.
68
+ this . _shellSettings = new Gio . Settings ( { schema : 'org.gnome.desktop.interface' } ) ;
69
+
65
70
this . _dbus = Gio . DBusExportedObject . wrapJSObject ( DBUS_INTERFACE , this ) ;
66
71
this . _dbus . export ( Gio . DBus . session , '/org/gnome/shell/extensions/KandoIntegration' ) ;
67
72
@@ -87,6 +92,8 @@ export default class KandoIntegration extends Extension {
87
92
return ;
88
93
}
89
94
95
+ this . _shellSettings = null ;
96
+
90
97
this . _dbus . flush ( ) ;
91
98
this . _dbus . unexport ( ) ;
92
99
this . _dbus = null ;
@@ -116,7 +123,12 @@ export default class KandoIntegration extends Extension {
116
123
117
124
const [ x , y ] = global . get_pointer ( ) ;
118
125
119
- return [ windowName , windowClass , x , y ] ;
126
+ const scalingFactor = this . _shellSettings . get_double ( 'text-scaling-factor' ) ;
127
+
128
+ return [
129
+ windowName , windowClass , Math . round ( x / scalingFactor ) ,
130
+ Math . round ( y / scalingFactor )
131
+ ] ;
120
132
}
121
133
122
134
// Warps the mouse pointer by the given distance.
You can’t perform that action at this time.
0 commit comments