rpms/kdebase3/devel kdebase-3.5.8-flash.patch, 1.2, 1.3 kdebase3.spec, 1.35, 1.36

Kevin Kofler (kkofler) fedora-extras-commits at redhat.com
Sat Feb 9 05:46:41 UTC 2008


Author: kkofler

Update of /cvs/pkgs/rpms/kdebase3/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26281/devel

Modified Files:
	kdebase-3.5.8-flash.patch kdebase3.spec 
Log Message:
* Sat Feb 09 2008 Kevin Kofler <Kevin at tigcc.ticalc.org> - 3.5.8-37
- sync from F8:
- kdm: local DoS vulnerability, CVE-2007-5963 (Than Ngo, 3.5.8-31.fc8)
- updated flash patch to support 64 bit platforms (Lukáš Tinkl, 3.5.8-32.fc8)

kdebase-3.5.8-flash.patch:

Index: kdebase-3.5.8-flash.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kdebase3/devel/kdebase-3.5.8-flash.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- kdebase-3.5.8-flash.patch	14 Dec 2007 17:34:51 -0000	1.2
+++ kdebase-3.5.8-flash.patch	9 Feb 2008 05:46:35 -0000	1.3
@@ -1,17 +1,42 @@
-diff -up kdebase-3.5.8/nsplugins/nspluginloader.cpp.flash kdebase-3.5.8/nsplugins/nspluginloader.cpp
---- kdebase-3.5.8/nsplugins/nspluginloader.cpp.flash	2006-10-01 12:31:58.000000000 -0500
-+++ kdebase-3.5.8/nsplugins/nspluginloader.cpp	2007-12-14 11:30:19.000000000 -0600
-@@ -54,11 +54,16 @@ NSPluginLoader *NSPluginLoader::s_instan
+diff -urN kdebase-orig/nsplugins/configure.in.in kdebase-3.5.8/nsplugins/configure.in.in
+--- kdebase-orig/nsplugins/configure.in.in	1970-01-01 01:00:00.000000000 +0100
++++ kdebase-3.5.8/nsplugins/configure.in.in	2008-01-29 15:51:04.000000000 +0100
+@@ -0,0 +1 @@
++KDE_PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 0.21 )
+diff -urN kdebase-orig/nsplugins/NSPluginCallbackIface.h kdebase-3.5.8/nsplugins/NSPluginCallbackIface.h
+--- kdebase-orig/nsplugins/NSPluginCallbackIface.h	2005-10-10 17:04:05.000000000 +0200
++++ kdebase-3.5.8/nsplugins/NSPluginCallbackIface.h	2008-01-29 15:51:20.000000000 +0100
+@@ -37,7 +37,7 @@
+   virtual ASYNC requestURL(QString url, QString target) = 0;
+   virtual ASYNC postURL(QString url, QString target, QByteArray data, QString mime) = 0;
+   virtual ASYNC statusMessage( QString msg ) = 0;
+-  virtual ASYNC evalJavaScript( int id, QString script ) = 0;
++  virtual ASYNC evalJavaScript( Q_INT32 id, QString script ) = 0;
+ 
+ };
+ 
+diff -urN kdebase-orig/nsplugins/nspluginloader.cpp kdebase-3.5.8/nsplugins/nspluginloader.cpp
+--- kdebase-orig/nsplugins/nspluginloader.cpp	2006-10-01 19:31:58.000000000 +0200
++++ kdebase-3.5.8/nsplugins/nspluginloader.cpp	2008-01-29 15:51:20.000000000 +0100
+@@ -41,6 +41,7 @@
+ #include <qpushbutton.h>
+ #include <qxembed.h>
+ #include <qtextstream.h>
++#include <qtimer.h>
+ #include <qregexp.h>
+ 
+ #include "nspluginloader.h"
+@@ -54,11 +55,14 @@
  int NSPluginLoader::s_refCount = 0;
  
  
 -NSPluginInstance::NSPluginInstance(QWidget *parent, const QCString& app, const QCString& id)
 -  : DCOPStub(app, id), NSPluginInstanceIface_stub(app, id), EMBEDCLASS(parent)
 +NSPluginInstance::NSPluginInstance(QWidget *parent)
-+  : EMBEDCLASS(parent), stub( NULL )
++  : EMBEDCLASS(parent), _loader( NULL ), shown( false ), inited( false ), resize_count( 0 ), stub( NULL )
  {
-     _loader = 0L;
-     shown = false;
+-    _loader = 0L;
+-    shown = false;
 +}
 +
 +void NSPluginInstance::init(const QCString& app, const QCString& obj)
@@ -20,7 +45,27 @@
      QGridLayout *_layout = new QGridLayout(this, 1, 1);
      KConfig cfg("kcmnspluginrc", false);
      cfg.setGroup("Misc");
-@@ -80,12 +85,19 @@ void NSPluginInstance::doLoadPlugin() {
+@@ -69,23 +73,37 @@
+         show();
+     } else {
+         _button = 0L;
+-        doLoadPlugin();
++        // Protection against repeated NPSetWindow() - Flash v9,0,115,0 doesn't handle
++        // repeated NPSetWindow() calls properly, which happens when NSPluginInstance is first
++        // shown and then resized. Which is what happens with KHTML. Therefore use 'shown'
++        // to detect whether the widget is shown and drop all resize events before that,
++        // and use 'resize_count' to wait for that one more resize to come (plus a timer
++        // for a possible timeout). Only then flash is actually initialized ('inited' is true).
++        resize_count = 1;
++        QTimer::singleShot( 1000, this, SLOT( doLoadPlugin()));
+     }
+ }
+ 
+ 
+ void NSPluginInstance::doLoadPlugin() {
+-    if (!_loader) {
++    if (!inited) {
+         delete _button;
          _button = 0L;
          _loader = NSPluginLoader::instance();
          setBackgroundMode(QWidget::NoBackground);
@@ -34,24 +79,80 @@
 +            setProtocol(QXEmbed::XEMBED);
 +        }
 +        // resize before showing, some plugins are stupid and can't handle repeated
-+        // NPSetWindow() calls very well
++        // NPSetWindow() calls very well (viewer will avoid the call if not shown yet)
 +        resizePlugin(width(), height());
          displayPlugin();
          show();
-         shown = true;
+-        shown = true;
 -        if (isVisible()) resizePlugin(width(), height());
++        inited = true;
      }
  }
  
-@@ -97,6 +109,7 @@ NSPluginInstance::~NSPluginInstance()
+@@ -93,10 +111,13 @@
+ NSPluginInstance::~NSPluginInstance()
+ {
+    kdDebug() << "-> NSPluginInstance::~NSPluginInstance" << endl;
+-   shutdown();
++   if( inited )
++     shutdown();
     kdDebug() << "release" << endl;
-    _loader->release();
+-   _loader->release();
++   if(_loader)
++     _loader->release();
     kdDebug() << "<- NSPluginInstance::~NSPluginInstance" << endl;
 +   delete stub;
  }
  
  
-@@ -445,19 +458,19 @@ NSPluginInstance *NSPluginLoader::newIns
+@@ -112,8 +133,14 @@
+ 
+ void NSPluginInstance::resizeEvent(QResizeEvent *event)
+ {
+-  if (shown == false)
++  if (shown == false) // ignore all resizes before being shown
+      return;
++  if( !inited && resize_count > 0 ) {
++      if( --resize_count == 0 )
++        doLoadPlugin();
++      else
++        return;
++  }
+   EMBEDCLASS::resizeEvent(event);
+   if (isVisible()) {
+     resizePlugin(width(), height());
+@@ -124,7 +151,29 @@
+ void NSPluginInstance::showEvent(QShowEvent *event)
+ {
+   EMBEDCLASS::showEvent(event);
+-  resizePlugin(width(), height());
++  shown = true;
++  if(!inited && resize_count == 0 )
++      doLoadPlugin();
++  if(inited)
++    resizePlugin(width(), height());
++}
++
++void NSPluginInstance::displayPlugin()
++{
++  qApp->syncX(); // process pending X commands
++  stub->displayPlugin();
++}
++
++void NSPluginInstance::resizePlugin( int w, int h )
++{
++  qApp->syncX();
++  stub->resizePlugin( w, h );
++}
++
++void NSPluginInstance::shutdown()
++{
++  if( stub )
++    stub->shutdown();
+ }
+ 
+ /*******************************************************************************/
+@@ -445,19 +494,19 @@
     if ( mime=="application/x-shockwave-flash" )
         embed = true; // flash doesn't work in full mode :(
  
@@ -76,570 +177,161 @@
  
     return plugin;
  }
-diff -up /dev/null kdebase-3.5.8/nsplugins/configure.in.in
---- /dev/null	2007-12-13 13:41:14.965729569 -0600
-+++ kdebase-3.5.8/nsplugins/configure.in.in	2007-12-14 11:30:19.000000000 -0600
-@@ -0,0 +1 @@
-+KDE_PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 0.21 )
-diff -up /dev/null kdebase-3.5.8/nsplugins/viewer/glibevents.h
---- /dev/null	2007-12-13 13:41:14.965729569 -0600
-+++ kdebase-3.5.8/nsplugins/viewer/glibevents.h	2007-12-14 11:30:19.000000000 -0600
-@@ -0,0 +1,41 @@
-+/*
-+  Copyright (c) 2007 Lubos Lunak <l.lunak at suse.cz>
-+ 
-+  This program is free software; you can redistribute it and/or modify
-+  it under the terms of the GNU General Public License as published by
-+  the Free Software Foundation; either version 2 of the License, or
-+  (at your option) any later version.
-+ 
-+  This program is distributed in the hope that it will be useful,
-+  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+  GNU General Public License for more details.
-+ 
-+  You should have received a copy of the GNU General Public License
-+  along with this program; if not, write to the Free Software
-+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-+ 
-+*/                                                                            
-+
-+#ifndef GLIBEVENTS_H
-+#define GLIBEVENTS_H
-+
-+#include <qwidget.h>
-+#include <qtimer.h>
-+
-+#include <glib.h>
-+
-+class GlibEvents
-+    : public QWidget
-+    {
-+    Q_OBJECT
-+    public:
-+        GlibEvents();
-+        virtual ~GlibEvents();
-+    private slots:
-+        void process();
-+    private:
-+        QTimer timer;
-+    };
-+
-+#endif
-diff -up kdebase-3.5.8/nsplugins/viewer/Makefile.am.flash kdebase-3.5.8/nsplugins/viewer/Makefile.am
---- kdebase-3.5.8/nsplugins/viewer/Makefile.am.flash	2005-09-10 03:25:39.000000000 -0500
-+++ kdebase-3.5.8/nsplugins/viewer/Makefile.am	2007-12-14 11:30:19.000000000 -0600
-@@ -1,12 +1,12 @@
--INCLUDES = -I$(top_srcdir)/nsplugins -I$(top_builddir)/nsplugins $(all_includes)
-+INCLUDES = -I$(top_srcdir)/nsplugins -I$(top_builddir)/nsplugins $(all_includes) $(GTK_CFLAGS)
- METASOURCES = AUTO
+diff -urN kdebase-orig/nsplugins/nspluginloader.h kdebase-3.5.8/nsplugins/nspluginloader.h
+--- kdebase-orig/nsplugins/nspluginloader.h	2006-10-01 19:31:58.000000000 +0200
++++ kdebase-3.5.8/nsplugins/nspluginloader.h	2008-01-29 15:51:20.000000000 +0100
+@@ -43,13 +43,16 @@
+ class QPushButton;
+ class QGridLayout;
  
