Hi, I test xembed support with the claws mail dillo plugin[1] and tabbed[2]. My guess is that the embedder needs to send some X events to the embedded program (dillo in this case) to make it work properly. Even with your patch dillo doesn't resize properly for me when I change the embedding window. I would look into the tabbed source code[2], which is pretty minimal. Cheers, Johannes [1] http://www.claws-mail.org/plugin.php?plugin=dillo [2] http://tools.suckless.org/tabbed/ On Mon, Dec 10, 2012 at 02:12:34PM +0100, podarcis wrote:
Hi all,
Here is a patch to make embedding dillo into an X-window work.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff -r 9bad41ea1dde src/xembed.cc --- a/src/xembed.cc Wed Dec 05 13:03:04 2012 +0100 +++ b/src/xembed.cc Sun Dec 09 10:12:36 2012 +0100 // TODO: Implement more XEMBED support;
-void Xembed::show() { +void Xembed::create() { createInternal(xid); setXembedInfo(1); Fl::event_dispatch(event_handler); diff -r 9bad41ea1dde src/xembed.hh --- a/src/xembed.hh Wed Dec 05 13:03:04 2012 +0100 +++ b/src/xembed.hh Sun Dec 09 10:12:36 2012 +0100 @@ -14,10 +14,11 @@
public: Xembed(uint32_t xid, int _w, int _h) : Fl_Window(_w, _h) { - this->xid = xid; + this->xid = xid; create(); }; - void show(); + void create(); int handle(int event); + void resize(int x, int y, int w, int h); };
#endif ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tested with this FLTK program:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include <FL/Fl.H> #include <FL/Fl_Window.H> #include <FL/x.H> #include <cstdio> #include <iostream> #include <sstream> #include <string>
using namespace std;
int main( int argc_, char *argv_[] ) { Fl_Window dw( 800, 600, "dillo embedded" ); dw.resizable( &dw ); dw.show(); cout << "dw.xid = " << (unsigned long)fl_xid(&dw) << endl; ostringstream cmd; cmd << "dillo -f -g " << dw.w() << "x" << dw.h() << " --xid " << (unsigned long)fl_xid(&dw); if ( argc_ > 1 ) cmd << " " << argv_[1]; cmd << " &"; cout << "system '" << cmd.str() << "'" << endl; system( cmd.str().c_str() ); return Fl::run(); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
What does NOT work is automatic resizing of the embedded dillo window, when the size is changed. This would be nice to have.
I do not know enough of the embedding stuff, but I wonder if the static int event_handler() ever gets called with type ClientMessage - at least I could not make it get there..
podarcis
_______________________________________________ Dillo-dev mailing list Dillo-dev at dillo.org http://lists.auriga.wearlab.de/cgi-bin/mailman/listinfo/dillo-dev