Merge branch 'wip/otte/for-master' into 'master'

surface: Don't take a display argument in gdk_surface_new_popup()

See merge request GNOME/gtk!1456
This commit is contained in:
Benjamin Otte 2020-02-21 20:35:47 +00:00
commit 112bc964cb
4 changed files with 5 additions and 15 deletions

View File

@ -778,7 +778,6 @@ gdk_surface_new_temp (GdkDisplay *display,
/** /**
* gdk_surface_new_popup: (constructor) * gdk_surface_new_popup: (constructor)
* @display: the display to create the surface on
* @parent: the parent surface to attach the surface to * @parent: the parent surface to attach the surface to
* @autohide: whether to hide the surface on outside clicks * @autohide: whether to hide the surface on outside clicks
* *
@ -790,16 +789,14 @@ gdk_surface_new_temp (GdkDisplay *display,
* Returns: (transfer full): a new #GdkSurface * Returns: (transfer full): a new #GdkSurface
*/ */
GdkSurface * GdkSurface *
gdk_surface_new_popup (GdkDisplay *display, gdk_surface_new_popup (GdkSurface *parent,
GdkSurface *parent,
gboolean autohide) gboolean autohide)
{ {
GdkSurface *surface; GdkSurface *surface;
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
g_return_val_if_fail (GDK_IS_SURFACE (parent), NULL); g_return_val_if_fail (GDK_IS_SURFACE (parent), NULL);
surface = gdk_surface_new (display, GDK_SURFACE_POPUP, surface = gdk_surface_new (parent->display, GDK_SURFACE_POPUP,
parent, 0, 0, 100, 100); parent, 0, 0, 100, 100);
surface->autohide = autohide; surface->autohide = autohide;

View File

@ -340,8 +340,7 @@ GdkSurface * gdk_surface_new_toplevel (GdkDisplay *display,
int width, int width,
int height); int height);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkSurface * gdk_surface_new_popup (GdkDisplay *display, GdkSurface * gdk_surface_new_popup (GdkSurface *parent,
GdkSurface *parent,
gboolean autohide); gboolean autohide);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL

View File

@ -743,13 +743,10 @@ gtk_popover_realize (GtkWidget *widget)
{ {
GtkPopover *popover = GTK_POPOVER (widget); GtkPopover *popover = GTK_POPOVER (widget);
GtkPopoverPrivate *priv = gtk_popover_get_instance_private (popover); GtkPopoverPrivate *priv = gtk_popover_get_instance_private (popover);
GdkDisplay *display;
GdkSurface *parent; GdkSurface *parent;
display = gtk_widget_get_display (priv->relative_to);
parent = gtk_native_get_surface (gtk_widget_get_native (priv->relative_to)); parent = gtk_native_get_surface (gtk_widget_get_native (priv->relative_to));
priv->surface = gdk_surface_new_popup (display, parent, priv->autohide); priv->surface = gdk_surface_new_popup (parent, priv->autohide);
gdk_surface_set_widget (priv->surface, widget); gdk_surface_set_widget (priv->surface, widget);

View File

@ -229,13 +229,10 @@ static void
gtk_tooltip_window_realize (GtkWidget *widget) gtk_tooltip_window_realize (GtkWidget *widget)
{ {
GtkTooltipWindow *window = GTK_TOOLTIP_WINDOW (widget); GtkTooltipWindow *window = GTK_TOOLTIP_WINDOW (widget);
GdkDisplay *display;
GdkSurface *parent; GdkSurface *parent;
display = gtk_widget_get_display (window->relative_to);
parent = gtk_native_get_surface (gtk_widget_get_native (window->relative_to)); parent = gtk_native_get_surface (gtk_widget_get_native (window->relative_to));
window->surface = gdk_surface_new_popup (display, parent, FALSE); window->surface = gdk_surface_new_popup (parent, FALSE);
gdk_surface_set_widget (window->surface, widget); gdk_surface_set_widget (window->surface, widget);