From 56f58b66642a63431458003e0631c0ee3fe1d38e Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Mon, 23 Mar 2020 14:09:56 +0300 Subject: [PATCH] Fixed context menu on ubuntu --- cvat-canvas/src/typescript/canvasView.ts | 6 +++++- .../annotation-page/standard-workspace/canvas-wrapper.tsx | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cvat-canvas/src/typescript/canvasView.ts b/cvat-canvas/src/typescript/canvasView.ts index 297ab2c1..58e152ce 100644 --- a/cvat-canvas/src/typescript/canvasView.ts +++ b/cvat-canvas/src/typescript/canvasView.ts @@ -1208,7 +1208,11 @@ export class CanvasViewImpl implements CanvasView, Listener { let shapeSizeElement: ShapeSizeElement | null = null; let resized = false; - (shape as any).resize().on('resizestart', (): void => { + (shape as any).resize().on('resizestart', (e: any): void => { + if (e.detail.event.detail.event.button === 2) { + e.preventDefault(); + return; + } this.mode = Mode.RESIZE; if (state.shapeType === 'rectangle') { shapeSizeElement = displayShapeSize(this.adoptedContent, this.adoptedText); diff --git a/cvat-ui/src/components/annotation-page/standard-workspace/canvas-wrapper.tsx b/cvat-ui/src/components/annotation-page/standard-workspace/canvas-wrapper.tsx index 4922a6d1..76d429f7 100644 --- a/cvat-ui/src/components/annotation-page/standard-workspace/canvas-wrapper.tsx +++ b/cvat-ui/src/components/annotation-page/standard-workspace/canvas-wrapper.tsx @@ -12,7 +12,7 @@ import { Tooltip, } from 'antd'; -import { SliderValue } from 'antd/lib//slider'; +import { SliderValue } from 'antd/lib/slider'; import { ColorBy, GridColor, @@ -232,7 +232,9 @@ export default class CanvasWrapperComponent extends React.PureComponent { canvasInstance.html().removeEventListener('canvas.drawn', this.onCanvasShapeDrawn); canvasInstance.html().removeEventListener('canvas.merged', this.onCanvasObjectsMerged); canvasInstance.html().removeEventListener('canvas.groupped', this.onCanvasObjectsGroupped); - canvasInstance.html().addEventListener('canvas.splitted', this.onCanvasTrackSplitted); + canvasInstance.html().removeEventListener('canvas.splitted', this.onCanvasTrackSplitted); + + canvasInstance.html().removeEventListener('point.contextmenu', this.onCanvasPointContextMenu); window.removeEventListener('resize', this.fitCanvas); }