Embedding multible java applets and focus problems

Leon Bottou leon at bottou.org
Mon Oct 13 19:45:43 BST 2003


>  I'd rather go with
> + if( topLevelWidget()->isActive())
>  as that's safer.

You mean isActiveWindow() ?
The doc of isActiveWindow() says 
    "When popup windows are visible, this property is
     TRUE for both the active window \e and for the popup."
So maybe the right test is 
+  if ( topLevelWidget() == qApp->activeWindow() )
which is closer to the X11 reality...

> > Of course, the correct fix would be to have Qt handle the focusProxy ...
>  If that's the correct fix, why not to do it that way then?  

That was not an option for me when I wrote these XPLAIN / XEMBED patches.
That would be a nasty patch into the innards of both Qt and KDE.
Difficult to take a patch like this from an occasional contributor like me.
Especially when we consider compatibility issues when linking
with earlier versions of Qt. 

>  Qt seems to  have some support for being embedded already anyway. 

Just a flag as I can tell.  
Most likely arranged by Matthias Ettrich
when he first wrote the first version.

> I'm just not sure about the timeframe, now
> that we're close to 3.2, and Qt X11 guys have few tough patches in their
> queue from me already.

:-).

> I actually meant comments in code, I just cited the cvs log message
> because in the commit there way no comment at all. And you have to admit
> setting focus back on focus out events looks weird. X11 related code can be
> a complicated thing even when commented.

You are right
Properly commenting QXEmbed would be a nice challenge.
We could start by giving some pointers :-)

*** qxembed.cpp.~1.44.~	2003-09-25 14:16:54.000000000 -0400
--- qxembed.cpp	2003-10-13 14:32:41.000000000 -0400
***************
*** 51,56 ****
--- 51,76 ----
  
  #include "qxembed.h"
  
+ /* WARNING: 
+    Breaking QXEmbed breaks most of KDE.
+    To make things worse, QXEmbed is a very 
+    intricate code with inadequate comments.
+ 
+    Suggested readings:
+
+    - Xlib Reference Manual and X11 ICCCM Manual  
+         (everything about focus, reparenting, window management)
+    - XEMBED specification: 
+        <http://www.freedesktop.org/Standards/xembed-spec>
+    - XPLAIN and XEMBED:
+        <http://lists.kde.org/?w=2&r=1&s=qxembed+variants&q=t>
+    - Community knowledge:
+        <http://lists.kde.org/?w=2&r=1&s=qxembed&q=t>
+        <http://lists.kde.org/?l=kde-devel&w=2&r=1&s=qxembed&q=b>
+        <http://lists.kde.org/?l=kfm-devel&w=2&r=1&s=qxembed&q=b>
+ */
+ 
  #ifndef XK_ISO_Left_Tab
  #define XK_ISO_Left_Tab                                 0xFE20
  #endif



More information about the kfm-devel mailing list