The Konqueror plugin with OpenGL renderer has problems with the scaling of the movies. Small movies are rendered at a too large size so that only a stretched portion of the movie shows in the Flash window in the browser. One consequence of this is that it is difficult to click on buttons because they are rendered to beside the actual clickable area. The same movies work fine in the standalone player so this is somehow caused by the embedding of the plugin window to the browser.

The attached patch simplifies the embedding of the plugin window a bit. As a side result it also fixes the scaling problem described above. Previously KlashPart created an X window in a QXEmbed object and embedded the gnash into the X window. This patch embeds gnash straight into the QXEmbed widget skipping the creation of the X window altogether.

I'm not completely sure what causes the wrong scaling and why this patch fixes it but because it does and because it simplifies the code I think it should be applied.

Antti

? README.amf
? build-stamp
? debian
? gui/klash.moc
? libltdl/COPYING.LIB
? libltdl/Makefile
? libltdl/Makefile.am
? libltdl/Makefile.in
? libltdl/README
? libltdl/acinclude.m4
? libltdl/aclocal.m4
? libltdl/config-h.in
? libltdl/config.guess
? libltdl/config.h
? libltdl/config.log
? libltdl/config.status
? libltdl/config.sub
? libltdl/configure
? libltdl/configure.ac
? libltdl/install-sh
? libltdl/libtool
? libltdl/ltdl.c
? libltdl/ltdl.h
? libltdl/ltmain.sh
? libltdl/missing
? libltdl/stamp-h1
Index: gui/kde.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/kde.cpp,v
retrieving revision 1.8
diff -u -r1.8 kde.cpp
--- gui/kde.cpp	17 Jan 2007 12:16:28 -0000	1.8
+++ gui/kde.cpp	18 Mar 2007 12:39:46 -0000
@@ -27,6 +27,7 @@
 #include <qwidget.h>
 #include <qmessagebox.h>
 #include <qcursor.h>
+#include <qxembed.h>
 
 #include "gnash.h"
 #include "movie_definition.h" 
@@ -67,7 +68,11 @@
 KdeGui::init(int argc, char **argv[])
 {
     _qapp = new QApplication(argc, *argv);
-    _qwidget = new qwidget(_xid, this); 
+    _qwidget = new qwidget(this); 
+    if (_xid != 0) {
+        QXEmbed::initialize();
+        QXEmbed::embedClientIntoWindow(_qwidget, _xid);
+    }
 
 //    GNASH_REPORT_FUNCTION;
     _glue.init (argc, argv);
@@ -238,11 +243,9 @@
     _godfather->notify_mouse_moved(position.x(), position.y());
 }
 
-qwidget::qwidget(WId embed, KdeGui* godfather)
+qwidget::qwidget(KdeGui* godfather)
   : QGLWidget(0, "hi")
 {
-    create (embed);
-
     _qmenu.insertItem("Play Movie", this, SLOT(menuitem_play_callback()));
     _qmenu.insertItem("Pause Movie", this, SLOT(menuitem_pause_callback()));
     _qmenu.insertItem("Stop Movie", this, SLOT(menuitem_stop_callback()));
Index: gui/kdesup.h
===================================================================
RCS file: /sources/gnash/gnash/gui/kdesup.h,v
retrieving revision 1.11
diff -u -r1.11 kdesup.h
--- gui/kdesup.h	17 Jan 2007 12:16:28 -0000	1.11
+++ gui/kdesup.h	18 Mar 2007 12:39:46 -0000
@@ -63,7 +63,7 @@
 {
     Q_OBJECT
 public:
-    qwidget(WId embed, KdeGui* godfather);
+    qwidget(KdeGui* godfather);
     void setInterval(unsigned int interval);
 protected:
     void contextMenuEvent(QContextMenuEvent *event);
Index: plugin/klash/klash_part.cpp
===================================================================
RCS file: /sources/gnash/gnash/plugin/klash/klash_part.cpp,v
retrieving revision 1.10
diff -u -r1.10 klash_part.cpp
--- plugin/klash/klash_part.cpp	1 Feb 2007 18:46:58 -0000	1.10
+++ plugin/klash/klash_part.cpp	18 Mar 2007 12:39:46 -0000
@@ -536,12 +536,7 @@
 #undef Unsorted
 #undef Bool
 
-KlashEmbed::KlashEmbed (KlashView * view) : QXEmbed (view), m_view (view) {
-    setProtocol (QXEmbed::XPLAIN);
-    int scr = DefaultScreen (qt_xdisplay ());
-    embed (XCreateSimpleWindow (qt_xdisplay(), view->winId (), 0, 0, width(), height(), 1, BlackPixel (qt_xdisplay(), scr), BlackPixel (qt_xdisplay(), scr)));
-    XClearWindow (qt_xdisplay(), embeddedWinId ());
-}
+KlashEmbed::KlashEmbed (KlashView * view) : QXEmbed (view), m_view (view) {}
 
 KlashEmbed::~KlashEmbed () {}
 
@@ -557,7 +552,7 @@
 }
 
 WId KlashView::embedId () {
-    return m_embed->embeddedWinId ();
+    return m_embed->winId ();
 }
 
 #include "klash_part.moc"
_______________________________________________
Gnash-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnash-dev

Reply via email to