------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. http://bugs.kde.org/show_bug.cgi?id=97347 tsdgeos terra es changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED ------- Additional Comments From tsdgeos terra es 2005-02-16 18:19 ------- CVS commit by aacid: Delay the calculation of m_width and m_height (and all its associated things) until first time the widget is shown (paintEvent), doing KGlobalSettings::desktopGeometry(this); in PresentationWidget::PresentationWidget always returns the geometry of the first screen, so it must be done in paintEvent (for example), where the widget has already been shown and KGlobalSettings::desktopGeometry(this); returns the geometry of the correct screen. Thanks to Olaf Bonorden for the patch testing BUGS: 97347 M +39 -29 presentationwidget.cpp 1.21 --- kdegraphics/kpdf/ui/presentationwidget.cpp #1.20:1.21 @ -53,23 +53,9 @ PresentationWidget::PresentationWidget( // set look and geometry setBackgroundMode( Qt::NoBackground ); - QRect d = KGlobalSettings::desktopGeometry(this); - m_width = d.width(); - m_height = d.height(); - // create top toolbar - m_topBar = new KToolBar( this, "presentationBar" ); - m_topBar->setIconSize( 32 ); - m_topBar->setMovingEnabled( false ); - m_topBar->insertButton( "1leftarrow", 2, SIGNAL( clicked() ), this, SLOT( slotPrevPage() ) ); - m_topBar->insertButton( "1rightarrow", 3, SIGNAL( clicked() ), this, SLOT( slotNextPage() ) ); - m_topBar->insertButton( "exit", 1, SIGNAL( clicked() ), this, SLOT( close() ) ); - m_topBar->setGeometry( 0, 0, m_width, 32 + 10 ); - m_topBar->alignItemRight( 1 ); - m_topBar->hide(); - // change topbar background color - QPalette p = m_topBar->palette(); - p.setColor( QPalette::Active, QColorGroup::Button, Qt::gray ); - p.setColor( QPalette::Active, QColorGroup::Background, Qt::darkGray ); - m_topBar->setPalette( p ); + m_width = -1; + + // show widget and take control + showFullScreen(); // misc stuff @ -80,7 +66,4 @ PresentationWidget::PresentationWidget( connect( m_overlayHideTimer, SIGNAL( timeout() ), this, SLOT( slotHideOverlay() ) ); - // show widget and take control - showFullScreen(); - // handle cursor appearance as specified in configuration if ( Settings::slidesCursor() == Settings::EnumSlidesCursor::HiddenDelay ) @ -93,11 +76,4 @ PresentationWidget::PresentationWidget( setCursor( KCursor::blankCursor() ); } - - // register this observer in document. events will come immediately - m_document->addObserver( this ); - - // show summary if requested - if ( Settings::slidesShowSummary() ) - generatePage(); } @ -195,4 +171,6 @ bool PresentationWidget::canUnloadPixmap void PresentationWidget::keyPressEvent( QKeyEvent * e ) { + if (m_width == -1) return; + if ( e->key() == Key_Left || e->key() == Key_Backspace ) slotPrevPage(); @ -245,4 +223,6 @ void PresentationWidget::mousePressEvent void PresentationWidget::mouseMoveEvent( QMouseEvent * e ) { + if (m_width == -1) return; + // hide a shown bar when exiting the area if ( m_topBar->isShown() ) @ -261,4 +241,34 @ void PresentationWidget::mouseMoveEvent( void PresentationWidget::paintEvent( QPaintEvent * pe ) { + if (m_width == -1) + { + QRect d = KGlobalSettings::desktopGeometry(this); + m_width = d.width(); + m_height = d.height(); + + // create top toolbar + m_topBar = new KToolBar( this, "presentationBar" ); + m_topBar->setIconSize( 32 ); + m_topBar->setMovingEnabled( false ); + m_topBar->insertButton( "1leftarrow", 2, SIGNAL( clicked() ), this, SLOT( slotPrevPage() ) ); + m_topBar->insertButton( "1rightarrow", 3, SIGNAL( clicked() ), this, SLOT( slotNextPage() ) ); + m_topBar->insertButton( "exit", 1, SIGNAL( clicked() ), this, SLOT( close() ) ); + m_topBar->setGeometry( 0, 0, m_width, 32 + 10 ); + m_topBar->alignItemRight( 1 ); + m_topBar->hide(); + // change topbar background color + QPalette p = m_topBar->palette(); + p.setColor( QPalette::Active, QColorGroup::Button, Qt::gray ); + p.setColor( QPalette::Active, QColorGroup::Background, Qt::darkGray ); + m_topBar->setPalette( p ); + + // register this observer in document. events will come immediately + m_document->addObserver( this ); + + // show summary if requested + if ( Settings::slidesShowSummary() ) + generatePage(); + } + // check painting rect consistancy QRect r = pe->rect().intersect( geometry() );