|
|
|
@ -132,7 +132,7 @@ static void segv_handler(int)
|
|
|
|
|
sleep(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern Atom qt_wm_state;
|
|
|
|
|
extern Atom tqt_wm_state;
|
|
|
|
|
extern bool trinity_desktop_lock_use_system_modal_dialogs;
|
|
|
|
|
extern bool trinity_desktop_lock_delay_screensaver_start;
|
|
|
|
|
extern bool trinity_desktop_lock_use_sak;
|
|
|
|
@ -220,15 +220,15 @@ LockProcess::LockProcess(bool child, bool useBlankOnly)
|
|
|
|
|
|
|
|
|
|
// Get root window size
|
|
|
|
|
XWindowAttributes rootAttr;
|
|
|
|
|
XGetWindowAttributes(qt_xdisplay(), RootWindow(qt_xdisplay(),
|
|
|
|
|
qt_xscreen()), &rootAttr);
|
|
|
|
|
XGetWindowAttributes(tqt_xdisplay(), RootWindow(tqt_xdisplay(),
|
|
|
|
|
tqt_xscreen()), &rootAttr);
|
|
|
|
|
mRootWidth = rootAttr.width;
|
|
|
|
|
mRootHeight = rootAttr.height;
|
|
|
|
|
{ // trigger creation of QToolTipManager, it does XSelectInput() on the root window
|
|
|
|
|
TQWidget w;
|
|
|
|
|
TQToolTip::add( &w, "foo" );
|
|
|
|
|
}
|
|
|
|
|
XSelectInput( qt_xdisplay(), qt_xrootwin(),
|
|
|
|
|
XSelectInput( tqt_xdisplay(), tqt_xrootwin(),
|
|
|
|
|
SubstructureNotifyMask | rootAttr.your_event_mask );
|
|
|
|
|
|
|
|
|
|
// Add non-KDE path
|
|
|
|
@ -249,8 +249,8 @@ LockProcess::LockProcess(bool child, bool useBlankOnly)
|
|
|
|
|
relPath);
|
|
|
|
|
|
|
|
|
|
// virtual root property
|
|
|
|
|
gXA_VROOT = XInternAtom (qt_xdisplay(), "__SWM_VROOT", False);
|
|
|
|
|
gXA_SCREENSAVER_VERSION = XInternAtom (qt_xdisplay(), "_SCREENSAVER_VERSION", False);
|
|
|
|
|
gXA_VROOT = XInternAtom (tqt_xdisplay(), "__SWM_VROOT", False);
|
|
|
|
|
gXA_SCREENSAVER_VERSION = XInternAtom (tqt_xdisplay(), "_SCREENSAVER_VERSION", False);
|
|
|
|
|
|
|
|
|
|
connect(&mHackProc, TQT_SIGNAL(processExited(KProcess *)),
|
|
|
|
|
TQT_SLOT(hackExited(KProcess *)));
|
|
|
|
@ -270,7 +270,7 @@ LockProcess::LockProcess(bool child, bool useBlankOnly)
|
|
|
|
|
if (mDPMSDepend) {
|
|
|
|
|
BOOL on;
|
|
|
|
|
CARD16 state;
|
|
|
|
|
DPMSInfo(qt_xdisplay(), &state, &on);
|
|
|
|
|
DPMSInfo(tqt_xdisplay(), &state, &on);
|
|
|
|
|
if (on)
|
|
|
|
|
{
|
|
|
|
|
connect(&mCheckDPMS, TQT_SIGNAL(timeout()), TQT_SLOT(checkDPMSActive()));
|
|
|
|
@ -876,14 +876,14 @@ void LockProcess::createSaverWindow()
|
|
|
|
|
|
|
|
|
|
// Some xscreensaver hacks check for this property
|
|
|
|
|
const char *version = "KDE 2.0";
|
|
|
|
|
XChangeProperty (qt_xdisplay(), winId(),
|
|
|
|
|
XChangeProperty (tqt_xdisplay(), winId(),
|
|
|
|
|
gXA_SCREENSAVER_VERSION, XA_STRING, 8, PropModeReplace,
|
|
|
|
|
(unsigned char *) version, strlen(version));
|
|
|
|
|
|
|
|
|
|
XSetWindowAttributes attr;
|
|
|
|
|
attr.event_mask = KeyPressMask | ButtonPressMask | PointerMotionMask |
|
|
|
|
|
VisibilityChangeMask | ExposureMask;
|
|
|
|
|
XChangeWindowAttributes(qt_xdisplay(), winId(),
|
|
|
|
|
XChangeWindowAttributes(tqt_xdisplay(), winId(),
|
|
|
|
|
CWEventMask, &attr);
|
|
|
|
|
|
|
|
|
|
// erase();
|
|
|
|
@ -905,7 +905,7 @@ void LockProcess::desktopResized()
|
|
|
|
|
|
|
|
|
|
// Get root window size
|
|
|
|
|
XWindowAttributes rootAttr;
|
|
|
|
|
XGetWindowAttributes(qt_xdisplay(), RootWindow(qt_xdisplay(), qt_xscreen()), &rootAttr);
|
|
|
|
|
XGetWindowAttributes(tqt_xdisplay(), RootWindow(tqt_xdisplay(), tqt_xscreen()), &rootAttr);
|
|
|
|
|
mRootWidth = rootAttr.width;
|
|
|
|
|
mRootHeight = rootAttr.height;
|
|
|
|
|
|
|
|
|
@ -958,14 +958,14 @@ void LockProcess::hideSaverWindow()
|
|
|
|
|
hide();
|
|
|
|
|
lower();
|
|
|
|
|
removeVRoot(winId());
|
|
|
|
|
XDeleteProperty(qt_xdisplay(), winId(), gXA_SCREENSAVER_VERSION);
|
|
|
|
|
XDeleteProperty(tqt_xdisplay(), winId(), gXA_SCREENSAVER_VERSION);
|
|
|
|
|
if ( gVRoot ) {
|
|
|
|
|
unsigned long vroot_data[1] = { gVRootData };
|
|
|
|
|
XChangeProperty(qt_xdisplay(), gVRoot, gXA_VROOT, XA_WINDOW, 32,
|
|
|
|
|
XChangeProperty(tqt_xdisplay(), gVRoot, gXA_VROOT, XA_WINDOW, 32,
|
|
|
|
|
PropModeReplace, (unsigned char *)vroot_data, 1);
|
|
|
|
|
gVRoot = 0;
|
|
|
|
|
}
|
|
|
|
|
XSync(qt_xdisplay(), False);
|
|
|
|
|
XSync(tqt_xdisplay(), False);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
@ -982,7 +982,7 @@ void LockProcess::saveVRoot()
|
|
|
|
|
{
|
|
|
|
|
Window rootReturn, parentReturn, *children;
|
|
|
|
|
unsigned int numChildren;
|
|
|
|
|
Window root = RootWindowOfScreen(ScreenOfDisplay(qt_xdisplay(), qt_xscreen()));
|
|
|
|
|
Window root = RootWindowOfScreen(ScreenOfDisplay(tqt_xdisplay(), tqt_xscreen()));
|
|
|
|
|
|
|
|
|
|
gVRoot = 0;
|
|
|
|
|
gVRootData = 0;
|
|
|
|
@ -990,7 +990,7 @@ void LockProcess::saveVRoot()
|
|
|
|
|
int (*oldHandler)(Display *, XErrorEvent *);
|
|
|
|
|
oldHandler = XSetErrorHandler(ignoreXError);
|
|
|
|
|
|
|
|
|
|
if (XQueryTree(qt_xdisplay(), root, &rootReturn, &parentReturn,
|
|
|
|
|
if (XQueryTree(tqt_xdisplay(), root, &rootReturn, &parentReturn,
|
|
|
|
|
&children, &numChildren))
|
|
|
|
|
{
|
|
|
|
|
for (unsigned int i = 0; i < numChildren; i++)
|
|
|
|
@ -1000,7 +1000,7 @@ void LockProcess::saveVRoot()
|
|
|
|
|
unsigned long nitems, bytesafter;
|
|
|
|
|
unsigned char *newRoot = 0;
|
|
|
|
|
|
|
|
|
|
if ((XGetWindowProperty(qt_xdisplay(), children[i], gXA_VROOT, 0, 1,
|
|
|
|
|
if ((XGetWindowProperty(tqt_xdisplay(), children[i], gXA_VROOT, 0, 1,
|
|
|
|
|
False, XA_WINDOW, &actual_type, &actual_format, &nitems, &bytesafter,
|
|
|
|
|
&newRoot) == Success) && newRoot)
|
|
|
|
|
{
|
|
|
|
@ -1029,14 +1029,14 @@ void LockProcess::setVRoot(Window win, Window vr)
|
|
|
|
|
if (gVRoot)
|
|
|
|
|
removeVRoot(gVRoot);
|
|
|
|
|
|
|
|
|
|
unsigned long rw = RootWindowOfScreen(ScreenOfDisplay(qt_xdisplay(), qt_xscreen()));
|
|
|
|
|
unsigned long rw = RootWindowOfScreen(ScreenOfDisplay(tqt_xdisplay(), tqt_xscreen()));
|
|
|
|
|
unsigned long vroot_data[1] = { vr };
|
|
|
|
|
|
|
|
|
|
Window rootReturn, parentReturn, *children;
|
|
|
|
|
unsigned int numChildren;
|
|
|
|
|
Window top = win;
|
|
|
|
|
while (1) {
|
|
|
|
|
XQueryTree(qt_xdisplay(), top , &rootReturn, &parentReturn,
|
|
|
|
|
XQueryTree(tqt_xdisplay(), top , &rootReturn, &parentReturn,
|
|
|
|
|
&children, &numChildren);
|
|
|
|
|
if (children)
|
|
|
|
|
XFree((char *)children);
|
|
|
|
@ -1046,7 +1046,7 @@ void LockProcess::setVRoot(Window win, Window vr)
|
|
|
|
|
top = parentReturn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
XChangeProperty(qt_xdisplay(), top, gXA_VROOT, XA_WINDOW, 32,
|
|
|
|
|
XChangeProperty(tqt_xdisplay(), top, gXA_VROOT, XA_WINDOW, 32,
|
|
|
|
|
PropModeReplace, (unsigned char *)vroot_data, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1056,7 +1056,7 @@ void LockProcess::setVRoot(Window win, Window vr)
|
|
|
|
|
//
|
|
|
|
|
void LockProcess::removeVRoot(Window win)
|
|
|
|
|
{
|
|
|
|
|
XDeleteProperty (qt_xdisplay(), win, gXA_VROOT);
|
|
|