--- changedisplay.c	2004-04-25 23:16:39.000000000 +1000
+++ changedisplay2.c	2004-04-25 23:15:45.000000000 +1000
@@ -76,13 +76,20 @@
   GdkWindow *pointer_window;
   GtkWidget *widget = NULL;
 
+  gpointer pwidget;
+
   pointer_window = gdk_display_get_window_at_pointer (display, NULL, NULL);
 
   /* The user data field of a GdkWindow is used to store a pointer
-   * to the widget that created it.
+     to the widget that created it. Note that we must store in a gpointer
+     variable and then copy this variable's address to the GtkWidget 
+     variable. If we don't, this breaks gcc's strict aliasing rules.
    */
   if (pointer_window)
-    gdk_window_get_user_data (pointer_window, (gpointer*) &widget);
+  {
+    gdk_window_get_user_data (pointer_window, &pwidget);
+    widget = (GtkWidget*)&pwidget;
+  }
 
   return widget ? gtk_widget_get_toplevel (widget) : NULL;
 }