- bin_PROGRAMS = nspluginviewer 
+-class NSPluginInstance : public EMBEDCLASS, virtual public NSPluginInstanceIface_stub
++class NSPluginInstance : public EMBEDCLASS
+ {
+   Q_OBJECT
  
- nspluginviewer_SOURCES = NSPluginCallbackIface.stub NSPluginClassIface.skel \
--	nsplugin.cpp viewer.cpp kxt.cpp qxteventloop.cpp
-+	nsplugin.cpp viewer.cpp kxt.cpp qxteventloop.cpp glibevents.cpp
- nspluginviewer_LDFLAGS = $(all_libraries) $(KDE_RPATH) -export-dynamic
--nspluginviewer_LDADD = $(LIB_KIO) $(LIB_KPARTS) -lXt
-+nspluginviewer_LDADD = $(LIB_KIO) $(LIB_KPARTS) -lXt $(GTK_LIBS)
+ public:
+-    NSPluginInstance(QWidget *parent, const QCString& app, const QCString& id);
++    NSPluginInstance(QWidget *parent);
++    void init( const QCString& app, const QCString& obj );
+     ~NSPluginInstance();
++public: // wrappers
++    void javascriptResult( int id, QString result ) { stub->javascriptResult( id, result ); }
  
- NSPluginCallbackIface_DIR = $(srcdir)/..
+ private slots:
+     void doLoadPlugin();
+@@ -60,8 +63,15 @@
+     void windowChanged(WId w);
+     class NSPluginLoader *_loader;
+     bool shown;
++    bool inited;
++    int resize_count;
+     QPushButton *_button;
+     QGridLayout *_layout;
++    NSPluginInstanceIface_stub* stub;
++private: // wrappers
++    void displayPlugin();
++    void resizePlugin( int w, int h );
++    void shutdown();
+ };
  
-diff -up kdebase-3.5.8/nsplugins/viewer/viewer.cpp.flash kdebase-3.5.8/nsplugins/viewer/viewer.cpp
---- kdebase-3.5.8/nsplugins/viewer/viewer.cpp.flash	2006-01-19 11:01:49.000000000 -0600
-+++ kdebase-3.5.8/nsplugins/viewer/viewer.cpp	2007-12-14 11:32:58.000000000 -0600
-@@ -52,8 +52,13 @@
- #include <X11/Shell.h>
- #else
- #include "qxteventloop.h"
-+#include "glibevents.h"
- #endif
  
-+// FIXME: this is just for calling gtk_init and fix the buggy flash player
-+// initialization
-+#include <gtk/gtkmain.h>
-+
- /**
-  *  Use RLIMIT_DATA on systems that don't define RLIMIT_AS,
-  *  such as FreeBSD 4.
-@@ -215,6 +220,10 @@ bool qt_set_socket_handler( int sockfd, 
+diff -urN kdebase-orig/nsplugins/sdk/jni_md.h kdebase-3.5.8/nsplugins/sdk/jni_md.h
+--- kdebase-orig/nsplugins/sdk/jni_md.h	2007-10-08 11:51:23.000000000 +0200
++++ kdebase-3.5.8/nsplugins/sdk/jni_md.h	2008-01-29 15:51:20.000000000 +0100
+@@ -1,23 +1,40 @@
+ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+  *
+- * The contents of this file are subject to the Netscape Public
+- * License Version 1.1 (the "License"); you may not use this file
+- * except in compliance with the License. You may obtain a copy of
+- * the License at http://www.mozilla.org/NPL/
+- *
+- * Software distributed under the License is distributed on an "AS
+- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+- * implied. See the License for the specific language governing
+- * rights and limitations under the License.
++ * ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
+  *
+  * The Original Code is mozilla.org code.
+  *
+- * The Initial Developer of the Original Code is Netscape
+- * Communications Corporation.  Portions created by Netscape are
+- * Copyright (C) 1998 Netscape Communications Corporation. All
+- * Rights Reserved.
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1998
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either the GNU General Public License Version 2 or later (the "GPL"), or
++ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
+  *
+- * Contributor(s): 
++ * ***** END LICENSE BLOCK *****
+  *
+  *
+  * This Original Code has been modified by IBM Corporation.
+diff -urN kdebase-orig/nsplugins/sdk/npapi.h kdebase-3.5.8/nsplugins/sdk/npapi.h
+--- kdebase-orig/nsplugins/sdk/npapi.h	2007-10-08 11:51:23.000000000 +0200
++++ kdebase-3.5.8/nsplugins/sdk/npapi.h	2008-01-29 15:51:20.000000000 +0100
+@@ -38,7 +38,7 @@
  
- int main(int argc, char** argv)
- {
-+    // FIXME; the gtk_init() call is here to fix a bug in flash player that does
-+    // not call it properly, or call it in a wrong place
-+    gtk_init(&argc, &argv);
-+
-     // nspluginviewer is a helper app, it shouldn't do session management at all
-    setenv( "SESSION_MANAGER", "", 1 );
  
-@@ -249,6 +258,7 @@ int main(int argc, char** argv)
+ /*
+- *  npapi.h $Revision$
++ *  npapi.h
+  *  Netscape client plug-in API spec
+  */
  
-    kdDebug(1430) << "4 - create KApplication" << endl;
-    KApplication app( argc,  argv, "nspluginviewer" );
-+   GlibEvents glibevents;
- #endif
+@@ -126,11 +126,11 @@
+ /*----------------------------------------------------------------------*/
  
