|
Lines 173-178
Link Here
|
| 173 |
mDialogControlLock(false), |
173 |
mDialogControlLock(false), |
| 174 |
mForceReject(false), |
174 |
mForceReject(false), |
| 175 |
currentDialog(NULL), |
175 |
currentDialog(NULL), |
|
|
176 |
mEnsureScreenHiddenTimer(NULL), |
| 176 |
mForceContinualLockDisplayTimer(NULL), |
177 |
mForceContinualLockDisplayTimer(NULL), |
| 177 |
mEnsureVRootWindowSecurityTimer(NULL), |
178 |
mEnsureVRootWindowSecurityTimer(NULL), |
| 178 |
mHackDelayStartupTimer(NULL), |
179 |
mHackDelayStartupTimer(NULL), |
|
Lines 288-293
Link Here
|
| 288 |
hackResumeTimer->stop(); |
289 |
hackResumeTimer->stop(); |
| 289 |
delete hackResumeTimer; |
290 |
delete hackResumeTimer; |
| 290 |
} |
291 |
} |
|
|
292 |
if (mEnsureScreenHiddenTimer != NULL) { |
| 293 |
mEnsureScreenHiddenTimer->stop(); |
| 294 |
delete mEnsureScreenHiddenTimer; |
| 295 |
} |
| 291 |
if (mForceContinualLockDisplayTimer != NULL) { |
296 |
if (mForceContinualLockDisplayTimer != NULL) { |
| 292 |
mForceContinualLockDisplayTimer->stop(); |
297 |
mForceContinualLockDisplayTimer->stop(); |
| 293 |
delete mForceContinualLockDisplayTimer; |
298 |
delete mForceContinualLockDisplayTimer; |
|
Lines 410-416
Link Here
|
| 410 |
if (numread > 0) { |
415 |
if (numread > 0) { |
| 411 |
if (readbuf[0] == 'C') { |
416 |
if (readbuf[0] == 'C') { |
| 412 |
mInfoMessageDisplayed=false; |
417 |
mInfoMessageDisplayed=false; |
| 413 |
while (mDialogControlLock == true) sleep(1); |
418 |
while (mDialogControlLock == true) usleep(100000); |
| 414 |
mDialogControlLock = true; |
419 |
mDialogControlLock = true; |
| 415 |
if (currentDialog != NULL) { |
420 |
if (currentDialog != NULL) { |
| 416 |
mForceReject = true; |
421 |
mForceReject = true; |
|
Lines 423-429
Link Here
|
| 423 |
to_display = to_display.remove(0,1); |
428 |
to_display = to_display.remove(0,1); |
| 424 |
// Lock out password dialogs and close any active dialog |
429 |
// Lock out password dialogs and close any active dialog |
| 425 |
mInfoMessageDisplayed=true; |
430 |
mInfoMessageDisplayed=true; |
| 426 |
while (mDialogControlLock == true) sleep(1); |
431 |
while (mDialogControlLock == true) usleep(100000); |
| 427 |
mDialogControlLock = true; |
432 |
mDialogControlLock = true; |
| 428 |
if (currentDialog != NULL) { |
433 |
if (currentDialog != NULL) { |
| 429 |
mForceReject = true; |
434 |
mForceReject = true; |
|
Lines 444-450
Link Here
|
| 444 |
to_display = to_display.remove(0,1); |
449 |
to_display = to_display.remove(0,1); |
| 445 |
// Lock out password dialogs and close any active dialog |
450 |
// Lock out password dialogs and close any active dialog |
| 446 |
mInfoMessageDisplayed=true; |
451 |
mInfoMessageDisplayed=true; |
| 447 |
while (mDialogControlLock == true) sleep(1); |
452 |
while (mDialogControlLock == true) usleep(100000); |
| 448 |
mDialogControlLock = true; |
453 |
mDialogControlLock = true; |
| 449 |
if (currentDialog != NULL) { |
454 |
if (currentDialog != NULL) { |
| 450 |
mForceReject = true; |
455 |
mForceReject = true; |
|
Lines 468-474
Link Here
|
| 468 |
to_display = to_display.remove(0,1); |
473 |
to_display = to_display.remove(0,1); |
| 469 |
// Lock out password dialogs and close any active dialog |
474 |
// Lock out password dialogs and close any active dialog |
| 470 |
mInfoMessageDisplayed=true; |
475 |
mInfoMessageDisplayed=true; |
| 471 |
while (mDialogControlLock == true) sleep(1); |
476 |
while (mDialogControlLock == true) usleep(100000); |
| 472 |
mDialogControlLock = true; |
477 |
mDialogControlLock = true; |
| 473 |
if (currentDialog != NULL) { |
478 |
if (currentDialog != NULL) { |
| 474 |
mForceReject = true; |
479 |
mForceReject = true; |
|
Lines 887-894
Link Here
|
| 887 |
mRootWidth = rootAttr.width; |
892 |
mRootWidth = rootAttr.width; |
| 888 |
mRootHeight = rootAttr.height; |
893 |
mRootHeight = rootAttr.height; |
| 889 |
|
894 |
|
|
|
895 |
// Resize the background widget |
| 890 |
setGeometry(0, 0, mRootWidth, mRootHeight); |
896 |
setGeometry(0, 0, mRootWidth, mRootHeight); |
| 891 |
|
897 |
|
|
|
898 |
// Black out the background widget to hide ugly resize tiling artifacts |
| 899 |
setBackgroundColor(black); |
| 900 |
erase(); |
| 901 |
|
| 892 |
// This slot needs to be able to execute very rapidly so as to prevent the user's desktop from ever |
902 |
// This slot needs to be able to execute very rapidly so as to prevent the user's desktop from ever |
| 893 |
// being displayed, so we finish the hack restarting/display prettying operations in a separate timed slot |
903 |
// being displayed, so we finish the hack restarting/display prettying operations in a separate timed slot |
| 894 |
if (resizeTimer == NULL) { |
904 |
if (resizeTimer == NULL) { |
|
Lines 902-908
Link Here
|
| 902 |
{ |
912 |
{ |
| 903 |
stopHack(); |
913 |
stopHack(); |
| 904 |
|
914 |
|
| 905 |
while (mDialogControlLock == true) sleep(1); |
915 |
while (mDialogControlLock == true) usleep(100000); |
| 906 |
mDialogControlLock = true; |
916 |
mDialogControlLock = true; |
| 907 |
if (closeCurrentWindow()) { |
917 |
if (closeCurrentWindow()) { |
| 908 |
TQTimer::singleShot( 0, this, SLOT(doDesktopResizeFinish()) ); |
918 |
TQTimer::singleShot( 0, this, SLOT(doDesktopResizeFinish()) ); |
|
Lines 911-917
Link Here
|
| 911 |
mDialogControlLock = false; |
921 |
mDialogControlLock = false; |
| 912 |
|
922 |
|
| 913 |
// Restart the hack as the window size is now different |
923 |
// Restart the hack as the window size is now different |
| 914 |
startHack(); |
924 |
if (trinity_desktop_lock_delay_screensaver_start && trinity_desktop_lock_forced && trinity_desktop_lock_use_system_modal_dialogs) { |
|
|
925 |
ENABLE_CONTINUOUS_LOCKDLG_DISPLAY |
| 926 |
if (mHackStartupEnabled) mHackDelayStartupTimer->start(mHackDelayStartupTimeout, TRUE); |
| 927 |
} |
| 928 |
else { |
| 929 |
startHack(); |
| 930 |
} |
| 915 |
|
931 |
|
| 916 |
mBusy = false; |
932 |
mBusy = false; |
| 917 |
} |
933 |
} |
|
Lines 1064-1070
Link Here
|
| 1064 |
|
1080 |
|
| 1065 |
if (!grabKeyboard()) |
1081 |
if (!grabKeyboard()) |
| 1066 |
{ |
1082 |
{ |
| 1067 |
sleep(1); |
1083 |
usleep(100000); |
| 1068 |
if (!grabKeyboard()) |
1084 |
if (!grabKeyboard()) |
| 1069 |
{ |
1085 |
{ |
| 1070 |
return false; |
1086 |
return false; |
|
Lines 1073-1079
Link Here
|
| 1073 |
|
1089 |
|
| 1074 |
if (!grabMouse()) |
1090 |
if (!grabMouse()) |
| 1075 |
{ |
1091 |
{ |
| 1076 |
sleep(1); |
1092 |
usleep(100000); |
| 1077 |
if (!grabMouse()) |
1093 |
if (!grabMouse()) |
| 1078 |
{ |
1094 |
{ |
| 1079 |
XUngrabKeyboard(qt_xdisplay(), CurrentTime); |
1095 |
XUngrabKeyboard(qt_xdisplay(), CurrentTime); |
|
Lines 1117-1123
Link Here
|
| 1117 |
m_grayImage.fill(0); // Set the alpha buffer to 0 (fully transparent) |
1133 |
m_grayImage.fill(0); // Set the alpha buffer to 0 (fully transparent) |
| 1118 |
m_grayImage.setAlphaBuffer(true); |
1134 |
m_grayImage.setAlphaBuffer(true); |
| 1119 |
TQPixmap m_root; |
1135 |
TQPixmap m_root; |
| 1120 |
m_root.resize( TQApplication::desktop()->geometry().width(), TQApplication::desktop()->geometry().height() ); |
1136 |
m_root.resize(mRootWidth, mRootHeight); |
| 1121 |
TQPainter p; |
1137 |
TQPainter p; |
| 1122 |
p.begin( &m_root ); |
1138 |
p.begin( &m_root ); |
| 1123 |
m_grayImage.setAlphaBuffer(false); |
1139 |
m_grayImage.setAlphaBuffer(false); |
|
Lines 1144-1157
Link Here
|
| 1144 |
setBackgroundColor(black); |
1160 |
setBackgroundColor(black); |
| 1145 |
else |
1161 |
else |
| 1146 |
setBackgroundPixmap(backingPixmap); |
1162 |
setBackgroundPixmap(backingPixmap); |
|
|
1163 |
setGeometry(0, 0, mRootWidth, mRootHeight); |
| 1147 |
erase(); |
1164 |
erase(); |
| 1148 |
} |
1165 |
} |
| 1149 |
if (trinity_desktop_lock_use_system_modal_dialogs) { |
1166 |
if (trinity_desktop_lock_use_system_modal_dialogs) { |
| 1150 |
// Try to get the root pixmap |
1167 |
// Try to get the root pixmap |
| 1151 |
m_rootPixmap = new KRootPixmap(this); |
1168 |
if (!m_rootPixmap) m_rootPixmap = new KRootPixmap(this); |
| 1152 |
m_rootPixmap->setCustomPainting(true); |
1169 |
m_rootPixmap->setCustomPainting(true); |
| 1153 |
connect(m_rootPixmap, TQT_SIGNAL(backgroundUpdated(const TQPixmap &)), this, TQT_SLOT(slotPaintBackground(const TQPixmap &))); |
1170 |
connect(m_rootPixmap, TQT_SIGNAL(backgroundUpdated(const TQPixmap &)), this, TQT_SLOT(slotPaintBackground(const TQPixmap &))); |
| 1154 |
m_rootPixmap->start(); |
1171 |
m_rootPixmap->start(); |
|
|
1172 |
// Sometimes KRootPixmap fails...make sure the desktop is hidden regardless |
| 1173 |
if (!mEnsureScreenHiddenTimer) { |
| 1174 |
mEnsureScreenHiddenTimer = new TQTimer( this ); |
| 1175 |
connect( mEnsureScreenHiddenTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotForcePaintBackground()) ); |
| 1176 |
} |
| 1177 |
mEnsureScreenHiddenTimer->start(2000, true); |
| 1155 |
} |
1178 |
} |
| 1156 |
|
1179 |
|
| 1157 |
if (trinity_desktop_lock_in_sec_dlg == FALSE) { |
1180 |
if (trinity_desktop_lock_in_sec_dlg == FALSE) { |
|
Lines 1275-1280
Link Here
|
| 1275 |
if (!mHackProc.isRunning()) { |
1298 |
if (!mHackProc.isRunning()) { |
| 1276 |
if (backingPixmap.isNull()) { |
1299 |
if (backingPixmap.isNull()) { |
| 1277 |
setBackgroundColor(black); |
1300 |
setBackgroundColor(black); |
|
|
1301 |
setGeometry(0, 0, mRootWidth, mRootHeight); |
| 1278 |
erase(); |
1302 |
erase(); |
| 1279 |
} |
1303 |
} |
| 1280 |
else { |
1304 |
else { |
|
Lines 1298-1303
Link Here
|
| 1298 |
setBackgroundColor(black); |
1322 |
setBackgroundColor(black); |
| 1299 |
else |
1323 |
else |
| 1300 |
setBackgroundPixmap(backingPixmap); |
1324 |
setBackgroundPixmap(backingPixmap); |
|
|
1325 |
setGeometry(0, 0, mRootWidth, mRootHeight); |
| 1301 |
erase(); |
1326 |
erase(); |
| 1302 |
return false; |
1327 |
return false; |
| 1303 |
} |
1328 |
} |
|
Lines 1344-1349
Link Here
|
| 1344 |
setBackgroundColor(black); |
1369 |
setBackgroundColor(black); |
| 1345 |
else |
1370 |
else |
| 1346 |
setBackgroundPixmap(backingPixmap); |
1371 |
setBackgroundPixmap(backingPixmap); |
|
|
1372 |
setGeometry(0, 0, mRootWidth, mRootHeight); |
| 1347 |
erase(); |
1373 |
erase(); |
| 1348 |
mSuspended = false; |
1374 |
mSuspended = false; |
| 1349 |
} |
1375 |
} |
|
Lines 1377-1383
Link Here
|
| 1377 |
else |
1403 |
else |
| 1378 |
setBackgroundPixmap(backingPixmap); |
1404 |
setBackgroundPixmap(backingPixmap); |
| 1379 |
} |
1405 |
} |
| 1380 |
if (backingPixmap.isNull()) erase(); |
1406 |
if (backingPixmap.isNull()) { |
|
|
1407 |
setGeometry(0, 0, mRootWidth, mRootHeight); |
| 1408 |
erase(); |
| 1409 |
} |
| 1381 |
else bitBlt(this, 0, 0, &backingPixmap); |
1410 |
else bitBlt(this, 0, 0, &backingPixmap); |
| 1382 |
if (trinity_desktop_lock_use_system_modal_dialogs) { |
1411 |
if (trinity_desktop_lock_use_system_modal_dialogs) { |
| 1383 |
ENABLE_CONTINUOUS_LOCKDLG_DISPLAY |
1412 |
ENABLE_CONTINUOUS_LOCKDLG_DISPLAY |
|
Lines 1416-1422
Link Here
|
| 1416 |
else |
1445 |
else |
| 1417 |
setBackgroundPixmap(backingPixmap); |
1446 |
setBackgroundPixmap(backingPixmap); |
| 1418 |
} |
1447 |
} |
| 1419 |
if (backingPixmap.isNull()) erase(); |
1448 |
if (backingPixmap.isNull()) { |
|
|
1449 |
setGeometry(0, 0, mRootWidth, mRootHeight); |
| 1450 |
erase(); |
| 1451 |
} |
| 1420 |
else bitBlt(this, 0, 0, &backingPixmap); |
1452 |
else bitBlt(this, 0, 0, &backingPixmap); |
| 1421 |
if (!mSuspended) { |
1453 |
if (!mSuspended) { |
| 1422 |
if (trinity_desktop_lock_use_system_modal_dialogs) { |
1454 |
if (trinity_desktop_lock_use_system_modal_dialogs) { |
|
Lines 1492-1497
Link Here
|
| 1492 |
setBackgroundColor(black); |
1524 |
setBackgroundColor(black); |
| 1493 |
else |
1525 |
else |
| 1494 |
setBackgroundPixmap(backingPixmap); |
1526 |
setBackgroundPixmap(backingPixmap); |
|
|
1527 |
setGeometry(0, 0, mRootWidth, mRootHeight); |
| 1495 |
erase(); |
1528 |
erase(); |
| 1496 |
return; |
1529 |
return; |
| 1497 |
} |
1530 |
} |
|
Lines 1597-1606
Link Here
|
| 1597 |
} |
1630 |
} |
| 1598 |
mDialogs.prepend( dlg ); |
1631 |
mDialogs.prepend( dlg ); |
| 1599 |
fakeFocusIn( dlg->winId()); |
1632 |
fakeFocusIn( dlg->winId()); |
| 1600 |
if (backingPixmap.isNull() && trinity_desktop_lock_use_system_modal_dialogs) erase(); |
1633 |
if (backingPixmap.isNull() && trinity_desktop_lock_use_system_modal_dialogs) { |
|
|
1634 |
setGeometry(0, 0, mRootWidth, mRootHeight); |
| 1635 |
erase(); |
| 1636 |
} |
| 1601 |
else bitBlt(this, 0, 0, &backingPixmap); |
1637 |
else bitBlt(this, 0, 0, &backingPixmap); |
| 1602 |
int rt = dlg->exec(); |
1638 |
int rt = dlg->exec(); |
| 1603 |
while (mDialogControlLock == true) sleep(1); |
1639 |
while (mDialogControlLock == true) usleep(100000); |
| 1604 |
currentDialog = NULL; |
1640 |
currentDialog = NULL; |
| 1605 |
mDialogs.remove( dlg ); |
1641 |
mDialogs.remove( dlg ); |
| 1606 |
if( mDialogs.isEmpty() ) { |
1642 |
if( mDialogs.isEmpty() ) { |
|
Lines 1624-1631
Link Here
|
| 1624 |
return rt; |
1660 |
return rt; |
| 1625 |
} |
1661 |
} |
| 1626 |
|
1662 |
|
|
|
1663 |
void LockProcess::slotForcePaintBackground() |
| 1664 |
{ |
| 1665 |
TQPixmap blankPixmap(mRootWidth, mRootHeight); |
| 1666 |
blankPixmap.fill(Qt::black); |
| 1667 |
slotPaintBackground(blankPixmap); |
| 1668 |
printf("[WARNING] Unable to obtain desktop wallpaper in a timely manner. High system load or possibly a TDE bug!\n\r"); fflush(stdout); |
| 1669 |
} |
| 1670 |
|
| 1627 |
void LockProcess::slotPaintBackground(const TQPixmap &rpm) |
1671 |
void LockProcess::slotPaintBackground(const TQPixmap &rpm) |
| 1628 |
{ |
1672 |
{ |
|
|
1673 |
mEnsureScreenHiddenTimer->stop(); |
| 1674 |
|
| 1629 |
TQPixmap pm = rpm; |
1675 |
TQPixmap pm = rpm; |
| 1630 |
|
1676 |
|
| 1631 |
if (TQPaintDevice::x11AppDepth() == 32) { |
1677 |
if (TQPaintDevice::x11AppDepth() == 32) { |
|
Lines 1652-1657
Link Here
|
| 1652 |
backingPixmap = pm; |
1698 |
backingPixmap = pm; |
| 1653 |
if (trinity_desktop_lock_delay_screensaver_start && trinity_desktop_lock_forced) { |
1699 |
if (trinity_desktop_lock_delay_screensaver_start && trinity_desktop_lock_forced) { |
| 1654 |
setBackgroundPixmap(backingPixmap); |
1700 |
setBackgroundPixmap(backingPixmap); |
|
|
1701 |
setGeometry(0, 0, mRootWidth, mRootHeight); |
| 1655 |
erase(); |
1702 |
erase(); |
| 1656 |
} |
1703 |
} |
| 1657 |
} |
1704 |
} |
|
Lines 1677-1683
Link Here
|
| 1677 |
mBusy=true; |
1724 |
mBusy=true; |
| 1678 |
TQTimer::singleShot(1000, this, TQT_SLOT(slotDeadTimePassed())); |
1725 |
TQTimer::singleShot(1000, this, TQT_SLOT(slotDeadTimePassed())); |
| 1679 |
if (mkeyCode == XKeysymToKeycode(qt_xdisplay(), XF86XK_Display)) { |
1726 |
if (mkeyCode == XKeysymToKeycode(qt_xdisplay(), XF86XK_Display)) { |
| 1680 |
while (mDialogControlLock == true) sleep(1); |
1727 |
while (mDialogControlLock == true) usleep(100000); |
| 1681 |
mDialogControlLock = true; |
1728 |
mDialogControlLock = true; |
| 1682 |
currentDialog->close(); // DO NOT use closeCurrentWindow() here! |
1729 |
currentDialog->close(); // DO NOT use closeCurrentWindow() here! |
| 1683 |
mDialogControlLock = false; |
1730 |
mDialogControlLock = false; |