[gtk/matthiasc/surface-state-rework: 59/80] gtk/tooltipwindow: Use gtk_tooltip_window_present() instead of GtkNative
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/surface-state-rework: 59/80] gtk/tooltipwindow: Use gtk_tooltip_window_present() instead of GtkNative
- Date: Sat, 5 Dec 2020 17:42:40 +0000 (UTC)
commit 679b7388742f2c9d6a1d8f806746b9d141ff646f
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Fri Dec 4 11:06:25 2020 +0100
gtk/tooltipwindow: Use gtk_tooltip_window_present() instead of GtkNative
gtk/gtklayoutmanager.c | 3 +++
gtk/gtktooltip.c | 2 +-
gtk/gtktooltipwindow.c | 8 ++++++--
gtk/gtktooltipwindowprivate.h | 2 ++
4 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtklayoutmanager.c b/gtk/gtklayoutmanager.c
index 1a7b7afbf6..5ba6d17021 100644
--- a/gtk/gtklayoutmanager.c
+++ b/gtk/gtklayoutmanager.c
@@ -79,6 +79,7 @@
#include "gtknative.h"
#include "gtkpopover.h"
#include "gtktexthandleprivate.h"
+#include "gtktooltipwindowprivate.h"
#ifdef G_ENABLE_DEBUG
#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));
else if (GTK_IS_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))
gtk_native_check_resize (GTK_NATIVE (child));
}
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index 392bd0620e..a192d1eb0d 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -1024,7 +1024,7 @@ gtk_tooltip_maybe_allocate (GtkNative *native)
if (!tooltip || GTK_NATIVE (tooltip->native) != native)
return;
- gtk_native_check_resize (GTK_NATIVE (tooltip->window));
+ gtk_tooltip_window_present (GTK_TOOLTIP_WINDOW (tooltip->window));
}
void
diff --git a/gtk/gtktooltipwindow.c b/gtk/gtktooltipwindow.c
index c4c5b64ecd..a0651e4338 100644
--- a/gtk/gtktooltipwindow.c
+++ b/gtk/gtktooltipwindow.c
@@ -142,8 +142,12 @@ gtk_tooltip_window_relayout (GtkTooltipWindow *window)
static void
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))
{
diff --git a/gtk/gtktooltipwindowprivate.h b/gtk/gtktooltipwindowprivate.h
index 61e6b91864..651a3cf7c7 100644
--- a/gtk/gtktooltipwindowprivate.h
+++ b/gtk/gtktooltipwindowprivate.h
@@ -37,6 +37,8 @@ G_DECLARE_FINAL_TYPE (GtkTooltipWindow, gtk_tooltip_window, GTK, TOOLTIP_WINDOW,
GtkWidget * gtk_tooltip_window_new (void);
+void gtk_tooltip_window_present (GtkTooltipWindow *window);
+
void gtk_tooltip_window_set_label_markup (GtkTooltipWindow *window,
const char *markup);
void gtk_tooltip_window_set_label_text (GtkTooltipWindow *window,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]