From 77d027bac09fb85e1593674679efa40a3aff53df Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Fri, 20 Feb 2009 11:17:54 +0000 Subject: [PATCH] save the real parent widget and use it later for getting the screen number of the okular application BUG: 185013 svn path=/trunk/KDE/kdegraphics/okular/; revision=928888 --- ui/presentationwidget.cpp | 5 +++-- ui/presentationwidget.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/presentationwidget.cpp b/ui/presentationwidget.cpp index 9057812d7..72e51f678 100644 --- a/ui/presentationwidget.cpp +++ b/ui/presentationwidget.cpp @@ -127,6 +127,7 @@ class PresentationToolBar : public QToolBar PresentationWidget::PresentationWidget( QWidget * parent, Okular::Document * doc, KActionCollection * collection ) : QWidget( 0 /* must be null, to have an independent widget */, Qt::FramelessWindowHint ), m_pressedLink( 0 ), m_handCursor( false ), m_drawingEngine( 0 ), m_screenSaverCookie( -1 ), + m_parentWidget( parent ), m_document( doc ), m_frameIndex( -1 ), m_topBar( 0 ), m_pagesEdit( 0 ), m_searchBar( 0 ), m_screenSelect( 0 ), m_blockNotifications( false ), m_inBlackScreenMode( false ) { @@ -1069,7 +1070,7 @@ void PresentationWidget::recalcGeometry() int screen = 0; if ( preferenceScreen == -2 ) { - screen = desktop->screenNumber( parentWidget() ); + screen = desktop->screenNumber( m_parentWidget ); } else if ( preferenceScreen == -1 ) { @@ -1081,7 +1082,7 @@ void PresentationWidget::recalcGeometry() } else { - screen = desktop->screenNumber( parentWidget() ); + screen = desktop->screenNumber( m_parentWidget ); Okular::Settings::setSlidesScreen( -2 ); } const QRect screenGeom = desktop->screenGeometry( screen ); diff --git a/ui/presentationwidget.h b/ui/presentationwidget.h index 6a326b2ee..8ee786aa0 100644 --- a/ui/presentationwidget.h +++ b/ui/presentationwidget.h @@ -113,6 +113,7 @@ class PresentationWidget : public QWidget, public Okular::DocumentObserver QList< QRect > m_transitionRects; // misc stuff + QWidget * m_parentWidget; Okular::Document * m_document; QVector< PresentationFrame * > m_frames; int m_frameIndex;