Commit 92fa2231 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor
Browse files

Fix error in computing length and a memory leak. (Fixes #94072, reported

Thu Oct  3 19:00:55 2002  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
        Fix error in computing length and a memory leak.
        (Fixes #94072, reported by Hema Seetharamaiah)

        * gtk/gtkmenu.c (gtk_menu_motion_notify): Fix &event
        used instead of event.
parent 12359a81
Thu Oct 3 19:00:55 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Fix error in computing length and a memory leak.
(Fixes #94072, reported by Hema Seetharamaiah)
* gtk/gtkmenu.c (gtk_menu_motion_notify): Fix &event
used instead of event.
2002-10-04 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/main.c (main):
......
Thu Oct 3 19:00:55 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Fix error in computing length and a memory leak.
(Fixes #94072, reported by Hema Seetharamaiah)
* gtk/gtkmenu.c (gtk_menu_motion_notify): Fix &event
used instead of event.
2002-10-04 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/main.c (main):
......
Thu Oct 3 19:00:55 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Fix error in computing length and a memory leak.
(Fixes #94072, reported by Hema Seetharamaiah)
* gtk/gtkmenu.c (gtk_menu_motion_notify): Fix &event
used instead of event.
2002-10-04 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/main.c (main):
......
Thu Oct 3 19:00:55 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Fix error in computing length and a memory leak.
(Fixes #94072, reported by Hema Seetharamaiah)
* gtk/gtkmenu.c (gtk_menu_motion_notify): Fix &event
used instead of event.
2002-10-04 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/main.c (main):
......
Thu Oct 3 19:00:55 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Fix error in computing length and a memory leak.
(Fixes #94072, reported by Hema Seetharamaiah)
* gtk/gtkmenu.c (gtk_menu_motion_notify): Fix &event
used instead of event.
2002-10-04 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/main.c (main):
......
Thu Oct 3 19:00:55 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Fix error in computing length and a memory leak.
(Fixes #94072, reported by Hema Seetharamaiah)
* gtk/gtkmenu.c (gtk_menu_motion_notify): Fix &event
used instead of event.
2002-10-04 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/main.c (main):
......
......@@ -295,35 +295,54 @@ gdk_selection_property_get (GdkWindow *requestor,
*ret_type = gdk_x11_xatom_to_atom_for_display (display, prop_type);
if (ret_format)
*ret_format = prop_format;
/* Add on an extra byte to handle null termination. X guarantees
that t will be 1 longer than nitems and null terminated */
length = nitems + 1;
if (data)
if (prop_type == XA_ATOM ||
prop_type == gdk_x11_get_xatom_by_name_for_display (display, "ATOM_PAIR"))
{
*data = g_new (guchar, length);
if (prop_type == XA_ATOM ||
prop_type == gdk_x11_get_xatom_by_name_for_display (display, "ATOM_PAIR"))
Atom* atoms = (Atom*) t;
GdkAtom* atoms_dest;
gint num_atom, i;
if (prop_format != 32)
goto err;
num_atom = nitems;
length = sizeof (GdkAtom) * num_atom + 1;
if (data)
{
Atom* atoms = (Atom*) t;
GdkAtom* atoms_dest;
gint num_atom, i;
num_atom = (length - 1) / sizeof (Atom);
length = sizeof (GdkAtom) * num_atom + 1;
*data = g_malloc (length);
(*data)[length - 1] = '\0';
atoms_dest = (GdkAtom *)(*data);
for (i=0; i < num_atom; i++)
atoms_dest[i] = gdk_x11_xatom_to_atom_for_display (display, atoms[i]);
}
else
}
else
{
switch (prop_format)
{
*data = g_memdup (t, length);
case 8:
length = nitems;
break;
case 16:
length = sizeof(short) * nitems;
break;
case 32:
length = sizeof(long) * nitems;
break;
default:
g_assert_not_reached ();
break;
}
/* Add on an extra byte to handle null termination. X guarantees
that t will be 1 longer than nitems and null terminated */
length += 1;
if (data)
*data = g_memdup (t, length);
}
if (t)
......
......@@ -1982,7 +1982,6 @@ gtk_menu_motion_notify (GtkWidget *widget,
GdkEvent *send_event = gdk_event_new (GDK_ENTER_NOTIFY);
gboolean result;
send_event->crossing.type = GDK_ENTER_NOTIFY;
send_event->crossing.window = g_object_ref (event->window);
send_event->crossing.time = event->time;
send_event->crossing.send_event = TRUE;
......@@ -1997,7 +1996,7 @@ gtk_menu_motion_notify (GtkWidget *widget,
* menuitem is a child of the active menu or some parent
* menu of the active menu.
*/
result = gtk_widget_event (widget, &send_event);
result = gtk_widget_event (widget, send_event);
gdk_event_free (send_event);
return result;
......
......@@ -1715,9 +1715,11 @@ create_buffer (void)
++i;
}
#if 0
buffer->invisible_tag = gtk_text_buffer_create_tag (buffer->buffer, NULL,
"invisible", TRUE, NULL);
#endif
buffer->not_editable_tag =
gtk_text_buffer_create_tag (buffer->buffer, NULL,
......
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