changeset 2062:d03d62c2ed36

more xembed porting
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Fri, 27 May 2011 22:41:54 +0200
parents 012f9f3a05f8
children 93b03ac0add6
files src/xembed.cc
diffstat 1 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/xembed.cc	Thu Jan 01 01:05:39 1970 +0100
+++ b/src/xembed.cc	Fri May 27 22:41:54 2011 +0200
@@ -77,7 +77,7 @@
    return Fl_Window::handle(e);
 }
 
-static int event_handler(int e) {
+static int event_handler(int e, Fl_Window *w) {
    Atom xembed_atom = XInternAtom (fl_display, "_XEMBED", false);
 
    if (fl_xevent->type == ClientMessage) {
@@ -88,10 +88,8 @@
             case XEMBED_WINDOW_ACTIVATE:
                // Force a ConfigureNotify message so fltk can get the new
                // coordinates after a move of the embedder window.
-#if 0
-PORT1.3
-               w->resize(0, 0, w->w(), w->h());
-#endif
+               if (w)
+                  w->resize(0,0, w->w(), w->h());
                break;
             case XEMBED_WINDOW_DEACTIVATE:
                break;
@@ -101,7 +99,7 @@
       }
    }
 
-   return 0;
+   return Fl::handle_(e, w);
 }
 
 // TODO: Implement more XEMBED support;
@@ -109,7 +107,7 @@
 void Xembed::show() {
    createInternal(xid);
    setXembedInfo(1);
-   Fl::add_handler(event_handler);
+   Fl::event_dispatch(event_handler);
 }
 
 void Xembed::createInternal(uint32_t parent) {