summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren gmail com>2007-04-23 22:44:01 +0000
committerElijah Newren <newren@src.gnome.org>2007-04-23 22:44:01 +0000
commit18c9101a4f78c0c817047c056efaa44ae5171314 (patch)
tree259ac5528e4326bb1f45794334cf7e90cbb4cd98
parentb10626c5d8c9787539d8bc14c1b40e2c0f543f7f (diff)
downloadmetacity-18c9101a4f78c0c817047c056efaa44ae5171314.tar.gz
Fix some uninitialized memory usage errors. #427385
2007-04-23 Elijah Newren <newren gmail com> 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
-rw-r--r--ChangeLog11
-rw-r--r--src/frame.c5
-rw-r--r--src/frames.c8
3 files changed, 21 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 3405a0aa..cdebfef2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-04-23 Elijah Newren <newren gmail com>
+
+ 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 <newren gmail com>
Fix some fallout from #426519; update user_rect for all position
diff --git a/src/frame.c b/src/frame.c
index 399bfac5..ab79d088 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 977099e9..0c82f1d4 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);