Saren-Arterius / google-chinese-handwriting-ime

Written in Electron for Linux.
https://aur.archlinux.org/packages/google-chinese-handwriting-ime/
Creative Commons Zero v1.0 Universal
85 stars 8 forks source link

a different window #1

Closed kinmenRP closed 6 years ago

kinmenRP commented 6 years ago

I've just installed it. Btw, it seems that "npm install" requires sudo too. Anyway, after starting it I get a window, which is a bit different from yours... Inside a Google translator page, I can only input characters from the keyboard. I'm on kde plasma, ubuntu 17.10 Or maybe I didn't get well how it works... snapshot1

Saren-Arterius commented 6 years ago

What is your node version? It seems that the important JS was not being executed correctly, or Google served a different webpage JS to your machine.

kinmenRP commented 6 years ago

node v6.11.4 Thank you

Saren-Arterius commented 6 years ago

Since this application made use of async await keywords, you need node 8 or higher. See https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

kinmenRP commented 6 years ago

Uh, actually I was using the one from https://deb.nodesource.com, thinking it was the newest... I've followed the instructions and installed node v9. Now I'm getting a blank window, and after some minutes, again the same window as before :-/

Saren-Arterius commented 6 years ago

@kinmenRP I found that I made wrong assumptions that made the program only works for me. I fixed it and tested in kubuntu 17.10. Please check.

kinmenRP commented 6 years ago

Ok, now the window is the right one, thank you for fixing it. But when I write a character, then chose it from the bottom line, I suppose it should appear for ex in the text editor which I've opened, or in another window where I can input text, but I don't get anything. Or maybe I'm wrong? Should I open a new issue for this?

Saren-Arterius commented 6 years ago

Is xdotool installed?

在 2018年1月24日週三 03:00,kinmenRP notifications@github.com 寫道:

Ok, now the window is the right one, thank you for fixing it. But when I write a character, then chose it from the bottom line, I suppose it should appear for ex in the text editor which I've opened, or in another window where I can input text, but I don't get anything. Or maybe I'm wrong? Should I open a new issue for this?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Saren-Arterius/google-chinese-handwriting-ime/issues/1#issuecomment-359894254, or mute the thread https://github.com/notifications/unsubscribe-auth/AEuDt9lIDQiIExelASRwIPQ2QGUVvc8lks5tNiw2gaJpZM4RpgVY .

kinmenRP commented 6 years ago

yes, xdotool version 3.20160805.1

Saren-Arterius commented 6 years ago

@kinmenRP Can you change renderer.js from const SHOULD_USE_CLIPBOARD = process.env.DESKTOP_SESSION.startsWith('gnome'); to const SHOULD_USE_CLIPBOARD = true;, then install python3 and pyperclip and test again?

kinmenRP commented 6 years ago

I've changed that line in render.js. Python3.6 and pyperclip were already installed. npm start shows the same window,I can write but no hanzi anywhere... Now I have to go, but tomorrow I'll try under Enlightenment, just to see if it's something DE related. Thank you again

Saren-Arterius commented 6 years ago

At worst case I think you were using wayland instead of X, which is unsupported and also explains that.

kinmenRP commented 6 years ago

I've given a try with Enlightenment but without luck. echo $XDG_SESSION_TYPE x11

If it works for you wit the same SO & version, then it's probably something in my environment...

Saren-Arterius commented 6 years ago

The last debug method:

  1. Remove the line …setMenu(null) in main.js
  2. npm start to open the program
  3. Ctrl+Shift+I to spawn the inspector
  4. Select element by mouse click
  5. Switch to console, type $0.openDevTools(), that will spawn a new inspector window
  6. In the new window, check console for errors, screen cap and upload to here.

在 2018年1月25日週四 16:35,kinmenRP notifications@github.com 寫道:

I've given a try with Enlightenment but without luck. echo $XDG_SESSION_TYPE x11

If it works for you wit the same SO & version, then it's probably something in my environment...

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Saren-Arterius/google-chinese-handwriting-ime/issues/1#issuecomment-360397211, or mute the thread https://github.com/notifications/unsubscribe-auth/AEuDt2woqTpzPz39hpPaeAJLemUEZqutks5tODzFgaJpZM4RpgVY .

kinmenRP commented 6 years ago

