diff --git a/bigbluebutton-html5/imports/ui/components/whiteboard/whiteboard-overlay/pencil-pointer-listener/component.jsx b/bigbluebutton-html5/imports/ui/components/whiteboard/whiteboard-overlay/pencil-pointer-listener/component.jsx index d5486b714526e66c1777f78c96e5027245de61bc..d15f3347a02757399ee2351955bdb1d164144d8b 100644 --- a/bigbluebutton-html5/imports/ui/components/whiteboard/whiteboard-overlay/pencil-pointer-listener/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/whiteboard/whiteboard-overlay/pencil-pointer-listener/component.jsx @@ -180,10 +180,10 @@ export default class PencilPointerListener extends Component { // resetting the current info this.points = []; this.isDrawing = false; - + // remove event listener window.removeEventListener('pointerup', this.handlePointerUp); window.removeEventListener('pointermove', this.handlePointerMove); - window.removeEventListener('pointercancle', this.handlePointerCancle); + window.removeEventListener('pointercancle', this.handlePointerCancle, true); } discardAnnotation() { @@ -204,24 +204,22 @@ export default class PencilPointerListener extends Component { this.palmRejectionActivated = Storage.getItem(PALM_REJECTION_MODE); switch (event.pointerType) { case 'mouse': { - if (!this.palmRejectionActivated) { - const isLeftClick = event.button === 0; - const isRightClick = event.button === 2; - - if (!this.isDrawing) { - if (isLeftClick) { - window.addEventListener('pointerup', this.handlePointerUp); - window.addEventListener('pointermove', this.handlePointerMove); - - const { clientX, clientY } = event; - this.commonDrawStartHandler(clientX, clientY); - } - - // if you switch to a different window using Alt+Tab while mouse is down and release it - // it wont catch mouseUp and will keep tracking the movements. Thus we need this check. - } else if (isRightClick) { - this.discardAnnotation(); + const isLeftClick = event.button === 0; + const isRightClick = event.button === 2; + + if (!this.isDrawing) { + if (isLeftClick) { + window.addEventListener('pointerup', this.handlePointerUp); + window.addEventListener('pointermove', this.handlePointerMove); + + const { clientX, clientY } = event; + this.commonDrawStartHandler(clientX, clientY); } + + // if you switch to a different window using Alt+Tab while mouse is down and release it + // it wont catch mouseUp and will keep tracking the movements. Thus we need this check. + } else if (isRightClick) { + this.discardAnnotation(); } break; } @@ -241,6 +239,7 @@ export default class PencilPointerListener extends Component { } } + // handler for finger touch and pencil touch touchPenDownHandler(event) { event.preventDefault(); if (!this.isDrawing) { @@ -261,9 +260,7 @@ export default class PencilPointerListener extends Component { handlePointerUp(event) { switch (event.pointerType) { case 'mouse': { - if (!this.palmRejectionActivated) { - this.sendLastMessage(); - } + this.sendLastMessage(); break; } case 'pen': { @@ -285,10 +282,8 @@ export default class PencilPointerListener extends Component { handlePointerMove(event) { switch (event.pointerType) { case 'mouse': { - if (!this.palmRejectionActivated) { - const { clientX, clientY } = event; - this.commonDrawMoveHandler(clientX, clientY); - } + const { clientX, clientY } = event; + this.commonDrawMoveHandler(clientX, clientY); break; } case 'pen': { diff --git a/bigbluebutton-html5/imports/ui/components/whiteboard/whiteboard-overlay/shape-pointer-listener/component.jsx b/bigbluebutton-html5/imports/ui/components/whiteboard/whiteboard-overlay/shape-pointer-listener/component.jsx index b76e273625daa423786737dbcdc5b07ae46d4160..a75939a5d85888543463afcd687d8be490fe0ad4 100755 --- a/bigbluebutton-html5/imports/ui/components/whiteboard/whiteboard-overlay/shape-pointer-listener/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/whiteboard/whiteboard-overlay/shape-pointer-listener/component.jsx @@ -204,10 +204,10 @@ export default class ShapePointerListener extends Component { x: undefined, y: undefined, }; - + // remove event handler window.removeEventListener('pointerup', this.handlePointerUp); window.removeEventListener('pointermove', this.handlePointerMove); - window.removeEventListener('pointercancle', this.handlePointerCancle); + window.removeEventListener('pointercancle', this.handlePointerCancle, true); } // since Rectangle / Triangle / Ellipse / Line have the same coordinate structure @@ -274,24 +274,22 @@ export default class ShapePointerListener extends Component { this.palmRejectionActivated = Storage.getItem(PALM_REJECTION_MODE); switch (event.pointerType) { case 'mouse': { - if (!this.palmRejectionActivated) { - const isLeftClick = event.button === 0; - const isRightClick = event.button === 2; - - if (!this.isDrawing) { - if (isLeftClick) { - window.addEventListener('pointerup', this.handlePointerUp); - window.addEventListener('pointermove', this.handlePointerMove); - - const { clientX, clientY } = event; - this.commonDrawStartHandler(clientX, clientY); - } - - // if you switch to a different window using Alt+Tab while mouse is down and release it - // it wont catch mouseUp and will keep tracking the movements. Thus we need this check. - } else if (isRightClick) { - this.discardAnnotation(); + const isLeftClick = event.button === 0; + const isRightClick = event.button === 2; + + if (!this.isDrawing) { + if (isLeftClick) { + window.addEventListener('pointerup', this.handlePointerUp); + window.addEventListener('pointermove', this.handlePointerMove); + + const { clientX, clientY } = event; + this.commonDrawStartHandler(clientX, clientY); } + + // if you switch to a different window using Alt+Tab while mouse is down and release it + // it wont catch mouseUp and will keep tracking the movements. Thus we need this check. + } else if (isRightClick) { + this.discardAnnotation(); } break; } @@ -311,6 +309,7 @@ export default class ShapePointerListener extends Component { } } + // handler for finger touch and pencil touch touchPenDownHandler(event) { event.preventDefault(); if (!this.isDrawing) { @@ -331,9 +330,7 @@ export default class ShapePointerListener extends Component { handlePointerUp(event) { switch (event.pointerType) { case 'mouse': { - if (!this.palmRejectionActivated) { - this.sendLastMessage(); - } + this.sendLastMessage(); break; } case 'pen': { @@ -355,10 +352,8 @@ export default class ShapePointerListener extends Component { handlePointerMove(event) { switch (event.pointerType) { case 'mouse': { - if (!this.palmRejectionActivated) { - const { clientX, clientY } = event; - this.commonDrawMoveHandler(clientX, clientY); - } + const { clientX, clientY } = event; + this.commonDrawMoveHandler(clientX, clientY); break; } case 'pen': {