rules kcm, detection use X11 to grab the pointer
BUG: 318437 REVIEW: 110078 FIXED-IN: 4.11
This commit is contained in:
parent
d2f9d8feee
commit
4ec1a9bb3a
1 changed files with 12 additions and 2 deletions
|
@ -172,8 +172,18 @@ void DetectDialog::selectWindow()
|
|||
grabber->move(-1000, -1000);
|
||||
grabber->setModal(true);
|
||||
grabber->show();
|
||||
grabber->grabMouse(Qt::CrossCursor);
|
||||
// Qt uses QX11Info::appTime() to grab the pointer, what can silently fail (#318437) ...
|
||||
XSync(QX11Info::display(), false);
|
||||
if (XGrabPointer(QX11Info::display(), grabber->winId(), false, ButtonReleaseMask,
|
||||
GrabModeAsync, GrabModeAsync, None, QCursor(Qt::CrossCursor).handle(),
|
||||
CurrentTime) == Success) { // ...so we use the far more convincing CurrentTime
|
||||
grabber->grabMouse(Qt::CrossCursor); // do anyway, so that Qt updates the mouseGrabber info
|
||||
grabber->installEventFilter(this);
|
||||
} else {
|
||||
// ... and if we fail, cleanup, so we won't receive random events
|
||||
delete grabber;
|
||||
grabber = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool DetectDialog::eventFilter(QObject* o, QEvent* e)
|
||||
|
|
Loading…
Reference in a new issue