-    {
-diff -up kdebase-3.5.8/nsplugins/viewer/nsplugin.cpp.flash kdebase-3.5.8/nsplugins/viewer/nsplugin.cpp
---- kdebase-3.5.8/nsplugins/viewer/nsplugin.cpp.flash	2006-10-01 12:31:58.000000000 -0500
-+++ kdebase-3.5.8/nsplugins/viewer/nsplugin.cpp	2007-12-14 11:30:19.000000000 -0600
-@@ -180,6 +180,12 @@ NPError g_NPN_GetValue(NPP /*instance*/,
-          // Offline browsing - no thanks
-          *(bool*)value = false;
-          return NPERR_NO_ERROR;
-+      case 13: // NPNVToolkit
-+         *(int*)value = 2; // (NPNToolkitType)NPNVGtk2
-+         return NPERR_NO_ERROR;
-+      case 14: // NPNVSupportsXEmbedBool
-+         *(bool*)value = true;
-+         return NPERR_NO_ERROR;
-       default:
-          return NPERR_INVALID_PARAM;
-    }
-@@ -484,6 +490,8 @@ const char *g_NPN_UserAgent(NPP /*instan
-     KProtocolManager kpm;
-     QString agent = kpm.userAgentForHost("nspluginviewer");
-     kdDebug(1431) << "g_NPN_UserAgent() = " << agent << endl;
-+    // flash crashes without Firefox UA
-+    agent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.10) Gecko/2007101500 Firefox/2.0.0.10";
-     return agent.latin1();
- }
+ #define NP_VERSION_MAJOR 0
+-#define NP_VERSION_MINOR 11
++#define NP_VERSION_MINOR 13
  
-@@ -583,7 +591,7 @@ NSPluginInstance::NSPluginInstance(NPP p
-                                    KLibrary *handle, int width, int height,
-                                    QString src, QString /*mime*/,
-                                    QString appId, QString callbackId,
--                                   bool embed,
-+                                   bool embed, WId xembed,
-                                    QObject *parent, const char* name )
-    : DCOPObject(), QObject( parent, name ) 
- {
-@@ -599,6 +607,8 @@ NSPluginInstance::NSPluginInstance(NPP p
-    _streams.setAutoDelete( true );
-    _waitingRequests.setAutoDelete( true );
-    _callback = new NSPluginCallbackIface_stub( appId.latin1(), callbackId.latin1() );
-+   _xembed_window = xembed;
-+   _toplevel = _form = 0;
  
-    KURL base(src);
-    base.setFileName( QString::null );
-@@ -619,51 +629,53 @@ NSPluginInstance::NSPluginInstance(NPP p
-    if (height == 0)
-       height = 1200;
+ /* The OS/2 version of Netscape uses RC_DATA to define the
+-   mime types, file extentions, etc that are required.
++   mime types, file extensions, etc that are required.
+    Use a vertical bar to separate types, end types with \0.
+    FileVersion and ProductVersion are 32bit ints, all other
+    entries are strings the MUST be terminated wwith a \0.
+@@ -387,7 +387,8 @@
  
--   // create drawing area
--   Arg args[7];
--   Cardinal nargs = 0;
--   XtSetArg(args[nargs], XtNwidth, width); nargs++;
--   XtSetArg(args[nargs], XtNheight, height); nargs++;
--   XtSetArg(args[nargs], XtNborderWidth, 0); nargs++;
--
--   String n, c;
--   XtGetApplicationNameAndClass(qt_xdisplay(), &n, &c);
--
--   _toplevel = XtAppCreateShell("drawingArea", c, applicationShellWidgetClass,
--                                qt_xdisplay(), args, nargs);
--
--   // What exactly does widget mapping mean? Without this call the widget isn't
--   // embedded correctly. With it the viewer doesn't show anything in standalone mode.
--   //if (embed)
--      XtSetMappedWhenManaged(_toplevel, False);
--   XtRealizeWidget(_toplevel);
--
--   // Create form window that is searched for by flash plugin
--   _form = XtVaCreateWidget("form", compositeWidgetClass, _toplevel, NULL);
--   XtSetArg(args[nargs], XtNvisual, QPaintDevice::x11AppVisual()); nargs++;
--   XtSetArg(args[nargs], XtNdepth, QPaintDevice::x11AppDepth()); nargs++;
--   XtSetArg(args[nargs], XtNcolormap, QPaintDevice::x11AppColormap()); nargs++;
--   XtSetValues(_form, args, nargs);
--   XSync(qt_xdisplay(), false);
-+   if( _xembed_window == 0 ) {
-+      // create drawing area
-+      Arg args[7];
-+      Cardinal nargs = 0;
-+      XtSetArg(args[nargs], XtNwidth, width); nargs++;
-+      XtSetArg(args[nargs], XtNheight, height); nargs++;
-+      XtSetArg(args[nargs], XtNborderWidth, 0); nargs++;
-+
-+      String n, c;
-+      XtGetApplicationNameAndClass(qt_xdisplay(), &n, &c);
-+
-+      _toplevel = XtAppCreateShell("drawingArea", c, applicationShellWidgetClass,
-+                                   qt_xdisplay(), args, nargs);
-+
-+      // What exactly does widget mapping mean? Without this call the widget isn't
-+      // embedded correctly. With it the viewer doesn't show anything in standalone mode.
-+      //if (embed)
-+         XtSetMappedWhenManaged(_toplevel, False);
-+      XtRealizeWidget(_toplevel);
-+
-+      // Create form window that is searched for by flash plugin
-+      _form = XtVaCreateWidget("form", compositeWidgetClass, _toplevel, NULL);
-+      XtSetArg(args[nargs], XtNvisual, QPaintDevice::x11AppVisual()); nargs++;
-+      XtSetArg(args[nargs], XtNdepth, QPaintDevice::x11AppDepth()); nargs++;
-+      XtSetArg(args[nargs], XtNcolormap, QPaintDevice::x11AppColormap()); nargs++;
-+      XtSetValues(_form, args, nargs);
-+      XSync(qt_xdisplay(), false);
- 
--   // From mozilla - not sure if it's needed yet, nor what to use for embedder
-+      // From mozilla - not sure if it's needed yet, nor what to use for embedder
- #if 0
--   /* this little trick seems to finish initializing the widget */
-+      /* this little trick seems to finish initializing the widget */
- #if XlibSpecificationRelease >= 6
--   XtRegisterDrawable(qt_xdisplay(), embedderid, _toplevel);
-+      XtRegisterDrawable(qt_xdisplay(), embedderid, _toplevel);
- #else
--   _XtRegisterWindow(embedderid, _toplevel);
-+      _XtRegisterWindow(embedderid, _toplevel);
- #endif
- #endif
--   XtRealizeWidget(_form);
--   XtManageChild(_form);
-+      XtRealizeWidget(_form);
-+      XtManageChild(_form);
- 
--   // Register forwarder
--   XtAddEventHandler(_toplevel, (KeyPressMask|KeyReleaseMask), 
--                     False, forwarder, (XtPointer)this );
--   XtAddEventHandler(_form, (KeyPressMask|KeyReleaseMask), 
--                     False, forwarder, (XtPointer)this );
--   XSync(qt_xdisplay(), false);
-+      // Register forwarder
-+      XtAddEventHandler(_toplevel, (KeyPressMask|KeyReleaseMask), 
-+                        False, forwarder, (XtPointer)this );
-+      XtAddEventHandler(_form, (KeyPressMask|KeyReleaseMask), 
-+                        False, forwarder, (XtPointer)this );
-+      XSync(qt_xdisplay(), false);
-+   }
- }
- 
- NSPluginInstance::~NSPluginInstance()
-@@ -714,14 +726,16 @@ void NSPluginInstance::destroy()
-         if (saved)
-           g_NPN_MemFree(saved);
- 
--        XtRemoveEventHandler(_form, (KeyPressMask|KeyReleaseMask), 
--                             False, forwarder, (XtPointer)this);
--        XtRemoveEventHandler(_toplevel, (KeyPressMask|KeyReleaseMask), 
--                             False, forwarder, (XtPointer)this);
--        XtDestroyWidget(_form);
--	_form = 0;
--        XtDestroyWidget(_toplevel);
--	_toplevel = 0;
-+        if( _form != 0 ) {
-+            XtRemoveEventHandler(_form, (KeyPressMask|KeyReleaseMask), 
-+                                 False, forwarder, (XtPointer)this);
-+            XtRemoveEventHandler(_toplevel, (KeyPressMask|KeyReleaseMask), 
-+                                 False, forwarder, (XtPointer)this);
-+            XtDestroyWidget(_form);
-+    	    _form = 0;
-+            XtDestroyWidget(_toplevel);
-+	    _toplevel = 0;
-+        }
- 
-         if (_npp) {
-             ::free(_npp);   // matched with malloc() in newInstance
-@@ -902,7 +916,6 @@ void NSPluginInstance::streamFinished( N
-    _timer->start( 100, true );
- }
- 
--
- int NSPluginInstance::setWindow(int remove)
- {
-    if (remove)
-@@ -926,14 +939,24 @@ int NSPluginInstance::setWindow(int remo
-    _win.clipRect.bottom = _height;
-    _win.clipRect.right = _width;
- 
--   _win.window = (void*) XtWindow(_form);
--   kdDebug(1431) << "Window ID = " << _win.window << endl;
-+   if( _xembed_window ) {
-+      _win.window = (void*) _xembed_window;
-+      _win_info.type = NP_SETWINDOW;
-+      _win_info.display = qt_xdisplay();
-+      _win_info.visual = DefaultVisualOfScreen(DefaultScreenOfDisplay(qt_xdisplay()));
-+      _win_info.colormap = DefaultColormapOfScreen(DefaultScreenOfDisplay(qt_xdisplay()));
-+      _win_info.depth = DefaultDepthOfScreen(DefaultScreenOfDisplay(qt_xdisplay()));
-+   } else {
-+      _win.window = (void*) XtWindow(_form);
- 
--   _win_info.type = NP_SETWINDOW;
--   _win_info.display = XtDisplay(_form);
--   _win_info.visual = DefaultVisualOfScreen(XtScreen(_form));
--   _win_info.colormap = DefaultColormapOfScreen(XtScreen(_form));
--   _win_info.depth = DefaultDepthOfScreen(XtScreen(_form));
-+      _win_info.type = NP_SETWINDOW;
-+      _win_info.display = XtDisplay(_form);
-+      _win_info.visual = DefaultVisualOfScreen(XtScreen(_form));
-+      _win_info.colormap = DefaultColormapOfScreen(XtScreen(_form));
-+      _win_info.depth = DefaultDepthOfScreen(XtScreen(_form));
-+   }
-+
-+   kdDebug(1431) << "Window ID = " << _win.window << endl;
- 
-    _win.ws_info = &_win_info;
- 
-@@ -959,9 +982,6 @@ static void resizeWidgets(Window w, int 
- 
- void NSPluginInstance::resizePlugin(int w, int h)
- {
--   if (!_visible)
--      return;
--
-    if (w == _width && h == _height)
-       return;
- 
-@@ -970,22 +990,30 @@ void NSPluginInstance::resizePlugin(int 
-    _width = w;
-    _height = h;
- 
--   XResizeWindow(qt_xdisplay(), XtWindow(_form), w, h);
--   XResizeWindow(qt_xdisplay(), XtWindow(_toplevel), w, h);
--
--   Arg args[7];
--   Cardinal nargs = 0;
--   XtSetArg(args[nargs], XtNwidth, _width); nargs++;
--   XtSetArg(args[nargs], XtNheight, _height); nargs++;
--   XtSetArg(args[nargs], XtNvisual, QPaintDevice::x11AppVisual()); nargs++;
--   XtSetArg(args[nargs], XtNdepth, QPaintDevice::x11AppDepth()); nargs++;
--   XtSetArg(args[nargs], XtNcolormap, QPaintDevice::x11AppColormap()); nargs++;
--   XtSetArg(args[nargs], XtNborderWidth, 0); nargs++;
--
--   XtSetValues(_toplevel, args, nargs);
--   XtSetValues(_form, args, nargs);
--
--   resizeWidgets(XtWindow(_form), _width, _height);
-+   if( _form != 0 ) {
-+      XResizeWindow(qt_xdisplay(), XtWindow(_form), w, h);
-+      XResizeWindow(qt_xdisplay(), XtWindow(_toplevel), w, h);
-+
-+      Arg args[7];
-+      Cardinal nargs = 0;
-+      XtSetArg(args[nargs], XtNwidth, _width); nargs++;
-+      XtSetArg(args[nargs], XtNheight, _height); nargs++;
-+      XtSetArg(args[nargs], XtNvisual, QPaintDevice::x11AppVisual()); nargs++;
-+      XtSetArg(args[nargs], XtNdepth, QPaintDevice::x11AppDepth()); nargs++;
-+      XtSetArg(args[nargs], XtNcolormap, QPaintDevice::x11AppColormap()); nargs++;
-+      XtSetArg(args[nargs], XtNborderWidth, 0); nargs++;
-+ 
-+      XtSetValues(_toplevel, args, nargs);
-+      XtSetValues(_form, args, nargs);
-+
-+      resizeWidgets(XtWindow(_form), _width, _height);
-+   }
-+
-+   // If not visible yet, displayWindow() will call setWindow() again anyway, so avoid this.
-+   // This also handled plugins that are broken and cannot handle repeated setWindow() calls
-+   // very well.
-+   if (!_visible)
-+      return;
- 
-    setWindow();
- 
-@@ -1405,7 +1433,7 @@ void NSPluginClass::shutdown()
- DCOPRef NSPluginClass::newInstance( QString url, QString mimeType, bool embed,
-                                     QStringList argn, QStringList argv,
-                                     QString appId, QString callbackId,
--                                    bool reload, bool doPost, QByteArray postData )
-+                                    bool reload, bool doPost, QByteArray postData, long xembed )
- {
-    kdDebug(1431) << "-> NSPluginClass::NewInstance" << endl;
- 
-@@ -1449,16 +1477,25 @@ DCOPRef NSPluginClass::newInstance( QStr
-    memset(npp, 0, sizeof(NPP_t));
-    npp->ndata = NULL;
- 
--   // Create plugin instance object
--   NSPluginInstance *inst = new NSPluginInstance( npp, &_pluginFuncs, _handle,
--                                                  width, height, baseURL, mimeType,
--                                                  appId, callbackId, embed, this );
--
-    // create plugin instance
-    NPError error = _pluginFuncs.newp(mime, npp, embed ? NP_EMBED : NP_FULL,
-                                      argc, _argn, _argv, 0);
-    kdDebug(1431) << "NPP_New = " << (int)error << endl;
- 
-+   // don't use bool here, it can be 1 byte, but some plugins write it as int, and I can't find what the spec says
-+   int wants_xembed = false;
-+   if (_pluginFuncs.getvalue) {
-+      NPError error = _pluginFuncs.getvalue(npp, (NPPVariable)14/*NPPVpluginNeedsXEmbed*/, &wants_xembed );
-+      if( error != NPERR_NO_ERROR )
-+         wants_xembed = false;
-+   }
-+   kdDebug(1431) << "Plugin requires XEmbed:" << (bool)wants_xembed << endl;
-+
-+   // Create plugin instance object
-+   NSPluginInstance *inst = new NSPluginInstance( npp, &_pluginFuncs, _handle,
-+                                                  width, height, baseURL, mimeType,
-+                                                  appId, callbackId, embed, wants_xembed ? xembed : 0, this );
-+
-    // free arrays with arguments
-    delete [] _argn;
-    delete [] _argv;
-@@ -1493,7 +1530,6 @@ void NSPluginClass::destroyInstance( NSP
-     timer(); //_timer->start( 0, TRUE );
- }
- 
--
- /****************************************************************************/
- 
- NSPluginStreamBase::NSPluginStreamBase( NSPluginInstance *instance )
-diff -up kdebase-3.5.8/nsplugins/viewer/NSPluginClassIface.h.flash kdebase-3.5.8/nsplugins/viewer/NSPluginClassIface.h
---- kdebase-3.5.8/nsplugins/viewer/NSPluginClassIface.h.flash	2005-11-19 05:08:29.000000000 -0600
-+++ kdebase-3.5.8/nsplugins/viewer/NSPluginClassIface.h	2007-12-14 11:30:19.000000000 -0600
-@@ -50,7 +50,7 @@ k_dcop:
-   virtual DCOPRef newInstance(QString url, QString mimeType, bool embed,
-                               QStringList argn, QStringList argv,
-                               QString appId, QString callbackId, bool reload,
--                              bool doPost, QByteArray postData) = 0;
-+                              bool doPost, QByteArray postData, long xembed) = 0;
-   virtual QString getMIMEDescription() = 0;
- 
- };
-diff -up /dev/null kdebase-3.5.8/nsplugins/viewer/glibevents.cpp
---- /dev/null	2007-12-13 13:41:14.965729569 -0600
-+++ kdebase-3.5.8/nsplugins/viewer/glibevents.cpp	2007-12-14 11:30:19.000000000 -0600
-@@ -0,0 +1,43 @@
-+/*
-+  Copyright (c) 2007 Lubos Lunak <l.lunak at suse.cz>
-+ 
-+  This program is free software; you can redistribute it and/or modify
-+  it under the terms of the GNU General Public License as published by
-+  the Free Software Foundation; either version 2 of the License, or
-+  (at your option) any later version.
-+ 
-+  This program is distributed in the hope that it will be useful,
-+  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+  GNU General Public License for more details.
-+ 
-+  You should have received a copy of the GNU General Public License
-+  along with this program; if not, write to the Free Software
-+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-+ 
-+*/                                                                            
-+
-+#include "glibevents.h"
-+
-+#include <qapplication.h>
-+
-+GlibEvents::GlibEvents()
-+    {
-+    g_main_context_ref( g_main_context_default());
-+    connect( &timer, SIGNAL( timeout()), SLOT( process()));
-+    // TODO Poll for now
-+    timer.start( 10 );
-+    }
-+
-+GlibEvents::~GlibEvents()
-+    {
-+    g_main_context_unref( g_main_context_default());
-+    }
-+
-+void GlibEvents::process()
-+    {
-+    while( g_main_context_pending( g_main_context_default()))
-+        g_main_context_iteration( g_main_context_default(), false );
-+    }
-+
-+#include "glibevents.moc"
-diff -up kdebase-3.5.8/nsplugins/viewer/nsplugin.h.flash kdebase-3.5.8/nsplugins/viewer/nsplugin.h
---- kdebase-3.5.8/nsplugins/viewer/nsplugin.h.flash	2007-10-08 04:51:23.000000000 -0500
-+++ kdebase-3.5.8/nsplugins/viewer/nsplugin.h	2007-12-14 11:30:19.000000000 -0600
-@@ -165,13 +165,13 @@ public:
-   // constructor, destructor
-   NSPluginInstance( NPP privateData, NPPluginFuncs *pluginFuncs, KLibrary *handle,
- 		    int width, int height, QString src, QString mime,
--                    QString appId, QString callbackId, bool embed,
-+                    QString appId, QString callbackId, bool embed, WId xembed,
- 		    QObject *parent, const char* name=0 );
-   ~NSPluginInstance();
- 
-   // DCOP functions
-   void shutdown();
--  int winId() { return XtWindow(_form); }
-+  int winId() { return _form != 0 ? XtWindow(_form) : 0; }
-   int setWindow(int remove=0);
-   void resizePlugin(int w, int h);
-   void javascriptResult(int id, QString result);
-@@ -232,6 +232,7 @@ private:
-   NPPluginFuncs _pluginFuncs;
- 
-   Widget _area, _form, _toplevel;
-+  WId _xembed_window;
-   QString _baseURL;
-   int _width, _height;
- 
-@@ -281,7 +282,7 @@ public:
-   DCOPRef newInstance(QString url, QString mimeType, bool embed,
-                       QStringList argn, QStringList argv,
-                       QString appId, QString callbackId, bool reload, bool post,
--                      QByteArray postData );
-+                      QByteArray postData, long xembed );
-   void destroyInstance( NSPluginInstance* inst );
-   bool error() { return _error; }
- 
-diff -up kdebase-3.5.8/nsplugins/sdk/npapi.h.flash kdebase-3.5.8/nsplugins/sdk/npapi.h
---- kdebase-3.5.8/nsplugins/sdk/npapi.h.flash	2007-10-08 04:51:23.000000000 -0500
-+++ kdebase-3.5.8/nsplugins/sdk/npapi.h	2007-12-14 11:30:19.000000000 -0600
-@@ -38,7 +38,7 @@
- 
- 
- /*
-- *  npapi.h $Revision$
-+ *  npapi.h $Revision$
-  *  Netscape client plug-in API spec
-  */
- 
-@@ -126,11 +126,11 @@
- /*----------------------------------------------------------------------*/
- 
- #define NP_VERSION_MAJOR 0
--#define NP_VERSION_MINOR 11
-+#define NP_VERSION_MINOR 13
- 
- 
- /* The OS/2 version of Netscape uses RC_DATA to define the
--   mime types, file extentions, etc that are required.
-+   mime types, file extensions, etc that are required.
-    Use a vertical bar to separate types, end types with \0.
-    FileVersion and ProductVersion are 32bit ints, all other
-    entries are strings the MUST be terminated wwith a \0.
-@@ -387,7 +387,8 @@ typedef enum {
- 
-   /* 12 and over are available on Mozilla builds starting with 0.9.9 */
-   NPPVjavascriptPushCallerBool = 12,
--  NPPVpluginKeepLibraryInMemory = 13   /* available in Mozilla 1.0 */
-+  NPPVpluginKeepLibraryInMemory = 13,   /* available in Mozilla 1.0 */
-+  NPPVpluginNeedsXEmbed         = 14
- } NPPVariable;
- 
- /*
-@@ -404,10 +405,20 @@ typedef enum {
-   /* 10 and over are available on Mozilla builds starting with 0.9.4 */
-   NPNVserviceManager = (10 | NP_ABI_MASK),
-   NPNVDOMElement     = (11 | NP_ABI_MASK),   /* available in Mozilla 1.2 */
--  NPNVDOMWindow      = (12 | NP_ABI_MASK)
-+  NPNVDOMWindow      = (12 | NP_ABI_MASK),
-+  NPNVToolkit        = (13 | NP_ABI_MASK),
-+  NPNVSupportsXEmbedBool = 14
- } NPNVariable;
- 
- /*
-+ * The type of Tookkit the widgets use
-+ */
-+typedef enum {
-+  NPNVGtk12 = 1,
-+  NPNVGtk2
-+} NPNToolkitType;
+   /* 12 and over are available on Mozilla builds starting with 0.9.9 */
+   NPPVjavascriptPushCallerBool = 12,
+-  NPPVpluginKeepLibraryInMemory = 13   /* available in Mozilla 1.0 */
++  NPPVpluginKeepLibraryInMemory = 13,   /* available in Mozilla 1.0 */
++  NPPVpluginNeedsXEmbed         = 14
+ } NPPVariable;
+ 
+ /*
+@@ -404,10 +405,20 @@
+   /* 10 and over are available on Mozilla builds starting with 0.9.4 */
+   NPNVserviceManager = (10 | NP_ABI_MASK),
+   NPNVDOMElement     = (11 | NP_ABI_MASK),   /* available in Mozilla 1.2 */
+-  NPNVDOMWindow      = (12 | NP_ABI_MASK)
++  NPNVDOMWindow      = (12 | NP_ABI_MASK),
++  NPNVToolkit        = (13 | NP_ABI_MASK),
++  NPNVSupportsXEmbedBool = 14
+ } NPNVariable;
+ 
+ /*
++ * The type of Tookkit the widgets use
++ */
++typedef enum {
++  NPNVGtk12 = 1,
++  NPNVGtk2
++} NPNToolkitType;
 +
 +/*
   * The type of a NPWindow - it specifies the type of the data structure
   * returned in the window field.
   */
-@@ -428,7 +439,7 @@ typedef struct _NPWindow
+@@ -428,7 +439,7 @@
    NPRect clipRect; /* Clipping rectangle in port coordinates */
                     /* Used by MAC only.			  */
  #if defined(XP_UNIX) && !defined(XP_MACOSX)
@@ -648,9 +340,9 @@
  #endif /* XP_UNIX */
    NPWindowType type; /* Is this a window or a drawable? */
  } NPWindow;
-diff -up /dev/null kdebase-3.5.8/nsplugins/sdk/npruntime.h
---- /dev/null	2007-12-13 13:41:14.965729569 -0600
-+++ kdebase-3.5.8/nsplugins/sdk/npruntime.h	2007-12-14 11:30:19.000000000 -0600
+diff -urN kdebase-orig/nsplugins/sdk/npruntime.h kdebase-3.5.8/nsplugins/sdk/npruntime.h
+--- kdebase-orig/nsplugins/sdk/npruntime.h	1970-01-01 01:00:00.000000000 +0100
++++ kdebase-3.5.8/nsplugins/sdk/npruntime.h	2008-01-29 15:51:04.000000000 +0100
 @@ -0,0 +1,399 @@
 +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 +/*
@@ -1051,9 +743,9 @@
 +#endif
 +
 +#endif
-diff -up kdebase-3.5.8/nsplugins/sdk/npupp.h.flash kdebase-3.5.8/nsplugins/sdk/npupp.h
---- kdebase-3.5.8/nsplugins/sdk/npupp.h.flash	2007-10-08 04:51:23.000000000 -0500
-+++ kdebase-3.5.8/nsplugins/sdk/npupp.h	2007-12-14 11:30:19.000000000 -0600
+diff -urN kdebase-orig/nsplugins/sdk/npupp.h kdebase-3.5.8/nsplugins/sdk/npupp.h
+--- kdebase-orig/nsplugins/sdk/npupp.h	2007-10-08 11:51:23.000000000 +0200
++++ kdebase-3.5.8/nsplugins/sdk/npupp.h	2008-01-29 15:51:20.000000000 +0100
 @@ -1,11 +1,11 @@
 -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
@@ -1104,7 +796,7 @@
  
  /*
 - *  npupp.h $Revision$
-+ *  npupp.h $Revision$
++ *  npupp.h
   *  function call mecahnics needed by platform specific glue code.
   */
  
@@ -1125,7 +817,7 @@
  #define _NPUPP_USE_UPP_ 0
  
  #if _NPUPP_USE_UPP_
-@@ -488,8 +488,6 @@ typedef NPError	(* NP_LOADDS NPP_SetValu
+@@ -488,8 +488,6 @@
  #endif
  
  
@@ -1134,7 +826,7 @@
  /*
   *  Netscape entry points
   */
-@@ -1063,6 +1061,584 @@ typedef void (* NP_LOADDS NPN_ForceRedra
+@@ -1063,6 +1061,584 @@
  
  #endif
  
@@ -1660,145 +1352,744 @@
 +#define CallNPN_SetExceptionProc(FUNC, ARG1, ARG2)		\
 +		(*(FUNC))((ARG1), (ARG2))	
 +
-+#endif
++#endif
++
++/* NPN_PushPopupsEnabledStateUPP */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_PushPopupsEnabledStateUPP;
++enum {
++	uppNPN_PushPopupsEnabledStateProcInfo = kThinkCStackBased
++		| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++        | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPBool)))
++		| RESULT_SIZE(SIZE_CODE(0))
++};
++
++#define NewNPN_PushPopupsEnabledStateProc(FUNC)		\
++		(NPN_PushPopupsEnabledStateUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PushPopupsEnabledStateProcInfo, GetCurrentArchitecture())
++#define CallNPN_PushPopupsEnabledStateProc(FUNC, ARG1, ARG2)		\
++		(jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PushPopupsEnabledStateProcInfo, (ARG1), (ARG2))
++
++#else
++
++typedef bool (* NP_LOADDS NPN_PushPopupsEnabledStateUPP)(NPP npp, NPBool enabled);
++#define NewNPN_PushPopupsEnabledStateProc(FUNC)		\
++		((NPN_PushPopupsEnabledStateUPP) (FUNC))
++#define CallNPN_PushPopupsEnabledStateProc(FUNC, ARG1, ARG2)		\
++		(*(FUNC))((ARG1), (ARG2))
++
++#endif
++
++/* NPN_PopPopupsEnabledState */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_PopPopupsEnabledStateUPP;
++enum {
++	uppNPN_PopPopupsEnabledStateProcInfo = kThinkCStackBased
++		| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++		| RESULT_SIZE(SIZE_CODE(0))
++};
++
++#define NewNPN_PopPopupsEnabledStateProc(FUNC)		\
++		(NPN_PopPopupsEnabledStateUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PopPopupsEnabledStateProcInfo, GetCurrentArchitecture())
++#define CallNPN_PopPopupsEnabledStateProc(FUNC, ARG1)		\
++		(jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PopPopupsEnabledStateProcInfo, (ARG1))
++
++#else
++
++typedef bool (* NP_LOADDS NPN_PopPopupsEnabledStateUPP)(NPP npp);
++#define NewNPN_PopPopupsEnabledStateProc(FUNC)		\
++		((NPN_PopPopupsEnabledStateUPP) (FUNC))
++#define CallNPN_PopPopupsEnabledStateProc(FUNC, ARG1)		\
++		(*(FUNC))((ARG1))
++
++#endif
++
++
+ 
+ /******************************************************************************************
+  * The actual plugin function table definitions
+@@ -1117,6 +1693,27 @@
+     NPN_InvalidateRectUPP invalidaterect;
+     NPN_InvalidateRegionUPP invalidateregion;
+     NPN_ForceRedrawUPP forceredraw;
++    NPN_GetStringIdentifierUPP getstringidentifier;
++    NPN_GetStringIdentifiersUPP getstringidentifiers;
++    NPN_GetIntIdentifierUPP getintidentifier;
++    NPN_IdentifierIsStringUPP identifierisstring;
++    NPN_UTF8FromIdentifierUPP utf8fromidentifier;
++    NPN_IntFromIdentifierUPP intfromidentifier;
++    NPN_CreateObjectUPP createobject;
++    NPN_RetainObjectUPP retainobject;
++    NPN_ReleaseObjectUPP releaseobject;
++    NPN_InvokeUPP invoke;
++    NPN_InvokeDefaultUPP invokeDefault;
++    NPN_EvaluateUPP evaluate;
++    NPN_GetPropertyUPP getproperty;
++    NPN_SetPropertyUPP setproperty;
++    NPN_RemovePropertyUPP removeproperty;
++    NPN_HasPropertyUPP hasproperty;
++    NPN_HasMethodUPP hasmethod;
++    NPN_ReleaseVariantValueUPP releasevariantvalue;
++    NPN_SetExceptionUPP setexception;
++    NPN_PushPopupsEnabledStateUPP pushpopupsenabledstate;
++    NPN_PopPopupsEnabledStateUPP poppopupsenabledstate;
+ } NPNetscapeFuncs;
+ 
+ #ifdef XP_MAC
+diff -urN kdebase-orig/nsplugins/sdk/prcpucfg.h kdebase-3.5.8/nsplugins/sdk/prcpucfg.h
+--- kdebase-orig/nsplugins/sdk/prcpucfg.h	2007-10-08 11:51:23.000000000 +0200
++++ kdebase-3.5.8/nsplugins/sdk/prcpucfg.h	2008-01-29 15:51:20.000000000 +0100
+@@ -276,7 +276,7 @@
+ #define PR_BYTES_PER_WORD_LOG2   2
+ #define PR_BYTES_PER_DWORD_LOG2  3
+ 
+-#elif defined(__sparc__)
++#elif defined(__sparc__) || (defined(__SUNPRO_CC) && defined(__sparc))
+ 
+ #undef	IS_LITTLE_ENDIAN
+ #define	IS_BIG_ENDIAN 1
+@@ -321,7 +321,7 @@
+ #define PR_BYTES_PER_WORD_LOG2   2
+ #define PR_BYTES_PER_DWORD_LOG2  3
+ 
+-#elif defined(__i386__)
++#elif defined(__i386__) || (defined(__SUNPRO_CC) && defined(__i386))
+ 
+ #define IS_LITTLE_ENDIAN 1
+ #undef  IS_BIG_ENDIAN
+@@ -629,7 +629,9 @@
+ #define BITS_PER_SHORT		PR_BITS_PER_SHORT
+ #define BITS_PER_INT		PR_BITS_PER_INT
+ #define BITS_PER_INT64		PR_BITS_PER_INT64
++#ifndef BITS_PER_LONG
+ #define BITS_PER_LONG		PR_BITS_PER_LONG
++#endif
+ #define BITS_PER_FLOAT		PR_BITS_PER_FLOAT
+ #define BITS_PER_DOUBLE		PR_BITS_PER_DOUBLE
+ #define BITS_PER_WORD		PR_BITS_PER_WORD
+diff -urN kdebase-orig/nsplugins/viewer/glibevents.cpp kdebase-3.5.8/nsplugins/viewer/glibevents.cpp
+--- kdebase-orig/nsplugins/viewer/glibevents.cpp	1970-01-01 01:00:00.000000000 +0100
++++ kdebase-3.5.8/nsplugins/viewer/glibevents.cpp	2008-01-29 15:51:04.000000000 +0100
+@@ -0,0 +1,43 @@
++/*
++  Copyright (c) 2007 Lubos Lunak <l.lunak at suse.cz>
++ 
++  This program is free software; you can redistribute it and/or modify
++  it under the terms of the GNU General Public License as published by
++  the Free Software Foundation; either version 2 of the License, or
++  (at your option) any later version.
++ 
++  This program is distributed in the hope that it will be useful,
++  but WITHOUT ANY WARRANTY; without even the implied warranty of
++  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++  GNU General Public License for more details.
++ 
++  You should have received a copy of the GNU General Public License
++  along with this program; if not, write to the Free Software
++  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
++ 
++*/                                                                            
++
++#include "glibevents.h"
++
++#include <qapplication.h>
++
++GlibEvents::GlibEvents()
++    {
++    g_main_context_ref( g_main_context_default());
++    connect( &timer, SIGNAL( timeout()), SLOT( process()));
++    // TODO Poll for now
++    timer.start( 10 );
++    }
++
++GlibEvents::~GlibEvents()
++    {
++    g_main_context_unref( g_main_context_default());
++    }
 +
