Skip to content

Commit

Permalink
chore: Workaround for #364 (choppy interactions with trackpad and OSR)
Browse files Browse the repository at this point in the history
  • Loading branch information
bric3 committed Nov 10, 2024
1 parent eed46dd commit dcfe935
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
### Changed

- Use the new `org.jetbrains.intellij.platform` v2.0.0 Gradle plugin to build the Excalidraw plugin
- Don't use offscreen rendering (OSR) by default due to issues with trackpad (at least on macOs), see
https://youtrack.jetbrains.com/issue/IJPL-156342/Scrolling-of-the-Whats-new-in-IntelliJ-IDEA-is-too-fast-faster-than-code-files

This is tunable in the advanced settings.


## 0.4.0 - 2024-01-27

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.intellij.openapi.Disposable
import com.intellij.openapi.application.invokeLater
import com.intellij.openapi.diagnostic.thisLogger
import com.intellij.openapi.editor.EditorBundle
import com.intellij.openapi.options.advanced.AdvancedSettings
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.util.registry.Registry
import com.intellij.ui.components.JBLoadingPanel
Expand Down Expand Up @@ -119,6 +120,6 @@ class LoadableJCEFHtmlPanel(
private const val LOADING_KEY = 1
private const val CONTENT_KEY = 0
private val useOsr
get() = Registry.`is`("excalidraw.viewer.use.jcef.osr.view")
get() = AdvancedSettings.getBoolean("bric3.excalidraw.useOsr")
}
}
14 changes: 11 additions & 3 deletions plugin/src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<depends>com.intellij.modules.platform</depends>
<depends>com.intellij.modules.json</depends>

<resource-bundle>messages.MyBundle</resource-bundle>

<extensions defaultExtensionNs="com.intellij">
<fileType name="Excalidraw sketch"
implementationClass="com.github.bric3.excalidraw.files.ExcalidrawFileType"
Expand Down Expand Up @@ -36,10 +38,16 @@
<scratch.creationHelper language="Excalidraw"
implementationClass="com.github.bric3.excalidraw.scratch.ExcalidrawScratchFileCreationHelper"/>

<registryKey defaultValue="true" key="excalidraw.viewer.use.jcef.osr.view" description="Enables JCEF off-screen rendering for Excalidraw"/>

<!-- Marketplace exception initializer : https://plugins.jetbrains.com/docs/marketplace/exception-analyzer.html -->
<!-- Marketplace exception initializer: https://plugins.jetbrains.com/docs/marketplace/exception-analyzer.html -->
<errorHandler implementation="com.intellij.diagnostic.JetBrainsMarketplaceErrorReportSubmitter"/>

<!--
Disable OSR by default due to trackpad issues on macOS (at least), see
https://youtrack.jetbrains.com/issue/IJPL-156342/Scrolling-of-the-Whats-new-in-IntelliJ-IDEA-is-too-fast-faster-than-code-files
-->
<advancedSetting default="false"
id="bric3.excalidraw.useOsr"
groupKey="bric3.excalidraw.advanced.settings" />
</extensions>

<actions>
Expand Down
6 changes: 5 additions & 1 deletion plugin/src/main/resources/messages/MyBundle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
name=Excalidraw Integration
applicationService=Application service
projectService=Project service: {0}
title.excalidraw.usage.error=Usage error
title.excalidraw.usage.error=Usage error

## Advanced settings
bric3.excalidraw.advanced.settings=Excalidraw
advanced.setting.bric3.excalidraw.useOsr=JCEF off-screen rendering for Excalidraw.

0 comments on commit dcfe935

Please sign in to comment.