hcherukuri / autokey

Automatically exported from code.google.com/p/autokey
GNU General Public License v3.0
0 stars 0 forks source link

clipboard.fill_clipboard causes crash on 0.90.4 #208

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Run on 0.90.4

clipboard.fill_clipboard("test")
contents = clipboard.get_clipboard()
keyboard.send_keys(content)

What is the expected output? What do you see instead?

Expect: "test" is pasted.
See: atk scripts not involving clipboard still work, autokey-gtk hangs

What version of the product are you using? On what operating system?

autokey-gtk 0.90.4
autokey-common 0.90.4
Crunchbang Linux
libgtk-3 3.2.2-2
libgtk2.0 2.24.10-1

Please provide any additional information below.

Other clipboard problems fixed by update to 0.90.4 for me

http://code.google.com/p/autokey/issues/list?can=1&q=get_selection&colspec=ID+Ty
pe+Status+Priority+Milestone+Owner+Summary&cells=tiles

Only got this for logging:

2012-07-13 10:09:52,741 DEBUG - service - Script runner executing: 
Script('test')
2012-07-13 10:09:52,743 DEBUG - service - Input stack at end of 
handle_keypress: [u'=']
2012-07-13 10:09:52,744 DEBUG - service - Ignored locking error in 
handle_keypress

Can try on latest GTK

Original issue reported on code.google.com by tpowe...@gmail.com on 13 Jul 2012 at 9:17

GoogleCodeExporter commented 8 years ago
I'm not sure why it's not logging an error, but you can try adding the "-1" 
value to what should be a default parameter that I suggested in this issue:
https://code.google.com/p/autokey/issues/detail?id=212

Original comment by pau...@zolabooks.com on 4 Dec 2012 at 9:22

GoogleCodeExporter commented 8 years ago
This also occurs with version 0.90.4 on Ubuntu 12.04 Precise.

Original comment by ranju.ma...@gmail.com on 19 Jul 2013 at 1:08

GoogleCodeExporter commented 8 years ago
I followed Paul's hint to do the following to resolve this issue:
in /usr/lib/python2.7/dist-packages/autokey/scripting.py, change the following:

* Change this line in GtkClipboard's __fillSelection():
        self.selection.set_text(string.encode("utf-8"))
  to this:
        self.selection.set_text(string.encode("utf-8"), -1)

* Change this line in GtkClipboard's fill_clipboard():
        self.clipBoard.set_text(contents.encode("utf-8"))
  to this:
        self.clipBoard.set_text(contents.encode("utf-8"), -1)

Original comment by ranju.ma...@gmail.com on 19 Jul 2013 at 1:34