From kde-commits Sat Feb 22 18:43:39 2003 From: Leon Bottou Date: Sat, 22 Feb 2003 18:43:39 +0000 To: kde-commits Subject: KDE_3_1_BRANCH: kdelibs/kdeui X-MARC-Message: https://marc.info/?l=kde-commits&m=104593944520719 CVS commit by leonb: Smallish improvement of focus signaling. M +12 -3 qxembed.cpp 1.33.2.2 --- kdelibs/kdeui/qxembed.cpp #1.33.2.1:1.33.2.2 @@ -477,5 +477,6 @@ QXEmbed::QXEmbed(QWidget *parent, const if (isActiveWindow()) if ( !((QPublicWidget*) topLevelWidget())->topData()->embedded ) - XSetInputFocus( qt_xdisplay(), d->focusProxy->winId(), RevertToParent, qt_x_time ); + XSetInputFocus( qt_xdisplay(), d->focusProxy->winId(), + RevertToParent, qt_x_time ); setAcceptDrops( TRUE ); @@ -575,5 +576,7 @@ bool QXEmbed::eventFilter( QObject *o, Q if ( o == topLevelWidget() ) { if ( !((QPublicWidget*) topLevelWidget())->topData()->embedded ) - XSetInputFocus( qt_xdisplay(), d->focusProxy->winId(), RevertToParent, qt_x_time ); + if (! hasFocus() ) + XSetInputFocus( qt_xdisplay(), d->focusProxy->winId(), + RevertToParent, qt_x_time ); if (d->xplain) checkGrab(); @@ -637,4 +640,7 @@ void QXEmbed::focusInEvent( QFocusEvent if (!window) return; + if ( !((QPublicWidget*) topLevelWidget())->topData()->embedded ) + XSetInputFocus( qt_xdisplay(), d->focusProxy->winId(), + RevertToParent, qt_x_time ); if (d->xplain) { checkGrab(); @@ -659,4 +665,7 @@ void QXEmbed::focusOutEvent( QFocusEvent send_xembed_message( window, XEMBED_FOCUS_OUT ); } + if ( !((QPublicWidget*) topLevelWidget())->topData()->embedded ) + XSetInputFocus( qt_xdisplay(), d->focusProxy->winId(), + RevertToParent, qt_x_time ); }