feat(pointers.js): don't start proc when it already exists
This commit is contained in:
parent
e021fb08d4
commit
42c99ac9d5
2 changed files with 6 additions and 2 deletions
|
@ -4,7 +4,7 @@ const { Box, Icon, Label, Button } = Widget;
|
|||
|
||||
import GLib from 'gi://GLib';
|
||||
|
||||
import Gesture from '../misc/drag.js';
|
||||
import Gesture from './gesture.js';
|
||||
import { EventBox } from '../misc/cursorbox.js'
|
||||
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ class Pointers extends Service {
|
|||
});
|
||||
}
|
||||
|
||||
proc;
|
||||
proc = undefined;
|
||||
output = "";
|
||||
devices = new Map();
|
||||
|
||||
|
@ -52,6 +52,9 @@ class Pointers extends Service {
|
|||
}
|
||||
|
||||
startProc() {
|
||||
if (this.proc)
|
||||
return;
|
||||
|
||||
let args = [];
|
||||
this.devices.forEach(dev => {
|
||||
if (dev.Kernel) {
|
||||
|
@ -79,6 +82,7 @@ class Pointers extends Service {
|
|||
killProc() {
|
||||
if (this.proc) {
|
||||
this.proc.force_exit();
|
||||
this.proc = undefined;
|
||||
this.emit('proc-destroyed', true);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue