kivy/kivy — Issue #384: FloatLayout receives touch down events out of its bounds
Author: treystout
Created: 2012-01-25 00:10:57+00:00
State: open

Machine: Linux 3.0.0-14-generic #23-Ubuntu SMP Mon Nov 21 20:28:43 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

Howdy, it appears that some layouts are receiving events for items outside of their boundaries.

Source to reproduce:

```python
"""
Simple example to show that FloatLayouts receive events they shouldn't

Run this code, then click anywhere on the left 10% of the screen, note
that touch events are printed when they shouldn't be
"""
import kivy
kivy.require('1.0.9')

from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.slider import Slider
from kivy.uix.widget import Widget

class Foo(FloatLayout):
# stupid child class so we can print when we get touch events
def on_touch_down(self, t):
print t

class LayoutApp(App):
def build(self):
# make a slider that will take the left 10%
sld = Slider(orientation="vertical", size_hint=(0.1, 1.0))
# make our stupid layout that will receive too many clicks
foo = Foo(size_hint=(0.9, 1.0))

# make a layout to contain both items
self.main_layout = BoxLayout(orientation="horizontal", padding=10,
spacing=10)
self.main_layout.add_widget(sld)
self.main_layout.add_widget(foo)
return self.main_layout

if __name__ in ('__android__', '__main__'):
LayoutApp().run()

```