|
|
@ -1487,28 +1487,31 @@ void TQWidget::grabMouse()
|
|
|
|
void TQWidget::grabMouse( const TQCursor &cursor )
|
|
|
|
void TQWidget::grabMouse( const TQCursor &cursor )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( !qt_nograb() ) {
|
|
|
|
if ( !qt_nograb() ) {
|
|
|
|
if ( mouseGrb )
|
|
|
|
if ( mouseGrb != this ) {
|
|
|
|
mouseGrb->releaseMouse();
|
|
|
|
if ( mouseGrb ) {
|
|
|
|
|
|
|
|
mouseGrb->releaseMouse();
|
|
|
|
|
|
|
|
}
|
|
|
|
#if defined(QT_CHECK_STATE)
|
|
|
|
#if defined(QT_CHECK_STATE)
|
|
|
|
int status =
|
|
|
|
int status =
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
XGrabPointer( x11Display(), winId(), False,
|
|
|
|
XGrabPointer( x11Display(), winId(), False,
|
|
|
|
(uint)(ButtonPressMask | ButtonReleaseMask |
|
|
|
|
(uint)(ButtonPressMask | ButtonReleaseMask |
|
|
|
|
PointerMotionMask | EnterWindowMask | LeaveWindowMask),
|
|
|
|
PointerMotionMask | EnterWindowMask | LeaveWindowMask),
|
|
|
|
GrabModeAsync, GrabModeAsync,
|
|
|
|
GrabModeAsync, GrabModeAsync,
|
|
|
|
None, cursor.handle(), tqt_x_time );
|
|
|
|
None, cursor.handle(), tqt_x_time );
|
|
|
|
#if defined(QT_CHECK_STATE)
|
|
|
|
#if defined(QT_CHECK_STATE)
|
|
|
|
if ( status ) {
|
|
|
|
if ( status ) {
|
|
|
|
const char *s =
|
|
|
|
const char *s =
|
|
|
|
status == GrabNotViewable ? "\"GrabNotViewable\"" :
|
|
|
|
status == GrabNotViewable ? "\"GrabNotViewable\"" :
|
|
|
|
status == AlreadyGrabbed ? "\"AlreadyGrabbed\"" :
|
|
|
|
status == AlreadyGrabbed ? "\"AlreadyGrabbed\"" :
|
|
|
|
status == GrabFrozen ? "\"GrabFrozen\"" :
|
|
|
|
status == GrabFrozen ? "\"GrabFrozen\"" :
|
|
|
|
status == GrabInvalidTime ? "\"GrabInvalidTime\"" :
|
|
|
|
status == GrabInvalidTime ? "\"GrabInvalidTime\"" :
|
|
|
|
"<?>";
|
|
|
|
"<?>";
|
|
|
|
tqWarning( "Grabbing the mouse failed with %s", s );
|
|
|
|
tqWarning( "Grabbing the mouse failed with %s", s );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
mouseGrb = this;
|
|
|
|
mouseGrb = this;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1548,11 +1551,13 @@ void TQWidget::releaseMouse()
|
|
|
|
void TQWidget::grabKeyboard()
|
|
|
|
void TQWidget::grabKeyboard()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( !qt_nograb() ) {
|
|
|
|
if ( !qt_nograb() ) {
|
|
|
|
if ( keyboardGrb )
|
|
|
|
if ( keyboardGrb != this ) {
|
|
|
|
keyboardGrb->releaseKeyboard();
|
|
|
|
if ( keyboardGrb ) {
|
|
|
|
XGrabKeyboard( x11Display(), winid, False, GrabModeAsync, GrabModeAsync,
|
|
|
|
keyboardGrb->releaseKeyboard();
|
|
|
|
tqt_x_time );
|
|
|
|
}
|
|
|
|
keyboardGrb = this;
|
|
|
|
XGrabKeyboard( x11Display(), winid, False, GrabModeAsync, GrabModeAsync, tqt_x_time );
|
|
|
|
|
|
|
|
keyboardGrb = this;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|