gtk/tooltipwindow: Use gtk_tooltip_window_present() instead of GtkNative

This commit is contained in:
Jonas Ådahl 2020-12-04 11:06:25 +01:00
parent 517bc0db84
commit 9d3f497a21
4 changed files with 12 additions and 3 deletions

View File

@ -79,6 +79,7 @@
#include "gtknative.h" #include "gtknative.h"
#include "gtkpopover.h" #include "gtkpopover.h"
#include "gtktexthandleprivate.h" #include "gtktexthandleprivate.h"
#include "gtktooltipwindowprivate.h"
#ifdef G_ENABLE_DEBUG #ifdef G_ENABLE_DEBUG
#define LAYOUT_MANAGER_WARN_NOT_IMPLEMENTED(m,method) G_STMT_START { \ #define LAYOUT_MANAGER_WARN_NOT_IMPLEMENTED(m,method) G_STMT_START { \
@ -369,6 +370,8 @@ allocate_native_children (GtkWidget *widget)
gtk_popover_present (GTK_POPOVER (child)); gtk_popover_present (GTK_POPOVER (child));
else if (GTK_IS_TEXT_HANDLE (child)) else if (GTK_IS_TEXT_HANDLE (child))
gtk_text_handle_present (GTK_TEXT_HANDLE (child)); gtk_text_handle_present (GTK_TEXT_HANDLE (child));
else if (GTK_IS_TOOLTIP_WINDOW (child))
gtk_tooltip_window_present (GTK_TOOLTIP_WINDOW (child));
else if (GTK_IS_NATIVE (child)) else if (GTK_IS_NATIVE (child))
gtk_native_check_resize (GTK_NATIVE (child)); gtk_native_check_resize (GTK_NATIVE (child));
} }

View File

@ -1024,7 +1024,7 @@ gtk_tooltip_maybe_allocate (GtkNative *native)
if (!tooltip || GTK_NATIVE (tooltip->native) != native) if (!tooltip || GTK_NATIVE (tooltip->native) != native)
return; return;
gtk_native_check_resize (GTK_NATIVE (tooltip->window)); gtk_tooltip_window_present (GTK_TOOLTIP_WINDOW (tooltip->window));
} }
void void

View File

@ -142,8 +142,12 @@ gtk_tooltip_window_relayout (GtkTooltipWindow *window)
static void static void
gtk_tooltip_window_native_check_resize (GtkNative *native) gtk_tooltip_window_native_check_resize (GtkNative *native)
{ {
GtkTooltipWindow *window = GTK_TOOLTIP_WINDOW (native); }
GtkWidget *widget = GTK_WIDGET (native);
void
gtk_tooltip_window_present (GtkTooltipWindow *window)
{
GtkWidget *widget = GTK_WIDGET (window);
if (!_gtk_widget_get_alloc_needed (widget)) if (!_gtk_widget_get_alloc_needed (widget))
{ {

View File

@ -37,6 +37,8 @@ G_DECLARE_FINAL_TYPE (GtkTooltipWindow, gtk_tooltip_window, GTK, TOOLTIP_WINDOW,
GtkWidget * gtk_tooltip_window_new (void); GtkWidget * gtk_tooltip_window_new (void);
void gtk_tooltip_window_present (GtkTooltipWindow *window);
void gtk_tooltip_window_set_label_markup (GtkTooltipWindow *window, void gtk_tooltip_window_set_label_markup (GtkTooltipWindow *window,
const char *markup); const char *markup);
void gtk_tooltip_window_set_label_text (GtkTooltipWindow *window, void gtk_tooltip_window_set_label_text (GtkTooltipWindow *window,