]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtksocket.c
css: Support opacity
[~andy/gtk] / gtk / gtksocket.c
index 174ea93e05d50018f132a8679e1b6b6fb9f844ab..fc893b80c2ac0ca8e4cc187fe6577683c21b1bbc 100644 (file)
@@ -12,8 +12,7 @@
  * 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 */
@@ -31,7 +30,6 @@
 
 #include <string.h>
 
-#include "gtkmainprivate.h"
 #include "gtkmarshalers.h"
 #include "gtksizerequest.h"
 #include "gtkplug.h"
@@ -39,6 +37,7 @@
 #include "gtkdnd.h"
 #include "gtkdebug.h"
 #include "gtkintl.h"
+#include "gtkmain.h"
 #include "gtkwidgetprivate.h"
 
 #include <gdk/gdkx.h>
@@ -405,7 +404,7 @@ gtk_socket_realize (GtkWidget *widget)
   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);
@@ -440,7 +439,6 @@ gtk_socket_realize (GtkWidget *widget)
 
 /**
  * gtk_socket_end_embedding:
- *
  * @socket: a #GtkSocket
  *
  * Called to end the embedding of a plug in the socket.
@@ -732,7 +730,6 @@ find_accel_key (GtkAccelKey *key,
 
 /**
  * gtk_socket_add_grabbed_key:
- *
  * @socket: a #GtkSocket
  * @keyval: a key
  * @modifiers: modifiers for the key
@@ -771,7 +768,6 @@ gtk_socket_add_grabbed_key (GtkSocket       *socket,
 
 /**
  * gtk_socket_remove_grabbed_key:
- *
  * @socket: a #GtkSocket
  * @keyval: a key
  * @modifiers: modifiers for the key
@@ -916,14 +912,15 @@ static void
 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?
  *
@@ -1010,11 +1007,10 @@ gtk_socket_forall (GtkContainer *container,
 
 /**
  * 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.
  */
@@ -1112,7 +1108,8 @@ gtk_socket_add_window (GtkSocket       *socket,
 
       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);
 
@@ -1146,7 +1143,6 @@ gtk_socket_add_window (GtkSocket       *socket,
 
 /**
  * gtk_socket_handle_map_request:
- *
  * @socket: a #GtkSocket
  *
  * Called from the GtkSocket backend when the plug has been mapped.
@@ -1166,7 +1162,6 @@ gtk_socket_handle_map_request (GtkSocket *socket)
 
 /**
  * gtk_socket_unmap_notify:
- *
  * @socket: a #GtkSocket
  *
  * Called from the GtkSocket backend when the plug has been unmapped ???
@@ -1184,7 +1179,6 @@ gtk_socket_unmap_notify (GtkSocket *socket)
 
 /**
  * gtk_socket_advance_toplevel_focus:
- *
  * @socket: a #GtkSocket
  * @direction: a direction
  *
@@ -1524,9 +1518,8 @@ gtk_socket_filter_func (GdkXEvent *gdk_xevent,
              (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);