diff options
Diffstat (limited to 'krdc/rdp/krdpview.cpp')
-rw-r--r-- | krdc/rdp/krdpview.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/krdc/rdp/krdpview.cpp b/krdc/rdp/krdpview.cpp index dc388e29..720293c3 100644 --- a/krdc/rdp/krdpview.cpp +++ b/krdc/rdp/krdpview.cpp @@ -19,6 +19,7 @@ For any questions, comments or whatever, you may mail me at: arend@auton.nl */ +#include <kapplication.h> #include <kdialogbase.h> #include <klocale.h> #include <kmessagebox.h> @@ -38,6 +39,7 @@ #include "rdphostpref.h" #include "rdpprefs.h" +bool launch_Fullscreen_rdp = false; bool rdpAppDataConfigured = false; extern KWallet::Wallet *wallet; @@ -188,6 +190,7 @@ bool KRdpView::editPreferences( HostPrefPtr host ) wv = prefs->rdpWidth(); hv = prefs->rdpHeight(); + kl = int2keymap( prefs->kbLayout() ); hp->setAskOnConnect( prefs->showPrefs() ); hp->setWidth(wv); @@ -206,6 +209,8 @@ bool KRdpView::start() SmartPtr<RdpHostPref> hp, rdpDefaults; bool useKWallet = false; + QWidget *desktop = QApplication::desktop(); + if(!rdpAppDataConfigured) { HostPreferences *hps = HostPreferences::instance(); @@ -225,7 +230,19 @@ bool KRdpView::start() m_process = new KProcess(m_container); *m_process << "rdesktop"; - *m_process << "-g" << (QString::number(hp->width()) + "x" + QString::number(hp->height())); + // Check for fullscreen mode + if ((hp->width() == 0) && (hp->height() == 0)) { + launch_Fullscreen_rdp = true; + *m_process << "-g" << (QString::number(desktop->width()) + "x" + QString::number((desktop->height()-2))); + } + else { + if ((hp->height() > (desktop->height()-2)) && (hp->height() <= (desktop->height()))) { + *m_process << "-g" << (QString::number(hp->width()) + "x" + QString::number(desktop->height()-2)); + } + else { + *m_process << "-g" << (QString::number(hp->width()) + "x" + QString::number(hp->height())); + } + } *m_process << "-k" << hp->layout(); if(!m_user.isEmpty()) { *m_process << "-u" << m_user; } @@ -311,6 +328,11 @@ bool KRdpView::viewOnly() return m_container->m_viewOnly; } +bool KRdpView::startFullscreen() +{ + return launch_Fullscreen_rdp; +} + void KRdpView::setViewOnly(bool s) { m_container->m_viewOnly = s; |