[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: [PATCH] Qt 4.4 - Fix alien widgets in Dolphin
From: "Robert Knight" <robertknight () gmail ! com>
Date: 2008-02-17 23:09:28
Message-ID: 13ed09c00802171509v443d96bbr15262323bc161beb () mail ! gmail ! com
[Download RAW message or body]
Patches for KPassivePopup , KMessageBox attached.
On 17/02/2008, Robert Knight <robertknight@gmail.com> wrote:
> Hi David,
>
> The attached patch attempts to fix this inside KIO by taking the top
> level window associated with the passed widget in
> JobUiDelegate::setWindow().
>
> The patch does change the semantics of the API slightly since it
> becomes possible that JobUiDelegate::window() does not return the same
> value passed to JobUiDelegate::setWindow().
>
> QWidget does provide an alternative, effectiveWinId() which goes up
> the widget chain and finds the first widget that does have an X11
> window associated with it and returns the id of that. The setWindow()
> change is simpler since it only occurs in one place.
>
> Regards,
> Robert.
>
> On 15/02/2008, David Faure <faure@kde.org> wrote:
> > On Thursday 14 February 2008, Robert Knight wrote:
> > > Since the actual call to winId() happens deep inside KIO, perhaps it
> > > would be better to put a fix there and only ever get winIds for
> > > top-level widgets to prevent applications doing this accidentally.
> > > Thoughts?
> >
> > Yes. We take the winId in several places in KIO, but in every case, the toplevel would
> > be fine, it's only about associating dialogs from other processes (e.g. the cookie dialog)
> > with the toplevel window that requested the KIO operation.
> >
> > --
> > David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
> > Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
> >
>
>
["kdelibs_kdeui_winid_fix_kmessagebox.patch" (text/x-patch)]
Index: dialogs/kmessagebox.cpp
===================================================================
--- dialogs/kmessagebox.cpp (revision 776189)
+++ dialogs/kmessagebox.cpp (working copy)
@@ -372,7 +372,7 @@
const QString &dontAskAgainName,
Options options)
{ // in order to avoid code duplication, convert to WId, it will be converted back
- return questionYesNoListWId( parent ? parent->winId() : 0, text, strlist,
+ return questionYesNoListWId( parent ? parent->effectiveWinId() : 0, text, \
strlist, caption, buttonYes, buttonNo, dontAskAgainName, options );
}
@@ -434,7 +434,7 @@
const QString &dontAskAgainName,
Options options)
{
- return questionYesNoCancelWId( parent ? parent->winId() : 0, text, caption, \
buttonYes, buttonNo, buttonCancel, + return questionYesNoCancelWId( parent ? \
parent->effectiveWinId() : 0, text, caption, buttonYes, buttonNo, buttonCancel, \
dontAskAgainName, options ); }
@@ -527,7 +527,7 @@
const QString &dontAskAgainName,
Options options)
{
- return warningYesNoListWId( parent ? parent->winId() : 0, text, strlist, \
caption, + return warningYesNoListWId( parent ? parent->effectiveWinId() : 0, \
text, strlist, caption, buttonYes, buttonNo, dontAskAgainName, options );
}
@@ -612,7 +612,7 @@
const QString &dontAskAgainName,
Options options)
{
- return warningContinueCancelListWId( parent ? parent->winId() : 0, text, \
strlist, + return warningContinueCancelListWId( parent ? parent->effectiveWinId() \
: 0, text, strlist,
caption, buttonContinue, buttonCancel, dontAskAgainName, options );
}
@@ -698,7 +698,7 @@
const QString &dontAskAgainName,
Options options)
{
- return warningYesNoCancelListWId( parent ? parent->winId() : 0, text, strlist,
+ return warningYesNoCancelListWId( parent ? parent->effectiveWinId() : 0, text, \
strlist,
caption, buttonYes, buttonNo, buttonCancel, dontAskAgainName, options );
}
@@ -763,7 +763,7 @@
void KMessageBox::error(QWidget *parent, const QString &text,
const QString &caption, Options options)
{
- return errorListWId( parent ? parent->winId() : 0, text, QStringList(), caption, \
options ); + return errorListWId( parent ? parent->effectiveWinId() : 0, text, \
QStringList(), caption, options ); }
void KMessageBox::errorWId(WId parent_id, const QString &text,
@@ -775,7 +775,7 @@
void KMessageBox::errorList(QWidget *parent, const QString &text, const QStringList \
&strlist, const QString &caption, Options options)
{
- return errorListWId( parent ? parent->winId() : 0, text, strlist, caption, \
options ); + return errorListWId( parent ? parent->effectiveWinId() : 0, text, \
strlist, caption, options ); }
void KMessageBox::errorListWId(WId parent_id, const QString &text, const \
QStringList &strlist, @@ -809,7 +809,7 @@
const QString &details,
const QString &caption, Options options)
{
- return detailedErrorWId( parent ? parent->winId() : 0, text, details, caption, \
options ); + return detailedErrorWId( parent ? parent->effectiveWinId() : 0, text, \
details, caption, options ); }
void KMessageBox::detailedErrorWId(WId parent_id, const QString &text,
@@ -842,7 +842,7 @@
const QString &details,
const QString &caption)
{
- return queuedDetailedErrorWId( parent ? parent->winId() : 0, text, details, \
caption ); + return queuedDetailedErrorWId( parent ? parent->effectiveWinId() : 0, \
text, details, caption ); }
void KMessageBox::queuedDetailedErrorWId(WId parent_id, const QString &text,
@@ -858,7 +858,7 @@
void KMessageBox::sorry(QWidget *parent, const QString &text,
const QString &caption, Options options)
{
- return sorryWId( parent ? parent->winId() : 0, text, caption, options );
+ return sorryWId( parent ? parent->effectiveWinId() : 0, text, caption, options \
); }
void KMessageBox::sorryWId(WId parent_id, const QString &text,
@@ -890,7 +890,7 @@
const QString &details,
const QString &caption, Options options)
{
- return detailedSorryWId( parent ? parent->winId() : 0, text, details, caption, \
options ); + return detailedSorryWId( parent ? parent->effectiveWinId() : 0, text, \
details, caption, options ); }
void KMessageBox::detailedSorryWId(WId parent_id, const QString &text,
@@ -934,7 +934,7 @@
void KMessageBox::informationList(QWidget *parent,const QString &text, const \
QStringList & strlist,
const QString &caption, const QString &dontShowAgainName, \
Options options) {
- return informationListWId( parent ? parent->winId() : 0, text, strlist, caption,
+ return informationListWId( parent ? parent->effectiveWinId() : 0, text, strlist, \
caption, dontShowAgainName, options );
}
@@ -1038,7 +1038,7 @@
const KGuiItem &buttonNo, const KGuiItem &buttonCancel,
const QString &dontShowAskAgainName, Options options )
{
- return messageBoxWId( parent ? parent->winId() : 0, type, text, caption,
+ return messageBoxWId( parent ? parent->effectiveWinId() : 0, type, text, \
caption,
buttonYes, buttonNo, buttonCancel, dontShowAskAgainName, options );
}
@@ -1081,7 +1081,7 @@
void KMessageBox::queuedMessageBox( QWidget *parent, DialogType type, const QString \
&text, const QString &caption, Options options ) {
- return queuedMessageBoxWId( parent ? parent->winId() : 0, type, text, caption, \
options ); + return queuedMessageBoxWId( parent ? parent->effectiveWinId() : 0, \
type, text, caption, options ); }
void KMessageBox::queuedMessageBoxWId( WId parent_id, DialogType type, const QString \
&text, const QString &caption, Options options ) @@ -1094,7 +1094,7 @@
void KMessageBox::queuedMessageBox( QWidget *parent, DialogType type, const QString \
&text, const QString &caption ) {
- return queuedMessageBoxWId( parent ? parent->winId() : 0, type, text, caption );
+ return queuedMessageBoxWId( parent ? parent->effectiveWinId() : 0, type, text, \
caption ); }
void KMessageBox::queuedMessageBoxWId( WId parent_id, DialogType type, const QString \
&text, const QString &caption )
["kdelibs_kdeui_winid_fix_kpassivepopup.patch" (text/x-patch)]
Index: util/kpassivepopup.cpp
===================================================================
--- util/kpassivepopup.cpp (revision 776189)
+++ util/kpassivepopup.cpp (working copy)
@@ -90,7 +90,7 @@
: QFrame( 0, f ? f : POPUP_FLAGS ),
d(new Private())
{
- init( parent ? parent->winId() : 0L );
+ init( parent ? parent->effectiveWinId() : 0L );
}
KPassivePopup::KPassivePopup( WId win )
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic