changeset 1110:b76606e867fe

add missing xembed files
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Mon, 18 May 2009 23:11:41 +0200
parents 39febe63d2c9
children 9845cc109124
files src/xembed.cc src/xembed.hh
diffstat 2 files changed, 32 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/xembed.cc	Mon May 18 23:11:41 2009 +0200
@@ -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
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/xembed.hh	Mon May 18 23:11:41 2009 +0200
@@ -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