Comment 34 for bug 157721

Revision history for this message
In , Jarkko Lietolahti (jarkko-jab) wrote :

In gcjwebplugin.cc there's a code block that could be suitable for doing the transformation from 100% --> real value.

It seems to have all the required information present.

gcjwebplugin.cc
  // The last plugin window width sent to us by the browser.
  guint32 window_width;
  // The last plugin window height sent to us by the browser.
  guint32 window_height;

// Build up the applet tag string that we'll send to the applet
// viewer.
static gchar*
plugin_create_applet_tag (int16 argc, char* argn[], char* argv[])
{

...

   else if (!g_ascii_strcasecmp (argn[i], "width"))
        {
          gchar* width = g_strdup_printf ("WIDTH=\"%s\" ", argv[i]);
          applet_tag = g_strconcat (applet_tag, width, NULL);
          g_free (width);
          width = NULL;
        }

Just check if argv[i] ends in % and do little calculation and voila.
And same thing for the height.