[arch-commits] Commit in atom/trunk (PKGBUILD fix-ime-events-handler.patch)
Nicola Squartini
tensor5 at archlinux.org
Sun Sep 18 05:13:25 UTC 2016
Date: Sunday, September 18, 2016 @ 05:13:24
Author: tensor5
Revision: 189892
upgpkg: atom 1.10.2-4
Fix IME events handler (see FS#50809).
Added:
atom/trunk/fix-ime-events-handler.patch
Modified:
atom/trunk/PKGBUILD
------------------------------+
PKGBUILD | 7 +++++-
fix-ime-events-handler.patch | 47 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 53 insertions(+), 1 deletion(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2016-09-18 05:11:40 UTC (rev 189891)
+++ PKGBUILD 2016-09-18 05:13:24 UTC (rev 189892)
@@ -3,7 +3,7 @@
pkgname=atom
pkgver=1.10.2
-pkgrel=3
+pkgrel=4
pkgdesc='A hackable text editor for the 21st Century'
arch=('i686' 'x86_64')
url='https://github.com/atom/atom'
@@ -17,6 +17,7 @@
'beforeunload.patch'
'deprecated-api.patch'
'fix-atom-sh.patch'
+ 'fix-ime-events-handler.patch'
'fix-license-path.patch'
'fix-marker-index.patch'
'fix-oniguruma.patch'
@@ -31,6 +32,7 @@
'e92e23bbf839bec6611b2ac76c1f5bba35b476983b0faa9b310288e2956247a2'
'6fca91b3e80248a96fc4b6b0228602d4dd68ef851cb059a97a7379e72e53b432'
'd3eb239f53feb3181fb4d57d2db391d7b31ce2188c5bd5b79d9ed3133351cd90'
+ '51e8f64206cdc96bddd934ffbf0a3b3509617deb9c9aad0ccb21df4b5b72dfee'
'a606d1efbea1f68a0a9c250b1d7023315a5392fa23f220600304c7308be7ebbb'
'2569702bee0508ee38a181f28bc99d6844725de206362a010705d84da09735c3'
'c0ae6c64802bc20219bc9142bd6e62e65853044b4a678d3f7ec72dcb61d22274'
@@ -58,6 +60,9 @@
# Fix for Electron 1.3.0
patch -Np1 -i "${srcdir}"/fix-pane-resize-handle.patch
+
+ # Fix for Electron 1.4.0
+ patch -Np1 -i "${srcdir}"/fix-ime-events-handler.patch
}
build() {
Added: fix-ime-events-handler.patch
===================================================================
--- fix-ime-events-handler.patch (rev 0)
+++ fix-ime-events-handler.patch 2016-09-18 05:13:24 UTC (rev 189892)
@@ -0,0 +1,47 @@
+--- a/src/text-editor-component.coffee
++++ b/src/text-editor-component.coffee
+@@ -119,6 +119,7 @@ class TextEditorComponent
+ @updateSync()
+ @checkForVisibilityChange()
+ @initialized = true
++ @checkpointForIME = null
+
+ destroy: ->
+ @mounted = false
+@@ -309,19 +310,20 @@ class TextEditorComponent
+ # User escape to cancel
+ # 4. compositionend fired
+ # OR User chooses a completion
+- # 4. compositionend fired
+- # 5. textInput fired; event.data == the completion string
++ # 4. textInput fired; event.data == the completion string
++ # 5. compositionend fired
+
+- checkpoint = null
+ @domNode.addEventListener 'compositionstart', =>
+ if @openedAccentedCharacterMenu
+ @editor.selectLeft()
+ @openedAccentedCharacterMenu = false
+- checkpoint = @editor.createCheckpoint()
++ @checkpointForIME = @editor.createCheckpoint()
+ @domNode.addEventListener 'compositionupdate', (event) =>
+ @editor.insertText(event.data, select: true)
+ @domNode.addEventListener 'compositionend', (event) =>
+- @editor.revertToCheckpoint(checkpoint)
++ if @checkpointForIME
++ @editor.revertToCheckpoint(@checkpointForIME)
++ @checkpointForIME = null
+ event.target.value = ''
+
+ # Listen for selection changes and store the currently selected text
+@@ -373,6 +375,10 @@ class TextEditorComponent
+ onTextInput: (event) =>
+ event.stopPropagation()
+
++ if @checkpointForIME
++ @editor.revertToCheckpoint(@checkpointForIME)
++ @checkpointForIME = null
++
+ # WARNING: If we call preventDefault on the input of a space character,
+ # then the browser interprets the spacebar keypress as a page-down command,
+ # causing spaces to scroll elements containing editors. This is impossible
More information about the arch-commits
mailing list