From 30617b6fb78c56e76aedd1480429dd4e68da201a Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 24 Apr 2012 19:21:48 -0500 Subject: Fix SAK dialog momentary display when SAK disabled Clean up build warnings in kdesktop --- kdesktop/bgmanager.cc | 10 +++++----- kdesktop/desktop.cc | 2 +- kdesktop/kdesktop.kcfg | 7 ------- kdesktop/lock/main.cc | 15 ++++++++++++++- tdm/kfrontend/kgapp.cpp | 8 ++++++-- 5 files changed, 26 insertions(+), 16 deletions(-) diff --git a/kdesktop/bgmanager.cc b/kdesktop/bgmanager.cc index b36219692..278f267d5 100644 --- a/kdesktop/bgmanager.cc +++ b/kdesktop/bgmanager.cc @@ -125,7 +125,7 @@ KBackgroundManager::KBackgroundManager(TQWidget *desktop, KWinModule* twinModule if (m_numberOfViewports < 1) { m_numberOfViewports = 1; } - for (unsigned j=0;j<(m_pKwinmodule->numberOfDesktops() * m_numberOfViewports);j++) { + for (signed j=0;j<(m_pKwinmodule->numberOfDesktops() * m_numberOfViewports);j++) { renderBackground(j); } } @@ -250,7 +250,7 @@ void KBackgroundManager::configure() if (m_numberOfViewports < 1) { m_numberOfViewports = 1; } - for (unsigned j=0;j<(m_pKwinmodule->numberOfDesktops() * m_numberOfViewports);j++) { + for (signed j=0;j<(m_pKwinmodule->numberOfDesktops() * m_numberOfViewports);j++) { renderBackground(j); } } @@ -350,7 +350,7 @@ void KBackgroundManager::slotChangeDesktop(int desk) desk--; // Lazy initialisation of # of desktops - if ((m_pKwinmodule->numberOfDesktops() * m_numberOfViewports) >= m_Renderer.size()) + if ((unsigned)(m_pKwinmodule->numberOfDesktops() * m_numberOfViewports) >= m_Renderer.size()) slotChangeNumberOfDesktops( m_pKwinmodule->numberOfDesktops() * m_numberOfViewports); int edesk = effectiveDesktop(); @@ -410,7 +410,7 @@ void KBackgroundManager::slotChangeViewport(int desk, const TQPoint& viewport) desk--; // Lazy initialisation of # of desktops - if ((m_pKwinmodule->numberOfDesktops() * m_numberOfViewports) >= m_Renderer.size()) + if ((unsigned)(m_pKwinmodule->numberOfDesktops() * m_numberOfViewports) >= m_Renderer.size()) slotChangeNumberOfDesktops( m_pKwinmodule->numberOfDesktops() * m_numberOfViewports ); int edesk = effectiveDesktop(); @@ -963,7 +963,7 @@ void KBackgroundManager::desktopResized() if (m_numberOfViewports < 1) { m_numberOfViewports = 1; } - for (unsigned j=0;j<(m_pKwinmodule->numberOfDesktops() * m_numberOfViewports);j++) { + for (signed j=0;j<(m_pKwinmodule->numberOfDesktops() * m_numberOfViewports);j++) { renderBackground(j); } } diff --git a/kdesktop/desktop.cc b/kdesktop/desktop.cc index 9b37e3ccc..0a105a373 100644 --- a/kdesktop/desktop.cc +++ b/kdesktop/desktop.cc @@ -135,8 +135,8 @@ KDesktop::WheelDirection KDesktop::m_eWheelDirection = KDesktop::m_eDefaultWheel const char* KDesktop::m_wheelDirectionStrings[2] = { "Forward", "Reverse" }; KDesktop::KDesktop( bool x_root_hack, bool wait_for_kded ) : - KDesktopIface(), TQWidget( 0L, "desktop", (WFlags)(WResizeNoErase | ( x_root_hack ? (WStyle_Customize | WStyle_NoBorder) : 0)) ), + KDesktopIface(), // those two WStyle_ break kdesktop when the root-hack isn't used (no Dnd) startup_id( NULL ), m_waitForKicker(0) { diff --git a/kdesktop/kdesktop.kcfg b/kdesktop/kdesktop.kcfg index 4b5c0a2b7..8d2dc6fe5 100644 --- a/kdesktop/kdesktop.kcfg +++ b/kdesktop/kdesktop.kcfg @@ -311,13 +311,6 @@ - - true - - Set to true to enable usage of the Trinity SAK anti-spoofing system - - - true diff --git a/kdesktop/lock/main.cc b/kdesktop/lock/main.cc index 225d9c5b4..896defd10 100644 --- a/kdesktop/lock/main.cc +++ b/kdesktop/lock/main.cc @@ -29,6 +29,7 @@ #include #include #include +#include #include @@ -199,7 +200,19 @@ int main( int argc, char **argv ) trinity_desktop_lock_use_system_modal_dialogs = !KDesktopSettings::useUnmanagedLockWindows(); trinity_desktop_lock_delay_screensaver_start = KDesktopSettings::delaySaverStart(); - trinity_desktop_lock_use_sak = KDesktopSettings::useTDESAK(); + + // RAJA + struct stat st; + KSimpleConfig* tdmconfig; + if( stat( KDE_CONFDIR "/tdm/tdmdistrc" , &st ) == 0) { + tdmconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmdistrc" )); + } + else { + tdmconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmrc" )); + } + tdmconfig->setGroup("X-*-Greeter"); + trinity_desktop_lock_use_sak = tdmconfig->readBoolEntry("UseSAK", true); + delete tdmconfig; if (args->isSet( "internal" )) { while (signalled_run == FALSE) { diff --git a/tdm/kfrontend/kgapp.cpp b/tdm/kfrontend/kgapp.cpp index 8fa0c18f5..727bddf8d 100644 --- a/tdm/kfrontend/kgapp.cpp +++ b/tdm/kfrontend/kgapp.cpp @@ -385,7 +385,9 @@ kg_main( const char *argv0 ) is_themed = false; has_twin = has_twin_bkp; delete tgrt; - checkSAK(app); + if (trinity_desktop_lock_use_sak) { + checkSAK(app); + } dialog = new KStdGreeter; #ifdef WITH_XRANDR dialog->move(dialog->x() + primaryScreenPosition.x(), dialog->y() + primaryScreenPosition.y()); @@ -398,7 +400,9 @@ kg_main( const char *argv0 ) } XSetErrorHandler( (XErrorHandler)0 ); } else { - checkSAK(app); + if (trinity_desktop_lock_use_sak) { + checkSAK(app); + } dialog = new KStdGreeter; #ifdef WITH_XRANDR dialog->move(dialog->x() + primaryScreenPosition.x(), dialog->y() + primaryScreenPosition.y()); -- cgit v1.2.1