summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-03 23:58:37 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-03 23:58:37 +0000
commite057cf9e08ab13e3f6ed139f6b0be3a06c2ec20c (patch)
treea022bd82c4c7b10cd396a463dd491d2897f70abe
parentc3e2931a5bb4c067b0983cf23d064264d1d6b175 (diff)
downloadtdebase-e057cf9e08ab13e3f6ed139f6b0be3a06c2ec20c.tar.gz
tdebase-e057cf9e08ab13e3f6ed139f6b0be3a06c2ec20c.zip
Wean kdebase off of hacky static qt_x_*_tim variables
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1227011 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--kicker/applets/menu/menuapplet.cpp4
-rw-r--r--klipper/clipboardpoll.cpp12
-rw-r--r--klipper/toplevel.cpp5
-rw-r--r--konqueror/KonquerorIface.cc15
-rw-r--r--konqueror/konq_mainwindow.cc10
-rw-r--r--ksmserver/legacy.cpp4
-rw-r--r--kwin/activation.cpp6
-rw-r--r--kwin/client.cpp17
-rw-r--r--kwin/events.cpp10
-rw-r--r--kwin/geometry.cpp16
-rw-r--r--kwin/layers.cpp2
-rw-r--r--kwin/main.cpp4
-rw-r--r--kwin/manage.cpp6
-rw-r--r--kwin/tabbox.cpp10
-rw-r--r--kwin/utils.cpp10
-rw-r--r--kwin/workspace.cpp20
16 files changed, 59 insertions, 92 deletions
diff --git a/kicker/applets/menu/menuapplet.cpp b/kicker/applets/menu/menuapplet.cpp
index 662859bd5..34540defb 100644
--- a/kicker/applets/menu/menuapplet.cpp
+++ b/kicker/applets/menu/menuapplet.cpp
@@ -57,8 +57,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-extern Time qt_x_time;
-
extern "C"
{
KDE_EXPORT KPanelApplet* init( TQWidget* parent_P, const TQString& configFile_P )
@@ -478,7 +476,7 @@ void MenuEmbed::setMinimumSize( int w, int h )
assert( msg_type_atom != None );
ev.xclient.message_type = msg_type_atom;
ev.xclient.format = 32;
- ev.xclient.data.l[0] = qt_x_time;
+ ev.xclient.data.l[0] = GET_QT_X_TIME();
ev.xclient.data.l[1] = minimumWidth();
ev.xclient.data.l[2] = minimumHeight();
ev.xclient.data.l[3] = 0;
diff --git a/klipper/clipboardpoll.cpp b/klipper/clipboardpoll.cpp
index d0b5cf01d..38ef196e4 100644
--- a/klipper/clipboardpoll.cpp
+++ b/klipper/clipboardpoll.cpp
@@ -58,8 +58,6 @@
*/
-extern Time qt_x_time;
-
ClipboardPoll::ClipboardPoll( TQWidget* parent )
: TQWidget( parent )
, xfixes_event_base( -1 )
@@ -117,7 +115,7 @@ void ClipboardPoll::initPolling()
timer.start( 1000, false );
selection.atom = XA_PRIMARY;
clipboard.atom = xa_clipboard;
- selection.last_change = clipboard.last_change = qt_x_time; // don't trigger right after startup
+ selection.last_change = clipboard.last_change = GET_QT_X_TIME(); // don't trigger right after startup
selection.last_owner = XGetSelectionOwner( qt_xdisplay(), XA_PRIMARY );
#ifdef NOISY_KLIPPER_
kdDebug() << "(1) Setting last_owner for =" << "selection" << ":" << selection.last_owner << endl;
@@ -154,7 +152,7 @@ bool ClipboardPoll::x11Event( XEvent* e )
#ifdef NOISY_KLIPPER_
kdDebug() << "SELECTION CHANGED (XFIXES)" << endl;
#endif
- qt_x_time = ev->timestamp;
+ SET_QT_X_TIME(ev->timestamp);
emit clipboardChanged( true );
}
else if( ev->selection == xa_clipboard && !kapp->tqclipboard()->ownsClipboard())
@@ -162,7 +160,7 @@ bool ClipboardPoll::x11Event( XEvent* e )
#ifdef NOISY_KLIPPER_
kdDebug() << "CLIPBOARD CHANGED (XFIXES)" << endl;
#endif
- qt_x_time = ev->timestamp;
+ SET_QT_X_TIME(ev->timestamp);
emit clipboardChanged( false );
}
}
@@ -272,9 +270,9 @@ bool ClipboardPoll::checkTimestamp( SelectionData& data )
return false;
}
XDeleteProperty( qt_xdisplay(), winId(), data.timestamp_atom );
- XConvertSelection( qt_xdisplay(), data.atom, xa_timestamp, data.timestamp_atom, winId(), qt_x_time );
+ XConvertSelection( qt_xdisplay(), data.atom, xa_timestamp, data.timestamp_atom, winId(), GET_QT_X_TIME() );
data.waiting_for_timestamp = true;
- data.waiting_x_time = qt_x_time;
+ data.waiting_x_time = GET_QT_X_TIME();
#ifdef REALLY_NOISY_KLIPPER_
kdDebug() << "WAITING TIMESTAMP:" << ( data.atom == XA_PRIMARY ) << endl;
#endif
diff --git a/klipper/toplevel.cpp b/klipper/toplevel.cpp
index cbbce7de5..a64f1d55a 100644
--- a/klipper/toplevel.cpp
+++ b/klipper/toplevel.cpp
@@ -1037,9 +1037,6 @@ bool KlipperWidget::ignoreClipboardChanges() const
// Call KApplication::updateUserTime() only from functions that are
// called from outside (DCOP), or from TQTimer timeout !
-extern Time qt_x_time;
-extern Time qt_x_user_time;
-
static Time next_x_time;
static Bool update_x_time_predicate( Display*, XEvent* event, XPointer )
{
@@ -1080,7 +1077,7 @@ void KlipperWidget::updateTimestamp()
{ // Qt3.3.0 and 3.3.1 use qt_x_user_time for clipboard operations
Time& time = ( strcmp( qVersion(), "3.3.1" ) == 0
|| strcmp( qVersion(), "3.3.0" ) == 0 )
- ? qt_x_user_time : qt_x_time;
+ ? GET_QT_X_USER_TIME() : GET_QT_X_TIME();
static TQWidget* w = 0;
if ( !w )
w = new TQWidget;
diff --git a/konqueror/KonquerorIface.cc b/konqueror/KonquerorIface.cc
index a22788858..a512f5686 100644
--- a/konqueror/KonquerorIface.cc
+++ b/konqueror/KonquerorIface.cc
@@ -39,7 +39,6 @@
// TODO a valid timestamp should be passed in the DCOP calls that
// are not for user scripting
#include <X11/Xlib.h>
-extern Time qt_x_user_time;
KonquerorIface::KonquerorIface()
: DCOPObject( "KonquerorIface" )
@@ -52,7 +51,7 @@ KonquerorIface::~KonquerorIface()
DCOPRef KonquerorIface::openBrowserWindow( const TQString &url )
{
- qt_x_user_time = 0;
+ SET_QT_X_USER_TIME(0);
KonqMainWindow *res = KonqMisc::createSimpleWindow( KURL(url) );
if ( !res )
return DCOPRef();
@@ -78,7 +77,7 @@ DCOPRef KonquerorIface::createNewWindowASN( const TQString &url, const TQCString
DCOPRef KonquerorIface::createNewWindowWithSelection( const TQString &url, TQStringList filesToSelect )
{
- qt_x_user_time = 0;
+ SET_QT_X_USER_TIME(0);
KonqMainWindow *res = KonqMisc::createNewWindow( KURL(url), KParts::URLArgs(), false, filesToSelect );
if ( !res )
return DCOPRef();
@@ -93,7 +92,7 @@ DCOPRef KonquerorIface::createNewWindowWithSelectionASN( const TQString &url, TQ
DCOPRef KonquerorIface::createNewWindow( const TQString &url, const TQString &mimetype, bool tempFile )
{
- qt_x_user_time = 0;
+ SET_QT_X_USER_TIME(0);
KParts::URLArgs args;
args.serviceType = mimetype;
// Filter the URL, so that "kfmclient openURL gg:foo" works also when konq is already running
@@ -113,7 +112,7 @@ DCOPRef KonquerorIface::createNewWindowASN( const TQString &url, const TQString
DCOPRef KonquerorIface::createBrowserWindowFromProfile( const TQString &path )
{
- qt_x_user_time = 0;
+ SET_QT_X_USER_TIME(0);
kdDebug(1202) << "void KonquerorIface::createBrowserWindowFromProfile( const TQString &path ) " << endl;
kdDebug(1202) << path << endl;
KonqMainWindow *res = KonqMisc::createBrowserWindowFromProfile( path, TQString::null );
@@ -130,7 +129,7 @@ DCOPRef KonquerorIface::createBrowserWindowFromProfileASN( const TQString &path,
DCOPRef KonquerorIface::createBrowserWindowFromProfile( const TQString & path, const TQString &filename )
{
- qt_x_user_time = 0;
+ SET_QT_X_USER_TIME(0);
kdDebug(1202) << "void KonquerorIface::createBrowserWindowFromProfile( path, filename ) " << endl;
kdDebug(1202) << path << "," << filename << endl;
KonqMainWindow *res = KonqMisc::createBrowserWindowFromProfile( path, filename );
@@ -148,7 +147,7 @@ DCOPRef KonquerorIface::createBrowserWindowFromProfileASN( const TQString &path,
DCOPRef KonquerorIface::createBrowserWindowFromProfileAndURL( const TQString & path, const TQString &filename, const TQString &url )
{
- qt_x_user_time = 0;
+ SET_QT_X_USER_TIME(0);
KonqMainWindow *res = KonqMisc::createBrowserWindowFromProfile( path, filename, KURL(url) );
if ( !res )
return DCOPRef();
@@ -164,7 +163,7 @@ DCOPRef KonquerorIface::createBrowserWindowFromProfileAndURLASN( const TQString
DCOPRef KonquerorIface::createBrowserWindowFromProfileAndURL( const TQString &path, const TQString &filename, const TQString &url, const TQString &mimetype )
{
- qt_x_user_time = 0;
+ SET_QT_X_USER_TIME(0);
KParts::URLArgs args;
args.serviceType = mimetype;
KonqMainWindow *res = KonqMisc::createBrowserWindowFromProfile( path, filename, KURL(url), args );
diff --git a/konqueror/konq_mainwindow.cc b/konqueror/konq_mainwindow.cc
index 79b88daa3..aa237261f 100644
--- a/konqueror/konq_mainwindow.cc
+++ b/konqueror/konq_mainwindow.cc
@@ -1292,8 +1292,7 @@ void KonqMainWindow::slotCreateNewWindow( const KURL &url, const KParts::URLArgs
// well. If the WM has support for _NET_WM_USER_TIME, it will be just set to 0 (=don't focus on show),
// and the WM should take care of it itself.
bool wm_usertime_support = false;
- extern Time qt_x_user_time;
- Time saved_last_input_time = qt_x_user_time;
+ Time saved_last_input_time = GET_QT_X_USER_TIME();
if ( windowArgs.lowerWindow )
{
NETRootInfo wm_info( qt_xdisplay(), NET::Supported );
@@ -1303,7 +1302,7 @@ void KonqMainWindow::slotCreateNewWindow( const KURL &url, const KParts::URLArgs
// *sigh*, and I thought nobody would need TQWidget::dontFocusOnShow().
// Avoid Qt's support for user time by setting it to 0, and
// set the property ourselves.
- qt_x_user_time = 0;
+ SET_QT_X_USER_TIME(0);
KWin::setUserTime( mainWindow->winId(), 0 );
}
// Put below the current window before showing, in case that actually works with the WM.
@@ -1316,7 +1315,7 @@ void KonqMainWindow::slotCreateNewWindow( const KURL &url, const KParts::URLArgs
if ( windowArgs.lowerWindow )
{
- qt_x_user_time = saved_last_input_time;
+ SET_QT_X_USER_TIME(saved_last_input_time);
if( !wm_usertime_support )
{ // No WM support. Let's try ugly tricks.
mainWindow->lower();
@@ -5815,8 +5814,7 @@ void KonqMainWindow::resetWindow()
static Atom atom = XInternAtom( qt_xdisplay(), "_KDE_NET_WM_USER_CREATION_TIME", False );
XChangeProperty( qt_xdisplay(), winId(), atom, XA_CARDINAL, 32,
PropModeReplace, (unsigned char *) &x_time, 1);
- extern Time qt_x_user_time; // reset also user time, so that this window
- qt_x_user_time = CurrentTime; // won't have _NET_WM_USER_TIME set
+ SET_QT_X_USER_TIME(CurrentTime); // won't have _NET_WM_USER_TIME set
#if !KDE_IS_VERSION( 3, 2, 90 ) // _KDE_NET_USER_TIME is obsolete
static Atom atom2 = XInternAtom( qt_xdisplay(), "_KDE_NET_USER_TIME", False );
timeval tv;
diff --git a/ksmserver/legacy.cpp b/ksmserver/legacy.cpp
index d7838253b..f754d4126 100644
--- a/ksmserver/legacy.cpp
+++ b/ksmserver/legacy.cpp
@@ -68,8 +68,6 @@ static Atom wm_save_yourself = None;
static Atom wm_protocols = None;
static Atom wm_client_leader = None;
-extern Time qt_x_time;
-
static int winsErrorHandler(Display *, XErrorEvent *ev)
{
if (windowMapPtr) {
@@ -153,7 +151,7 @@ void KSMServer::performLegacySessionSave()
ev.xclient.message_type = wm_protocols;
ev.xclient.format = 32;
ev.xclient.data.l[0] = wm_save_yourself;
- ev.xclient.data.l[1] = qt_x_time;
+ ev.xclient.data.l[1] = GET_QT_X_TIME();
XSelectInput(newdisplay, w, PropertyChangeMask|StructureNotifyMask);
XSendEvent(newdisplay, w, False, 0, &ev);
}
diff --git a/kwin/activation.cpp b/kwin/activation.cpp
index e964ed1b9..ad9dc8eba 100644
--- a/kwin/activation.cpp
+++ b/kwin/activation.cpp
@@ -31,8 +31,6 @@ License. See the file "COPYING" for the exact licensing terms.
#include "group.h"
#include "rules.h"
-extern Time qt_x_time;
-
namespace KWinInternal
{
@@ -672,7 +670,7 @@ void Workspace::unfakeActivity( Client* c )
void Client::updateUserTime( Time time )
{ // copied in Group::updateUserTime
if( time == CurrentTime )
- time = qt_x_time;
+ time = GET_QT_X_TIME();
if( time != -1U
&& ( user_time == CurrentTime
|| timestampCompare( time, user_time ) > 0 )) // time > user_time
@@ -997,7 +995,7 @@ void Group::startupIdChanged()
void Group::updateUserTime( Time time )
{ // copy of Client::updateUserTime
if( time == CurrentTime )
- time = qt_x_time;
+ time = GET_QT_X_TIME();
if( time != -1U
&& ( user_time == CurrentTime
|| timestampCompare( time, user_time ) > 0 )) // time > user_time
diff --git a/kwin/client.cpp b/kwin/client.cpp
index 2b7794748..dfb352408 100644
--- a/kwin/client.cpp
+++ b/kwin/client.cpp
@@ -38,7 +38,6 @@ License. See the file "COPYING" for the exact licensing terms.
// to resolve them properly
extern Atom qt_wm_state;
-extern Time qt_x_time;
extern Atom qt_window_role;
extern Atom qt_sm_client_id;
@@ -1660,7 +1659,7 @@ void Client::sendClientMessage(Window w, Atom a, Atom protocol, long data1, long
ev.xclient.message_type = a;
ev.xclient.format = 32;
ev.xclient.data.l[0] = protocol;
- ev.xclient.data.l[1] = qt_x_time;
+ ev.xclient.data.l[1] = GET_QT_X_TIME();
ev.xclient.data.l[2] = data1;
ev.xclient.data.l[3] = data2;
ev.xclient.data.l[4] = data3;
@@ -1737,7 +1736,7 @@ void Client::pingWindow()
ping_timer = new TQTimer( this );
connect( ping_timer, TQT_SIGNAL( timeout()), TQT_SLOT( pingTimeout()));
ping_timer->start( options->killPingTimeout, true );
- ping_timestamp = qt_x_time;
+ ping_timestamp = GET_QT_X_TIME();
workspace()->sendPingToWindow( window(), ping_timestamp );
}
@@ -1919,15 +1918,15 @@ void Client::takeActivity( int flags, bool handled, allowed_t )
#ifndef NDEBUG
static Time previous_activity_timestamp;
static Client* previous_client;
- if( previous_activity_timestamp == qt_x_time && previous_client != this )
+ if( previous_activity_timestamp == GET_QT_X_TIME() && previous_client != this )
{
kdDebug( 1212 ) << "Repeated use of the same X timestamp for activity" << endl;
kdDebug( 1212 ) << kdBacktrace() << endl;
}
- previous_activity_timestamp = qt_x_time;
+ previous_activity_timestamp = GET_QT_X_TIME();
previous_client = this;
#endif
- workspace()->sendTakeActivity( this, qt_x_time, flags );
+ workspace()->sendTakeActivity( this, GET_QT_X_TIME(), flags );
}
// performs the actual focusing of the window using XSetInputFocus and WM_TAKE_FOCUS
@@ -1936,17 +1935,17 @@ void Client::takeFocus( allowed_t )
#ifndef NDEBUG
static Time previous_focus_timestamp;
static Client* previous_client;
- if( previous_focus_timestamp == qt_x_time && previous_client != this )
+ if( previous_focus_timestamp == GET_QT_X_TIME() && previous_client != this )
{
kdDebug( 1212 ) << "Repeated use of the same X timestamp for focus" << endl;
kdDebug( 1212 ) << kdBacktrace() << endl;
}
- previous_focus_timestamp = qt_x_time;
+ previous_focus_timestamp = GET_QT_X_TIME();
previous_client = this;
#endif
if ( rules()->checkAcceptFocus( input ))
{
- XSetInputFocus( qt_xdisplay(), window(), RevertToPointerRoot, qt_x_time );
+ XSetInputFocus( qt_xdisplay(), window(), RevertToPointerRoot, GET_QT_X_TIME() );
}
if ( Ptakefocus )
sendClientMessage(window(), atoms->wm_protocols, atoms->wm_take_focus);
diff --git a/kwin/events.cpp b/kwin/events.cpp
index 74563d3fb..570b41ddb 100644
--- a/kwin/events.cpp
+++ b/kwin/events.cpp
@@ -30,7 +30,6 @@ License. See the file "COPYING" for the exact licensing terms.
#include <X11/Xatom.h>
#include <stdlib.h>
-extern Time qt_x_time;
extern Atom qt_window_role;
namespace KWinInternal
@@ -198,7 +197,7 @@ bool Workspace::workspaceEvent( XEvent * e )
if ( mouse_emulation && (e->type == ButtonPress || e->type == ButtonRelease ) )
{
mouse_emulation = FALSE;
- XUngrabKeyboard( qt_xdisplay(), qt_x_time );
+ XUngrabKeyboard( qt_xdisplay(), GET_QT_X_TIME() );
}
if( e->type == PropertyNotify || e->type == ClientMessage )
@@ -293,9 +292,11 @@ bool Workspace::workspaceEvent( XEvent * e )
!e->xcreatewindow.override_redirect )
{
// see comments for allowClientActivation()
+ Time my_qtx_time = GET_QT_X_TIME();
XChangeProperty(qt_xdisplay(), e->xcreatewindow.window,
atoms->kde_net_wm_user_creation_time, XA_CARDINAL,
- 32, PropModeReplace, (unsigned char *)&qt_x_time, 1);
+ 32, PropModeReplace, (unsigned char *)&my_qtx_time, 1);
+ SET_QT_X_TIME(my_qtx_time);
}
break;
@@ -1344,6 +1345,7 @@ bool Client::buttonPressEvent( Window w, int button, int state, int x, int y, in
if( w == wrapperId() || w == frameId() || w == decorationId())
{ // FRAME neco s tohohle by se melo zpracovat, nez to dostane dekorace
+ { // FRAME something out of this would be processed before it gets decorations
updateUserTime();
workspace()->setWasUserInteraction();
uint keyModX = (options->keyCmdAllModKey() == Qt::Key_Meta) ?
@@ -1548,7 +1550,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( qt_x_time, next_motion_time ) < 0 )
+ && timestampCompare( GET_QT_X_TIME(), next_motion_time ) < 0 )
return true;
was_motion = false;
XSync( qt_xdisplay(), False ); // this helps to discard more MotionNotify events
diff --git a/kwin/geometry.cpp b/kwin/geometry.cpp
index e69b630a2..3116f16bf 100644
--- a/kwin/geometry.cpp
+++ b/kwin/geometry.cpp
@@ -29,8 +29,6 @@ License. See the file "COPYING" for the exact licensing terms.
#include "geometrytip.h"
#include "rules.h"
-extern Time qt_x_time;
-
namespace KWinInternal
{
@@ -688,7 +686,7 @@ void Workspace::updateTopMenuGeometry( Client* c )
static Atom msg_type_atom = XInternAtom( qt_xdisplay(), "_KDE_TOPMENU_MINSIZE", False );
ev.xclient.message_type = msg_type_atom;
ev.xclient.format = 32;
- ev.xclient.data.l[0] = qt_x_time;
+ ev.xclient.data.l[0] = GET_QT_X_TIME();
ev.xclient.data.l[1] = topmenu_space->width();
ev.xclient.data.l[2] = topmenu_space->height();
ev.xclient.data.l[3] = 0;
@@ -2319,9 +2317,9 @@ bool Client::startMoveResize()
XMapRaised( qt_xdisplay(), move_resize_grab_window );
if( XGrabPointer( qt_xdisplay(), move_resize_grab_window, False,
ButtonPressMask | ButtonReleaseMask | PointerMotionMask | EnterWindowMask | LeaveWindowMask,
- GrabModeAsync, GrabModeAsync, move_resize_grab_window, cursor.handle(), qt_x_time ) == Success )
+ GrabModeAsync, GrabModeAsync, move_resize_grab_window, cursor.handle(), GET_QT_X_TIME() ) == Success )
has_grab = true;
- if( XGrabKeyboard( qt_xdisplay(), frameId(), False, GrabModeAsync, GrabModeAsync, qt_x_time ) == Success )
+ if( XGrabKeyboard( qt_xdisplay(), frameId(), False, GrabModeAsync, GrabModeAsync, GET_QT_X_TIME() ) == Success )
has_grab = true;
if( !has_grab ) // at least one grab is necessary in order to be able to finish move/resize
{
@@ -2389,8 +2387,8 @@ void Client::leaveMoveResize()
if ( ( isMove() && rules()->checkMoveResizeMode( options->moveMode ) != Options::Opaque )
|| ( isResize() && rules()->checkMoveResizeMode( options->resizeMode ) != Options::Opaque ) )
ungrabXServer();
- XUngrabKeyboard( qt_xdisplay(), qt_x_time );
- XUngrabPointer( qt_xdisplay(), qt_x_time );
+ XUngrabKeyboard( qt_xdisplay(), GET_QT_X_TIME() );
+ XUngrabPointer( qt_xdisplay(), GET_QT_X_TIME() );
XDestroyWindow( qt_xdisplay(), move_resize_grab_window );
move_resize_grab_window = None;
workspace()->setClientIsMoving(0);
@@ -2507,7 +2505,7 @@ void Client::handleMoveResize( int x, int y, int x_root, int y_root )
bool update = false;
if( isResize())
{
- // first resize (without checking constrains), then snap, then check bounds, then check constrains
+ // first resize (without checking constraints), then snap, then check bounds, then check constraints
TQRect orig = initialMoveResizeGeom;
Sizemode sizemode = SizemodeAny;
switch ( mode )
@@ -2642,7 +2640,7 @@ void Client::handleMoveResize( int x, int y, int x_root, int y_root )
} // so the geometry tip will be painted above the outline
}
if ( isMove() )
- workspace()->clientMoved(globalPos, qt_x_time);
+ workspace()->clientMoved(globalPos, GET_QT_X_TIME());
}
diff --git a/kwin/layers.cpp b/kwin/layers.cpp
index 3151b22e5..e5194ed49 100644
--- a/kwin/layers.cpp
+++ b/kwin/layers.cpp
@@ -73,8 +73,6 @@ License. See the file "COPYING" for the exact licensing terms.
#include "group.h"
#include "rules.h"
-extern Time qt_x_time;
-
namespace KWinInternal
{
diff --git a/kwin/main.cpp b/kwin/main.cpp
index ee1f66c68..a65a32431 100644
--- a/kwin/main.cpp
+++ b/kwin/main.cpp
@@ -36,8 +36,6 @@ License. See the file "COPYING" for the exact licensing terms.
#undef INT8
#undef INT32
-extern Time qt_x_time;
-
namespace KWinInternal
{
@@ -148,7 +146,7 @@ Application::~Application()
delete Workspace::self();
if( owner.ownerWindow() != None ) // if there was no --replace (no new WM)
{
- XSetInputFocus( qt_xdisplay(), PointerRoot, RevertToPointerRoot, qt_x_time );
+ XSetInputFocus( qt_xdisplay(), PointerRoot, RevertToPointerRoot, GET_QT_X_TIME() );
DCOPRef ref( "kded", "kded" );
if( !ref.send( "loadModule", TQCString( "kdetrayproxy" )))
kdWarning( 176 ) << "Loading of kdetrayproxy failed." << endl;
diff --git a/kwin/manage.cpp b/kwin/manage.cpp
index c50a504d0..3df18027e 100644
--- a/kwin/manage.cpp
+++ b/kwin/manage.cpp
@@ -25,8 +25,6 @@ License. See the file "COPYING" for the exact licensing terms.
#include "rules.h"
#include "group.h"
-extern Time qt_x_time;
-
namespace KWinInternal
{
@@ -522,9 +520,9 @@ bool Client::manage( Window w, bool isMapped )
if( user_time == CurrentTime || user_time == -1U ) // no known user time, set something old
{
- user_time = qt_x_time - 1000000;
+ user_time = GET_QT_X_TIME() - 1000000;
if( user_time == CurrentTime || user_time == -1U ) // let's be paranoid
- user_time = qt_x_time - 1000000 + 10;
+ user_time = GET_QT_X_TIME() - 1000000 + 10;
}
updateWorkareaDiffs();
diff --git a/kwin/tabbox.cpp b/kwin/tabbox.cpp
index 6d78b4242..f5a9b9f03 100644
--- a/kwin/tabbox.cpp
+++ b/kwin/tabbox.cpp
@@ -35,8 +35,6 @@ License. See the file "COPYING" for the exact licensing terms.
// specify externals before namespace
-extern Time qt_x_time;
-
namespace KWinInternal
{
@@ -694,7 +692,7 @@ void TabBox::delayedShow()
void TabBox::handleMouseEvent( XEvent* e )
{
- XAllowEvents( qt_xdisplay(), AsyncPointer, qt_x_time );
+ XAllowEvents( qt_xdisplay(), AsyncPointer, GET_QT_X_TIME() );
if( e->type != ButtonPress )
return;
TQPoint pos( e->xbutton.x_root, e->xbutton.y_root );
@@ -852,7 +850,7 @@ void Workspace::slotWalkThroughWindows()
return;
if ( options->altTabStyle == Options::CDE || !options->focusPolicyIsReasonable())
{
- //XUngrabKeyboard(qt_xdisplay(), qt_x_time); // need that because of accelerator raw mode
+ //XUngrabKeyboard(qt_xdisplay(), GET_QT_X_TIME()); // need that because of accelerator raw mode
// CDE style raise / lower
CDEWalkThroughWindows( true );
}
@@ -1319,7 +1317,7 @@ Client* Workspace::previousStaticClient( Client* c ) const
bool Workspace::establishTabBoxGrab()
{
if( XGrabKeyboard( qt_xdisplay(), root, FALSE,
- GrabModeAsync, GrabModeAsync, qt_x_time) != GrabSuccess )
+ GrabModeAsync, GrabModeAsync, GET_QT_X_TIME()) != GrabSuccess )
return false;
// Don't try to establish a global mouse grab using XGrabPointer, as that would prevent
// using Alt+Tab while DND (#44972). However force passive grabs on all windows
@@ -1335,7 +1333,7 @@ bool Workspace::establishTabBoxGrab()
void Workspace::removeTabBoxGrab()
{
- XUngrabKeyboard(qt_xdisplay(), qt_x_time);
+ XUngrabKeyboard(qt_xdisplay(), GET_QT_X_TIME());
assert( forced_global_mouse_grab );
forced_global_mouse_grab = false;
if( active_client != NULL )
diff --git a/kwin/utils.cpp b/kwin/utils.cpp
index 5a8d5ad3c..796c7932b 100644
--- a/kwin/utils.cpp
+++ b/kwin/utils.cpp
@@ -36,14 +36,6 @@ License. See the file "COPYING" for the exact licensing terms.
#include <Qt/qx11info_x11.h>
#endif // USE_QT4
-#ifdef USE_QT4
-#define SET_X_TIME(x) QX11Info::setAppTime(x)
-#else // USE_QT4
-#define SET_X_TIME(x) qt_x_time = x
-#endif // USE_QT4
-
-extern Time qt_x_time;
-
#endif
namespace KWinInternal
@@ -281,7 +273,7 @@ void updateXTime()
XCheckIfEvent( qt_xdisplay(), &dummy, update_x_time_predicate, NULL );
}
assert( next_x_time != CurrentTime );
- SET_X_TIME(next_x_time);
+ SET_QT_X_TIME(next_x_time);
XEvent ev; // remove the PropertyNotify event from the events queue
XWindowEvent( qt_xdisplay(), w->winId(), PropertyChangeMask, &ev );
}
diff --git a/kwin/workspace.cpp b/kwin/workspace.cpp
index ac4fcdc3f..48c8494bd 100644
--- a/kwin/workspace.cpp
+++ b/kwin/workspace.cpp
@@ -45,8 +45,6 @@ License. See the file "COPYING" for the exact licensing terms.
#include <X11/keysymdef.h>
#include <X11/cursorfont.h>
-extern Time qt_x_time;
-
namespace KWinInternal
{
@@ -153,8 +151,8 @@ Workspace::Workspace( bool restore )
delayFocusTimer = 0;
- electric_time_first = qt_x_time;
- electric_time_last = qt_x_time;
+ electric_time_first = GET_QT_X_TIME();
+ electric_time_last = GET_QT_X_TIME();
if ( restore )
loadSessionInfo();
@@ -1855,7 +1853,7 @@ void Workspace::slotMouseEmulation()
if ( mouse_emulation )
{
- XUngrabKeyboard(qt_xdisplay(), qt_x_time);
+ XUngrabKeyboard(qt_xdisplay(), GET_QT_X_TIME());
mouse_emulation = FALSE;
return;
}
@@ -1863,7 +1861,7 @@ void Workspace::slotMouseEmulation()
if ( XGrabKeyboard(qt_xdisplay(),
root, FALSE,
GrabModeAsync, GrabModeAsync,
- qt_x_time) == GrabSuccess )
+ GET_QT_X_TIME()) == GrabSuccess )
{
mouse_emulation = TRUE;
mouse_emulation_state = 0;
@@ -1919,7 +1917,7 @@ unsigned int Workspace::sendFakedMouseEvent( TQPoint pos, WId w, MouseEmulation
e.xmotion.window = w;
e.xmotion.root = qt_xrootwin();
e.xmotion.subwindow = w;
- e.xmotion.time = qt_x_time;
+ e.xmotion.time = GET_QT_X_TIME();
e.xmotion.x = x;
e.xmotion.y = y;
e.xmotion.x_root = pos.x();
@@ -1935,7 +1933,7 @@ unsigned int Workspace::sendFakedMouseEvent( TQPoint pos, WId w, MouseEmulation
e.xbutton.window = w;
e.xbutton.root = qt_xrootwin();
e.xbutton.subwindow = w;
- e.xbutton.time = qt_x_time;
+ e.xbutton.time = GET_QT_X_TIME();
e.xbutton.x = x;
e.xbutton.y = y;
e.xbutton.x_root = pos.x();
@@ -2061,7 +2059,7 @@ bool Workspace::keyPressMouseEmulation( XKeyEvent& ev )
}
// fall through
case XK_Escape:
- XUngrabKeyboard(qt_xdisplay(), qt_x_time);
+ XUngrabKeyboard(qt_xdisplay(), GET_QT_X_TIME());
mouse_emulation = FALSE;
return TRUE;
default:
@@ -2356,7 +2354,7 @@ bool Workspace::electricBorder(XEvent *e)
|| e->xclient.window == electric_right_border ))
{
updateXTime();
- clientMoved( TQPoint( e->xclient.data.l[2]>>16, e->xclient.data.l[2]&0xffff), qt_x_time );
+ clientMoved( TQPoint( e->xclient.data.l[2]>>16, e->xclient.data.l[2]&0xffff), GET_QT_X_TIME() );
return true;
}
}
@@ -2492,7 +2490,7 @@ bool Workspace::checkStartupNotification( Window w, KStartupInfoId& id, KStartup
*/
void Workspace::focusToNull()
{
- XSetInputFocus(qt_xdisplay(), null_focus_window, RevertToPointerRoot, qt_x_time );
+ XSetInputFocus(qt_xdisplay(), null_focus_window, RevertToPointerRoot, GET_QT_X_TIME() );
}
void Workspace::helperDialog( const TQString& message, const Client* c )