`Failed to load resource: net::ERR_TUNNEL_CONNECTION_FAILED child_process.js:217 Uncaught (in promise) Error: Command failed: xdotool getactivewindow XGetWindowProperty[_NET_ACTIVE_WINDOW] failed (code=1) xdo_get_active_window reported an error

at ChildProcess.exithandler (child_process.js:217:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:194:7)
at maybeClose (internal/child_process.js:899:16)
at Socket.<anonymous> (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at Pipe._handle.close [as _onclose] (net.js:510:12)

child_process.js:217 Uncaught (in promise) Error: Command failed: xdotool getactivewindow XGetWindowProperty[_NET_ACTIVE_WINDOW] failed (code=1) xdo_get_active_window reported an error

at ChildProcess.exithandler (child_process.js:217:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:194:7)
at maybeClose (internal/child_process.js:899:16)
at Socket.<anonymous> (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at Pipe._handle.close [as _onclose] (net.js:510:12)`
Saren-Arterius commented 6 years ago

Can you do xdotool getactivewindow durectly on terminal?

在 2018年1月25日週四 18:09,kinmenRP notifications@github.com 寫道:

`Failed to load resource: net::ERR_TUNNEL_CONNECTION_FAILED child_process.js:217 Uncaught (in promise) Error: Command failed: xdotool getactivewindow XGetWindowProperty[_NET_ACTIVE_WINDOW] failed (code=1) xdo_get_active_window reported an error

at ChildProcess.exithandler (child_process.js:217:12) at emitTwo (events.js:106:13) at ChildProcess.emit (events.js:194:7) at maybeClose (internal/child_process.js:899:16) at Socket. (internal/child_process.js:342:11) at emitOne (events.js:96:13) at Socket.emit (events.js:191:7) at Pipe._handle.close [as _onclose] (net.js:510:12)

child_process.js:217 Uncaught (in promise) Error: Command failed: xdotool getactivewindow XGetWindowProperty[_NET_ACTIVE_WINDOW] failed (code=1) xdo_get_active_window reported an error

at ChildProcess.exithandler (child_process.js:217:12) at emitTwo (events.js:106:13) at ChildProcess.emit (events.js:194:7) at maybeClose (internal/child_process.js:899:16) at Socket. (internal/child_process.js:342:11) at emitOne (events.js:96:13) at Socket.emit (events.js:191:7) at Pipe._handle.close [as _onclose] (net.js:510:12)`

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Saren-Arterius/google-chinese-handwriting-ime/issues/1#issuecomment-360420773, or mute the thread https://github.com/notifications/unsubscribe-auth/AEuDt0DoyPIwsWnqiJGQyih_nlsqyQ96ks5tOFLDgaJpZM4RpgVY .

kinmenRP commented 6 years ago

the answer is... 44040198

Saren-Arterius commented 6 years ago

Very very weird… I would push a commit later to see if it will get to work by polling.

在 2018年1月25日週四 18:17,kinmenRP notifications@github.com 寫道:

the answer is... 44040198

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Saren-Arterius/google-chinese-handwriting-ime/issues/1#issuecomment-360422885, or mute the thread https://github.com/notifications/unsubscribe-auth/AEuDtymR6Ghb7oeFw7bqZf2flZz8uKEPks5tOFS0gaJpZM4RpgVY .

kinmenRP commented 6 years ago

:-P maybe I should try with another browser... firefox is so full of addons... I wouldn't like to find out that something is making troubles

Saren-Arterius commented 6 years ago

No, electron use chrome internally. Firefox does not matter here.

在 2018年1月25日週四 18:24,kinmenRP notifications@github.com 寫道:

:-P maybe I should try with another browser... firefox is so full of addons... I wouldn't like to find out that something is making troubles

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Saren-Arterius/google-chinese-handwriting-ime/issues/1#issuecomment-360424700, or mute the thread https://github.com/notifications/unsubscribe-auth/AEuDt34tyuiSHB0OdRwd8mmzoLSyccGBks5tOFZlgaJpZM4RpgVY .

kinmenRP commented 6 years ago

ah, ok

D12EA177E12 commented 6 years ago

Your IME was installed on Feb 25th and it worked for like 2–3 days before failing to load the input pad/canvas: Upon start up the window tries to load the right page (the input canvas perhaps?) but it fails and keeps reloading. You can see the behavior here.

Saren-Arterius commented 6 years ago

@D12EA177E12 Google changed their JS. Since it's PITA to reverse enginner their scripts, I have forced the JS version in the latest commit, I dont know how long it could last... Just try

D12EA177E12 commented 6 years ago

@Saren-Arterius Yep, your last commit fixed the problem.