diff --git a/mozilla/embedding/browser/gtk/src/EmbedPrivate.cpp b/mozilla/embedding/browser/gtk/src/EmbedPrivate.cpp index a6ba2a40765..356d500d1f9 100644 --- a/mozilla/embedding/browser/gtk/src/EmbedPrivate.cpp +++ b/mozilla/embedding/browser/gtk/src/EmbedPrivate.cpp @@ -336,6 +336,13 @@ EmbedPrivate::Resize(PRUint32 aWidth, PRUint32 aHeight) 0, 0, aWidth, aHeight); } +void +EmbedPrivate::GetSize(PRInt32 *aWidth, PRInt32 *aHeight) +{ + mWindow->GetDimensions(nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER, + nsnull, nsnull, aWidth, aHeight); +} + void EmbedPrivate::Destroy(void) { diff --git a/mozilla/embedding/browser/gtk/src/EmbedPrivate.h b/mozilla/embedding/browser/gtk/src/EmbedPrivate.h index 7b21fd322f6..0d4a812d075 100644 --- a/mozilla/embedding/browser/gtk/src/EmbedPrivate.h +++ b/mozilla/embedding/browser/gtk/src/EmbedPrivate.h @@ -78,6 +78,7 @@ class EmbedPrivate { void Show (void); void Hide (void); void Resize (PRUint32 aWidth, PRUint32 aHeight); + void GetSize (PRInt32 *aWidth, PRInt32 *aHeight); void Destroy (void); void SetURI (const char *aURI); void LoadCurrentURI (void); diff --git a/mozilla/embedding/browser/gtk/src/gtkmozembed2.cpp b/mozilla/embedding/browser/gtk/src/gtkmozembed2.cpp index eec19808cc3..010b2e063ee 100644 --- a/mozilla/embedding/browser/gtk/src/gtkmozembed2.cpp +++ b/mozilla/embedding/browser/gtk/src/gtkmozembed2.cpp @@ -710,10 +710,16 @@ gtk_moz_embed_size_allocate(GtkWidget *widget, GtkAllocation *allocation) if (GTK_WIDGET_REALIZED(widget)) { + PRInt32 width, height; + + embedPrivate->GetSize (&width, &height); + gdk_window_move_resize(widget->window, allocation->x, allocation->y, allocation->width, allocation->height); - embedPrivate->Resize(allocation->width, allocation->height); + + if ((allocation->width != width) || (allocation->height != height)) + embedPrivate->Resize(allocation->width, allocation->height); } }