From 053d87becb284d0d24629d582e8a79cd638d02d5 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 17 Mar 2013 22:45:02 -0500 Subject: Fix krdc fullscreen mode under Xinerama (cherry picked from commit 2cdc4ecf3cd1d36ae02586d5bf2119bc4f95c57c) --- krdc/krdc.cpp | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/krdc/krdc.cpp b/krdc/krdc.cpp index b773d7f0..8276c481 100644 --- a/krdc/krdc.cpp +++ b/krdc/krdc.cpp @@ -408,7 +408,15 @@ void KRDC::switchToFullscreen(bool scaling) bool fromFullscreen = (m_isFullscreen == WINDOW_MODE_FULLSCREEN); TQWidget *desktop = TQT_TQWIDGET(TQApplication::desktop()); - TQSize ds = desktop->size(); + TQDesktopWidget* desktopWidget = TQApplication::desktop(); + //int activeXineramaScreen = desktopWidget->screenNumber(this); + int activeXineramaScreen = desktopWidget->screenNumber(TQCursor::pos()); + if (activeXineramaScreen < 0) { + activeXineramaScreen = 0; + } + TQRect desktopScreenGeometry = desktopWidget->screenGeometry(activeXineramaScreen); + TQSize ds = desktopScreenGeometry.size(); + TQSize fbs = m_view->framebufferSize(); bool scalingPossible = m_view->supportsScaling() && ((fbs.width() >= ds.width()) || (fbs.height() >= ds.height())); @@ -420,13 +428,16 @@ void KRDC::switchToFullscreen(bool scaling) fbs.width(), fbs.height(), x, y); - if (m_oldResolution.valid) + if (m_oldResolution.valid) { m_fullscreenResolution = TQSize(x, y); - else - m_fullscreenResolution = TQApplication::desktop()->size(); + } + else { + m_fullscreenResolution = ds; + } m_isFullscreen = WINDOW_MODE_FULLSCREEN; - if (!scalingPossible) + if (!scalingPossible) { m_windowScaling = m_view->scaling(); + } } if (m_toolbar) { @@ -460,8 +471,9 @@ void KRDC::switchToFullscreen(bool scaling) m_view->resize(fbs); repositionView(true); } - else + else { m_view->enableScaling(false); + } m_fsToolbar = new KFullscreenPanel(this, "fstoolbar", m_fullscreenResolution); connect(m_fsToolbar, TQT_SIGNAL(mouseEnter()), TQT_SLOT(showFullscreenToolbar())); @@ -494,7 +506,7 @@ void KRDC::switchToFullscreen(bool scaling) TQToolTip::add(advancedButton, i18n("Advanced options")); TQLabel *hostLabel = new TQLabel(t); - hostLabel->setName("kde toolbar widget"); + hostLabel->setName("tde toolbar widget"); hostLabel->setAlignment(TQt::AlignCenter); hostLabel->setText(" "+m_host+" "); t->insertWidget(FS_HOSTLABEL_ID, 150, hostLabel); @@ -525,7 +537,7 @@ void KRDC::switchToFullscreen(bool scaling) setMaximumSize(m_fullscreenResolution.width(), m_fullscreenResolution.height()); - setGeometry(0, 0, m_fullscreenResolution.width(), + setGeometry(desktopScreenGeometry.x(), desktopScreenGeometry.y(), m_fullscreenResolution.width(), m_fullscreenResolution.height()); KWin::setState(winId(), NET::StaysOnTop); @@ -704,10 +716,12 @@ bool KRDC::event(TQEvent *e) { m_view->width(), m_view->height(), x, y); - if (m_oldResolution.valid) + if (m_oldResolution.valid) { m_fullscreenResolution = TQSize(x, y); - else + } + else { m_fullscreenResolution = TQApplication::desktop()->size(); + } showFullScreen(); setGeometry(0, 0, m_fullscreenResolution.width(), -- cgit v1.2.1