From 4e14de2d742ab90e9f87724ba9425e83a534ff27 Mon Sep 17 00:00:00 2001 From: "serge%netscape.com" Date: Thu, 20 Jun 2002 01:50:54 +0000 Subject: [PATCH] fix for #85958 Shockwave/Flash pages cause crash under Solaris [x-server/bit-depth], patch by sep@sparc.spb.su,r=serge,sr=blizzard --- modules/plugin/base/src/ns4xPluginInstance.cpp | 4 ++-- widget/src/gtkxtbin/gtkxtbin.c | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/plugin/base/src/ns4xPluginInstance.cpp b/modules/plugin/base/src/ns4xPluginInstance.cpp index bb2ca257b2d..2fe6450b0fd 100644 --- a/modules/plugin/base/src/ns4xPluginInstance.cpp +++ b/modules/plugin/base/src/ns4xPluginInstance.cpp @@ -884,9 +884,9 @@ NS_IMETHODIMP ns4xPluginInstance::SetWindow(nsPluginWindow* window) // fill in window info structure ws->type = 0; // OK, that was a guess!! - ws->depth = gdk_rgb_get_visual()->depth; + ws->depth = gdk_window_get_visual(win)->depth; ws->display = GTK_XTBIN(mXtBin)->xtdisplay; - ws->visual = GDK_VISUAL_XVISUAL(gdk_rgb_get_visual()); + ws->visual = GDK_VISUAL_XVISUAL(gdk_window_get_visual(win)); ws->colormap = GDK_COLORMAP_XCOLORMAP(gdk_window_get_colormap(win)); XFlush(ws->display); diff --git a/widget/src/gtkxtbin/gtkxtbin.c b/widget/src/gtkxtbin/gtkxtbin.c index ff5f916eeab..23d9f05dc7e 100644 --- a/widget/src/gtkxtbin/gtkxtbin.c +++ b/widget/src/gtkxtbin/gtkxtbin.c @@ -213,7 +213,7 @@ gtk_xtbin_realize (GtkWidget *widget) GdkWindowAttr attributes; gint attributes_mask, n; GtkXtBin *xtbin; - Arg args[2]; + Arg args[5]; gint width, height; Widget top_widget; Window win; @@ -254,9 +254,9 @@ gtk_xtbin_realize (GtkWidget *widget) attributes.width = widget->allocation.width; attributes.height = widget->allocation.height; attributes.wclass = GDK_INPUT_OUTPUT; - attributes.visual = gtk_widget_get_visual (widget); - attributes.colormap = gtk_widget_get_colormap (widget); - attributes.event_mask = gtk_widget_get_events (widget); + attributes.visual = gdk_window_get_visual (xtbin->parent_window); + attributes.colormap = gdk_window_get_colormap (xtbin->parent_window); + attributes.event_mask = gdk_window_get_events (xtbin->parent_window); attributes.event_mask |= GDK_EXPOSURE_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; @@ -309,6 +309,9 @@ gtk_xtbin_realize (GtkWidget *widget) n = 0; XtSetArg(args[n], XtNheight, xtbin->height);n++; XtSetArg(args[n], XtNwidth, xtbin->width);n++; + XtSetArg(args[n], XtNvisual, GDK_VISUAL_XVISUAL(gdk_window_get_visual( xtbin->parent_window )) ); n++; + XtSetArg(args[n], XtNdepth, gdk_window_get_visual( xtbin->parent_window )->depth ); n++; + XtSetArg(args[n], XtNcolormap, GDK_COLORMAP_XCOLORMAP(gdk_window_get_colormap( xtbin->parent_window)) ); n++; XtSetValues(embeded, args, n); /* Ok, here is the dirty little secret on how I am */