diff --git a/src/ExcalidrawView.ts b/src/ExcalidrawView.ts index dff6eb1..034871d 100644 --- a/src/ExcalidrawView.ts +++ b/src/ExcalidrawView.ts @@ -3269,6 +3269,9 @@ export default class ExcalidrawView extends TextFileView { await this.plugin.saveSettings(); })(); }, + + // TODO: Potentially better way to block middle mouse paste on linux: + //! onauxclick: (e: any) => {e.preventDefault()}, renderTopRightUI: (isMobile: boolean, appState: AppState) => this.obsidianMenu.renderButton (isMobile, appState), renderEmbeddableMenu: (appState: AppState) => this.embeddableMenu.renderButtons(appState), onPaste: ( @@ -3287,6 +3290,18 @@ export default class ExcalidrawView extends TextFileView { }); if(typeof res === "boolean" && res === false) return false; } + + // Disables Middle Mouse Button Paste Functionality on Linux + if( + !this.modifierKeyDown.ctrlKey + && typeof event !== "undefined" + && event !== null + && DEVICE.isLinux + ) { + console.debug("Prevented what is likely middle mouse button paste.") + return false + }; + if(data && data.text && hyperlinkIsImage(data.text)) { this.addImageWithURL(data.text); return false; @@ -3325,6 +3340,9 @@ export default class ExcalidrawView extends TextFileView { } return true; }, + + + onThemeChange: async (newTheme: string) => { //debug({where:"ExcalidrawView.onThemeChange",file:this.file.name,before:"this.loadSceneFiles",newTheme}); this.excalidrawData.scene.appState.theme = newTheme;