From 18c9101a4f78c0c817047c056efaa44ae5171314 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Mon, 23 Apr 2007 22:44:01 +0000 Subject: [PATCH] Fix some uninitialized memory usage errors. #427385 2007-04-23 Elijah Newren Fix some uninitialized memory usage errors. #427385 * src/frame.c (meta_window_ensure_frame): * src/frames.c (meta_frames_manage_window): Do not try to set the window background in meta_frames_manage_window() since the frame window is not yet created and not yet registered with the corresponding MetaWindow. Do it inside meta_window_ensure_frame() instead. svn path=/trunk/; revision=3208 --- ChangeLog | 11 +++++++++++ src/frame.c | 5 +++++ src/frames.c | 8 +++++--- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3405a0aa1..cdebfef29 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2007-04-23 Elijah Newren + + Fix some uninitialized memory usage errors. #427385 + + * src/frame.c (meta_window_ensure_frame): + * src/frames.c (meta_frames_manage_window): + Do not try to set the window background in + meta_frames_manage_window() since the frame window is not yet + created and not yet registered with the corresponding MetaWindow. + Do it inside meta_window_ensure_frame() instead. + 2007-04-17 Elijah Newren Fix some fallout from #426519; update user_rect for all position diff --git a/src/frame.c b/src/frame.c index 399bfac5d..ab79d088e 100644 --- a/src/frame.c +++ b/src/frame.c @@ -114,6 +114,11 @@ meta_window_ensure_frame (MetaWindow *window) meta_display_register_x_window (window->display, &frame->xwindow, window); + /* Now that frame->xwindow is registered with window, we can set its + * background. + */ + meta_ui_reset_frame_bg (window->screen->ui, frame->xwindow); + /* Reparent the client window; it may be destroyed, * thus the error trap. We'll get a destroy notify later * and free everything. Comment in FVWM source code says diff --git a/src/frames.c b/src/frames.c index 977099e97..0c82f1d46 100644 --- a/src/frames.c +++ b/src/frames.c @@ -571,9 +571,6 @@ meta_frames_manage_window (MetaFrames *frames, gdk_window_set_user_data (frame->window, frames); - /* Set the window background to the current style */ - meta_frames_set_window_background (frames, frame); - /* Don't set event mask here, it's in frame.c */ frame->xwindow = xwindow; @@ -584,6 +581,11 @@ meta_frames_manage_window (MetaFrames *frames, frame->expose_delayed = FALSE; frame->shape_applied = FALSE; frame->prelit_control = META_FRAME_CONTROL_NONE; + + /* Don't set the window background yet; we need frame->xwindow to be + * registered with its MetaWindow, which happens after this function + * and meta_ui_create_frame_window() return to meta_window_ensure_frame(). + */ meta_core_grab_buttons (gdk_display, frame->xwindow);