]> Pileus Git - ~andy/gtk/blobdiff - gdk/x11/gdkwindow-x11.c
Zero out some stack-allocated X structures, to avoid valgrind warnings
[~andy/gtk] / gdk / x11 / gdkwindow-x11.c
index 55b153a9ba32f833ff84f3a160198a1023b48a34..2a71b22ada3f302c5e439679ed40f6c00268d2f8 100644 (file)
@@ -2322,7 +2322,7 @@ gdk_window_get_type_hint (GdkWindow *window)
       if ((type_return == XA_ATOM) && (format_return == 32) &&
           (data) && (nitems_return == 1))
         {
-          Atom atom = (Atom) *data;
+          Atom atom = *(Atom*)data;
 
           if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DIALOG"))
             type = GDK_WINDOW_TYPE_HINT_DIALOG;
@@ -5021,6 +5021,8 @@ gdk_window_set_decorations (GdkWindow      *window,
   
   g_return_if_fail (GDK_IS_WINDOW (window));
   
+  /* initialize to zero to avoid writing uninitialized data to socket */
+  memset(&hints, 0, sizeof(hints));
   hints.flags = MWM_HINTS_DECORATIONS;
   hints.decorations = decorations;
   
@@ -5066,9 +5068,11 @@ gdk_window_get_decorations(GdkWindow       *window,
  * @window: a toplevel #GdkWindow
  * @functions: bitmask of operations to allow on @window
  *
- * This function isn't really good for much. It sets the traditional
- * Motif window manager hint for which operations the window manager
- * should allow on a toplevel window. However, few window managers do
+ * Sets hints about the window management functions to make available
+ * via buttons on the window frame.
+ * 
+ * On the X backend, this function sets the traditional Motif window 
+ * manager hint for this purpose. However, few window managers do
  * anything reliable or interesting with this hint. Many ignore it
  * entirely.
  *
@@ -5087,6 +5091,8 @@ gdk_window_set_functions (GdkWindow    *window,
   
   g_return_if_fail (GDK_IS_WINDOW (window));
   
+  /* initialize to zero to avoid writing uninitialized data to socket */
+  memset(&hints, 0, sizeof(hints));
   hints.flags = MWM_HINTS_FUNCTIONS;
   hints.functions = functions;