-+/* NPN_PushPopupsEnabledStateUPP */
++void GlibEvents::process()
++    {
++    while( g_main_context_pending( g_main_context_default()))
++        g_main_context_iteration( g_main_context_default(), false );
++    }
 +
-+#if _NPUPP_USE_UPP_
++#include "glibevents.moc"
+diff -urN kdebase-orig/nsplugins/viewer/glibevents.h kdebase-3.5.8/nsplugins/viewer/glibevents.h
+--- kdebase-orig/nsplugins/viewer/glibevents.h	1970-01-01 01:00:00.000000000 +0100
++++ kdebase-3.5.8/nsplugins/viewer/glibevents.h	2008-01-29 15:51:04.000000000 +0100
+@@ -0,0 +1,41 @@
++/*
++  Copyright (c) 2007 Lubos Lunak <l.lunak at suse.cz>
++ 
++  This program is free software; you can redistribute it and/or modify
++  it under the terms of the GNU General Public License as published by
++  the Free Software Foundation; either version 2 of the License, or
++  (at your option) any later version.
++ 
++  This program is distributed in the hope that it will be useful,
++  but WITHOUT ANY WARRANTY; without even the implied warranty of
++  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++  GNU General Public License for more details.
++ 
++  You should have received a copy of the GNU General Public License
++  along with this program; if not, write to the Free Software
++  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
++ 
++*/                                                                            
 +
