static void
update_drag (GtkPaned *paned,
- GdkEventCrossing *crossing)
+ /* relative to priv->handle */
+ int xpos,
+ int ypos)
{
GtkPanedPrivate *priv = paned->priv;
GtkAllocation allocation;
gint pos;
gint handle_size;
gint size;
+ gint x, y;
+ gdk_window_get_position (priv->handle, &x, &y);
+ gtk_widget_get_allocation (widget, &allocation);
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_widget_get_pointer (widget, &pos, NULL);
+ {
+ pos = xpos + x - allocation.x;
+ }
else
- gtk_widget_get_pointer (widget, NULL, &pos);
+ {
+ pos = ypos + y - allocation.y;
+ }
pos -= priv->drag_pos;
"handle-size", &handle_size,
NULL);
- gtk_widget_get_allocation (widget, &allocation);
size = allocation.width - pos - handle_size;
}
else
GtkPanedPrivate *priv = paned->priv;
if (priv->in_drag)
- update_drag (paned, event);
+ update_drag (paned, event->x, event->y);
else
{
priv->handle_prelit = TRUE;
GtkPanedPrivate *priv = paned->priv;
if (priv->in_drag)
- update_drag (paned);
+ update_drag (paned, event->x, event->y);
else
{
priv->handle_prelit = FALSE;
if (priv->in_drag)
{
- update_drag (paned);
+ update_drag (paned, event->x, event->y);
return TRUE;
}