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);