bugGnash - The GNU Flash player - Bugs: bug #22104, Won't build for KDE4 / Qt4

 
 

bug #22104: Won't build for KDE4 / Qt4

Submitter:  Benjamin Wolsey <bwy>
Submitted:  Thu 24 Jan 2008 11:57:58 AM UTC
   
 
Category:  gui-kde3 Severity:  3 - Normal
Release:  None Status:  Fixed
Privacy:  Public Assigned to:  bwy
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 13 Nov 2008 11:42:58 PM UTC, comment #26: 

Ah nevermind, it turns out I was missing this portion of code which is in the kde4 branch, but not the 0.8.4 release:
http://cvs.fedoraproject.org/viewvc/rpms/gnash/devel/gnash-0.8.4-fix-kde4-port-2.patch?revision=1.1&view=markup
(This patch is 100% code from the upstream kde4 branch, I only rediffed the patch.)

So now I can confirm the port is working. :-) Thanks a lot!

Kevin Kofler <kevinkofler>
Thu 13 Nov 2008 09:06:07 PM UTC, comment #25: 

Bero, what did you test this with? I still can't get this to display anything in Konqueror 4.1.2 (using 0.8.4 with gnash-port-to-kde4.patch, gnash-kde4-no-excessive-linkage.patch, gnash-kde4-x11embed.patch and gnash-kde4-x11embed-resize.patch, plus a one-line patch I wrote because the KPart was failing to load otherwise (see comment #11) - except for that one-line patch, the code of klash4 and KdeGui.{cpp,h} in the patched build I tested is identical to the current head of the kde4 branch). So I can't confirm the "now that it works" part at all.

Kevin Kofler <kevinkofler>
Thu 13 Nov 2008 05:44:30 PM UTC, comment #24: 

Nice, but for now it isn't gonna happen. This initial shot at fixing the config is to build one or the other, cleanly. Then maybe later I can see about building both. But yes, the executables should be renamed. While hacking on this, I figure it's a good time as any to clean up things so we only have *_kde3 or *_kde4 variables, conditionals, defines, etc... I think it's safe to drop the remnants of QT2 support now.

Rob Savoye <rsavoye>
Group administrator
Thu 13 Nov 2008 05:01:39 PM UTC, comment #23: 

I think it'd be very nice to have the possibility to build both kde3 and kde4 when both libs are available.
Beside, shouldn't these be called qt3-gnash and qt4-gnash ?

Sandro Santilli <strk>
Group Member
Thu 13 Nov 2008 04:33:09 PM UTC, comment #22: 

That's an easy config fix, I'll go look into making sure HAVE_KDE$ gets defined. I think the way it works now for --enable-gui= was to only take 'kde' as the value instead of kde4. Then the config code defaulted to kde3 if both were found, since that's the only thing that worked. I can make it work that way, with either 'kde3' or 'kde4' if that's the desired functionality. (as our autotools hacker)

Rob Savoye <rsavoye>
Group administrator
Thu 13 Nov 2008 04:21:17 PM UTC, comment #21: 

Thanks for the patches. They've been applied in kde4 branch.

--enable-gui=kde gives the error:

configure: error: conditional "WITH_KDE4" was never defined.
Usually this means the macro was only invoked conditionally.

And --enable-gui=kde4 fails to find my include path for Qt headers.
In fact, I have the line "-Ino/include -Ino/include/QtCore -Ino/include/QtGui".

This may not be an obstacle to moving into trunk because it's a new feature (though I hope someone who can handle autoconf can fix it), but it has to build with kde only.

Benjamin Wolsey <bwy>
Group Member
Thu 13 Nov 2008 08:04:25 AM UTC, comment #20: 

Yes, apply 16823, 16824, 16825 and 16826 in that order.

They're against the kde4 branch - bzr branch http://bzr.savannah.gnu.org/r/gnash/kde4/

Btw, I really think this should move to trunk now that it works...

Bernhard Rosenkraenzer <bero>
Thu 13 Nov 2008 02:27:16 AM UTC, comment #19: 

To confirm,
we have to apply patch 16823, 16824, 16825, and then 16826 for this to work.

Is this against trunk or the last stable version?

BTW, thanks for all the progress.

