b=814200 don't redirect embedder socket window resize requests to Xt client r=stransky

--HG--
extra : rebase_source : 936d2fb8dbed72c064b158a106dde582b091454b
This commit is contained in:
Karl Tomlinson 2013-01-04 12:37:08 +13:00
parent b6ff0a9d63
commit 7d3aff8ef4
3 changed files with 4 additions and 49 deletions

View File

@ -134,15 +134,14 @@ nsresult nsPluginNativeWindowGtk2::CallSetWindow(nsRefPtr<nsNPAPIPluginInstance>
}
// Make sure to resize and re-place the window if required.
SetAllocation();
// Need to reset "window" each time as nsObjectFrame::DidReflow sets it
// to the ancestor window.
if (GTK_IS_XTBIN(mSocketWidget)) {
gtk_xtbin_resize(mSocketWidget, width, height);
// Point the NPWindow structures window to the actual X window
SetWindow(GTK_XTBIN(mSocketWidget)->xtwindow);
}
else { // XEmbed or OOP&Xt
SetAllocation();
SetWindow(gtk_socket_get_id(GTK_SOCKET(mSocketWidget)));
}
#ifdef DEBUG

View File

@ -237,17 +237,13 @@ gtk_xtbin_realize (GtkWidget *widget)
printf("initial allocation %d %d %d %d\n", x, y, w, h);
#endif
xtbin->width = widget->allocation.width;
xtbin->height = widget->allocation.height;
/* use GtkSocket's realize */
(*GTK_WIDGET_CLASS(parent_class)->realize)(widget);
/* create the Xt client widget */
xt_client_create(&(xtbin->xtclient),
gtk_socket_get_id(GTK_SOCKET(xtbin)),
xtbin->height,
xtbin->width);
h, w);
xtbin->xtwindow = XtWindow(xtbin->xtclient.child_widget);
gdk_flush();
@ -314,42 +310,6 @@ gtk_xtbin_new (GdkWindow *parent_window, String * f)
return GTK_WIDGET (xtbin);
}
void
gtk_xtbin_resize (GtkWidget *widget,
gint width,
gint height)
{
Arg args[2];
GtkXtBin *xtbin = GTK_XTBIN (widget);
GtkAllocation allocation;
#ifdef DEBUG_XTBIN
printf("gtk_xtbin_resize %p %d %d\n", (void *)widget, width, height);
#endif
xtbin->height = height;
xtbin->width = width;
/* Avoid BadValue errors in XtSetValues */
if (height <= 0 || width <=0) {
height = 1;
width = 1;
}
XtSetArg(args[0], XtNheight, height);
XtSetArg(args[1], XtNwidth, width);
if (xtbin->xtclient.top_widget)
XtSetValues(xtbin->xtclient.top_widget, args, 2);
/* we need to send a size allocate so the socket knows about the
size changes */
allocation.x = 0;
allocation.y = 0;
allocation.width = xtbin->width;
allocation.height = xtbin->height;
gtk_widget_size_allocate(widget, &allocation);
}
static void
gtk_xtbin_unrealize (GtkWidget *object)
{
@ -582,8 +542,8 @@ xt_client_create ( XtClient* xtclient ,
/* listen to all Xt events */
XSelectInput(xtclient->xtdisplay,
XtWindow(top_widget),
0x0FFFFF);
embedderid,
XtBuildEventMask(top_widget));
xt_client_set_info (child_widget, 0);
XtManageChild(child_widget);

View File

@ -58,7 +58,6 @@ struct _GtkXtBin
Display *xtdisplay; /* Xt Toolkit Display */
Window xtwindow; /* Xt Toolkit XWindow */
gint width, height;
XtClient xtclient; /* Xt Client for XEmbed */
};
@ -69,9 +68,6 @@ struct _GtkXtBinClass
GTKXTBIN_API(GType) gtk_xtbin_get_type (void);
GTKXTBIN_API(GtkWidget *) gtk_xtbin_new (GdkWindow *parent_window, String *f);
GTKXTBIN_API(void) gtk_xtbin_resize (GtkWidget *widget,
gint width,
gint height);
typedef struct _XtTMRec {
XtTranslations translations; /* private to Translation Manager */