Commit 1fd7a6e4 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Make gtk_propagate_event() non-static, we need it in gtkdnd.c so that the

Tue Jan  5 15:03:47 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmain.c (gtk_propagate_event): Make
	gtk_propagate_event() non-static, we need it in gtkdnd.c
	so that the button-release we synthesize gets propagated
	correctly.

	* gtk/gtkdnd.c: Use gtk_propagate_event() so
	release gets to a GtkList. But we can't really
	get this right without access to the windows
	event masks and doing X-style propagation ourselves.

Tue Jan  5 11:31:55 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkselection.c (gtk_target_list_unref): Free
	memory allocated for target lists.

	* gtk/gtkdnd.c (gtk_drag_drop_finished): Release
	selections before destroying info structure.

	* gdk/gdkdnd.c gdktypes.h (gdk_drag_get_protocol): Add
	new value GDK_DRAG_PROTO_NONE, use it for non-drag
	targets, to quiet Purify.

	* gdk/gdkdnd.c (gdk_window_register_dnd): Set size
	of property properly.
parent ce87813a
......@@ -2541,6 +2541,7 @@ gdk_drag_get_protocol (guint32 xid,
}
}
*protocol = GDK_DRAG_PROTO_NONE;
return GDK_NONE;
}
......@@ -2950,8 +2951,7 @@ gdk_window_register_dnd (GdkWindow *window)
GDK_WINDOW_XWINDOW (window),
xdnd_aware_atom, XA_ATOM,
32, PropModeReplace,
(guchar *)&xdnd_version,
sizeof (xdnd_version));
(guchar *)&xdnd_version, 1);
}
/*************************************************************
......
......@@ -2541,6 +2541,7 @@ gdk_drag_get_protocol (guint32 xid,
}
}
*protocol = GDK_DRAG_PROTO_NONE;
return GDK_NONE;
}
......@@ -2950,8 +2951,7 @@ gdk_window_register_dnd (GdkWindow *window)
GDK_WINDOW_XWINDOW (window),
xdnd_aware_atom, XA_ATOM,
32, PropModeReplace,
(guchar *)&xdnd_version,
sizeof (xdnd_version));
(guchar *)&xdnd_version, 1);
}
/*************************************************************
......
......@@ -2005,11 +2005,14 @@ gtk_drag_drop_finished (GtkDragSourceInfo *info,
gboolean success,
guint time)
{
gtk_drag_source_release_selections (info, time);
if (info->proxy_dest)
{
/* The time from the event isn't reliable for Xdnd drags */
gtk_drag_finish (info->proxy_dest->context, success, FALSE,
info->proxy_dest->proxy_drop_time);
gtk_drag_source_info_destroy (info);
}
else
{
......@@ -2039,8 +2042,6 @@ gtk_drag_drop_finished (GtkDragSourceInfo *info,
gtk_timeout_add (ANIM_STEP_TIME, gtk_drag_anim_timeout, anim);
}
}
gtk_drag_source_release_selections (info, GDK_CURRENT_TIME); /* fixme */
}
static void
......@@ -2459,19 +2460,31 @@ gtk_drag_button_release_cb (GtkWidget *widget,
gtk_grab_remove (widget);
/* Send on a release pair to the the original
* widget to convince it to release its grab. We need to
* call gtk_propagate_event() here, instead of
* gtk_widget_event() because widget like GtkList may
* expect propagation.
*/
send_event.button.type = GDK_BUTTON_RELEASE;
send_event.button.window = source_widget->window;
send_event.button.send_event = TRUE;
send_event.button.time = event->time;
send_event.button.x = 0;
send_event.button.y = 0;
send_event.button.pressure = 0.;
send_event.button.xtilt = 0.;
send_event.button.ytilt = 0.;
send_event.button.state = event->state;
send_event.button.button = event->button;
send_event.button.time = event->time;
send_event.button.source = GDK_SOURCE_PEN;
send_event.button.deviceid = GDK_CORE_POINTER;
send_event.button.x_root = 0;
send_event.button.y_root = 0;
gtk_propagate_event (source_widget, &send_event);
/* Send on the button release to the original widget to
* convince it to release its grab
*/
gtk_widget_event (source_widget, &send_event);
gtk_widget_unref (source_widget);
return TRUE;
......
......@@ -85,8 +85,6 @@ static gint gtk_quit_invoke_function (GtkQuitFunction *quitf);
static void gtk_quit_destroy (GtkQuitFunction *quitf);
static gint gtk_invoke_key_snoopers (GtkWidget *grab_widget,
GdkEvent *event);
static void gtk_propagate_event (GtkWidget *widget,
GdkEvent *event);
static void gtk_destroy_closure (gpointer data);
static gboolean gtk_invoke_idle_timeout (gpointer data);
......@@ -1196,7 +1194,7 @@ gtk_quit_invoke_function (GtkQuitFunction *quitf)
}
}
static void
void
gtk_propagate_event (GtkWidget *widget,
GdkEvent *event)
{
......
......@@ -139,6 +139,11 @@ GdkEvent* gtk_get_current_event (void);
GtkWidget* gtk_get_event_widget (GdkEvent *event);
/* Private routines internal to GTK+
*/
void gtk_propagate_event (GtkWidget *widget,
GdkEvent *event);
#ifdef __cplusplus
}
#endif /* __cplusplus */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment