summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2013-03-17 22:45:02 -0500
committerTimothy Pearson <[email protected]>2013-03-17 22:45:02 -0500
commit2cdc4ecf3cd1d36ae02586d5bf2119bc4f95c57c (patch)
tree673c136bd485ee1147647852bef79e65628905c3
parenta90dbcd7c58eae6c72b116a59f56c8833364ec0b (diff)
downloadtdenetwork-2cdc4ecf3cd1d36ae02586d5bf2119bc4f95c57c.tar.gz
tdenetwork-2cdc4ecf3cd1d36ae02586d5bf2119bc4f95c57c.zip
Fix krdc fullscreen mode under Xinerama
-rw-r--r--krdc/krdc.cpp34
1 files changed, 24 insertions, 10 deletions
diff --git a/krdc/krdc.cpp b/krdc/krdc.cpp
index 750557f6..ab35a6dd 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(),