<p><code>:map-event</code> is ugly IMO, because it's a mere implementation detail at best.  Doing it properly would be listening to <a href="https://developer.gnome.org/gtk3/stable/GtkMenuToolButton.html#GtkMenuToolButton-show-menu"><code>GtkMenuToolButton::show-menu</code></a>.  However, just like <code>GtkWidget::show</code> on the menu itself, it somehow is emitted twice under GTK >= 3.16.  See the <a href="https://bugzilla.gnome.org/show_bug.cgi?id=769287">just-filed bug</a>.</p>

<p>I'm not sure what to do.  This is clearly a GTK bug, so I'm not very keen on adding a hack just for it until it gets fixed.</p>

<blockquote>
<p>IIUC "show" is called everytime one calls gtk_widget_show() which can be more than once?</p>
</blockquote>

<p>No, it's only emitted if the visible state changed.  What happens here is that the menu is effectively shown twice.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/1149#issuecomment-236049030">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ2CS1JElRBEyENu0k7WVz86r0ezlks5qaTL_gaJpZM4JTxOO">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJw0l2VeY0CgOAK774LnSEZG2hGfdks5qaTL_gaJpZM4JTxOO.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/issues/1149#issuecomment-236049030"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>