[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    More on focus issues of a QXEmbed window
From:       Koos Vriezen <koos.vriezen () xs4all ! nl>
Date:       2002-07-21 21:04:19
[Download RAW message or body]

Hi,

There are still focus problems when having two or more applets with form
elements. The focus seems to stay in one of the applets, if an applet
gets the focus.

I've attached a patch with fixes it for java. It sends a
XFocusInEvent/XFocusOutEvent to the embedded window if the QXEmbed widget
gets/looses the focus.

Tested it with two 'Application launcher' applets in kicker. No problem
here.

Tested with two flash objects with form elements. These had problems and
now still have :(. Focus still seems to follow the mouse and
problems getting focus after deactivating/activating the browser.

Regards,

Koos Vriezen

["qxembed-focus2.diff" (TEXT/PLAIN)]

Index: kdeui/qxembed.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/qxembed.cpp,v
retrieving revision 1.30
diff -u -3 -p -r1.30 qxembed.cpp
--- kdeui/qxembed.cpp	2002/07/17 18:02:39	1.30
+++ kdeui/qxembed.cpp	2002/07/21 21:03:23
@@ -599,6 +599,9 @@ void QXEmbed::focusInEvent( QFocusEvent 
 void QXEmbed::focusOutEvent( QFocusEvent * ){
     if (!window)
         return;
+    XFocusInEvent outev = { XFocusOut, 0, TRUE, qt_xdisplay(), window, 
+                            NotifyNormal, NotifyPointer };
+    XSendEvent(qt_xdisplay(), window, TRUE, FocusChangeMask, (XEvent*) &outev);
     send_xembed_message( window, XEMBED_FOCUS_OUT );
 }
 
@@ -745,12 +748,15 @@ bool QXEmbed::x11Event( XEvent* e)
             embed( window );
         }
         break;
-    case ButtonPress:
+    case ButtonPress: {
+        XFocusInEvent inev = { XFocusIn, 0, TRUE, qt_xdisplay(), \
e->xbutton.subwindow, NotifyNormal, NotifyPointer }; +        \
XSendEvent(qt_xdisplay(), e->xbutton.subwindow, TRUE, FocusChangeMask, (XEvent*) \
&inev);  QFocusEvent::setReason( QFocusEvent::Mouse );
         setFocus();
         QFocusEvent::resetReason();
         XAllowEvents(qt_xdisplay(), ReplayPointer, CurrentTime);
         return TRUE;
+    }
     case ButtonRelease:
         XAllowEvents(qt_xdisplay(), SyncPointer, CurrentTime);
         break;



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic