<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Gtk.Window loses focus when clicking a Gtk.Popover"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=101489">101489</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Gtk.Window loses focus when clicking a Gtk.Popover
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Wayland
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>weston
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>wayland-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>forenjunkie@chello.at
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi,

hope im right here

weston 1.12.0
OS: Ubuntu 17.04
I use Python 3.5.3
GTK+ Version: 3.22.11
PyGobject Version: 3.22.0


i created this minimal example:

import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk


class Popover(Gtk.Window):
    def __init__(self):
        Gtk.Window.__init__(self)
        self.set_title("Popover")
        self.set_default_size(250, 250)
        self.connect("destroy", Gtk.main_quit)
        self.connect('focus-in-event', self.focus_in)
        self.connect('focus-out-event', self.focus_out)

        box = Gtk.Box()
        box.set_orientation(Gtk.Orientation.VERTICAL)
        self.add(box)

        button = Gtk.MenuButton()
        box.add(button)

        pop = Gtk.Popover()
        flowbox = Gtk.FlowBox()
        flowbox.add(Gtk.Button(label='test'))
        flowbox.show_all()
        pop.add(flowbox)

        button.set_popover(pop)

    def focus_out(*args):
        print('focus out')

    def focus_in(*args):
        print('focus in')


window = Popover()
window.show_all()

Gtk.main()


If you click the Gtk.MenuButton everything is alright, as soon as you click the
Button that is in the Gtk.Popover, first the focus-out of the Gtk.Window event
is triggered, then the focus-in event of the Gtk.Window is triggered.

The Window shouldn't focus out because i use widgets inside that Window.

thanks</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>