@ -319,11 +319,7 @@ bool QXEmbedAppFilter::eventFilter( TQObject *o, TQEvent * e)
// Variable `obeyFocus' suggests that this is the result of mouse
// Variable `obeyFocus' suggests that this is the result of mouse
// activity in the client. The XEMBED_REQUEST_FOCUS message causes
// activity in the client. The XEMBED_REQUEST_FOCUS message causes
// the embedding widget to take the Qt focus (L2085).
// the embedding widget to take the Qt focus (L2085).
# ifdef USE_QT4
WId window = ( ( QPublicWidget * ) tqApp - > focusWidget ( ) - > topLevelWidget ( ) ) - > effectiveWinId ( ) ;
# else // USE_QT4
WId window = ( ( QPublicWidget * ) tqApp - > focusWidget ( ) - > topLevelWidget ( ) ) - > topData ( ) - > parentWinId ;
WId window = ( ( QPublicWidget * ) tqApp - > focusWidget ( ) - > topLevelWidget ( ) ) - > topData ( ) - > parentWinId ;
# endif // USE_QT4
focusMap - > remove ( tqApp - > focusWidget ( ) - > topLevelWidget ( ) ) ;
focusMap - > remove ( tqApp - > focusWidget ( ) - > topLevelWidget ( ) ) ;
sendXEmbedMessage ( window , XEMBED_REQUEST_FOCUS ) ;
sendXEmbedMessage ( window , XEMBED_REQUEST_FOCUS ) ;
} else if ( fe - > reason ( ) = = TQFocusEvent : : ActiveWindow ) {
} else if ( fe - > reason ( ) = = TQFocusEvent : : ActiveWindow ) {
@ -365,32 +361,20 @@ bool QXEmbedAppFilter::eventFilter( TQObject *o, TQEvent * e)
bool tabForward = true ;
bool tabForward = true ;
if ( ! ( k - > state ( ) & ControlButton | | k - > state ( ) & AltButton ) ) {
if ( ! ( k - > state ( ) & ControlButton | | k - > state ( ) & AltButton ) ) {
if ( k - > key ( ) = = Key_Backtab | | ( k - > key ( ) = = Key_Tab & & ( k - > state ( ) & ShiftButton ) ) ) {
if ( k - > key ( ) = = Key_Backtab | | ( k - > key ( ) = = Key_Tab & & ( k - > state ( ) & ShiftButton ) ) ) {
# ifdef USE_QT4
res = ( ( QPublicWidget * ) w ) - > focusNextPrev ( tabForward = false ) ;
# else // USE_QT4
TQFocusEvent : : setReason ( TQFocusEvent : : Backtab ) ;
TQFocusEvent : : setReason ( TQFocusEvent : : Backtab ) ;
res = ( ( QPublicWidget * ) w ) - > focusNextPrev ( tabForward = false ) ;
res = ( ( QPublicWidget * ) w ) - > focusNextPrev ( tabForward = false ) ;
TQFocusEvent : : resetReason ( ) ;
TQFocusEvent : : resetReason ( ) ;
# endif // USE_QT4
} else if ( k - > key ( ) = = Key_Tab ) {
} else if ( k - > key ( ) = = Key_Tab ) {
# ifdef USE_QT4
res = ( ( QPublicWidget * ) w ) - > focusNextPrev ( tabForward = true ) ;
# else // USE_QT4
TQFocusEvent : : setReason ( TQFocusEvent : : Tab ) ;
TQFocusEvent : : setReason ( TQFocusEvent : : Tab ) ;
res = ( ( QPublicWidget * ) w ) - > focusNextPrev ( tabForward = true ) ;
res = ( ( QPublicWidget * ) w ) - > focusNextPrev ( tabForward = true ) ;
TQFocusEvent : : resetReason ( ) ;
TQFocusEvent : : resetReason ( ) ;
# endif // USE_QT4
}
}
}
}
if ( res ) {
if ( res ) {
// L0625: We changed the focus because of tab/backtab key
// L0625: We changed the focus because of tab/backtab key
// Now check whether we have been looping around.
// Now check whether we have been looping around.
TQFocusData * fd = ( ( QPublicWidget * ) w ) - > focusData ( ) ;
TQFocusData * fd = ( ( QPublicWidget * ) w ) - > focusData ( ) ;
# ifdef USE_QT4
WId window = ( ( QPublicWidget * ) w - > topLevelWidget ( ) ) - > effectiveWinId ( ) ;
# else // USE_QT4
WId window = ( ( QPublicWidget * ) w - > topLevelWidget ( ) ) - > topData ( ) - > parentWinId ;
WId window = ( ( QPublicWidget * ) w - > topLevelWidget ( ) ) - > topData ( ) - > parentWinId ;
# endif // USE_QT4
TQWidget * cw = 0 ;
TQWidget * cw = 0 ;
TQWidget * fw = fd - > home ( ) ;
TQWidget * fw = fd - > home ( ) ;
if ( tabForward & & window ) {
if ( tabForward & & window ) {
@ -445,12 +429,7 @@ static int qxembed_x11_event_filter( XEvent* e)
// L0675: We just have been embedded into a XEMBED aware widget.
// L0675: We just have been embedded into a XEMBED aware widget.
TQTLWExtra * extra = ( ( QPublicWidget * ) w - > topLevelWidget ( ) ) - > topData ( ) ;
TQTLWExtra * extra = ( ( QPublicWidget * ) w - > topLevelWidget ( ) ) - > topData ( ) ;
extra - > embedded = 1 ;
extra - > embedded = 1 ;
# ifdef USE_QT4
// [FIXME]
printf ( " [FIXME] WId not set in tdelibs/tdeui/qxembed.cpp \n " ) ;
# else // USE_QT4
extra - > parentWinId = e - > xclient . data . l [ 3 ] ;
extra - > parentWinId = e - > xclient . data . l [ 3 ] ;
# endif // USE_QT4
w - > topLevelWidget ( ) - > show ( ) ;
w - > topLevelWidget ( ) - > show ( ) ;
break ;
break ;
}
}
@ -509,29 +488,19 @@ static int qxembed_x11_event_filter( XEvent* e)
case XEMBED_FOCUS_FIRST :
case XEMBED_FOCUS_FIRST :
{
{
// L0684: Search first widget in tab chain
// L0684: Search first widget in tab chain
# ifdef USE_QT4
w - > topLevelWidget ( ) - > setFocus ( ) ;
( ( QPublicWidget * ) w - > topLevelWidget ( ) ) - > focusNextPrev ( true ) ;
# else // USE_QT4
TQFocusEvent : : setReason ( TQFocusEvent : : Tab ) ;
TQFocusEvent : : setReason ( TQFocusEvent : : Tab ) ;
w - > topLevelWidget ( ) - > setFocus ( ) ;
w - > topLevelWidget ( ) - > setFocus ( ) ;
( ( QPublicWidget * ) w - > topLevelWidget ( ) ) - > focusNextPrev ( true ) ;
( ( QPublicWidget * ) w - > topLevelWidget ( ) ) - > focusNextPrev ( true ) ;
TQFocusEvent : : resetReason ( ) ;
TQFocusEvent : : resetReason ( ) ;
# endif // USE_QT4
}
}
break ;
break ;
case XEMBED_FOCUS_LAST :
case XEMBED_FOCUS_LAST :
{
{
// L0686: Search last widget in tab chain
// L0686: Search last widget in tab chain
# ifdef USE_QT4
w - > topLevelWidget ( ) - > setFocus ( ) ;
( ( QPublicWidget * ) w - > topLevelWidget ( ) ) - > focusNextPrev ( false ) ;
# else // USE_QT4
TQFocusEvent : : setReason ( TQFocusEvent : : Backtab ) ;
TQFocusEvent : : setReason ( TQFocusEvent : : Backtab ) ;
w - > topLevelWidget ( ) - > setFocus ( ) ;
w - > topLevelWidget ( ) - > setFocus ( ) ;
( ( QPublicWidget * ) w - > topLevelWidget ( ) ) - > focusNextPrev ( false ) ;
( ( QPublicWidget * ) w - > topLevelWidget ( ) ) - > focusNextPrev ( false ) ;
TQFocusEvent : : resetReason ( ) ;
TQFocusEvent : : resetReason ( ) ;
# endif // USE_QT4
}
}
break ;
break ;
default :
default :
@ -1168,13 +1137,9 @@ bool QXEmbed::x11Event( XEvent* e)
if ( d - > xplain & & d - > xgrab ) {
if ( d - > xplain & & d - > xgrab ) {
// L2060: The passive grab has intercepted a mouse click
// L2060: The passive grab has intercepted a mouse click
// in the embedded client window. Take the focus.
// in the embedded client window. Take the focus.
# ifdef USE_QT4
setFocus ( ) ;
# else // USE_QT4
TQFocusEvent : : setReason ( TQFocusEvent : : Mouse ) ;
TQFocusEvent : : setReason ( TQFocusEvent : : Mouse ) ;
setFocus ( ) ;
setFocus ( ) ;
TQFocusEvent : : resetReason ( ) ;
TQFocusEvent : : resetReason ( ) ;
# endif // USE_QT4
// L2064: Resume X11 event processing.
// L2064: Resume X11 event processing.
XAllowEvents ( tqt_xdisplay ( ) , ReplayPointer , CurrentTime ) ;
XAllowEvents ( tqt_xdisplay ( ) , ReplayPointer , CurrentTime ) ;
// L2065: Qt should not know about this.
// L2065: Qt should not know about this.
@ -1213,20 +1178,12 @@ bool QXEmbed::x11Event( XEvent* e)
if ( ( ( QPublicWidget * ) topLevelWidget ( ) ) - > topData ( ) - > embedded ) {
if ( ( ( QPublicWidget * ) topLevelWidget ( ) ) - > topData ( ) - > embedded ) {
focusMap - > remove ( topLevelWidget ( ) ) ;
focusMap - > remove ( topLevelWidget ( ) ) ;
focusMap - > insert ( topLevelWidget ( ) , new TQGuardedPtr < TQWidget > ( this ) ) ;
focusMap - > insert ( topLevelWidget ( ) , new TQGuardedPtr < TQWidget > ( this ) ) ;
# ifdef USE_QT4
WId window = ( ( QPublicWidget * ) topLevelWidget ( ) ) - > effectiveWinId ( ) ;
# else // USE_QT4
WId window = ( ( QPublicWidget * ) topLevelWidget ( ) ) - > topData ( ) - > parentWinId ;
WId window = ( ( QPublicWidget * ) topLevelWidget ( ) ) - > topData ( ) - > parentWinId ;
# endif // USE_QT4
sendXEmbedMessage ( window , XEMBED_REQUEST_FOCUS ) ;
sendXEmbedMessage ( window , XEMBED_REQUEST_FOCUS ) ;
} else {
} else {
# ifdef USE_QT4
setFocus ( ) ;
# else // USE_QT4
TQFocusEvent : : setReason ( TQFocusEvent : : Mouse ) ;
TQFocusEvent : : setReason ( TQFocusEvent : : Mouse ) ;
setFocus ( ) ;
setFocus ( ) ;
TQFocusEvent : : resetReason ( ) ;
TQFocusEvent : : resetReason ( ) ;
# endif // USE_QT4
}
}
break ;
break ;
default :
default :
@ -1318,12 +1275,7 @@ void QXEmbed::embedClientIntoWindow(TQWidget* client, WId window)
XReparentWindow ( tqt_xdisplay ( ) , client - > winId ( ) , window , 0 , 0 ) ;
XReparentWindow ( tqt_xdisplay ( ) , client - > winId ( ) , window , 0 , 0 ) ;
// L2451: These two lines are redundant. See L0680.
// L2451: These two lines are redundant. See L0680.
( ( QXEmbed * ) client ) - > topData ( ) - > embedded = true ;
( ( QXEmbed * ) client ) - > topData ( ) - > embedded = true ;
# ifdef USE_QT4
// [FIXME]
printf ( " [FIXME] WId not set in tdelibs/tdeui/qxembed.cpp \n " ) ;
# else // USE_QT4
( ( QXEmbed * ) client ) - > topData ( ) - > parentWinId = window ;
( ( QXEmbed * ) client ) - > topData ( ) - > parentWinId = window ;
# endif // USE_QT4
// L2452: This seems redundant because L2020 maps the window.
// L2452: This seems redundant because L2020 maps the window.
// But calling show() might also set Qt internal flags.
// But calling show() might also set Qt internal flags.
client - > show ( ) ;
client - > show ( ) ;