summaryrefslogtreecommitdiffstats
path: root/twin/events.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'twin/events.cpp')
-rw-r--r--twin/events.cpp77
1 files changed, 41 insertions, 36 deletions
diff --git a/twin/events.cpp b/twin/events.cpp
index e2e6b8d60..5158df40b 100644
--- a/twin/events.cpp
+++ b/twin/events.cpp
@@ -196,8 +196,8 @@ bool Workspace::workspaceEvent( XEvent * e )
{
if ( mouse_emulation && (e->type == ButtonPress || e->type == ButtonRelease ) )
{
- mouse_emulation = FALSE;
- XUngrabKeyboard( tqt_xdisplay(), GET_QT_X_TIME() );
+ mouse_emulation = false;
+ XUngrabKeyboard( tqt_xdisplay(), get_tqt_x_time() );
}
if( e->type == PropertyNotify || e->type == ClientMessage )
@@ -221,7 +221,7 @@ bool Workspace::workspaceEvent( XEvent * e )
if ( tab_grab || control_grab )
{
tab_box->handleMouseEvent( e );
- return TRUE;
+ return true;
}
break;
case KeyPress:
@@ -292,11 +292,11 @@ bool Workspace::workspaceEvent( XEvent * e )
!e->xcreatewindow.override_redirect )
{
// see comments for allowClientActivation()
- Time my_qtx_time = GET_QT_X_TIME();
+ Time my_qtx_time = get_tqt_x_time();
XChangeProperty(tqt_xdisplay(), e->xcreatewindow.window,
atoms->kde_net_wm_user_creation_time, XA_CARDINAL,
32, PropModeReplace, (unsigned char *)&my_qtx_time, 1);
- SET_QT_X_TIME(my_qtx_time);
+ set_tqt_x_time(my_qtx_time);
}
break;
@@ -323,7 +323,7 @@ bool Workspace::workspaceEvent( XEvent * e )
addSystemTrayWin( w );
}
}
- return TRUE;
+ return true;
}
return ( e->xunmap.event != e->xunmap.window ); // hide wm typical event from Qt
@@ -336,12 +336,12 @@ bool Workspace::workspaceEvent( XEvent * e )
{
//do not confuse Qt with these events. After all, _we_ are the
//window manager who does the reparenting.
- return TRUE;
+ return true;
}
case DestroyNotify:
{
if ( removeSystemTrayWin( e->xdestroywindow.window, false ) )
- return TRUE;
+ return true;
return false;
}
case MapRequest:
@@ -362,7 +362,7 @@ bool Workspace::workspaceEvent( XEvent * e )
// this code doesn't check the parent to be root.
// if ( e->xmaprequest.parent == root ) { //###TODO store previously destroyed client ids
if ( addSystemTrayWin( e->xmaprequest.window ) )
- return TRUE;
+ return true;
c = createClient( e->xmaprequest.window, false );
if ( c != NULL && root != tqt_xrootwin() )
{ // TODO what is this?
@@ -428,7 +428,7 @@ bool Workspace::workspaceEvent( XEvent * e )
break;
case KeyRelease:
if ( mouse_emulation )
- return FALSE;
+ return false;
break;
case FocusIn:
if( e->xfocus.window == rootWin() && TQCString( getenv("TDE_MULTIHEAD")).lower() != "true"
@@ -460,7 +460,7 @@ bool Workspace::workspaceEvent( XEvent * e )
default:
break;
}
- return FALSE;
+ return false;
}
// Some events don't have the actual window which caused the event
@@ -733,7 +733,7 @@ void Client::destroyNotifyEvent( XDestroyWindowEvent* e )
}
-bool blockAnimation = FALSE;
+bool blockAnimation = false;
/*!
Handles client messages for the client window
@@ -785,8 +785,13 @@ void Client::configureRequestEvent( XConfigureRequestEvent* e )
{
if( e->window != window())
return; // ignore frame/wrapper
- if ( isResize() || isMove())
+ if ( isResize() || isMove() || inhibitConfigureRequests)
+ {
+ // Send a synthetic configure notification to make sure the
+ // window contents get updated by the application
+ sendSyntheticConfigureNotify();
return; // we have better things to do right now
+ }
if( fullscreen_mode == FullScreenNormal ) // refuse resizing of fullscreen windows
{ // but allow resizing fullscreen hacks in order to let them cancel fullscreen mode
@@ -818,7 +823,7 @@ void Client::configureRequestEvent( XConfigureRequestEvent* e )
restackWindow( e->above, e->detail, NET::FromApplication, userTime(), false );
// TODO sending a synthetic configure notify always is fine, even in cases where
- // the ICCCM doesn't require this - it can be though of as 'the WM decided to move
+ // the ICCCM doesn't require this - it can be thought of as 'the WM decided to move
// the window later'. The client should not cause that many configure request,
// so this should not have any significant impact. With user moving/resizing
// the it should be optimized though (see also Client::setGeometry()/plainResize()/move()).
@@ -881,8 +886,8 @@ void Client::enterNotifyEvent( XCrossingEvent* e )
{
delete shadeHoverTimer;
shadeHoverTimer = new TQTimer( this );
- connect( shadeHoverTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( shadeHover() ));
- shadeHoverTimer->start( options->shadeHoverInterval, TRUE );
+ connect( shadeHoverTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( shadeHover() ));
+ shadeHoverTimer->start( options->shadeHoverInterval, true );
}
if ( options->focusPolicy == Options::ClickToFocus )
@@ -894,8 +899,8 @@ void Client::enterNotifyEvent( XCrossingEvent* e )
{
delete autoRaiseTimer;
autoRaiseTimer = new TQTimer( this );
- connect( autoRaiseTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( autoRaise() ) );
- autoRaiseTimer->start( options->autoRaiseInterval, TRUE );
+ connect( autoRaiseTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( autoRaise() ) );
+ autoRaiseTimer->start( options->autoRaiseInterval, true );
}
TQPoint currentPos( e->x_root, e->y_root );
@@ -924,7 +929,7 @@ void Client::leaveNotifyEvent( XCrossingEvent* e )
if ( !buttonDown )
{
mode = PositionCenter;
- setCursor( tqarrowCursor );
+ setCursor( TQt::arrowCursor );
}
bool lostMouse = !rect().contains( TQPoint( e->x, e->y ) );
// 'lostMouse' wouldn't work with e.g. B2 or Keramik, which have non-rectangular decorations
@@ -974,7 +979,7 @@ void Client::grabButton( int modifier )
++i )
XGrabButton( tqt_xdisplay(), AnyButton,
modifier | mods[ i ],
- wrapperId(), FALSE, ButtonPressMask,
+ wrapperId(), false, ButtonPressMask,
GrabModeSync, GrabModeAsync, None, None );
}
@@ -1295,25 +1300,25 @@ bool Client::eventFilter( TQObject* o, TQEvent* e )
return false;
if( e->type() == TQEvent::MouseButtonPress )
{
- TQMouseEvent* ev = TQT_TQMOUSEEVENT( e );
+ TQMouseEvent* ev = static_cast<TQMouseEvent*>( e );
return buttonPressEvent( decorationId(), qtToX11Button( ev->button()), qtToX11State( ev->state()),
ev->x(), ev->y(), ev->globalX(), ev->globalY() );
}
if( e->type() == TQEvent::MouseButtonRelease )
{
- TQMouseEvent* ev = TQT_TQMOUSEEVENT( e );
+ TQMouseEvent* ev = static_cast<TQMouseEvent*>( e );
return buttonReleaseEvent( decorationId(), qtToX11Button( ev->button()), qtToX11State( ev->state()),
ev->x(), ev->y(), ev->globalX(), ev->globalY() );
}
if( e->type() == TQEvent::MouseMove ) // FRAME i fake z enter/leave?
{
- TQMouseEvent* ev = TQT_TQMOUSEEVENT( e );
+ TQMouseEvent* ev = static_cast<TQMouseEvent*>( e );
return motionNotifyEvent( decorationId(), qtToX11State( ev->state()),
ev->x(), ev->y(), ev->globalX(), ev->globalY() );
}
if( e->type() == TQEvent::Wheel )
{
- TQWheelEvent* ev = TQT_TQWHEELEVENT( e );
+ TQWheelEvent* ev = static_cast<TQWheelEvent*>( e );
bool r = buttonPressEvent( decorationId(), ev->delta() > 0 ? Button4 : Button5, qtToX11State( ev->state()),
ev->x(), ev->y(), ev->globalX(), ev->globalY() );
r = r || buttonReleaseEvent( decorationId(), ev->delta() > 0 ? Button4 : Button5, qtToX11State( ev->state()),
@@ -1322,7 +1327,7 @@ bool Client::eventFilter( TQObject* o, TQEvent* e )
}
if( e->type() == TQEvent::Resize )
{
- TQResizeEvent* ev = TQT_TQRESIZEEVENT( e );
+ TQResizeEvent* ev = static_cast<TQResizeEvent*>( e );
// Filter out resize events that inform about size different than frame size.
// This will ensure that decoration->width() etc. and decoration->widget()->width() will be in sync.
// These events only seem to be delayed events from initial resizing before show() was called
@@ -1420,7 +1425,7 @@ bool Client::buttonPressEvent( Window w, int button, int state, int x, int y, in
bool replay = performMouseCommand( com, TQPoint( x_root, y_root), perform_handled );
if ( isSpecialWindow())
- replay = TRUE;
+ replay = true;
if( w == wrapperId()) // these can come only from a grab
XAllowEvents(tqt_xdisplay(), replay? ReplayPointer : SyncPointer, CurrentTime ); //tqt_x_time);
@@ -1448,7 +1453,7 @@ void Client::processDecorationButtonPress( int button, int /*state*/, int x, int
Options::MouseCommand com = Options::MouseNothing;
bool active = isActive();
if ( !wantsInput() ) // we cannot be active, use it anyway
- active = TRUE;
+ active = true;
if ( button == Button1 )
com = active ? options->commandActiveTitlebar1() : options->commandInactiveTitlebar1();
@@ -1461,7 +1466,7 @@ void Client::processDecorationButtonPress( int button, int /*state*/, int x, int
&& com != Options::MouseMinimize ) // mouse release event
{
mode = mousePosition( TQPoint( x, y ));
- buttonDown = TRUE;
+ buttonDown = true;
moveOffset = TQPoint( x, y );
invertedMoveOffset = rect().bottomRight() - moveOffset;
unrestrictedMoveResize = false;
@@ -1512,7 +1517,7 @@ bool Client::buttonReleaseEvent( Window w, int /*button*/, int state, int x, int
y = this->y();
if ( (state & ( Button1Mask & Button2Mask & Button3Mask )) == 0 )
{
- buttonDown = FALSE;
+ buttonDown = false;
if ( moveResizeMode )
{
finishMoveResize( false );
@@ -1550,7 +1555,7 @@ static bool waitingMotionEvent()
// of processes events reaches the timestamp of the last suitable
// MotionNotify event in the queue.
if( next_motion_time != CurrentTime
- && timestampCompare( GET_QT_X_TIME(), next_motion_time ) < 0 )
+ && timestampCompare( get_tqt_x_time(), next_motion_time ) < 0 )
return true;
was_motion = false;
XSync( tqt_xdisplay(), False ); // this helps to discard more MotionNotify events
@@ -1599,7 +1604,7 @@ void Client::focusInEvent( XFocusInEvent* e )
bool activate = workspace()->allowClientActivation( this, -1U, true );
workspace()->gotFocusIn( this ); // remove from should_get_focus list
if( activate )
- setActive( TRUE );
+ setActive( true );
else
{
workspace()->restoreFocus();
@@ -1668,7 +1673,7 @@ void Client::focusOutEvent( XFocusOutEvent* e )
if ( TQApplication::activePopupWidget() )
return;
if( !check_follows_focusin( this ))
- setActive( FALSE );
+ setActive( false );
}
// performs _NET_WM_MOVERESIZE
@@ -1679,7 +1684,7 @@ void Client::NETMoveResize( int x_root, int y_root, NET::Direction direction )
else if( moveResizeMode && direction == NET::MoveResizeCancel )
{
finishMoveResize( true );
- buttonDown = FALSE;
+ buttonDown = false;
setCursor( mode );
}
else if( direction >= NET::TopLeft && direction <= NET::Left )
@@ -1699,7 +1704,7 @@ void Client::NETMoveResize( int x_root, int y_root, NET::Direction direction )
return;
if( moveResizeMode )
finishMoveResize( false );
- buttonDown = TRUE;
+ buttonDown = true;
moveOffset = TQPoint( x_root - x(), y_root - y()); // map from global
invertedMoveOffset = rect().bottomRight() - moveOffset;
unrestrictedMoveResize = false;
@@ -1751,12 +1756,12 @@ void Client::keyPressEvent( uint key_code )
case Key_Return:
case Key_Enter:
finishMoveResize( false );
- buttonDown = FALSE;
+ buttonDown = false;
setCursor( mode );
break;
case Key_Escape:
finishMoveResize( true );
- buttonDown = FALSE;
+ buttonDown = false;
setCursor( mode );
break;
default: