* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.Free
*/
/* By Owen Taylor <otaylor@gtk.org> 98/4/4 */
#include <string.h>
-#include "gtkmainprivate.h"
#include "gtkmarshalers.h"
#include "gtksizerequest.h"
#include "gtkplug.h"
#include "gtkdnd.h"
#include "gtkdebug.h"
#include "gtkintl.h"
+#include "gtkmain.h"
#include "gtkwidgetprivate.h"
#include <gdk/gdkx.h>
gtk_socket_realize (GtkWidget *widget)
{
GtkAllocation allocation;
- GtkSocket *socket = GTK_SOCKET (widget);
GdkWindow *window;
GdkWindowAttr attributes;
XWindowAttributes xattrs;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
gtk_widget_set_window (widget, window);
- gdk_window_set_user_data (window, socket);
+ gtk_widget_register_window (widget, window);
gtk_style_context_set_background (gtk_widget_get_style_context (widget),
window);
/**
* gtk_socket_end_embedding:
- *
* @socket: a #GtkSocket
*
* Called to end the embedding of a plug in the socket.
/**
* gtk_socket_add_grabbed_key:
- *
* @socket: a #GtkSocket
* @keyval: a key
* @modifiers: modifiers for the key
/**
* gtk_socket_remove_grabbed_key:
- *
* @socket: a #GtkSocket
* @keyval: a key
* @modifiers: modifiers for the key
gtk_socket_notify (GObject *object,
GParamSpec *pspec)
{
- if (!strcmp (pspec->name, "is-focus"))
- return;
- socket_update_focus_in (GTK_SOCKET (object));
+ if (strcmp (pspec->name, "is-focus") == 0)
+ socket_update_focus_in (GTK_SOCKET (object));
+
+ if (G_OBJECT_CLASS (gtk_socket_parent_class)->notify)
+ G_OBJECT_CLASS (gtk_socket_parent_class)->notify (object, pspec);
}
/**
* gtk_socket_claim_focus:
- *
* @socket: a #GtkSocket
* @send_event: huh?
*
/**
* gtk_socket_add_window:
- *
* @socket: a #GtkSocket
* @xid: the native identifier for a window
* @need_reparent: whether the socket's plug's window needs to be
- * reparented to the socket
+ * reparented to the socket
*
* Adds a window to a GtkSocket.
*/
private->need_map = private->is_mapped;
- if (gdk_drag_get_protocol_for_display (display, xid, &protocol))
+ protocol = gdk_window_get_drag_protocol (private->plug_window, NULL);
+ if (protocol)
gtk_drag_dest_set_proxy (GTK_WIDGET (socket), private->plug_window,
protocol, TRUE);
/**
* gtk_socket_handle_map_request:
- *
* @socket: a #GtkSocket
*
* Called from the GtkSocket backend when the plug has been mapped.
/**
* gtk_socket_unmap_notify:
- *
* @socket: a #GtkSocket
*
* Called from the GtkSocket backend when the plug has been unmapped ???
/**
* gtk_socket_advance_toplevel_focus:
- *
* @socket: a #GtkSocket
* @direction: a direction
*
(xevent->xproperty.atom == gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_RECEIVER_INFO")))
{
gdk_error_trap_push ();
- if (gdk_drag_get_protocol_for_display (display,
- xevent->xproperty.window,
- &protocol))
+ protocol = gdk_window_get_drag_protocol (private->plug_window, NULL);
+ if (protocol)
gtk_drag_dest_set_proxy (GTK_WIDGET (socket),
private->plug_window,
protocol, TRUE);