-+typedef UniversalProcPtr NPN_PushPopupsEnabledStateUPP;
-+enum {
-+	uppNPN_PushPopupsEnabledStateProcInfo = kThinkCStackBased
-+		| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
-+        | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPBool)))
-+		| RESULT_SIZE(SIZE_CODE(0))
-+};
++#ifndef GLIBEVENTS_H
++#define GLIBEVENTS_H
 +
-+#define NewNPN_PushPopupsEnabledStateProc(FUNC)		\
-+		(NPN_PushPopupsEnabledStateUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PushPopupsEnabledStateProcInfo, GetCurrentArchitecture())
-+#define CallNPN_PushPopupsEnabledStateProc(FUNC, ARG1, ARG2)		\
-+		(jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PushPopupsEnabledStateProcInfo, (ARG1), (ARG2))
++#include <qwidget.h>
++#include <qtimer.h>
 +
-+#else
++#include <glib.h>
 +
-+typedef bool (* NP_LOADDS NPN_PushPopupsEnabledStateUPP)(NPP npp, NPBool enabled);
-+#define NewNPN_PushPopupsEnabledStateProc(FUNC)		\
-+		((NPN_PushPopupsEnabledStateUPP) (FUNC))
-+#define CallNPN_PushPopupsEnabledStateProc(FUNC, ARG1, ARG2)		\
-+		(*(FUNC))((ARG1), (ARG2))
++class GlibEvents
++    : public QWidget
++    {
++    Q_OBJECT
++    public:
++        GlibEvents();
++        virtual ~GlibEvents();
++    private slots:
++        void process();
++    private:
++        QTimer timer;
++    };
 +
 +#endif
