diff options
author | Robert Xu <robxu9@gmail.com> | 2011-11-10 18:04:39 -0500 |
---|---|---|
committer | Robert Xu <robxu9@gmail.com> | 2011-11-10 18:04:39 -0500 |
commit | 21fcfa3348213aa87f0e3aef62ca4720c6d31cb7 (patch) | |
tree | 2cfb64c59322628e613ed0895e3c3694d3abe6bd /opensuse/core/tdelibs/fix-qxembed.diff | |
parent | 8667643bff14a60d8571c599efd3e48bed3e3b12 (diff) | |
download | tde-packaging-21fcfa3348213aa87f0e3aef62ca4720c6d31cb7.tar.gz tde-packaging-21fcfa3348213aa87f0e3aef62ca4720c6d31cb7.zip |
initial commit to suse branch: eclipse integration
Diffstat (limited to 'opensuse/core/tdelibs/fix-qxembed.diff')
-rw-r--r-- | opensuse/core/tdelibs/fix-qxembed.diff | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/opensuse/core/tdelibs/fix-qxembed.diff b/opensuse/core/tdelibs/fix-qxembed.diff new file mode 100644 index 000000000..8ea18d69d --- /dev/null +++ b/opensuse/core/tdelibs/fix-qxembed.diff @@ -0,0 +1,80 @@ +Index: kdeui/qxembed.h +=================================================================== +--- kdeui/qxembed.h.orig ++++ kdeui/qxembed.h +@@ -191,6 +191,11 @@ public: + void enterWhatsThisMode(); // temporary, fix in Qt (Matthias, Mon Jul 17 15:20:55 CEST 2000 ) + virtual void reparent( QWidget * parent, WFlags f, const QPoint & p, bool showIt = false ); + ++ /** ++ * @internal ++ */ ++ void updateEmbeddedFocus( bool hasfocus ); ++ + signals: + /** + * This signal is emitted when the embedded window has been lost (destroyed or reparented away) +Index: kdeui/qxembed.cpp +=================================================================== +--- kdeui/qxembed.cpp.orig ++++ kdeui/qxembed.cpp +@@ -314,8 +314,8 @@ bool QXEmbedAppFilter::eventFilter( QObj + if ( qApp->focusWidget() == o && + ((QPublicWidget*)qApp->focusWidget()->topLevelWidget())->topData()->embedded ) { + QFocusEvent* fe = (QFocusEvent*) e; +- if ( obeyFocus || fe->reason() == QFocusEvent::Mouse || +- fe->reason() == QFocusEvent::Shortcut ) { ++ if ( obeyFocus || fe->reason() != QFocusEvent::ActiveWindow /*|| fe->reason() == QFocusEvent::Mouse || ++ fe->reason() == QFocusEvent::Shortcut*/ ) { + // L0614: A widget in the embedded client was just given the Qt focus. + // Variable `obeyFocus' suggests that this is the result of mouse + // activity in the client. The XEMBED_REQUEST_FOCUS message causes +@@ -478,8 +478,11 @@ static int qxembed_x11_event_filter( XEv + switch ( detail ) { + case XEMBED_FOCUS_CURRENT: + // L0683: Set focus on saved focus widget +- if ( focusCurrent ) ++ if ( focusCurrent ) { + focusCurrent->setFocus(); ++ if( QXEmbed* emb = dynamic_cast< QXEmbed* >( focusCurrent )) ++ emb->updateEmbeddedFocus( true ); ++ } + else if ( !w->topLevelWidget()->focusWidget() ) + w->topLevelWidget()->setFocus(); + break; +@@ -511,6 +514,8 @@ static int qxembed_x11_event_filter( XEv + // We first record what the focus widget was + // and clear the Qt focus. + if ( w->topLevelWidget()->focusWidget() ) { ++ if( QXEmbed* emb = dynamic_cast< QXEmbed* >( w->topLevelWidget()->focusWidget())) ++ emb->updateEmbeddedFocus( false ); + focusMap->insert( w->topLevelWidget(), + new QGuardedPtr<QWidget>(w->topLevelWidget()->focusWidget() ) ); + w->topLevelWidget()->focusWidget()->clearFocus(); +@@ -919,6 +924,17 @@ void QXEmbed::focusOutEvent( QFocusEvent + } + + ++// When QXEmbed has Qt focus and gets/loses X focus, make sure the client knows ++// about the state of the focus. ++void QXEmbed::updateEmbeddedFocus( bool hasfocus ){ ++ if (!window || d->xplain) ++ return; ++ if( hasfocus ) ++ sendXEmbedMessage( window, XEMBED_FOCUS_IN, XEMBED_FOCUS_CURRENT); ++ else ++ sendXEmbedMessage( window, XEMBED_FOCUS_OUT); ++} ++ + // L1600: Helper for QXEmbed::embed() + // Check whether a window is in withdrawn state. + static bool wstate_withdrawn( WId winid ) +@@ -1161,6 +1177,8 @@ bool QXEmbed::x11Event( XEvent* e) + // L2085: The client asks for the focus. + case XEMBED_REQUEST_FOCUS: + if( ((QPublicWidget*)topLevelWidget())->topData()->embedded ) { ++ focusMap->remove( topLevelWidget() ); ++ focusMap->insert( topLevelWidget(), new QGuardedPtr<QWidget>( this )); + WId window = ((QPublicWidget*)topLevelWidget())->topData()->parentWinId; + sendXEmbedMessage( window, XEMBED_REQUEST_FOCUS ); + } else { |