#include "gtkintl.h"
#include "gtkprivate.h"
#include "gtkplugprivate.h"
+#include "gtkwidgetprivate.h"
#include "gtkwindow.h"
/**
*
* Retrieves the socket the plug is embedded in.
*
- * Return value: the window of the socket, or %NULL
+ * Return value: (transfer none): the window of the socket, or %NULL
*
* Since: 2.14
**/
{
GtkPlugPrivate *priv;
GtkWidget *widget;
- gint w, h;
g_return_if_fail (GTK_IS_PLUG (plug));
g_return_if_fail (GTK_IS_SOCKET (socket_));
GdkWindow *window;
window = gtk_widget_get_window (widget);
- gdk_drawable_get_size (GDK_DRAWABLE (window), &w, &h);
- gdk_window_reparent (window, priv->socket_window, -w, -h);
+ gdk_window_reparent (window, priv->socket_window,
+ -gdk_window_get_width (window),
+ -gdk_window_get_height (window));
}
gtk_widget_set_parent (widget, GTK_WIDGET (socket_));
priv = plug->priv;
widget = GTK_WIDGET (plug);
- if (GTK_WIDGET_IN_REPARENT (widget))
+ if (_gtk_widget_get_in_reparent (widget))
return;
g_object_ref (plug);
window = gtk_widget_get_window (widget);
gdk_window_hide (window);
- GTK_PRIVATE_SET_FLAG (plug, GTK_IN_REPARENT);
+ _gtk_widget_set_in_reparent (widget, TRUE);
gdk_window_reparent (window,
gtk_widget_get_root_window (widget),
0, 0);
gtk_widget_unparent (GTK_WIDGET (plug));
- GTK_PRIVATE_UNSET_FLAG (plug, GTK_IN_REPARENT);
+ _gtk_widget_set_in_reparent (widget, FALSE);
socket_->plug_widget = NULL;
if (socket_->plug_window != NULL)
/**
* gtk_plug_new_for_display:
- * @display : the #GdkDisplay on which @socket_id is displayed
+ * @display: the #GdkDisplay on which @socket_id is displayed
* @socket_id: the XID of the socket's window.
*
* Create a new plug widget inside the #GtkSocket identified by socket_id.
/* this isn't right - we should match our parent's visual/colormap.
* though that will require handling "foreign" colormaps */
attributes.visual = gtk_widget_get_visual (widget);
- attributes.colormap = gtk_widget_get_colormap (widget);
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |= (GDK_EXPOSURE_MASK |
GDK_KEY_PRESS_MASK |
GDK_LEAVE_NOTIFY_MASK |
GDK_STRUCTURE_MASK);
- attributes_mask = GDK_WA_VISUAL | GDK_WA_COLORMAP;
+ attributes_mask = GDK_WA_VISUAL;
attributes_mask |= (title ? GDK_WA_TITLE : 0);
- attributes_mask |= (g_strdup (g_get_prgname ()) ? GDK_WA_WMCLASS : 0);
+ attributes_mask |= (wmclass_name ? GDK_WA_WMCLASS : 0);
if (gtk_widget_is_toplevel (widget))
{