+diff -urN kdebase-orig/nsplugins/viewer/Makefile.am kdebase-3.5.8/nsplugins/viewer/Makefile.am
+--- kdebase-orig/nsplugins/viewer/Makefile.am	2005-09-10 10:25:39.000000000 +0200
++++ kdebase-3.5.8/nsplugins/viewer/Makefile.am	2008-01-29 15:51:20.000000000 +0100
+@@ -1,12 +1,11 @@
+-INCLUDES = -I$(top_srcdir)/nsplugins -I$(top_builddir)/nsplugins $(all_includes)
++INCLUDES = -I$(top_srcdir)/nsplugins -I$(top_builddir)/nsplugins $(all_includes) $(GTK_CFLAGS) `pkg-config --cflags glib-2.0`
+ METASOURCES = AUTO
+ 
+ bin_PROGRAMS = nspluginviewer 
+ 
+ nspluginviewer_SOURCES = NSPluginCallbackIface.stub NSPluginClassIface.skel \
+-	nsplugin.cpp viewer.cpp kxt.cpp qxteventloop.cpp
+-nspluginviewer_LDFLAGS = $(all_libraries) $(KDE_RPATH) -export-dynamic
+-nspluginviewer_LDADD = $(LIB_KIO) $(LIB_KPARTS) -lXt
++	nsplugin.cpp viewer.cpp kxt.cpp qxteventloop.cpp glibevents.cpp
++nspluginviewer_LDFLAGS = $(all_libraries) $(KDE_RPATH) -export-dynamic `pkg-config --libs glib-2.0`
++nspluginviewer_LDADD = $(LIB_KIO) $(LIB_KPARTS) -lXt $(GTK_LIBS)
+ 
+ NSPluginCallbackIface_DIR = $(srcdir)/..
+-
+diff -urN kdebase-orig/nsplugins/viewer/NSPluginClassIface.h kdebase-3.5.8/nsplugins/viewer/NSPluginClassIface.h
+--- kdebase-orig/nsplugins/viewer/NSPluginClassIface.h	2005-11-19 12:08:29.000000000 +0100
++++ kdebase-3.5.8/nsplugins/viewer/NSPluginClassIface.h	2008-01-29 15:51:20.000000000 +0100
+@@ -47,10 +47,10 @@
+ 
+ k_dcop:
+ 
+-  virtual DCOPRef newInstance(QString url, QString mimeType, bool embed,
++  virtual DCOPRef newInstance(QString url, QString mimeType, Q_INT8 embed,
+                               QStringList argn, QStringList argv,
+-                              QString appId, QString callbackId, bool reload,
+-                              bool doPost, QByteArray postData) = 0;
++                              QString appId, QString callbackId, Q_INT8 reload,
++                              Q_INT8 doPost, QByteArray postData, Q_UINT32 xembed) = 0;
+   virtual QString getMIMEDescription() = 0;
+ 
+ };
+@@ -66,11 +66,11 @@
+ 
+   virtual int winId() = 0;
+ 
+-  virtual int setWindow(int remove=0) = 0;
++  virtual int setWindow(Q_INT8 remove=0) = 0;
+ 
+-  virtual void resizePlugin(int w, int h) = 0;
++  virtual void resizePlugin(Q_INT32 w, Q_INT32 h) = 0;
+ 
+-  virtual void javascriptResult(int id, QString result) = 0;
++  virtual void javascriptResult(Q_INT32 id, QString result) = 0;
+ 
+   virtual void displayPlugin() = 0;
+ };
+diff -urN kdebase-orig/nsplugins/viewer/nsplugin.cpp kdebase-3.5.8/nsplugins/viewer/nsplugin.cpp
+--- kdebase-orig/nsplugins/viewer/nsplugin.cpp	2006-10-01 19:31:58.000000000 +0200
++++ kdebase-3.5.8/nsplugins/viewer/nsplugin.cpp	2008-01-29 15:51:21.000000000 +0100
+@@ -180,6 +180,12 @@
+          // Offline browsing - no thanks
+          *(bool*)value = false;
+          return NPERR_NO_ERROR;
++      case NPNVToolkit:
++         *(NPNToolkitType*)value = NPNVGtk2;
++         return NPERR_NO_ERROR;
++      case NPNVSupportsXEmbedBool:
++         *(bool*)value = true;
++         return NPERR_NO_ERROR;
+       default:
+          return NPERR_INVALID_PARAM;
+    }
+@@ -484,6 +490,8 @@
+     KProtocolManager kpm;
+     QString agent = kpm.userAgentForHost("nspluginviewer");
+     kdDebug(1431) << "g_NPN_UserAgent() = " << agent << endl;
++    // flash crashes without Firefox UA
++    agent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.10) Gecko/2007101500 Firefox/2.0.0.10";
+     return agent.latin1();
+ }
+ 
+@@ -583,7 +591,7 @@
+                                    KLibrary *handle, int width, int height,
+                                    QString src, QString /*mime*/,
+                                    QString appId, QString callbackId,
+-                                   bool embed,
++                                   bool embed, WId xembed,
+                                    QObject *parent, const char* name )
+    : DCOPObject(), QObject( parent, name ) 
+ {
+@@ -599,6 +607,8 @@
+    _streams.setAutoDelete( true );
+    _waitingRequests.setAutoDelete( true );
+    _callback = new NSPluginCallbackIface_stub( appId.latin1(), callbackId.latin1() );
++   _xembed_window = xembed;
++   _toplevel = _form = 0;
+ 
+    KURL base(src);
+    base.setFileName( QString::null );
+@@ -619,51 +629,53 @@
+    if (height == 0)
+       height = 1200;
+ 
+-   // create drawing area
+-   Arg args[7];
+-   Cardinal nargs = 0;
+-   XtSetArg(args[nargs], XtNwidth, width); nargs++;
+-   XtSetArg(args[nargs], XtNheight, height); nargs++;
+-   XtSetArg(args[nargs], XtNborderWidth, 0); nargs++;
+-
+-   String n, c;
+-   XtGetApplicationNameAndClass(qt_xdisplay(), &n, &c);
+-
+-   _toplevel = XtAppCreateShell("drawingArea", c, applicationShellWidgetClass,
+-                                qt_xdisplay(), args, nargs);
+-
+-   // What exactly does widget mapping mean? Without this call the widget isn't
+-   // embedded correctly. With it the viewer doesn't show anything in standalone mode.
+-   //if (embed)
+-      XtSetMappedWhenManaged(_toplevel, False);
+-   XtRealizeWidget(_toplevel);
+-
+-   // Create form window that is searched for by flash plugin
+-   _form = XtVaCreateWidget("form", compositeWidgetClass, _toplevel, NULL);
+-   XtSetArg(args[nargs], XtNvisual, QPaintDevice::x11AppVisual()); nargs++;
+-   XtSetArg(args[nargs], XtNdepth, QPaintDevice::x11AppDepth()); nargs++;
+-   XtSetArg(args[nargs], XtNcolormap, QPaintDevice::x11AppColormap()); nargs++;
+-   XtSetValues(_form, args, nargs);
+-   XSync(qt_xdisplay(), false);
++   if( _xembed_window == 0 ) {
++      // create drawing area
++      Arg args[7];
++      Cardinal nargs = 0;
++      XtSetArg(args[nargs], XtNwidth, width); nargs++;
++      XtSetArg(args[nargs], XtNheight, height); nargs++;
++      XtSetArg(args[nargs], XtNborderWidth, 0); nargs++;
 +
-+/* NPN_PopPopupsEnabledState */
++      String n, c;
++      XtGetApplicationNameAndClass(qt_xdisplay(), &n, &c);
 +
-+#if _NPUPP_USE_UPP_
++      _toplevel = XtAppCreateShell("drawingArea", c, applicationShellWidgetClass,
++                                   qt_xdisplay(), args, nargs);
 +
-+typedef UniversalProcPtr NPN_PopPopupsEnabledStateUPP;
-+enum {
-+	uppNPN_PopPopupsEnabledStateProcInfo = kThinkCStackBased
-+		| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
-+		| RESULT_SIZE(SIZE_CODE(0))
-+};
++      // What exactly does widget mapping mean? Without this call the widget isn't
++      // embedded correctly. With it the viewer doesn't show anything in standalone mode.
++      //if (embed)
++         XtSetMappedWhenManaged(_toplevel, False);
++      XtRealizeWidget(_toplevel);
++
++      // Create form window that is searched for by flash plugin
++      _form = XtVaCreateWidget("form", compositeWidgetClass, _toplevel, NULL);
++      XtSetArg(args[nargs], XtNvisual, QPaintDevice::x11AppVisual()); nargs++;
++      XtSetArg(args[nargs], XtNdepth, QPaintDevice::x11AppDepth()); nargs++;
++      XtSetArg(args[nargs], XtNcolormap, QPaintDevice::x11AppColormap()); nargs++;
++      XtSetValues(_form, args, nargs);
++      XSync(qt_xdisplay(), false);
+ 
+-   // From mozilla - not sure if it's needed yet, nor what to use for embedder
++      // From mozilla - not sure if it's needed yet, nor what to use for embedder
+ #if 0
+-   /* this little trick seems to finish initializing the widget */
++      /* this little trick seems to finish initializing the widget */
+ #if XlibSpecificationRelease >= 6
+-   XtRegisterDrawable(qt_xdisplay(), embedderid, _toplevel);
++      XtRegisterDrawable(qt_xdisplay(), embedderid, _toplevel);
+ #else
+-   _XtRegisterWindow(embedderid, _toplevel);
++      _XtRegisterWindow(embedderid, _toplevel);
+ #endif
+ #endif
+-   XtRealizeWidget(_form);
+-   XtManageChild(_form);
++      XtRealizeWidget(_form);
++      XtManageChild(_form);
+ 
+-   // Register forwarder
+-   XtAddEventHandler(_toplevel, (KeyPressMask|KeyReleaseMask), 
+-                     False, forwarder, (XtPointer)this );
+-   XtAddEventHandler(_form, (KeyPressMask|KeyReleaseMask), 
+-                     False, forwarder, (XtPointer)this );
+-   XSync(qt_xdisplay(), false);
++      // Register forwarder
++      XtAddEventHandler(_toplevel, (KeyPressMask|KeyReleaseMask), 
++                        False, forwarder, (XtPointer)this );
++      XtAddEventHandler(_form, (KeyPressMask|KeyReleaseMask), 
++                        False, forwarder, (XtPointer)this );
++      XSync(qt_xdisplay(), false);
++   }
+ }
+ 
+ NSPluginInstance::~NSPluginInstance()
+@@ -714,14 +726,16 @@
+         if (saved)
+           g_NPN_MemFree(saved);
+ 
+-        XtRemoveEventHandler(_form, (KeyPressMask|KeyReleaseMask), 
+-                             False, forwarder, (XtPointer)this);
+-        XtRemoveEventHandler(_toplevel, (KeyPressMask|KeyReleaseMask), 
+-                             False, forwarder, (XtPointer)this);
+-        XtDestroyWidget(_form);
+-	_form = 0;
+-        XtDestroyWidget(_toplevel);
+-	_toplevel = 0;
++        if( _form != 0 ) {
++            XtRemoveEventHandler(_form, (KeyPressMask|KeyReleaseMask), 
++                                 False, forwarder, (XtPointer)this);
++            XtRemoveEventHandler(_toplevel, (KeyPressMask|KeyReleaseMask), 
++                                 False, forwarder, (XtPointer)this);
++            XtDestroyWidget(_form);
++    	    _form = 0;
++            XtDestroyWidget(_toplevel);
++	    _toplevel = 0;
++        }
+ 
+         if (_npp) {
+             ::free(_npp);   // matched with malloc() in newInstance
+@@ -806,7 +820,7 @@
+                     s->post( url, req.data, req.mime, req.notify, req.args );
+                 } else if (url.lower().startsWith("javascript:")){
+                     if (_callback) {
+-                        static int _jsrequestid = 0;
++                        static Q_INT32 _jsrequestid = 0;
+ 			_jsrequests.insert(_jsrequestid, new Request(req));
+                         _callback->evalJavaScript(_jsrequestid++, url.mid(11));
+                     } else {
+@@ -902,8 +916,7 @@
+    _timer->start( 100, true );
+ }
+ 
+-
+-int NSPluginInstance::setWindow(int remove)
++int NSPluginInstance::setWindow(Q_INT8 remove)
+ {
+    if (remove)
+    {
+@@ -926,14 +939,24 @@
+    _win.clipRect.bottom = _height;
+    _win.clipRect.right = _width;
+ 
+-   _win.window = (void*) XtWindow(_form);
+-   kdDebug(1431) << "Window ID = " << _win.window << endl;
++   if( _xembed_window ) {
++      _win.window = (void*) _xembed_window;
++      _win_info.type = NP_SETWINDOW;
++      _win_info.display = qt_xdisplay();
++      _win_info.visual = DefaultVisualOfScreen(DefaultScreenOfDisplay(qt_xdisplay()));
++      _win_info.colormap = DefaultColormapOfScreen(DefaultScreenOfDisplay(qt_xdisplay()));
++      _win_info.depth = DefaultDepthOfScreen(DefaultScreenOfDisplay(qt_xdisplay()));
++   } else {
++      _win.window = (void*) XtWindow(_form);
+ 
+-   _win_info.type = NP_SETWINDOW;
+-   _win_info.display = XtDisplay(_form);
+-   _win_info.visual = DefaultVisualOfScreen(XtScreen(_form));
+-   _win_info.colormap = DefaultColormapOfScreen(XtScreen(_form));
+-   _win_info.depth = DefaultDepthOfScreen(XtScreen(_form));
++      _win_info.type = NP_SETWINDOW;
++      _win_info.display = XtDisplay(_form);
++      _win_info.visual = DefaultVisualOfScreen(XtScreen(_form));
++      _win_info.colormap = DefaultColormapOfScreen(XtScreen(_form));
++      _win_info.depth = DefaultDepthOfScreen(XtScreen(_form));
++   }
 +
-+#define NewNPN_PopPopupsEnabledStateProc(FUNC)		\
-+		(NPN_PopPopupsEnabledStateUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PopPopupsEnabledStateProcInfo, GetCurrentArchitecture())
-+#define CallNPN_PopPopupsEnabledStateProc(FUNC, ARG1)		\
-+		(jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PopPopupsEnabledStateProcInfo, (ARG1))
++   kdDebug(1431) << "Window ID = " << _win.window << endl;
+ 
+    _win.ws_info = &_win_info;
+ 
+@@ -957,11 +980,8 @@
+ }
+ 
+ 
+-void NSPluginInstance::resizePlugin(int w, int h)
++void NSPluginInstance::resizePlugin(Q_INT32 w, Q_INT32 h)
+ {
+-   if (!_visible)
+-      return;
+-
+    if (w == _width && h == _height)
+       return;
+ 
+@@ -970,22 +990,30 @@
+    _width = w;
+    _height = h;
+ 
+-   XResizeWindow(qt_xdisplay(), XtWindow(_form), w, h);
+-   XResizeWindow(qt_xdisplay(), XtWindow(_toplevel), w, h);
+-
+-   Arg args[7];
+-   Cardinal nargs = 0;
+-   XtSetArg(args[nargs], XtNwidth, _width); nargs++;
+-   XtSetArg(args[nargs], XtNheight, _height); nargs++;
+-   XtSetArg(args[nargs], XtNvisual, QPaintDevice::x11AppVisual()); nargs++;
+-   XtSetArg(args[nargs], XtNdepth, QPaintDevice::x11AppDepth()); nargs++;
+-   XtSetArg(args[nargs], XtNcolormap, QPaintDevice::x11AppColormap()); nargs++;
+-   XtSetArg(args[nargs], XtNborderWidth, 0); nargs++;
+-
+-   XtSetValues(_toplevel, args, nargs);
+-   XtSetValues(_form, args, nargs);
+-
+-   resizeWidgets(XtWindow(_form), _width, _height);
++   if( _form != 0 ) {
++      XResizeWindow(qt_xdisplay(), XtWindow(_form), w, h);
++      XResizeWindow(qt_xdisplay(), XtWindow(_toplevel), w, h);
 +
-+#else
++      Arg args[7];
++      Cardinal nargs = 0;
++      XtSetArg(args[nargs], XtNwidth, _width); nargs++;
++      XtSetArg(args[nargs], XtNheight, _height); nargs++;
++      XtSetArg(args[nargs], XtNvisual, QPaintDevice::x11AppVisual()); nargs++;
++      XtSetArg(args[nargs], XtNdepth, QPaintDevice::x11AppDepth()); nargs++;
++      XtSetArg(args[nargs], XtNcolormap, QPaintDevice::x11AppColormap()); nargs++;
++      XtSetArg(args[nargs], XtNborderWidth, 0); nargs++;
++ 
++      XtSetValues(_toplevel, args, nargs);
++      XtSetValues(_form, args, nargs);
 +
-+typedef bool (* NP_LOADDS NPN_PopPopupsEnabledStateUPP)(NPP npp);
-+#define NewNPN_PopPopupsEnabledStateProc(FUNC)		\
-+		((NPN_PopPopupsEnabledStateUPP) (FUNC))
-+#define CallNPN_PopPopupsEnabledStateProc(FUNC, ARG1)		\
-+		(*(FUNC))((ARG1))
++      resizeWidgets(XtWindow(_form), _width, _height);
++   }
 +
-+#endif
++   // If not visible yet, displayWindow() will call setWindow() again anyway, so avoid this.
++   // This also handled plugins that are broken and cannot handle repeated setWindow() calls
++   // very well.
++   if (!_visible)
++      return;
+ 
+    setWindow();
+ 
+@@ -993,7 +1021,7 @@
+ }
+ 
+ 
+-void NSPluginInstance::javascriptResult(int id, QString result) {
++void NSPluginInstance::javascriptResult(Q_INT32 id, QString result) {
+     QMap<int, Request*>::iterator i = _jsrequests.find( id );
+     if (i != _jsrequests.end()) {
+         Request *req = i.data();
+@@ -1402,10 +1430,10 @@
+ }
+ 
+ 
+-DCOPRef NSPluginClass::newInstance( QString url, QString mimeType, bool embed,
++DCOPRef NSPluginClass::newInstance( QString url, QString mimeType, Q_INT8 embed,
+                                     QStringList argn, QStringList argv,
+                                     QString appId, QString callbackId,
+-                                    bool reload, bool doPost, QByteArray postData )
++                                    Q_INT8 reload, Q_INT8 doPost, QByteArray postData, Q_UINT32 xembed )
+ {
+    kdDebug(1431) << "-> NSPluginClass::NewInstance" << endl;
+ 
+@@ -1449,16 +1477,25 @@
+    memset(npp, 0, sizeof(NPP_t));
+    npp->ndata = NULL;
+ 
+-   // Create plugin instance object
+-   NSPluginInstance *inst = new NSPluginInstance( npp, &_pluginFuncs, _handle,
+-                                                  width, height, baseURL, mimeType,
+-                                                  appId, callbackId, embed, this );
+-
+    // create plugin instance
+    NPError error = _pluginFuncs.newp(mime, npp, embed ? NP_EMBED : NP_FULL,
+                                      argc, _argn, _argv, 0);
+    kdDebug(1431) << "NPP_New = " << (int)error << endl;
+ 
++   // don't use bool here, it can be 1 byte, but some plugins write it as int, and I can't find what the spec says
++   int wants_xembed = false;
++   if (_pluginFuncs.getvalue) {
++      NPError error = _pluginFuncs.getvalue(npp, (NPPVariable)14/*NPPVpluginNeedsXEmbed*/, &wants_xembed );
++      if( error != NPERR_NO_ERROR )
++         wants_xembed = false;
++   }
++   kdDebug(1431) << "Plugin requires XEmbed:" << (bool)wants_xembed << endl;
 +
++   // Create plugin instance object
++   NSPluginInstance *inst = new NSPluginInstance( npp, &_pluginFuncs, _handle,
++                                                  width, height, baseURL, mimeType,
++                                                  appId, callbackId, embed, wants_xembed ? xembed : 0, this );
 +
+    // free arrays with arguments
+    delete [] _argn;
+    delete [] _argv;
+@@ -1493,7 +1530,6 @@
+     timer(); //_timer->start( 0, TRUE );
+ }
  
- /******************************************************************************************
-  * The actual plugin function table definitions
-@@ -1117,6 +1693,27 @@ typedef struct _NPNetscapeFuncs {
-     NPN_InvalidateRectUPP invalidaterect;
-     NPN_InvalidateRegionUPP invalidateregion;
-     NPN_ForceRedrawUPP forceredraw;
-+    NPN_GetStringIdentifierUPP getstringidentifier;
-+    NPN_GetStringIdentifiersUPP getstringidentifiers;
-+    NPN_GetIntIdentifierUPP getintidentifier;
-+    NPN_IdentifierIsStringUPP identifierisstring;
-+    NPN_UTF8FromIdentifierUPP utf8fromidentifier;
-+    NPN_IntFromIdentifierUPP intfromidentifier;
-+    NPN_CreateObjectUPP createobject;
-+    NPN_RetainObjectUPP retainobject;
-+    NPN_ReleaseObjectUPP releaseobject;
-+    NPN_InvokeUPP invoke;
-+    NPN_InvokeDefaultUPP invokeDefault;
-+    NPN_EvaluateUPP evaluate;
-+    NPN_GetPropertyUPP getproperty;
-+    NPN_SetPropertyUPP setproperty;
-+    NPN_RemovePropertyUPP removeproperty;
-+    NPN_HasPropertyUPP hasproperty;
-+    NPN_HasMethodUPP hasmethod;
-+    NPN_ReleaseVariantValueUPP releasevariantvalue;
-+    NPN_SetExceptionUPP setexception;
-+    NPN_PushPopupsEnabledStateUPP pushpopupsenabledstate;
-+    NPN_PopPopupsEnabledStateUPP poppopupsenabledstate;
- } NPNetscapeFuncs;
+-
+ /****************************************************************************/
  
- #ifdef XP_MAC
-diff -up kdebase-3.5.8/nsplugins/sdk/prcpucfg.h.flash kdebase-3.5.8/nsplugins/sdk/prcpucfg.h
---- kdebase-3.5.8/nsplugins/sdk/prcpucfg.h.flash	2007-10-08 04:51:23.000000000 -0500
-+++ kdebase-3.5.8/nsplugins/sdk/prcpucfg.h	2007-12-14 11:30:19.000000000 -0600
-@@ -276,7 +276,7 @@
- #define PR_BYTES_PER_WORD_LOG2   2
- #define PR_BYTES_PER_DWORD_LOG2  3
+ NSPluginStreamBase::NSPluginStreamBase( NSPluginInstance *instance )
+@@ -1516,8 +1552,6 @@
  
--#elif defined(__sparc__)
-+#elif defined(__sparc__) || (defined(__SUNPRO_CC) && defined(__sparc))
+    delete _tempFile;
+    _tempFile = 0;
+-   delete _queue;
+-   _queue = 0;
+ }
  
- #undef	IS_LITTLE_ENDIAN
- #define	IS_BIG_ENDIAN 1
-@@ -321,7 +321,7 @@
- #define PR_BYTES_PER_WORD_LOG2   2
- #define PR_BYTES_PER_DWORD_LOG2  3
  
--#elif defined(__i386__)
-+#elif defined(__i386__) || (defined(__SUNPRO_CC) && defined(__i386))
+diff -urN kdebase-orig/nsplugins/viewer/nsplugin.h kdebase-3.5.8/nsplugins/viewer/nsplugin.h
+--- kdebase-orig/nsplugins/viewer/nsplugin.h	2007-10-08 11:51:23.000000000 +0200
++++ kdebase-3.5.8/nsplugins/viewer/nsplugin.h	2008-01-29 15:51:21.000000000 +0100
+@@ -165,16 +165,16 @@
+   // constructor, destructor
+   NSPluginInstance( NPP privateData, NPPluginFuncs *pluginFuncs, KLibrary *handle,
+ 		    int width, int height, QString src, QString mime,
+-                    QString appId, QString callbackId, bool embed,
++                    QString appId, QString callbackId, bool embed, WId xembed,
+ 		    QObject *parent, const char* name=0 );
+   ~NSPluginInstance();
  
- #define IS_LITTLE_ENDIAN 1
- #undef  IS_BIG_ENDIAN
-diff -up kdebase-3.5.8/nsplugins/nspluginloader.h.flash kdebase-3.5.8/nsplugins/nspluginloader.h
---- kdebase-3.5.8/nsplugins/nspluginloader.h.flash	2006-10-01 12:31:58.000000000 -0500
-+++ kdebase-3.5.8/nsplugins/nspluginloader.h	2007-12-14 11:30:19.000000000 -0600
-@@ -43,13 +43,16 @@ class KProcess;
- class QPushButton;
- class QGridLayout;
+   // DCOP functions
+   void shutdown();
+-  int winId() { return XtWindow(_form); }
+-  int setWindow(int remove=0);
+-  void resizePlugin(int w, int h);
+-  void javascriptResult(int id, QString result);
++  int winId() { return _form != 0 ? XtWindow(_form) : 0; }
++  int setWindow(Q_INT8 remove=0);
++  void resizePlugin(Q_INT32 w, Q_INT32 h);
++  void javascriptResult(Q_INT32 id, QString result);
+   void displayPlugin();
  
--class NSPluginInstance : public EMBEDCLASS, virtual public NSPluginInstanceIface_stub
-+class NSPluginInstance : public EMBEDCLASS
+   // value handling
+@@ -232,6 +232,7 @@
+   NPPluginFuncs _pluginFuncs;
+ 
+   Widget _area, _form, _toplevel;
++  WId _xembed_window;
+   QString _baseURL;
+   int _width, _height;
+ 
+@@ -278,10 +279,10 @@
+   ~NSPluginClass();
+ 
+   QString getMIMEDescription();
+-  DCOPRef newInstance(QString url, QString mimeType, bool embed,
++  DCOPRef newInstance(QString url, QString mimeType, Q_INT8 embed,
+                       QStringList argn, QStringList argv,
+-                      QString appId, QString callbackId, bool reload, bool post,
+-                      QByteArray postData );
++                      QString appId, QString callbackId, Q_INT8 reload, Q_INT8 post,
++                      QByteArray postData, Q_UINT32 xembed );
+   void destroyInstance( NSPluginInstance* inst );
+   bool error() { return _error; }
+ 
+diff -urN kdebase-orig/nsplugins/viewer/qxteventloop.cpp kdebase-3.5.8/nsplugins/viewer/qxteventloop.cpp
+--- kdebase-orig/nsplugins/viewer/qxteventloop.cpp	2007-05-14 09:55:42.000000000 +0200
++++ kdebase-3.5.8/nsplugins/viewer/qxteventloop.cpp	2008-01-29 15:51:21.000000000 +0100
+@@ -72,7 +72,7 @@
+ 
+     QIntDict<QSocketNotifier> socknotDict;
+     bool activate_timers;
+-    int timerid;
++    XtIntervalId timerid;
+ 
+     // arguments for Xt display initialization
+     const char* applicationClass;
+@@ -110,7 +110,7 @@
+ 
+ QXtEventLoopPrivate::QXtEventLoopPrivate()
+     : appContext(NULL), ownContext(NULL),
+-      activate_timers(FALSE), timerid(-1)
++      activate_timers(FALSE), timerid(0)
  {
-   Q_OBJECT
+ }
  
- public:
--    NSPluginInstance(QWidget *parent, const QCString& app, const QCString& id);
-+    NSPluginInstance(QWidget *parent);
-+    void init( const QCString& app, const QCString& obj );
-     ~NSPluginInstance();
-+public: // wrappers
-+    void javascriptResult( int id, QString result ) { stub->javascriptResult( id, result ); }
+@@ -416,7 +416,7 @@
+ void qmotif_timeout_handler( XtPointer, XtIntervalId * )
+ {
+     static_d->activate_timers = TRUE;
+-    static_d->timerid = -1;
++    static_d->timerid = 0;
+ }
  
- private slots:
-     void doLoadPlugin();
-@@ -62,6 +65,11 @@ protected:
-     bool shown;
-     QPushButton *_button;
-     QGridLayout *_layout;
-+    NSPluginInstanceIface_stub* stub;
-+private: // wrappers
-+    void displayPlugin() { stub->displayPlugin(); }
-+    void resizePlugin( int w, int h ) { stub->resizePlugin( w, h ); }
-+    void shutdown() { if( stub ) stub->shutdown(); }
- };
+ /*! \reimp
+@@ -429,10 +429,10 @@
+ 
+     // make sure we fire off Qt's timers
+     int ttw = timeToWait();
+-    if ( d->timerid != -1 ) {
++    if ( d->timerid != 0 ) {
+ 	XtRemoveTimeOut( d->timerid );
+     }
+-    d->timerid = -1;
++    d->timerid = 0;
+     if ( ttw != -1 ) {
+ 	d->timerid =
+ 	    XtAppAddTimeOut( d->appContext, ttw,
+diff -urN kdebase-orig/nsplugins/viewer/resolve.h kdebase-3.5.8/nsplugins/viewer/resolve.h
+--- kdebase-orig/nsplugins/viewer/resolve.h	2005-10-10 17:04:05.000000000 +0200
++++ kdebase-3.5.8/nsplugins/viewer/resolve.h	2008-01-29 15:51:21.000000000 +0100
+@@ -40,7 +40,7 @@
+ 
+ 
+ #define CHECK(fname,error)                    \
+-  kdDebug() << "Result of " << endl;          \
++  kdDebug() << "Result of " << #fname << ":" << error << endl;          \
+   return error;
+ 
+ 
+diff -urN kdebase-orig/nsplugins/viewer/viewer.cpp kdebase-3.5.8/nsplugins/viewer/viewer.cpp
+--- kdebase-orig/nsplugins/viewer/viewer.cpp	2006-01-19 18:01:49.000000000 +0100
++++ kdebase-3.5.8/nsplugins/viewer/viewer.cpp	2008-01-29 15:51:04.000000000 +0100
+@@ -52,8 +52,13 @@
+ #include <X11/Shell.h>
+ #else
+ #include "qxteventloop.h"
++#include "glibevents.h"
+ #endif
+ 
++// FIXME: this is just for calling gtk_init and fix the buggy flash player
++// initialization
++#include <gtk/gtkmain.h>
++
+ /**
+  *  Use RLIMIT_DATA on systems that don't define RLIMIT_AS,
+  *  such as FreeBSD 4.
+@@ -215,6 +220,10 @@
+ 
+ int main(int argc, char** argv)
+ {
++    // FIXME; the gtk_init() call is here to fix a bug in flash player that does
++    // not call it properly, or call it in a wrong place
++    gtk_init(&argc, &argv);
++
+     // nspluginviewer is a helper app, it shouldn't do session management at all
+    setenv( "SESSION_MANAGER", "", 1 );
  
+@@ -249,6 +258,7 @@
+ 
+    kdDebug(1430) << "4 - create KApplication" << endl;
+    KApplication app( argc,  argv, "nspluginviewer" );
++   GlibEvents glibevents;
+ #endif
  
+    {


Index: kdebase3.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kdebase3/devel/kdebase3.spec,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- kdebase3.spec	6 Feb 2008 12:16:07 -0000	1.35
+++ kdebase3.spec	9 Feb 2008 05:46:35 -0000	1.36
@@ -15,7 +15,7 @@
 %define _with_samba --with-samba
 
 Version: 3.5.8
-Release: 36%{?dist}
+Release: 37%{?dist}
 
 %if 0%{?fedora} > 8
 Name: kdebase3
@@ -318,12 +318,16 @@
 %patch202 -p4 -b .gtk212
 %patch203 -p0 -b .gcc43
 
+%patch1000 -p0 -b .CVE-2007-5963
+
 %if "%{name}" != "kdebase"
 # hacks to omit stuff that doesn't support DO_NOT_COMPILE
 sed -i -e 's|^FONTINST_SUBDIR=kfontinst|#FONTINST_SUBDIR=kfontinst|' -e 's/kicker//' -e 's/taskbar//' kcontrol/Makefile.am
 %endif
 
 # security fixes
+# KDM local DoS vulnerability, CVE-2007-5963
+Patch1000: post-3.5.8-kdebase-kdm.diff
 
 %if %redhatify
    cp %{SOURCE1} konsole
@@ -812,6 +816,11 @@
 
 
 %changelog
+* Sat Feb 09 2008 Kevin Kofler <Kevin at tigcc.ticalc.org> - 3.5.8-37
+- sync from F8:
+- kdm: local DoS vulnerability, CVE-2007-5963 (Than Ngo, 3.5.8-31.fc8)
+- updated flash patch to support 64 bit platforms (Lukáš Tinkl, 3.5.8-32.fc8)
+
 * Wed Feb 06 2008 Than Ngo <than at redhat.com> 3.5.8-36
 - f9+: remove %%{_bindir}/kcontrol %%{_datadir}/applications/kde/Kcontrol*
 - f9+: make kde3 config tools hidden




More information about the fedora-extras-commits mailing list