Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kivy can crash when a TextInput.is_focusable is set to False and focus is switched to another widget at same time #5242

Closed
Bakterija opened this issue Jun 26, 2017 · 1 comment

Comments

@Bakterija
Copy link
Contributor

  • Python: All
  • OS: Ubuntu 16.04
  • Kivy: 1.10 and 1.10.1-dev0
  • Kivy installation method: pip

Tested with this test app

Error log:

[INFO   ] [Logger      ] Record log in /home/atis/.kivy/logs/kivy_17-06-26_71.txt
[INFO   ] [Kivy        ] v1.10.1.dev0, git-f91378d, 20170626
[INFO   ] [Python      ] v2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609]
[INFO   ] [Factory     ] 194 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO   ] [OSC         ] using <multiprocessing> for socket
[INFO   ] [Window      ] Provider: sdl2(['window_egl_rpi'] ignored)
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] Backend used <gl>
[INFO   ] [GL          ] OpenGL version <3.0 Mesa 12.0.6>
[INFO   ] [GL          ] OpenGL vendor <Intel Open Source Technology Center>
[INFO   ] [GL          ] OpenGL renderer <Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2) >
[INFO   ] [GL          ] OpenGL parsed version: 3, 0
[INFO   ] [GL          ] Shading version <1.30>
[INFO   ] [GL          ] Texture max size <8192>
[INFO   ] [GL          ] Texture max units <32>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [Clipboard   ] Provider: gtk3(['clipboard_dbusklipper'] ignored)
xclip version 0.12
Copyright (C) 2001-2008 Kim Saunders et al.
Distributed under the terms of the GNU GPL
[INFO   ] [Cutbuffer   ] Provider: xclip
[INFO   ] [CutBuffer   ] cut buffer support enabled
[INFO   ] [GL          ] NPOT texture support is available
[INFO   ] [Base        ] Start application main loop
('NEW FOCUS', 1)
('NEW FOCUS', 2)
('NEW FOCUS', 3)
('NEW FOCUS', 0)
('NEW FOCUS', 1)
('NEW FOCUS', 2)
('NEW FOCUS', 3)
('NEW FOCUS', 0)
[INFO   ] [Base        ] Leaving application in progress...
 Traceback (most recent call last):
   File "<string>", line 140, in <module>
   File "/home/atis/.local/lib/python2.7/site-packages/kivy/base.py", line 502, in runTouchApp
     EventLoop.window.mainloop()
   File "/home/atis/.local/lib/python2.7/site-packages/kivy/core/window/window_sdl2.py", line 663, in mainloop
     self._mainloop()
   File "/home/atis/.local/lib/python2.7/site-packages/kivy/core/window/window_sdl2.py", line 405, in _mainloop
     EventLoop.idle()
   File "/home/atis/.local/lib/python2.7/site-packages/kivy/base.py", line 337, in idle
     Clock.tick()
   File "/home/atis/.local/lib/python2.7/site-packages/kivy/clock.py", line 581, in tick
     self._process_events()
   File "kivy/_clock.pyx", line 367, in kivy._clock.CyClockBase._process_events (/tmp/pip-NNmYND-build/kivy/_clock.c:7700)
   File "kivy/_clock.pyx", line 397, in kivy._clock.CyClockBase._process_events (/tmp/pip-NNmYND-build/kivy/_clock.c:7577)
   File "kivy/_clock.pyx", line 395, in kivy._clock.CyClockBase._process_events (/tmp/pip-NNmYND-build/kivy/_clock.c:7498)
   File "kivy/_clock.pyx", line 167, in kivy._clock.ClockEvent.tick (/tmp/pip-NNmYND-build/kivy/_clock.c:3490)
   File "<string>", line 97, in do_test
   File "kivy/weakproxy.pyx", line 33, in kivy.weakproxy.WeakProxy.__setattr__ (/tmp/pip-NNmYND-build/kivy/weakproxy.c:1471)
   File "kivy/properties.pyx", line 478, in kivy.properties.Property.__set__ (/tmp/pip-NNmYND-build/kivy/properties.c:5572)
   File "kivy/properties.pyx", line 516, in kivy.properties.Property.set (/tmp/pip-NNmYND-build/kivy/properties.c:6405)
   File "kivy/properties.pyx", line 571, in kivy.properties.Property.dispatch (/tmp/pip-NNmYND-build/kivy/properties.c:7105)
   File "kivy/_event.pyx", line 1225, in kivy._event.EventObservers.dispatch (/tmp/pip-NNmYND-build/kivy/_event.c:14035)
   File "kivy/_event.pyx", line 1131, in kivy._event.EventObservers._dispatch (/tmp/pip-NNmYND-build/kivy/_event.c:13193)
   File "/home/atis/.local/lib/python2.7/site-packages/kivy/uix/behaviors/focus.py", line 384, in _on_focus
     self._bind_keyboard()
   File "/home/atis/.local/lib/python2.7/site-packages/kivy/uix/behaviors/focus.py", line 406, in _bind_keyboard
     old_focus = keyboards[keyboard]  # keyboard should be in dict
 KeyError: <kivy.core.window.Keyboard object at 0x7f5a2a459b40>
@Bakterija Bakterija changed the title Kivy can crash when a TextInput.is_focus is set to False and focus is switched to another widget at same time Kivy can crash when a TextInput.is_focusable is set to False and focus is switched to another widget at same time Jun 26, 2017
@Bakterija
Copy link
Contributor Author

I was testing modification in the pr and it seemed to work properly in this example and my other keyboard heavy apps.

matham added a commit that referenced this issue Jul 5, 2017
Fix for crash when setting is_focusable property in issue #5242
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants