diff options
Diffstat (limited to 'tqtinterface/qt4/src/dialogs/tqdialog.cpp')
-rw-r--r-- | tqtinterface/qt4/src/dialogs/tqdialog.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/tqtinterface/qt4/src/dialogs/tqdialog.cpp b/tqtinterface/qt4/src/dialogs/tqdialog.cpp index 43db3ca..58093f1 100644 --- a/tqtinterface/qt4/src/dialogs/tqdialog.cpp +++ b/tqtinterface/qt4/src/dialogs/tqdialog.cpp @@ -681,6 +681,11 @@ bool TQDialog::event( TQEvent *e ) #if defined(TQ_WS_X11) extern "C" { int XSetTransientForHint( Display *, unsigned long, unsigned long ); } +#include <private/tqt_x11_p.h> +#undef FocusIn +// defined in qapplication_x11.cpp +extern Atom qt_net_wm_full_placement; +extern bool qt_net_supports(Atom atom); #endif // TQ_WS_X11 /*! @@ -702,10 +707,12 @@ void TQDialog::show() if ( !did_resize ) adjustSize(); - if ( has_relpos && !did_move ) { - adjustPositionInternal( parentWidget(), TRUE ); - } else if ( !did_move ) { - adjustPositionInternal( parentWidget() ); + if( !qt_net_supports( qt_net_wm_full_placement )) { + if ( has_relpos && !did_move ) { + adjustPositionInternal( parentWidget(), TRUE ); + } else if ( !did_move ) { + adjustPositionInternal( parentWidget() ); + } } if (windowState() != state) @@ -716,7 +723,7 @@ void TQDialog::show() && tqApp->mainWidget() && tqApp->mainWidget()->isVisible() && !tqApp->mainWidget()->isMinimized()) { // make sure the transient for hint is set properly for modal dialogs - XSetTransientForHint( x11Display(), winId(), tqApp->mainWidget()->winId() ); + x11SetWindowTransient( tqApp->mainWidget()); } #endif // TQ_WS_X11 @@ -811,7 +818,9 @@ void TQDialog::adjustPositionInternal( TQWidget*w, bool useRelPos) w = w->tqtopLevelWidget(); TQRect desk; if ( w ) { - scrn = TQApplication::desktop()->screenNumber( w ); + // Use mapToGlobal rather than tqgeometry() in case w might + // be embedded in another application + scrn = TQApplication::desktop()->screenNumber( w->mapToGlobal( TQPoint(0,0) ) ); } else if ( TQApplication::desktop()->isVirtualDesktop() ) { scrn = TQApplication::desktop()->screenNumber( TQCursor::pos() ); } else { |