Merge branch 'BUG_tooltip_blocks_combo_GTK3' into 'gtk-3-24'

tooltips: hide tooltips before showing popups

See merge request GNOME/gtk!1084
This commit is contained in:
Matthias Clasen 2019-09-15 21:20:37 +00:00
commit ac53fed1f2
4 changed files with 21 additions and 0 deletions

View File

@ -44,6 +44,7 @@
#include "gtkwindow.h"
#include "gtktypebuiltins.h"
#include "gtkprivate.h"
#include "gtktooltipprivate.h"
#include "gtkcomboboxprivate.h"
#include <gobject/gvaluecollector.h>
@ -2315,6 +2316,7 @@ gtk_combo_box_popup_for_device (GtkComboBox *combo_box,
return;
}
_gtk_tooltip_hide (GTK_WIDGET (combo_box));
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (combo_box));
if (GTK_IS_WINDOW (toplevel))
{

View File

@ -133,6 +133,7 @@
#include "gtkcssnodeprivate.h"
#include "gtkstylecontextprivate.h"
#include "gtkcssstylepropertyprivate.h"
#include "gtktooltipprivate.h"
#include "deprecated/gtktearoffmenuitem.h"
@ -1824,6 +1825,7 @@ gtk_menu_popup_internal (GtkMenu *menu,
g_return_if_fail (GTK_IS_MENU (menu));
g_return_if_fail (device == NULL || GDK_IS_DEVICE (device));
_gtk_tooltip_hide_in_display (gtk_widget_get_display (GTK_WIDGET (menu)));
display = gtk_widget_get_display (GTK_WIDGET (menu));
if (device == NULL)

View File

@ -1277,6 +1277,22 @@ _gtk_tooltip_hide (GtkWidget *widget)
gtk_tooltip_hide_tooltip (tooltip);
}
void
_gtk_tooltip_hide_in_display (GdkDisplay *display)
{
GtkTooltip *tooltip;
if (!display)
return;
tooltip = g_object_get_qdata (G_OBJECT (display), quark_current_tooltip);
if (!tooltip || !GTK_TOOLTIP_VISIBLE (tooltip))
return;
gtk_tooltip_hide_tooltip (tooltip);
}
static gboolean
tooltips_enabled (GdkEvent *event)
{

View File

@ -36,6 +36,7 @@ void _gtk_tooltip_focus_out (GtkWidget *widget);
void _gtk_tooltip_toggle_keyboard_mode (GtkWidget *widget);
void _gtk_tooltip_handle_event (GdkEvent *event);
void _gtk_tooltip_hide (GtkWidget *widget);
void _gtk_tooltip_hide_in_display (GdkDisplay *display);
GtkWidget * _gtk_widget_find_at_coords (GdkWindow *window,
gint window_x,