title: on_enter firing before screen is entered when using nested ScreenManager in Kivy
body: <p>I'm having an issue with using a ScreenManager within a ScreenManager where the <code>on_enter</code> event is being triggered on the first screen in the nested ScreenManager before the screen is visible. This is an issue for me as there's some blocking code that's triggering on the launch of the script and causing unwelcome delays.</p>
  
  <p>I've recreated the setup with the following code:</p>
  
  <p>main.py</p>
  
  <pre><code>from kivy.app import App
  from kivy.uix.widget import Widget
  from kivy.uix.label import Label
  from kivy.uix.button import Button
  from kivy.uix.floatlayout import FloatLayout
  from kivy.uix.screenmanager import ScreenManager, Screen
  from kivy.properties import StringProperty
  from kivy.core.window import Window
  from time import sleep
  
  class NestedScreen(Screen):
      scrname = StringProperty("")
  
      def __init__(self, **kwargs):
          super(NestedScreen, self).__init__(**kwargs)
          self.scrname = kwargs["scname"]
          self.nest_scrmgr = self.ids.nest_scrmgr
          self.nest_scr_list = []
          self.nest_scr_id = 0
          for s in range(4):
              scr_name = "Nest-{}".format(s)
              d = NestedDummyScreen(scname=scr_name, name=scr_name)
              self.nest_scrmgr.add_widget(d)
              self.nest_scr_list.append(scr_name)
  
      def previous(self):
          self.nest_scr_id = (self.nest_scr_id - 1) % len(self.nest_scr_list)
          self.nest_scrmgr.current = self.nest_scr_list[self.nest_scr_id]
  
      def next(self):
          self.nest_scr_id = (self.nest_scr_id + 1) % len(self.nest_scr_list)
          self.nest_scrmgr.current = self.nest_scr_list[self.nest_scr_id]
  
      def on_enter(self):
          print "Nested screen on_enter event"
          print "Entering {}".format(self.name)
  
  class NestedDummyScreen(Screen):
      scrname = StringProperty("")
  
      def __init__(self, **kwargs):
          super(NestedDummyScreen, self).__init__(**kwargs)
          self.scrname = kwargs["scname"]
          self.running = False
  
      def on_enter(self):
          print "Entering nested screen #{}".format(self.name)
          if not self.running:
              print "Sleep 2..."
              sleep(2)
              self.running = True
  
  class DummyScreen(Screen):
      scrname = StringProperty("")
  
      def __init__(self, **kwargs):
          super(DummyScreen, self).__init__(**kwargs)
          self.scrname = kwargs["scname"]
  
      def on_enter(self):
          print "Entering screen #{}".format(self.name)
  
  class TestScreenBase(FloatLayout):
      def __init__(self, **kwargs):
          super(TestScreenBase, self).__init__(**kwargs)
          self.scrmgr = self.ids.test_scrmgr
          self.scr_list = []
          self.scr_id = 0
          for s in range(4):
              scr_name = str(s)
              d = DummyScreen(scname=scr_name, name=scr_name)
              self.scrmgr.add_widget(d)
              self.scr_list.append(scr_name)
          n = NestedScreen(scname="NestedScreen", name="NestedScreen")
          self.scrmgr.add_widget(n)
          self.scr_list.append("NestedScreen")
  
      def previous(self):
          self.scr_id = (self.scr_id - 1) % len(self.scr_list)
          self.scrmgr.current = self.scr_list[self.scr_id]
  
      def next(self):
          self.scr_id = (self.scr_id + 1) % len(self.scr_list)
          self.scrmgr.current = self.scr_list[self.scr_id]
  
  class TestApp(App):
      def build(self):
          Window.size = (800,480)
          return TestScreenBase()
  
  
  if __name__ == '__main__':
      TestApp().run()
  </code></pre>
  
  <p>test.kv</p>
  
  <pre><code>&lt;TestScreenBase&gt;
      Button:
          size: 50, root.height
          size_hint: None, None
          pos: 0, 0
          text: "&lt;"
          on_press: root.previous()
  
      Button:
          size: 50, root.height
          size_hint: None, None
          pos: root.width - 50, 0
          text: "&gt;"
          on_press: root.next()
  
      ScreenManager:
          id: test_scrmgr
  
  &lt;DummyScreen&gt;
      Label:
          text: "This is screen #{}".format(root.scrname)
  
  &lt;NestedDummyScreen&gt;
      Label:
          text: "This is nested screen #{}".format(root.scrname)
  
  &lt;NestedScreen&gt;
      FloatLayout:
  
          Button:
              size: root.width, 50
              size_hint: None, None
              pos: 0, 0
              text: "\/"
              on_press: root.previous()
  
          Button:
              size: root.width, 50
              size_hint: None, None
              pos: 0, root.height - 50
              text: "^"
              on_press: root.next()
  
          ScreenManager:
              id: nest_scrmgr
  </code></pre>
  
  <p>When the script is run, the following lines are printed immediately to the console:</p>
  
  <pre><code>Entering screen #0
  Entering nested screen #Nest-0
  Sleep 2...
  </code></pre>
  
  <p>The first line is fine, but I wasn't expecting the next two lines.</p>
  
  <p>My guess would be that the <code>on_enter</code> event is triggered on the current Screen in the ScreenManager instance without having any regard as to whether that ScreenManager is, itself, visible. </p>
  
  <p>Does anyone have any thoughts on this?</p>
  
  <p>Happy to report as a bug if appropriate.</p>