diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-12-31 22:31:45 -0800 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2015-01-19 05:08:22 +0200 |
commit | 09a223a2796b853248fd7d165bfa71a36688bf5b (patch) | |
tree | ae3f91546daf0ced8c6777197a632aa550a6676d /src/ui/frames.c | |
parent | 330ff9b53398eeedb472736d123e6d158ab6bee9 (diff) | |
download | metacity-09a223a2796b853248fd7d165bfa71a36688bf5b.tar.gz |
frames: Fix astonishing accidental pointer trickery
Whenever we added a frame to the GHashTable, we added the frame itself
as the value, and a pointer to its storage of the frame window XID,
as the key.
When we iterated over the hash table, we actually looked up the
MetaUIFrame in the key, which might seem extraordinarily wrong, but
eagle-eyed viewers might notice that the XID is the first field in
MetaUIFrame, so the key and value are actually the same pointer.
Changing the layout of MetaUIFrame at all causes this to go haywire,
so let's not do this and simply put the MetaUIFrame in the value,
as expected.
Diffstat (limited to 'src/ui/frames.c')
-rw-r--r-- | src/ui/frames.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ui/frames.c b/src/ui/frames.c index 39a79689..63046b2e 100644 --- a/src/ui/frames.c +++ b/src/ui/frames.c @@ -2393,7 +2393,7 @@ find_frame_to_draw (MetaFrames *frames, MetaUIFrame *frame; g_hash_table_iter_init (&iter, frames->frames); - while (g_hash_table_iter_next (&iter, (gpointer *) &frame, NULL)) + while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &frame)) if (gtk_cairo_should_draw_window (cr, frame->window)) return frame; |