diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-26 17:07:20 -0600 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2012-06-03 03:26:50 +0200 |
commit | cf85ef952c224946891b27d4aec0b1fe3f722d6d (patch) | |
tree | 77668c0a57ffc3c2be14e0b86caef2176fc6429b /kdesktop/lock | |
parent | 9512f43dd8822bdcfd96e1f3ca9fa34193a32093 (diff) | |
download | tdebase-cf85ef952c224946891b27d4aec0b1fe3f722d6d.tar.gz tdebase-cf85ef952c224946891b27d4aec0b1fe3f722d6d.zip |
Clean up lock screen internals
This cleanup is part of an effort to resolve Bug 810, but a new Qt3 version is required to fully resolve it
(cherry picked from commit 057932620ba8355a6506b9d437518e253ba14ed9)
Diffstat (limited to 'kdesktop/lock')
-rw-r--r-- | kdesktop/lock/autologout.cc | 2 | ||||
-rw-r--r-- | kdesktop/lock/infodlg.cc | 1 | ||||
-rw-r--r-- | kdesktop/lock/lockdlg.cc | 4 | ||||
-rw-r--r-- | kdesktop/lock/lockprocess.cc | 25 | ||||
-rw-r--r-- | kdesktop/lock/main.cc | 3 | ||||
-rw-r--r-- | kdesktop/lock/querydlg.cc | 1 | ||||
-rw-r--r-- | kdesktop/lock/sakdlg.cc | 1 | ||||
-rw-r--r-- | kdesktop/lock/securedlg.cc | 1 |
8 files changed, 31 insertions, 7 deletions
diff --git a/kdesktop/lock/autologout.cc b/kdesktop/lock/autologout.cc index 22b449c1a..bef39ddf0 100644 --- a/kdesktop/lock/autologout.cc +++ b/kdesktop/lock/autologout.cc @@ -82,6 +82,8 @@ AutoLogout::AutoLogout(LockProcess *parent) : TQDialog(parent, "password dialog" mCountdownTimerId = startTimer(1000/25); connect(tqApp, TQT_SIGNAL(activity()), TQT_SLOT(slotActivity())); + + setFixedSize( sizeHint() ); } AutoLogout::~AutoLogout() diff --git a/kdesktop/lock/infodlg.cc b/kdesktop/lock/infodlg.cc index c689465e0..ddc4b37a6 100644 --- a/kdesktop/lock/infodlg.cc +++ b/kdesktop/lock/infodlg.cc @@ -99,6 +99,7 @@ InfoDlg::InfoDlg(LockProcess *parent) frameLayout->addLayout( layStatus, 1, 1 ); installEventFilter(this); + setFixedSize( sizeHint() ); } InfoDlg::~InfoDlg() diff --git a/kdesktop/lock/lockdlg.cc b/kdesktop/lock/lockdlg.cc index e420ec527..b2d1fda55 100644 --- a/kdesktop/lock/lockdlg.cc +++ b/kdesktop/lock/lockdlg.cc @@ -215,6 +215,7 @@ void PasswordDlg::init(GreeterPluginHandle *plugin) mNewSessButton->hide(); installEventFilter(this); + setFixedSize( sizeHint() ); mFailedTimerId = 0; mTimeoutTimerId = startTimer(PASSDLG_HIDE_TIMEOUT); @@ -598,6 +599,7 @@ void PasswordDlg::show() { TQDialog::show(); TQApplication::flushX(); + setFixedSize( sizeHint() ); } void PasswordDlg::slotStartNewSession() @@ -818,6 +820,8 @@ void PasswordDlg::slotSwitchUser() connect( btn, TQT_SIGNAL(clicked()), &dialog, TQT_SLOT(reject()) ); vbox2->addWidget( btn ); + dialog.setFixedSize( dialog.sizeHint() ); + int ret = static_cast< LockProcess* >(parent())->execDialog( &dialog ); if (ret != TQDialog::Rejected) { TQDialog::reject(); diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc index f41f2537e..e438f06ea 100644 --- a/kdesktop/lock/lockprocess.cc +++ b/kdesktop/lock/lockprocess.cc @@ -4,7 +4,7 @@ // // Copyright (c) 1999 Martin R. Jones <mjones@kde.org> // Copyright (c) 2003 Oswald Buddenhagen <ossi@kde.org> -// Copyright (c) 2010-2011 Timothy Pearson <kb9vqf@pearsoncomputing.net> +// Copyright (c) 2010-2012 Timothy Pearson <kb9vqf@pearsoncomputing.net> // //kdesktop keeps running and checks user inactivity @@ -111,6 +111,10 @@ Status DPMSInfo ( Display *, CARD16 *, BOOL * ); #define LOCK_GRACE_DEFAULT 5000 #define AUTOLOGOUT_DEFAULT 600 +// FIXME +// This should be defined if Qt 3.4.0 or higher is in use +// #define KEEP_MOUSE_UNGRABBED 1 + // These lines are taken on 10/2009 from X.org (X11/XF86keysym.h), defining some special multimedia keys #define XF86XK_AudioMute 0x1008FF12 #define XF86XK_AudioRaiseVolume 0x1008FF13 @@ -183,6 +187,10 @@ LockProcess::LockProcess(bool child, bool useBlankOnly) mBackingStartupDelayTimer(0), m_startupStatusDialog(NULL) { +#ifdef KEEP_MOUSE_UNGRABBED + setNFlags(WX11DisableMove|WX11DisableClose|WX11DisableShade|WX11DisableMinimize|WX11DisableMaximize); +#endif + setupSignals(); setupPipe(); @@ -267,7 +275,11 @@ LockProcess::LockProcess(bool child, bool useBlankOnly) #endif #if (QT_VERSION-0 >= 0x030200) // XRANDR support - connect( kapp->desktop(), TQT_SIGNAL( resized( int )), TQT_SLOT( desktopResized())); + connect( kapp->desktop(), TQT_SIGNAL( resized( int )), TQT_SLOT( desktopResized())); +#endif + +#ifdef KEEP_MOUSE_UNGRABBED + setEnabled(false); #endif greetPlugin.library = 0; @@ -874,7 +886,6 @@ void LockProcess::createSaverWindow() // this is a security risk and has been deactivated--welcome to the 21st century folks! // setBackgroundMode(TQWidget::NoBackground); - setCursor( tqblankCursor ); setGeometry(0, 0, mRootWidth, mRootHeight); kdDebug(1204) << "Saver window Id: " << winId() << endl; @@ -884,7 +895,6 @@ void LockProcess::desktopResized() { mBusy = true; suspend(); - setCursor( tqblankCursor ); // Get root window size XWindowAttributes rootAttr; @@ -1087,6 +1097,7 @@ bool LockProcess::grabInput() } } +#ifndef KEEP_MOUSE_UNGRABBED if (!grabMouse()) { usleep(100000); @@ -1096,6 +1107,7 @@ bool LockProcess::grabInput() return false; } } +#endif lockXF86(); @@ -1150,7 +1162,6 @@ bool LockProcess::startSaver() createSaverWindow(); move(0, 0); show(); - setCursor( tqblankCursor ); raise(); XSync(qt_xdisplay(), False); @@ -1313,6 +1324,8 @@ void LockProcess::repaintRootWindowIfNeeded() bool LockProcess::startHack() { + setCursor( tqblankCursor ); + if ((mEnsureVRootWindowSecurityTimer) && (!mEnsureVRootWindowSecurityTimer->isActive())) mEnsureVRootWindowSecurityTimer->start(250, FALSE); if (currentDialog || (!mDialogs.isEmpty())) @@ -1429,6 +1442,7 @@ void LockProcess::stopHack() mHackProc.kill(SIGKILL); } } + setCursor( tqarrowCursor ); } //--------------------------------------------------------------------------- @@ -1730,7 +1744,6 @@ void LockProcess::doFunctionKeyBroadcast() { mDialogControlLock = false; } } - setCursor( tqblankCursor ); DCOPRef ref( "*", "MainApplication-Interface"); ref.send("sendFakeKey", DCOPArg(mkeyCode , "unsigned int")); diff --git a/kdesktop/lock/main.cc b/kdesktop/lock/main.cc index fb7e241ac..a54981296 100644 --- a/kdesktop/lock/main.cc +++ b/kdesktop/lock/main.cc @@ -45,8 +45,9 @@ bool trinity_desktop_lock_forced = FALSE; bool MyApp::x11EventFilter( XEvent *ev ) { - if (ev->type == XKeyPress || ev->type == ButtonPress) + if (ev->type == XKeyPress || ev->type == ButtonPress) { emit activity(); + } else if (ev->type == MotionNotify) { time_t tick = time( 0 ); if (tick != lastTick) { diff --git a/kdesktop/lock/querydlg.cc b/kdesktop/lock/querydlg.cc index 7a75c248e..c55822a9c 100644 --- a/kdesktop/lock/querydlg.cc +++ b/kdesktop/lock/querydlg.cc @@ -118,6 +118,7 @@ QueryDlg::QueryDlg(LockProcess *parent) connect(ok, TQT_SIGNAL(clicked()), TQT_SLOT(slotOK())); installEventFilter(this); + setFixedSize( sizeHint() ); } QueryDlg::~QueryDlg() diff --git a/kdesktop/lock/sakdlg.cc b/kdesktop/lock/sakdlg.cc index 371038448..5b5574519 100644 --- a/kdesktop/lock/sakdlg.cc +++ b/kdesktop/lock/sakdlg.cc @@ -102,6 +102,7 @@ SAKDlg::SAKDlg(LockProcess *parent) mStatusLabel->setText("<b>" + i18n("Press Ctrl+Alt+Del to begin.") + "</b><p>" + i18n("This process helps keep your password secure.") + "<br>" + i18n("It prevents unauthorized users from emulating the login screen.")); installEventFilter(this); + setFixedSize( sizeHint() ); mSAKProcess = new KProcess; *mSAKProcess << "kdmtsak"; diff --git a/kdesktop/lock/securedlg.cc b/kdesktop/lock/securedlg.cc index 4577f5784..b1bf946e0 100644 --- a/kdesktop/lock/securedlg.cc +++ b/kdesktop/lock/securedlg.cc @@ -144,6 +144,7 @@ SecureDlg::SecureDlg(LockProcess *parent) mSwitchButton->setFixedWidth(btnSize); installEventFilter(this); + setFixedSize( sizeHint() ); } SecureDlg::~SecureDlg() |