diff options
author | Owen Taylor <otaylor@redhat.com> | 2001-12-04 17:12:35 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2001-12-04 17:12:35 +0000 |
commit | feca5a64e293cf21746d41527c31f26507765d0b (patch) | |
tree | 05a718da7e1bc6222686b44ddb7decd740dbdcc6 /gdk/gdkevents.c | |
parent | 76030813c71ed837173114ee5bcdd2cf083eee31 (diff) | |
download | gdk-pixbuf-feca5a64e293cf21746d41527c31f26507765d0b.tar.gz |
Ref and sink priv->tooltips in init() and unref priv->tooltips in destroy
Tue Dec 4 12:06:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c: Ref and sink priv->tooltips in
init() and unref priv->tooltips in destroy rather
than calling gtk_object_destroy() which has no
effect on memory management. (#66104, HideToshi
Tajima)
* gtk/gtkcolorsel.c (palette_set_color): Use g_object_set_data_full()
so we free the when the object is freed. (Fixes memory
leak, #66096, HideToshi Tajima)
* gdk/gdkevents.c (gdk_synthesize_window_state): Use
a full GdkEvent structure to avoid reads of uninitialized/
invalid memory in gdk_event_put() (#65877, patch
from Hidetoshi Tajima)
Diffstat (limited to 'gdk/gdkevents.c')
-rw-r--r-- | gdk/gdkevents.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c index fce4dbcbe..137ef78e8 100644 --- a/gdk/gdkevents.c +++ b/gdk/gdkevents.c @@ -941,23 +941,23 @@ gdk_synthesize_window_state (GdkWindow *window, GdkWindowState unset_flags, GdkWindowState set_flags) { - GdkEventWindowState temp_event; + GdkEvent temp_event; GdkWindowState old; g_return_if_fail (window != NULL); - temp_event.window = window; - temp_event.type = GDK_WINDOW_STATE; - temp_event.send_event = FALSE; + temp_event.window_state.window = window; + temp_event.window_state.type = GDK_WINDOW_STATE; + temp_event.window_state.send_event = FALSE; - old = ((GdkWindowObject*) temp_event.window)->state; + old = ((GdkWindowObject*) temp_event.window_state.window)->state; - temp_event.changed_mask = (unset_flags | set_flags) ^ old; - temp_event.new_window_state = old; - temp_event.new_window_state |= set_flags; - temp_event.new_window_state &= ~unset_flags; + temp_event.window_state.changed_mask = (unset_flags | set_flags) ^ old; + temp_event.window_state.new_window_state = old; + temp_event.window_state.new_window_state |= set_flags; + temp_event.window_state.new_window_state &= ~unset_flags; - if (temp_event.new_window_state == old) + if (temp_event.window_state.new_window_state == old) return; /* No actual work to do, nothing changed. */ /* Actually update the field in GdkWindow, this is sort of an odd @@ -965,7 +965,7 @@ gdk_synthesize_window_state (GdkWindow *window, * inconsistent state to the user. */ - ((GdkWindowObject*) window)->state = temp_event.new_window_state; + ((GdkWindowObject*) window)->state = temp_event.window_state.new_window_state; /* We only really send the event to toplevels, since * all the window states don't apply to non-toplevels. @@ -977,7 +977,7 @@ gdk_synthesize_window_state (GdkWindow *window, case GDK_WINDOW_TOPLEVEL: case GDK_WINDOW_DIALOG: case GDK_WINDOW_TEMP: /* ? */ - gdk_event_put ((GdkEvent*) &temp_event); + gdk_event_put (&temp_event); break; case GDK_WINDOW_FOREIGN: |