David Broome <jackiebrown>
Tue 11 Nov 2008 09:21:20 AM UTC, comment #18: 

Attaching another patch to fix my last issue - it was caused by the width/height being out of sync with the embed container's idea of width and height.

(file #16826)

Bernhard Rosenkraenzer <bero>
Tue 11 Nov 2008 08:31:48 AM UTC, comment #17: 

After applying my latest set of patches (16823, 16824, 16825), it is almost usable here -- last remaining problem: when kde4-gnash is embedded into a different application using -x, it only draws the upper-left area of the animation (usually about 3/4 of the animation is visible).

Specifying --width and --height on the command line doesn't fix it (in fact it makes it worse).

Any ideas about this?

Bernhard Rosenkraenzer <bero>
Thu 09 Oct 2008 08:29:47 AM UTC, comment #16: 

It doesn't work yet (that's why I said it's preliminary) - it's just a port of klash to the KDE4 API that needs some more tweaks before it starts working (most of all, it needs xembed bits in the gui part).

Bernhard Rosenkraenzer <bero>
Thu 09 Oct 2008 08:06:00 AM UTC, comment #15: 

I've committed the patch to the kde4 branch:

http://bzr.savannah.gnu.org/r/gnash/kde4

The patch didn't apply that cleanly for some reason, so I hope everything is correct.

I haven't looked at the klash4 code at all. Whether or not it works, it's good that the code is there to work on.

There was never any support for the XEmbed process in the new kde4 gui. It isn't difficult to add.

I can't say why the patch doesn't work with 0.8.3. I can only suggest building the branch (I merged from trunk yesterday, which is in pre-release testing) and if it still doesn't work we can fix it.

Benjamin Wolsey <bwy>
Group Member
Thu 09 Oct 2008 06:16:07 AM UTC, comment #14: 

I've neither tested nor backported it yet.

Benjamin Wolsey <bwy>
Group Member
Thu 09 Oct 2008 02:33:22 AM UTC, comment #13: 

Sorry, I should have mentioned that I'm using a version of the patch I backported to the 0.8.3 release:
http://cvs.fedoraproject.org/viewvc/rpms/gnash/devel/gnash-0.8.3-port-to-kde4.patch?view=log
so I can't exclude that some of the bugs are due to the backport.

Using the KDE 4 KPart (with the one-line fix from comment #11) with the KDE 3 kde-gnash executable mostly works, by the way. (It sometimes fails to show the graphics/video through XEmbed, but that's not clearly reproducible, thus the "mostly".)

Kevin Kofler <kevinkofler>
Thu 09 Oct 2008 12:55:23 AM UTC, comment #12: 

For the KPart, something like this code (from your gui/kde.cpp):
#ifdef HAVE_KDE
    if (_xid) {
        QXEmbed::initialize();
        QXEmbed::embedClientIntoWindow(_qwidget.get(), _xid);
    }
#endif
is also needed in your gui/Kde4Gui.cpp.

This still doesn't explain why the standalone app does not display anything though.

Kevin Kofler <kevinkofler>
Thu 09 Oct 2008 12:49:08 AM UTC, comment #11: 

Have you actually tested this port?

1. You have to replace this FIMXE in plugin/klash4/klash_part.cpp:
-    // FIXME what is the right replacement for this? setInstance (KlashFactory::instance (), true);
by this actual implementation:
+    setComponentData (*KlashFactory::instance ());

or the KPart will fail with:
No such XML file:  "klashpartui.rc".

2. Even with that, I still can't get kde4-gnash to play any SWF without locking up (and yes, the GTK+ gnash works on at least one of them, haven't tried the others), which manifests itself as the KPart not showing anything when using the KPart.

Kevin Kofler <kevinkofler>
Wed 08 Oct 2008 05:57:52 PM UTC, comment #10: 

Thanks for this. I'll backport it to the kde4 branch soon, and migrate everything to trunk once the release is done.

Benjamin Wolsey <bwy>
Group Member
Wed 08 Oct 2008 04:19:18 PM UTC, comment #9: 

Your patch adds a unused klash.desktop which is not installed and which refers to kmplayer instead of klash, you probably want to remove that.

Kevin Kofler <kevinkofler>
Wed 08 Oct 2008 11:57:09 AM UTC, comment #8: 

I've attached a patch relative to gnash trunk (gnash-port-to-kde4.patch) that:

- Copies the KDE4 gui/ bits from kde4 branch
- Autoconfiscates them
- Adds a preliminary KDE4 KPart

Bernhard Rosenkraenzer <bero>
Mon 06 Oct 2008 07:32:35 PM UTC, comment #7: 

Wosley,
Has this been merged into trunk?  (I don't see it but am wondering if I am missing a flag?)

David Broome <jackiebrown>
Fri 05 Sep 2008 06:16:20 PM UTC, comment #6: 

I've got a basic kde4 GUI going. It should be usable by next week, but needs autoconf support before it can be added to Gnash.

It will be a completely separate GUI from the kde/qt3 one, because the differences make too many ifdefs necessary.

Benjamin Wolsey <bwy>
Group Member
Sun 20 Jul 2008 12:49:32 AM UTC, comment #5: 

Is nobody interested in getting this finalized? Lack of KDE 4 support means Klash doesn't work at all in Fedora 9 (nor Rawhide, i.e. what will become Fedora 10), and other major distributions are also going to move to shipping KDE 4 only (e.g. Kubuntu plans it for their 8.10 version "Intrepid Ibex").

Kevin Kofler <kevinkofler>
Mon 10 Mar 2008 02:06:29 PM UTC, comment #4: 

Thanks for the comments!

My patch was a reference for what needs to be done, rather than a serious attempt at adapting to KDE4. We'd be grateful for a proper patch that didn't break Qt3 support. As far as I remember it was only the paint event handling code that needs more than minor adaptation.

Before anything can be built easily the kde and qt m4 macros need attention, but just looking at m4 macros fills me with horror. Qt4 seems to be a particular problem too, as distros put it in all sorts of different places to avoid conflicts with Qt3.

Benjamin Wolsey <bwy>
Group Member
Sat 08 Mar 2008 05:46:45 PM UTC, comment #3: 

Oh and this is invalid:
#  define QWidget::StrongFocus Qt::StrongFocus
you have to #ifdef the use instead, or use something like:
#  define StrongFocus Qt::StrongFocus
for Qt 4 and:
#  define StrongFocus QWidget::StrongFocus
for Qt 3.

Kevin Kofler <kevinkofler>
Sat 08 Mar 2008 05:42:21 PM UTC, comment #2: 




Grrr, that comment was mangled by markup. Let's try again:
> I think QApplication tries to use argv after it goes out of scope.

argc actually. (The data pointed to by argv too, but that one can't change anyway.) It's explicitly passed by reference!

The Qt 4 documentation also says:
Warning: The data pointed to by argc and argv must stay valid for the entire lifetime of the QApplication object.

The correct fix is to change the KdeGui::init prototype to:
KdeGui::init(int &argc, char **argv[])
(note the reference)

I also don't understand the hackery with argv, normally argv should be either a char ** or a char *[] (those are handled exactly the same way in function prototypes), not a char **[] (which is a char ***), i.e. the code would become:
KdeGui::init(int &argc, char **argv)
{
// GNASH_REPORT_FUNCTION;
_qapp.reset(new QApplication(argc, argv));
but that could require changes elsewhere in Gnash too.

Kevin Kofler <kevinkofler>
Sat 08 Mar 2008 05:39:26 PM UTC, comment #1: 


> I think QApplication tries to use argv after it goes out of scope.


argc actually. (The data pointed to by argv too, but that one can't change anyway.) It's explicitly passed by reference!

The Qt 4 documentation also says:
Warning: The data pointed to by argc and argv must stay valid for the entire lifetime of the QApplication object.

The correct fix is to change the KdeGui::init prototype to:
KdeGui::init(int &argc, char **argv[])
(note the reference)

I also don't understand the hackery with argv, normally argv should be either a char * or a char [] (those are handled exactly the same way in function prototypes), not a char *[] (which is a char **), i.e. the code would become:
KdeGui::init(int &argc, char **argv)
{
//    GNASH_REPORT_FUNCTION;
    _qapp.reset(new QApplication(argc, argv));
but that could require changes elsewhere in Gnash too.

Kevin Kofler <kevinkofler>
Thu 24 Jan 2008 11:57:58 AM UTC, original submission:  

I'm trying to get gnash to build with KDE and Qt4, and have encountered the following problems.

1. In qt.m4: even when you specify --with-qt-incl the macro uses the environment variable QTDIR to decide the Qt version, so fails to find the qobject.h header (in /usr/lib/qt4/include). And the version is wrong.

2. It needs CXXFLAGS -I/usr/lib/qt4/include/Qt -L/usr/lib/qt4/lib64/ (or whatever... the point is they aren't passed to the compiler properly).

3. A number of class / object names have changed.

For KDE4:

1. The main header file is kapplication.h, not kapp.h. If I tell it where to look for the includes and libs it's fine.

(replace kapp.h with kapplication.h in macros/kde.m4)

Apply the attached patch to the gui files (it uses ifdefs, but probably breaks the KDE3 build anyway).

The code is nowhere near correct; paint event handling has changed for qt4 and needs some rewriting. Calling "_qapp.reset(new QApplication(argc, *argv));" results in a segfault. I think QApplication tries to use argv after it goes out of scope. But I can get it to run (very slowly because of the terrible paint event hack).

export QTDIR=/usr/lib/qt4/lib64

./autogen.sh

CXXFLAGS=-I/usr/lib/qt4/include/Qt LDFLAGS=-L/usr/lib/qt4/lib64/ LIBS="-lQtCore -lQtGui -lQt3Support" ./configure --enable-renderer=agg --enable-media=gst --enable-gui=gtk,kde --with-kde-incl=/opt/kde4/include/ --with-kde-lib=/opt/kde4/lib64


Benjamin Wolsey <bwy>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #16826:  gnash-kde4-x11embed-resize.patch added by bero (1KiB - text/x-patch - XEmbed resizing patch)
file #16825:  gnash-kde4-x11embed.patch added by bero (1KiB - text/x-patch - This patch adds XEmbed support so kde4-gnash can be used in browser plugins and the likes)
file #16824:  gnash-kde4-codeduplication.patch added by bero (5KiB - text/x-patch - Kde4Gui.h contains the same definitions twice (merge error?). This patch removes the superfluous bits)
file #16823:  gnash-kde4-no-excessive-linkage.patch added by bero (646B - text/x-patch - Currently kde4-gnash (from kde4 branch) links against various KDE libraries, but only needs Qt -- this patch removes the superfluous linkage)
file #16628:  gnash-port-to-kde4.patch added by bero (92KiB - text/x-patch - Update to patch 16627 with some automake fixes)
file #16627:  gnash-port-to-kde4.patch added by bero (92KiB - text/x-patch - Patch -- adds KDE4 GUI, autoconf stuff, KPart)
file #14863:  kde4.patch added by bwy (4KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by strk (Posted a comment)
  • -email is unavailable- added by rsavoye (Posted a comment)
  • -email is unavailable- added by saknopper
  • -email is unavailable- added by bero (Updated the item)
  • -email is unavailable- added by jackiebrown (Posted a comment)
  • -email is unavailable- added by kevinkofler (Posted a comment)
  • -email is unavailable- added by bwy (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 13 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-01-04 bwy StatusIn Progress Fixed
        PrivacyPublic Public
        Open/ClosedOpen Closed
    2008-11-11 bero Attached File- Added gnash-kde4-x11embed-resize.patch, #16826
    2008-11-11 bero Attached File- Added gnash-kde4-x11embed.patch, #16825
    2008-11-11 bero Attached File- Added gnash-kde4-codeduplication.patch, #16824
    2008-11-11 bero Attached File- Added gnash-kde4-no-excessive-linkage.patch, #16823
    2008-10-21 saknopper Carbon-Copy- Added saknopper
    2008-10-08 bero Attached File- Added gnash-port-to-kde4.patch, #16628
    2008-10-08 bero Attached File- Added gnash-port-to-kde4.patch, #16627
    2008-09-05 bwy StatusNone In Progress
        Assigned toNone bwy
    2008-01-24 bwy Attached File- Added kde4.patch, #14863

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code