diff options
author | Owen Taylor <otaylor@redhat.com> | 2002-05-17 18:15:26 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2002-05-17 18:15:26 +0000 |
commit | f58d55300b90242087898aba147a4d94b8b57505 (patch) | |
tree | 03957e2678ef669f7af0c5c563c4ea5954875119 /gtk/gtkplug.c | |
parent | 2bf6824ffafe27fcf8bddba71d05e346e5126359 (diff) | |
download | gtk+-f58d55300b90242087898aba147a4d94b8b57505.tar.gz |
Fix a missing unref in the local/passive case. (#82067, Michael Meeks)
Fri May 17 13:56:23 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.c (gtk_plug_filter_func): Fix a missing
unref in the local/passive case. (#82067, Michael
Meeks)
* gtk/gtkplug.c (_gtk_plug_remove_from_socket): Fix
reference leak on the plug window.
* tests/testsocket.c (add_child): Fix memory leak.
* gtk/gtkdnd.c (gtk_drag_dest_site_destroy): Unref
the proxy window.
Diffstat (limited to 'gtk/gtkplug.c')
-rw-r--r-- | gtk/gtkplug.c | 39 |
1 files changed, 9 insertions, 30 deletions
diff --git a/gtk/gtkplug.c b/gtk/gtkplug.c index fc3b66a828..5d076a4acb 100644 --- a/gtk/gtkplug.c +++ b/gtk/gtkplug.c @@ -48,8 +48,6 @@ static void gtk_plug_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static gboolean gtk_plug_key_press_event (GtkWidget *widget, GdkEventKey *event); -static gboolean gtk_plug_focus_event (GtkWidget *widget, - GdkEventFocus *event); static void gtk_plug_set_focus (GtkWindow *window, GtkWidget *focus); static gboolean gtk_plug_focus (GtkWidget *widget, @@ -125,8 +123,6 @@ gtk_plug_class_init (GtkPlugClass *class) widget_class->realize = gtk_plug_realize; widget_class->unrealize = gtk_plug_unrealize; widget_class->key_press_event = gtk_plug_key_press_event; - widget_class->focus_in_event = gtk_plug_focus_event; - widget_class->focus_out_event = gtk_plug_focus_event; widget_class->show = gtk_plug_show; widget_class->hide = gtk_plug_hide; @@ -284,7 +280,9 @@ _gtk_plug_remove_from_socket (GtkPlug *plug, GTK_PRIVATE_UNSET_FLAG (plug, GTK_IN_REPARENT); socket->plug_widget = NULL; + g_object_unref (socket->plug_window); socket->plug_window = NULL; + socket->same_app = FALSE; plug->same_app = FALSE; @@ -657,17 +655,6 @@ gtk_plug_key_press_event (GtkWidget *widget, return FALSE; } -static gboolean -gtk_plug_focus_event (GtkWidget *widget, - GdkEventFocus *event) -{ - /* We eat focus-in events and focus-out events, since they - * can be generated by something like a keyboard grab on - * a child of the plug. - */ - return FALSE; -} - static void gtk_plug_set_focus (GtkWindow *window, GtkWidget *focus) @@ -1013,24 +1000,15 @@ handle_xembed_message (GtkPlug *plug, case XEMBED_FOCUS_OUT: { - GtkWidget *widget = GTK_WIDGET (plug); GdkEvent event; event.focus_change.type = GDK_FOCUS_CHANGE; - event.focus_change.window = widget->window; + event.focus_change.window = GTK_WIDGET (plug)->window; event.focus_change.send_event = TRUE; + event.focus_change.in = (message == XEMBED_FOCUS_IN); + + gtk_widget_event (GTK_WIDGET (plug), &event); - if (message == XEMBED_FOCUS_IN) - { - event.focus_change.in = TRUE; - GTK_WIDGET_CLASS (parent_class)->focus_in_event (widget, (GdkEventFocus *)&event); - } - else - { - event.focus_change.in = FALSE; - GTK_WIDGET_CLASS (parent_class)->focus_out_event (widget, (GdkEventFocus *)&event); - } - break; } @@ -1137,7 +1115,7 @@ gtk_plug_filter_func (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data) } } else - break; + goto done; } if (xre->parent != GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen))) @@ -1172,7 +1150,8 @@ gtk_plug_filter_func (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data) if (!was_embedded) g_signal_emit (G_OBJECT (plug), plug_signals[EMBEDDED], 0); } - + + done: g_object_unref (plug); break; |