diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-05-18 23:11:41 +0200 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-05-18 23:11:41 +0200 |
commit | 687de724066bc9be42c191fde36924f051b30304 (patch) | |
tree | 0a00d08d08bd38b7b58429b6214c56fd79ce1c6b | |
parent | 2ea9718c0a3297ff91c1219b3e011a8a3367461f (diff) |
add missing xembed files
-rw-r--r-- | src/xembed.cc | 20 | ||||
-rw-r--r-- | src/xembed.hh | 12 |
2 files changed, 32 insertions, 0 deletions
diff --git a/src/xembed.cc b/src/xembed.cc new file mode 100644 index 00000000..92be330a --- /dev/null +++ b/src/xembed.cc @@ -0,0 +1,20 @@ +#include <fltk/Window.h> +#include <fltk/x11.h> +#include <fltk/x.h> + +#include "xembed.hh" + +using namespace fltk; +// TODO; Implement proper XEMBED support; +// http://standards.freedesktop.org/xembed-spec/xembed-spec-latest.html +void Xembed::embed (unsigned long xid) { +#if USE_X11 + fltk::Widget *r = resizable(); + // WORKAROUND: Avoid jumping windows with tiling window managers (e.g. dwm) + resizable(NULL); + fltk::Window::show(); + fltk::Widget::hide(); + resizable(r); + XReparentWindow (fltk::xdisplay, fltk::xid(this), xid, 0, 0); +#endif +} diff --git a/src/xembed.hh b/src/xembed.hh new file mode 100644 index 00000000..06bd599c --- /dev/null +++ b/src/xembed.hh @@ -0,0 +1,12 @@ +#ifndef __XIDWINDOW_HH__ +#define __XIDWINDOW_HH__ + +#include <fltk/Window.h> + +class Xembed : public fltk::Window { + public: + Xembed(int _w, int _h) : fltk::Window(_w, _h) {}; + void embed(unsigned long xid); +}; + +#endif |