forked from AuroraMiddleware/gtk
D&D fixes
This commit is contained in:
parent
a589338a7f
commit
fa10f1361f
30
gdk/gdk.c
30
gdk/gdk.c
@ -916,6 +916,10 @@ gdk_event_free (GdkEvent *event)
|
||||
g_free (event->dropdataavailable.data);
|
||||
break;
|
||||
|
||||
case GDK_DRAG_REQUEST:
|
||||
g_free (event->dragrequest.data_type);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -2069,16 +2073,16 @@ gdk_event_translate (GdkEvent *event,
|
||||
x, y, &x, &y, &twin);
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG_DND
|
||||
g_print("Drag is now in window %#x, lastwin was %#x\n",
|
||||
curwin, lastwin);
|
||||
#if defined(DEBUG_DND) /* && defined(DEBUG_DND_MORE_DETAILS) */
|
||||
g_print("Drag is now in window %#x, lastwin was %#x, ddc = %#x\n",
|
||||
curwin, lastwin, dnd_drag_curwin);
|
||||
#endif
|
||||
if(curwin != dnd_drag_curwin && curwin != lastwin)
|
||||
{
|
||||
/* We have left one window and entered another
|
||||
(do leave & enter bits) */
|
||||
if(dnd_drag_curwin != real_sw->xwindow && dnd_drag_curwin != None)
|
||||
gdk_dnd_drag_leave(dnd_drag_curwin);
|
||||
if(dnd_drag_curwin != None)
|
||||
gdk_dnd_drag_leave(dnd_drag_curwin);
|
||||
dnd_drag_curwin = curwin;
|
||||
gdk_dnd_drag_enter(dnd_drag_curwin);
|
||||
dnd_drag_dropzone.x = dnd_drag_dropzone.y = 0;
|
||||
@ -2122,8 +2126,8 @@ gdk_event_translate (GdkEvent *event,
|
||||
dnd_drag_target = None;
|
||||
}
|
||||
}
|
||||
} else
|
||||
dnd_drag_curwin = None;
|
||||
} /* else
|
||||
dnd_drag_curwin = None; */
|
||||
return_val = FALSE;
|
||||
}
|
||||
else
|
||||
@ -2133,7 +2137,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
case EnterNotify:
|
||||
/* Print debugging info.
|
||||
*/
|
||||
#ifndef DEBUG_DND
|
||||
#if !(defined(DEBUG_DND) && defined(DEBUG_DND_MORE_DETAILS))
|
||||
if (gdk_show_events)
|
||||
#endif
|
||||
g_print ("enter notify:\t\twindow: %ld detail: %d subwin: %ld\n",
|
||||
@ -2211,7 +2215,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
case LeaveNotify:
|
||||
/* Print debugging info.
|
||||
*/
|
||||
#ifndef DEBUG_DND
|
||||
#if !(defined(DEBUG_DND) && defined(DEBUG_DND_MORE_DETAILS))
|
||||
if (gdk_show_events)
|
||||
#endif
|
||||
g_print ("leave notify:\t\twindow: %ld detail: %d subwin: %ld\n",
|
||||
@ -2650,7 +2654,8 @@ gdk_event_translate (GdkEvent *event,
|
||||
#ifndef DEBUG_DND
|
||||
if (gdk_show_events)
|
||||
#endif
|
||||
g_print ("GDK_DROP_ENTER\n");
|
||||
g_print ("GDK_DROP_ENTER [%d][%d]\n",
|
||||
window_private->dnd_drop_enabled, event->dropenter.u.flags.sendreply);
|
||||
return_val = FALSE;
|
||||
|
||||
/* Now figure out if we really want this drop...
|
||||
@ -2684,8 +2689,13 @@ gdk_event_translate (GdkEvent *event,
|
||||
False, NoEventMask, &replyev);
|
||||
|
||||
event->any.type = GDK_DROP_ENTER;
|
||||
event->any.window = window;
|
||||
event->dropenter.requestor = replyev.xclient.window;
|
||||
event->dropenter.u.allflags = xevent->xclient.data.l[1];
|
||||
#ifdef DEBUG_DND
|
||||
g_print("We sent a GDK_DROP_ENTER on to Gtk\n");
|
||||
#endif
|
||||
return_val = TRUE;
|
||||
}
|
||||
}
|
||||
else if (xevent->xclient.message_type == gdk_dnd.gdk_XdeLeave)
|
||||
|
@ -1349,7 +1349,7 @@ gdk_window_dnd_drag_set (GdkWindow *window,
|
||||
}
|
||||
else
|
||||
{
|
||||
free (window_private->dnd_drag_data_typesavail);
|
||||
g_free (window_private->dnd_drag_data_typesavail);
|
||||
window_private->dnd_drag_data_typesavail = NULL;
|
||||
window_private->dnd_drag_data_numtypesavail = 0;
|
||||
}
|
||||
@ -1410,9 +1410,6 @@ gdk_window_dnd_data_set (GdkWindow *window,
|
||||
g_return_if_fail (data_numbytes > 0);
|
||||
g_return_if_fail (event->type == GDK_DRAG_REQUEST);
|
||||
|
||||
g_free (event->dragrequest.data_type);
|
||||
event->dragrequest.data_type = NULL;
|
||||
|
||||
window_private = (GdkWindowPrivate *) window;
|
||||
g_return_if_fail (window_private->dnd_drag_accepted != 0);
|
||||
if (window_private->destroyed)
|
||||
|
@ -916,6 +916,10 @@ gdk_event_free (GdkEvent *event)
|
||||
g_free (event->dropdataavailable.data);
|
||||
break;
|
||||
|
||||
case GDK_DRAG_REQUEST:
|
||||
g_free (event->dragrequest.data_type);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -2069,16 +2073,16 @@ gdk_event_translate (GdkEvent *event,
|
||||
x, y, &x, &y, &twin);
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG_DND
|
||||
g_print("Drag is now in window %#x, lastwin was %#x\n",
|
||||
curwin, lastwin);
|
||||
#if defined(DEBUG_DND) /* && defined(DEBUG_DND_MORE_DETAILS) */
|
||||
g_print("Drag is now in window %#x, lastwin was %#x, ddc = %#x\n",
|
||||
curwin, lastwin, dnd_drag_curwin);
|
||||
#endif
|
||||
if(curwin != dnd_drag_curwin && curwin != lastwin)
|
||||
{
|
||||
/* We have left one window and entered another
|
||||
(do leave & enter bits) */
|
||||
if(dnd_drag_curwin != real_sw->xwindow && dnd_drag_curwin != None)
|
||||
gdk_dnd_drag_leave(dnd_drag_curwin);
|
||||
if(dnd_drag_curwin != None)
|
||||
gdk_dnd_drag_leave(dnd_drag_curwin);
|
||||
dnd_drag_curwin = curwin;
|
||||
gdk_dnd_drag_enter(dnd_drag_curwin);
|
||||
dnd_drag_dropzone.x = dnd_drag_dropzone.y = 0;
|
||||
@ -2122,8 +2126,8 @@ gdk_event_translate (GdkEvent *event,
|
||||
dnd_drag_target = None;
|
||||
}
|
||||
}
|
||||
} else
|
||||
dnd_drag_curwin = None;
|
||||
} /* else
|
||||
dnd_drag_curwin = None; */
|
||||
return_val = FALSE;
|
||||
}
|
||||
else
|
||||
@ -2133,7 +2137,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
case EnterNotify:
|
||||
/* Print debugging info.
|
||||
*/
|
||||
#ifndef DEBUG_DND
|
||||
#if !(defined(DEBUG_DND) && defined(DEBUG_DND_MORE_DETAILS))
|
||||
if (gdk_show_events)
|
||||
#endif
|
||||
g_print ("enter notify:\t\twindow: %ld detail: %d subwin: %ld\n",
|
||||
@ -2211,7 +2215,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
case LeaveNotify:
|
||||
/* Print debugging info.
|
||||
*/
|
||||
#ifndef DEBUG_DND
|
||||
#if !(defined(DEBUG_DND) && defined(DEBUG_DND_MORE_DETAILS))
|
||||
if (gdk_show_events)
|
||||
#endif
|
||||
g_print ("leave notify:\t\twindow: %ld detail: %d subwin: %ld\n",
|
||||
@ -2650,7 +2654,8 @@ gdk_event_translate (GdkEvent *event,
|
||||
#ifndef DEBUG_DND
|
||||
if (gdk_show_events)
|
||||
#endif
|
||||
g_print ("GDK_DROP_ENTER\n");
|
||||
g_print ("GDK_DROP_ENTER [%d][%d]\n",
|
||||
window_private->dnd_drop_enabled, event->dropenter.u.flags.sendreply);
|
||||
return_val = FALSE;
|
||||
|
||||
/* Now figure out if we really want this drop...
|
||||
@ -2684,8 +2689,13 @@ gdk_event_translate (GdkEvent *event,
|
||||
False, NoEventMask, &replyev);
|
||||
|
||||
event->any.type = GDK_DROP_ENTER;
|
||||
event->any.window = window;
|
||||
event->dropenter.requestor = replyev.xclient.window;
|
||||
event->dropenter.u.allflags = xevent->xclient.data.l[1];
|
||||
#ifdef DEBUG_DND
|
||||
g_print("We sent a GDK_DROP_ENTER on to Gtk\n");
|
||||
#endif
|
||||
return_val = TRUE;
|
||||
}
|
||||
}
|
||||
else if (xevent->xclient.message_type == gdk_dnd.gdk_XdeLeave)
|
||||
|
@ -1349,7 +1349,7 @@ gdk_window_dnd_drag_set (GdkWindow *window,
|
||||
}
|
||||
else
|
||||
{
|
||||
free (window_private->dnd_drag_data_typesavail);
|
||||
g_free (window_private->dnd_drag_data_typesavail);
|
||||
window_private->dnd_drag_data_typesavail = NULL;
|
||||
window_private->dnd_drag_data_numtypesavail = 0;
|
||||
}
|
||||
@ -1410,9 +1410,6 @@ gdk_window_dnd_data_set (GdkWindow *window,
|
||||
g_return_if_fail (data_numbytes > 0);
|
||||
g_return_if_fail (event->type == GDK_DRAG_REQUEST);
|
||||
|
||||
g_free (event->dragrequest.data_type);
|
||||
event->dragrequest.data_type = NULL;
|
||||
|
||||
window_private = (GdkWindowPrivate *) window;
|
||||
g_return_if_fail (window_private->dnd_drag_accepted != 0);
|
||||
if (window_private->destroyed)
|
||||
|
@ -16,6 +16,7 @@
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Other stuff */
|
||||
#undef HAVE_BROKEN_WCTYPE
|
||||
#undef HAVE_DOPRNT
|
||||
#undef HAVE_FLOAT_H
|
||||
#undef HAVE_LIMITS_H
|
||||
@ -26,17 +27,13 @@
|
||||
#undef HAVE_VSNPRINTF
|
||||
#undef HAVE_VALUES_H
|
||||
#undef HAVE_VPRINTF
|
||||
#undef HAVE_WCHAR_H
|
||||
#undef HAVE_WCTYPE_H
|
||||
|
||||
#undef NO_FD_SET
|
||||
#undef NO_SYS_ERRLIST
|
||||
#undef NO_SYS_SIGLIST
|
||||
|
||||
#undef HAVE_WCHAR_H
|
||||
#undef HAVE_WCTYPE_H
|
||||
|
||||
/* Define if iswalnum(), etc. should not be used */
|
||||
#undef HAVE_BROKEN_WCTYPE
|
||||
|
||||
/* #undef PACKAGE */
|
||||
/* #undef VERSION */
|
||||
|
||||
|
@ -376,7 +376,7 @@ gtk_main_iteration_do (gboolean blocking)
|
||||
{
|
||||
grab_widget = event_widget;
|
||||
}
|
||||
|
||||
|
||||
/* Not all events get sent to the grabbing widget.
|
||||
* The delete, destroy, expose, focus change and resize
|
||||
* events still get sent to the event widget because
|
||||
|
@ -1703,7 +1703,6 @@ gtk_widget_event (GtkWidget *widget,
|
||||
gint signal_num;
|
||||
|
||||
g_return_val_if_fail (widget != NULL, TRUE);
|
||||
|
||||
gtk_widget_ref (widget);
|
||||
return_val = FALSE;
|
||||
gtk_signal_emit (GTK_OBJECT (widget), widget_signals[EVENT], event,
|
||||
|
Loading…
Reference in New Issue
Block a user