rdmenezes / cefpython

Automatically exported from code.google.com/p/cefpython
1 stars 0 forks source link

Keyboard problems in popup windows in the wxpython examples (Windows) #80

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There was a similar keys "chars" events problem when embedding browser
in wx tabs, this was fixed by adding the wx.WANTS_CHARS style to panel
and notebook controls. See this topic on the CEF Forum:

http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=10922

Adding the wx.WANTS_CHARS style to wx.Frame does not solve the problem
for popup windows. This probably needs a more complex fix, requiring
to hook up to wx keyboard events and propagate them to the CEF child 
windows.

Original issue reported on code.google.com by czarek.t...@gmail.com on 7 Aug 2013 at 4:47

GoogleCodeExporter commented 9 years ago
Setting style for wx.Frame:

    style=(wx.DEFAULT_FRAME_STYLE | wx.WANTS_CHARS)

Original comment by czarek.t...@gmail.com on 7 Aug 2013 at 4:55

GoogleCodeExporter commented 9 years ago
See these links:

"Catching key events globally"
http://wiki.wxwidgets.org/Catching_key_events_globally

EVT_CHAR_HOOK
http://stackoverflow.com/questions/3876966/what-does-wxwidgets-evt-char-hook-do

"Unreliable keyboard events with wx.Frame"
http://comp.soft-sys.wxwindows.narkive.com/H0ymFpRo/unreliable-keyboard-events-w
ith-wxframe

Original comment by czarek.t...@gmail.com on 7 Aug 2013 at 5:38

GoogleCodeExporter commented 9 years ago
I think that the solution is to create the popup windows explicitilly, by 
implenting the LifespanHandler.`OnBeforePopup` callback. Keyboard behaves 
correctly in the wxpython.py popup example when using the NewWindow() function.

Original comment by czarek.t...@gmail.com on 21 May 2014 at 7:34

GoogleCodeExporter commented 9 years ago
Thanks, implenting the LifespanHandler.`OnBeforePopup` callback helped.
However this is not a straightforward solution as you can't create new window 
directly in this callback (as it is executed in wrong thread).

Original comment by mathemat...@gmail.com on 22 May 2014 at 2:21

GoogleCodeExporter commented 9 years ago
Issue 61 is to allow posting tasks on the UI thread.

Original comment by czarek.t...@gmail.com on 22 May 2014 at 2:31

GoogleCodeExporter commented 9 years ago

Original comment by czarek.t...@gmail.com on 22 May 2014 at 2:33

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Fixed in revision a07c898cb1df.

Exposed cefpython.`PostTask` function for execution of tasks on various 
threads. See example usage:
https://code.google.com/p/cefpython/source/browse/cefpython/cef3/windows/binarie
s/wxpython.py?r=a07c898cb1df#607

Original comment by czarek.t...@gmail.com on 9 Aug 2014 at 4:18

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Note that are implications of creating the popup window of our own by 
implementing LifespanHandler.OnBeforePopup. The popup window and parent window 
will not be able to script each other. There will be no "window.opener" 
property available in the popup window.

Original comment by czarek.t...@gmail.com on 22 Jan 2015 at 5:00

GoogleCodeExporter commented 9 years ago
The popup/parent scripting issues are to be fixed in a separate Issue 171.

Original comment by czarek.t...@gmail.com on 23 Jan 2015 at 11:42