Rename additional global functions and variables for tqt3

pull/2/head
Timothy Pearson 12 years ago
parent e8a1cdc01d
commit 8bd291c0e8

@ -178,7 +178,7 @@ KCMInit::KCMInit( KCmdLineArgs* args )
KConfig config("kcmdisplayrc", true ); KConfig config("kcmdisplayrc", true );
config.setGroup("X11"); config.setGroup("X11");
bool multihead = !config.readBoolEntry( "disableMultihead", false) && bool multihead = !config.readBoolEntry( "disableMultihead", false) &&
(ScreenCount(qt_xdisplay()) > 1); (ScreenCount(tqt_xdisplay()) > 1);
// Pass env. var to tdeinit. // Pass env. var to tdeinit.
TQCString name = "TDE_MULTIHEAD"; TQCString name = "TDE_MULTIHEAD";
TQCString value = multihead ? "true" : "false"; TQCString value = multihead ? "true" : "false";

@ -107,7 +107,7 @@ KAccessApp::KAccessApp(bool allowStyles, bool GUIenabled)
initMasks(); initMasks();
XkbStateRec state_return; XkbStateRec state_return;
XkbGetState (qt_xdisplay(), XkbUseCoreKbd, &state_return); XkbGetState (tqt_xdisplay(), XkbUseCoreKbd, &state_return);
unsigned char latched = XkbStateMods (&state_return); unsigned char latched = XkbStateMods (&state_return);
unsigned char locked = XkbModLocks (&state_return); unsigned char locked = XkbModLocks (&state_return);
state = ((int)locked)<<8 | latched; state = ((int)locked)<<8 | latched;
@ -138,23 +138,23 @@ void KAccessApp::readSettings()
// select bell events if we need them // select bell events if we need them
int state = (_artsBell || _visibleBell) ? XkbBellNotifyMask : 0; int state = (_artsBell || _visibleBell) ? XkbBellNotifyMask : 0;
XkbSelectEvents(qt_xdisplay(), XkbUseCoreKbd, XkbBellNotifyMask, state); XkbSelectEvents(tqt_xdisplay(), XkbUseCoreKbd, XkbBellNotifyMask, state);
// deactivate system bell if not needed // deactivate system bell if not needed
if (!_systemBell) if (!_systemBell)
XkbChangeEnabledControls(qt_xdisplay(), XkbUseCoreKbd, XkbAudibleBellMask, 0); XkbChangeEnabledControls(tqt_xdisplay(), XkbUseCoreKbd, XkbAudibleBellMask, 0);
else else
XkbChangeEnabledControls(qt_xdisplay(), XkbUseCoreKbd, XkbAudibleBellMask, XkbAudibleBellMask); XkbChangeEnabledControls(tqt_xdisplay(), XkbUseCoreKbd, XkbAudibleBellMask, XkbAudibleBellMask);
// keyboard ------------------------------------------------------------- // keyboard -------------------------------------------------------------
config->setGroup("Keyboard"); config->setGroup("Keyboard");
// get keyboard state // get keyboard state
XkbDescPtr xkb = XkbGetMap(qt_xdisplay(), 0, XkbUseCoreKbd); XkbDescPtr xkb = XkbGetMap(tqt_xdisplay(), 0, XkbUseCoreKbd);
if (!xkb) if (!xkb)
return; return;
if (XkbGetControls(qt_xdisplay(), XkbAllControlsMask, xkb) != Success) if (XkbGetControls(tqt_xdisplay(), XkbAllControlsMask, xkb) != Success)
return; return;
// sticky keys // sticky keys
@ -279,10 +279,10 @@ void KAccessApp::readSettings()
if (dialog == 0) if (dialog == 0)
requestedFeatures = features; requestedFeatures = features;
// set state // set state
XkbSetControls(qt_xdisplay(), XkbControlsEnabledMask | XkbMouseKeysAccelMask | XkbStickyKeysMask | XkbSlowKeysMask | XkbBounceKeysMask | XkbAccessXKeysMask | XkbAccessXTimeoutMask, xkb); XkbSetControls(tqt_xdisplay(), XkbControlsEnabledMask | XkbMouseKeysAccelMask | XkbStickyKeysMask | XkbSlowKeysMask | XkbBounceKeysMask | XkbAccessXKeysMask | XkbAccessXTimeoutMask, xkb);
// select AccessX events // select AccessX events
XkbSelectEvents(qt_xdisplay(), XkbUseCoreKbd, XkbAllEventsMask, XkbAllEventsMask); XkbSelectEvents(tqt_xdisplay(), XkbUseCoreKbd, XkbAllEventsMask, XkbAllEventsMask);
if (!_artsBell && !_visibleBell && !_gestureConfirmation if (!_artsBell && !_visibleBell && !_gestureConfirmation
&& !_kNotifyModifiers && !_kNotifyAccessX) { && !_kNotifyModifiers && !_kNotifyAccessX) {
@ -290,13 +290,13 @@ void KAccessApp::readSettings()
// We will exit, but the features need to stay configured // We will exit, but the features need to stay configured
uint ctrls = XkbStickyKeysMask | XkbSlowKeysMask | XkbBounceKeysMask | XkbMouseKeysMask | XkbAudibleBellMask | XkbControlsNotifyMask; uint ctrls = XkbStickyKeysMask | XkbSlowKeysMask | XkbBounceKeysMask | XkbMouseKeysMask | XkbAudibleBellMask | XkbControlsNotifyMask;
uint values = xkb->ctrls->enabled_ctrls & ctrls; uint values = xkb->ctrls->enabled_ctrls & ctrls;
XkbSetAutoResetControls(qt_xdisplay(), ctrls, &ctrls, &values); XkbSetAutoResetControls(tqt_xdisplay(), ctrls, &ctrls, &values);
exit(0); exit(0);
} else { } else {
// reset them after program exit // reset them after program exit
uint ctrls = XkbStickyKeysMask | XkbSlowKeysMask | XkbBounceKeysMask | XkbMouseKeysMask | XkbAudibleBellMask | XkbControlsNotifyMask; uint ctrls = XkbStickyKeysMask | XkbSlowKeysMask | XkbBounceKeysMask | XkbMouseKeysMask | XkbAudibleBellMask | XkbControlsNotifyMask;
uint values = XkbAudibleBellMask; uint values = XkbAudibleBellMask;
XkbSetAutoResetControls(qt_xdisplay(), ctrls, &ctrls, &values); XkbSetAutoResetControls(tqt_xdisplay(), ctrls, &ctrls, &values);
} }
delete overlay; delete overlay;
@ -319,14 +319,14 @@ void KAccessApp::initMasks() {
int mask = modifierKeys[i].mask; int mask = modifierKeys[i].mask;
if (mask == 0) if (mask == 0)
if (modifierKeys[i].keysym != 0) if (modifierKeys[i].keysym != 0)
mask = XkbKeysymToModifiers (qt_xdisplay(), modifierKeys[i].keysym); mask = XkbKeysymToModifiers (tqt_xdisplay(), modifierKeys[i].keysym);
else if (!strcmp(modifierKeys[i].name, "Win")) else if (!strcmp(modifierKeys[i].name, "Win"))
mask = KKeyNative::modX(KKey::WIN); mask = KKeyNative::modX(KKey::WIN);
else else
mask = XkbKeysymToModifiers (qt_xdisplay(), XK_Mode_switch) mask = XkbKeysymToModifiers (tqt_xdisplay(), XK_Mode_switch)
| XkbKeysymToModifiers (qt_xdisplay(), XK_ISO_Level3_Shift) | XkbKeysymToModifiers (tqt_xdisplay(), XK_ISO_Level3_Shift)
| XkbKeysymToModifiers (qt_xdisplay(), XK_ISO_Level3_Latch) | XkbKeysymToModifiers (tqt_xdisplay(), XK_ISO_Level3_Latch)
| XkbKeysymToModifiers (qt_xdisplay(), XK_ISO_Level3_Lock); | XkbKeysymToModifiers (tqt_xdisplay(), XK_ISO_Level3_Lock);
int bit = maskToBit (mask); int bit = maskToBit (mask);
if (bit != -1 && keys[bit] == -1) if (bit != -1 && keys[bit] == -1)
@ -376,7 +376,7 @@ void KAccessApp::activeWindowChanged(WId wid)
void KAccessApp::xkbStateNotify () { void KAccessApp::xkbStateNotify () {
XkbStateRec state_return; XkbStateRec state_return;
XkbGetState (qt_xdisplay(), XkbUseCoreKbd, &state_return); XkbGetState (tqt_xdisplay(), XkbUseCoreKbd, &state_return);
unsigned char latched = XkbStateMods (&state_return); unsigned char latched = XkbStateMods (&state_return);
unsigned char locked = XkbModLocks (&state_return); unsigned char locked = XkbModLocks (&state_return);
int mods = ((int)locked)<<8 | latched; int mods = ((int)locked)<<8 | latched;
@ -430,7 +430,7 @@ void KAccessApp::xkbBellNotify(XkbBellNotifyEvent *event)
WId id = _activeWindow; WId id = _activeWindow;
NETRect frame, window; NETRect frame, window;
NETWinInfo net(qt_xdisplay(), id, desktop()->winId(), 0); NETWinInfo net(tqt_xdisplay(), id, desktop()->winId(), 0);
net.kdeGeometry(frame, window); net.kdeGeometry(frame, window);
@ -733,7 +733,7 @@ void KAccessApp::xkbControlsNotify(XkbControlsNotifyEvent *event)
else if ((enabled | disabled) == XkbStickyKeysMask) else if ((enabled | disabled) == XkbStickyKeysMask)
explanation = i18n("You pressed the Shift key 5 consecutive times or an application has requested to change this setting."); explanation = i18n("You pressed the Shift key 5 consecutive times or an application has requested to change this setting.");
else if ((enabled | disabled) == XkbMouseKeysMask) { else if ((enabled | disabled) == XkbMouseKeysMask) {
TQString shortcut = mouseKeysShortcut(qt_xdisplay()); TQString shortcut = mouseKeysShortcut(tqt_xdisplay());
if (!shortcut.isEmpty() && !shortcut.isNull()) if (!shortcut.isEmpty() && !shortcut.isNull())
explanation = i18n("You pressed %1 or an application has requested to change this setting.").arg(shortcut); explanation = i18n("You pressed %1 or an application has requested to change this setting.").arg(shortcut);
} }

@ -27,7 +27,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char * argv[] )
} }
kdDebug() << "Xlib XKB extension major=" << major << " minor=" << minor << endl; kdDebug() << "Xlib XKB extension major=" << major << " minor=" << minor << endl;
// we need an application object for qt_xdisplay() // we need an application object for tqt_xdisplay()
KAccessApp app; KAccessApp app;
// verify the X server has matching XKB extension // verify the X server has matching XKB extension
@ -35,7 +35,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char * argv[] )
int opcode_rtrn; int opcode_rtrn;
int error_rtrn; int error_rtrn;
int xkb_opcode; int xkb_opcode;
if (!XkbQueryExtension(qt_xdisplay(), &opcode_rtrn, &xkb_opcode, &error_rtrn, if (!XkbQueryExtension(tqt_xdisplay(), &opcode_rtrn, &xkb_opcode, &error_rtrn,
&major, &minor)) &major, &minor))
{ {
kdError() << "X server has not matching XKB extension" << endl; kdError() << "X server has not matching XKB extension" << endl;

@ -51,8 +51,8 @@
static TQCString desktopConfigname() static TQCString desktopConfigname()
{ {
int desktop=0; int desktop=0;
if (qt_xdisplay()) if (tqt_xdisplay())
desktop = DefaultScreen(qt_xdisplay()); desktop = DefaultScreen(tqt_xdisplay());
TQCString name; TQCString name;
if (desktop == 0) if (desktop == 0)
name = "kdesktoprc"; name = "kdesktoprc";

@ -192,7 +192,7 @@ int KBackgroundRenderer::doBackground(bool quit)
// some dithering may be needed even with bpb==15/16, so don't use tileWidth==1 // some dithering may be needed even with bpb==15/16, so don't use tileWidth==1
// for them // for them
// with tileWidth>2, repainting the desktop causes nasty effect (XFree86 4.1.0 ) // with tileWidth>2, repainting the desktop causes nasty effect (XFree86 4.1.0 )
if( XQueryBestTile( qt_xdisplay(), qt_xrootwin(), tile_val, tile_val, if( XQueryBestTile( tqt_xdisplay(), tqt_xrootwin(), tile_val, tile_val,
&tileWidth, &tileHeight ) != Success ) &tileWidth, &tileHeight ) != Success )
tileWidth = tileHeight = tile_val; // some defaults tileWidth = tileHeight = tile_val; // some defaults
} }
@ -549,12 +549,12 @@ bool KBackgroundRenderer::canTile() const
return m_TilingEnabled && optimize(); return m_TilingEnabled && optimize();
} }
extern bool qt_use_xrender; // in Qt ( qapplication_x11.cpp ) extern bool tqt_use_xrender; // in Qt ( qapplication_x11.cpp )
void KBackgroundRenderer::wallpaperBlend() void KBackgroundRenderer::wallpaperBlend()
{ {
if( !enabled() || wallpaperMode() == NoWallpaper if( !enabled() || wallpaperMode() == NoWallpaper
|| (blendMode() == NoBlending && ( qt_use_xrender || !m_Wallpaper.hasAlphaBuffer()))) { || (blendMode() == NoBlending && ( tqt_use_xrender || !m_Wallpaper.hasAlphaBuffer()))) {
fastWallpaperBlend(); fastWallpaperBlend();
} }
else { else {
@ -1030,8 +1030,8 @@ KVirtualBGRenderer::KVirtualBGRenderer( int desk, KConfig *config )
// The following code is borrowed from KBackgroundSettings::KBackgroundSettings // The following code is borrowed from KBackgroundSettings::KBackgroundSettings
if (!config) { if (!config) {
int screen_number = 0; int screen_number = 0;
if (qt_xdisplay()) if (tqt_xdisplay())
screen_number = DefaultScreen(qt_xdisplay()); screen_number = DefaultScreen(tqt_xdisplay());
TQCString configname; TQCString configname;
if (screen_number == 0) if (screen_number == 0)
configname = "kdesktoprc"; configname = "kdesktoprc";

@ -493,8 +493,8 @@ KBackgroundSettings::KBackgroundSettings(int desk, int screen, bool drawBackgrou
if (!config) { if (!config) {
int screen_number = 0; int screen_number = 0;
if (qt_xdisplay()) if (tqt_xdisplay())
screen_number = DefaultScreen(qt_xdisplay()); screen_number = DefaultScreen(tqt_xdisplay());
TQCString configname; TQCString configname;
if (screen_number == 0) if (screen_number == 0)
configname = "kdesktoprc"; configname = "kdesktoprc";
@ -1215,7 +1215,7 @@ void KGlobalBackgroundSettings::readSettings()
m_CacheSize = m_pConfig->readNumEntry("CacheSize", _defCacheSize); m_CacheSize = m_pConfig->readNumEntry("CacheSize", _defCacheSize);
m_Names.clear(); m_Names.clear();
NETRootInfo info( qt_xdisplay(), NET::DesktopNames | NET::NumberOfDesktops ); NETRootInfo info( tqt_xdisplay(), NET::DesktopNames | NET::NumberOfDesktops );
m_bDrawBackgroundPerScreen.resize(info.numberOfDesktops()); m_bDrawBackgroundPerScreen.resize(info.numberOfDesktops());
for ( int i = 0 ; i < info.numberOfDesktops() ; ++i ) for ( int i = 0 ; i < info.numberOfDesktops() ; ++i )
m_bDrawBackgroundPerScreen[i] = m_pConfig->readBoolEntry( TQString("DrawBackgroundPerScreen_%1").arg(i), _defDrawBackgroundPerScreen ); m_bDrawBackgroundPerScreen[i] = m_pConfig->readBoolEntry( TQString("DrawBackgroundPerScreen_%1").arg(i), _defDrawBackgroundPerScreen );

@ -45,8 +45,8 @@ KBackground::KBackground(TQWidget *parent, const char *name, const TQStringList
: KCModule(KBackGndFactory::instance(), parent, name) : KCModule(KBackGndFactory::instance(), parent, name)
{ {
int screen_number = 0; int screen_number = 0;
if (qt_xdisplay()) if (tqt_xdisplay())
screen_number = DefaultScreen(qt_xdisplay()); screen_number = DefaultScreen(tqt_xdisplay());
TQCString configname; TQCString configname;
if (screen_number == 0) if (screen_number == 0)
configname = "kdesktoprc"; configname = "kdesktoprc";
@ -105,8 +105,8 @@ void KBackground::save()
client->attach(); client->attach();
int screen_number = 0; int screen_number = 0;
if (qt_xdisplay()) if (tqt_xdisplay())
screen_number = DefaultScreen(qt_xdisplay()); screen_number = DefaultScreen(tqt_xdisplay());
TQCString appname; TQCString appname;
if (screen_number == 0) if (screen_number == 0)
appname = "kdesktop"; appname = "kdesktop";

@ -399,7 +399,7 @@ void KColorScheme::save()
#if defined Q_WS_X11 && !defined K_WS_QTONLY #if defined Q_WS_X11 && !defined K_WS_QTONLY
// Undo the property xrdb has placed on the root window (if any), // Undo the property xrdb has placed on the root window (if any),
// i.e. remove all entries, including ours // i.e. remove all entries, including ours
XDeleteProperty( qt_xdisplay(), qt_xrootwin(), XA_RESOURCE_MANAGER ); XDeleteProperty( tqt_xdisplay(), tqt_xrootwin(), XA_RESOURCE_MANAGER );
#endif #endif
} }
runRdb( flags ); // Save the palette to qtrc for KStyles runRdb( flags ); // Save the palette to qtrc for KStyles

@ -856,7 +856,7 @@ void KDisplayConfig::identifyMonitors () {
ScreenInfo *randr_screen_info; ScreenInfo *randr_screen_info;
XRROutputInfo *output_info; XRROutputInfo *output_info;
randr_display = qt_xdisplay(); randr_display = tqt_xdisplay();
randr_screen_info = m_randrsimple->read_screen_info(randr_display); randr_screen_info = m_randrsimple->read_screen_info(randr_display);
for (i = 0; i < m_screenInfoArray.count(); i++) { for (i = 0; i < m_screenInfoArray.count(); i++) {

@ -94,7 +94,7 @@ extern "C" {
KConfig *cfg = new KConfig("kcmdisplayrc", true /*readonly*/, false /*no globals*/); KConfig *cfg = new KConfig("kcmdisplayrc", true /*readonly*/, false /*no globals*/);
cfg->setGroup("DisplayEnergy"); cfg->setGroup("DisplayEnergy");
Display *dpy = qt_xdisplay(); Display *dpy = tqt_xdisplay();
CARD16 pre_configured_status; CARD16 pre_configured_status;
BOOL pre_configured_enabled; BOOL pre_configured_enabled;
CARD16 pre_configured_standby; CARD16 pre_configured_standby;
@ -153,7 +153,7 @@ KEnergy::KEnergy(TQWidget *parent, const char *name)
#ifdef HAVE_DPMS #ifdef HAVE_DPMS
int dummy; int dummy;
m_bDPMS = DPMSQueryExtension(qt_xdisplay(), &dummy, &dummy); m_bDPMS = DPMSQueryExtension(tqt_xdisplay(), &dummy, &dummy);
#endif #endif
TQVBoxLayout *top = new TQVBoxLayout(this, 0, KDialog::spacingHint()); TQVBoxLayout *top = new TQVBoxLayout(this, 0, KDialog::spacingHint());
@ -333,7 +333,7 @@ void KEnergy::applySettings(bool enable, int standby, int suspend, int off)
XErrFunc defaultHandler; XErrFunc defaultHandler;
defaultHandler = XSetErrorHandler(dropError); defaultHandler = XSetErrorHandler(dropError);
Display *dpy = qt_xdisplay(); Display *dpy = tqt_xdisplay();
int dummy; int dummy;
bool hasDPMS = DPMSQueryExtension(dpy, &dummy, &dummy); bool hasDPMS = DPMSQueryExtension(dpy, &dummy, &dummy);

@ -164,7 +164,7 @@ int main(int argc, char ** argv)
bool ok; bool ok;
long id = args->getOption("parent").toLong(&ok); long id = args->getOption("parent").toLong(&ok);
if (ok) if (ok)
XSetTransientForHint( qt_xdisplay(), dlg.winId(), id ); XSetTransientForHint( tqt_xdisplay(), dlg.winId(), id );
} }
#endif #endif
args->clear(); args->clear();

@ -495,8 +495,8 @@ int FontAASettings::exec()
static TQCString desktopConfigName() static TQCString desktopConfigName()
{ {
int desktop=0; int desktop=0;
if (qt_xdisplay()) if (tqt_xdisplay())
desktop = DefaultScreen(qt_xdisplay()); desktop = DefaultScreen(tqt_xdisplay());
TQCString name; TQCString name;
if (desktop == 0) if (desktop == 0)
name = "kdesktoprc"; name = "kdesktoprc";

@ -62,23 +62,23 @@ extern "C"
// use a default value for theme only if it's not configured at all, not even in X resources // use a default value for theme only if it's not configured at all, not even in X resources
if( theme.isEmpty() if( theme.isEmpty()
&& TQCString( XGetDefault( qt_xdisplay(), "Xcursor", "theme" )).isEmpty() && TQCString( XGetDefault( tqt_xdisplay(), "Xcursor", "theme" )).isEmpty()
&& TQCString( XcursorGetTheme( qt_xdisplay())).isEmpty()) && TQCString( XcursorGetTheme( tqt_xdisplay())).isEmpty())
{ {
theme = "default"; theme = "default";
} }
// Apply the KDE cursor theme to ourselves // Apply the KDE cursor theme to ourselves
if( !theme.isEmpty()) if( !theme.isEmpty())
XcursorSetTheme(qt_xdisplay(), theme.data()); XcursorSetTheme(tqt_xdisplay(), theme.data());
if (!size.isEmpty()) if (!size.isEmpty())
XcursorSetDefaultSize(qt_xdisplay(), size.toUInt()); XcursorSetDefaultSize(tqt_xdisplay(), size.toUInt());
// Load the default cursor from the theme and apply it to the root window. // Load the default cursor from the theme and apply it to the root window.
Cursor handle = XcursorLibraryLoadCursor(qt_xdisplay(), "left_ptr"); Cursor handle = XcursorLibraryLoadCursor(tqt_xdisplay(), "left_ptr");
XDefineCursor(qt_xdisplay(), qt_xrootwin(), handle); XDefineCursor(tqt_xdisplay(), tqt_xrootwin(), handle);
XFreeCursor(qt_xdisplay(), handle); // Don't leak the cursor XFreeCursor(tqt_xdisplay(), handle); // Don't leak the cursor
// Tell klauncher to set the XCURSOR_THEME and XCURSOR_SIZE environment // Tell klauncher to set the XCURSOR_THEME and XCURSOR_SIZE environment
// variables when launching applications. // variables when launching applications.

@ -34,8 +34,8 @@
#include "previewwidget.h" #include "previewwidget.h"
extern bool qt_has_xft; extern bool tqt_has_xft;
extern bool qt_use_xrender; extern bool tqt_use_xrender;
namespace { namespace {
@ -314,7 +314,7 @@ void PreviewWidget::paintEvent( TQPaintEvent * )
p.fillRect( rect(), colorGroup().brush( TQColorGroup::Background ) ); p.fillRect( rect(), colorGroup().brush( TQColorGroup::Background ) );
Picture dest; Picture dest;
if ( !qt_has_xft || !qt_use_xrender ) { if ( !tqt_has_xft || !tqt_use_xrender ) {
XRenderPictFormat *fmt = XRenderFindVisualFormat( x11Display(), (Visual*)buffer.x11Visual() ); XRenderPictFormat *fmt = XRenderFindVisualFormat( x11Display(), (Visual*)buffer.x11Visual() );
dest = XRenderCreatePicture( x11Display(), buffer.handle(), fmt, 0, NULL ); dest = XRenderCreatePicture( x11Display(), buffer.handle(), fmt, 0, NULL );
} else } else
@ -334,7 +334,7 @@ void PreviewWidget::paintEvent( TQPaintEvent * )
bitBlt( this, 0, 0, &buffer ); bitBlt( this, 0, 0, &buffer );
if ( !qt_has_xft || !qt_use_xrender ) if ( !tqt_has_xft || !tqt_use_xrender )
XRenderFreePicture( x11Display(), dest ); XRenderFreePicture( x11Display(), dest );
} }

@ -90,7 +90,7 @@ ProxyWidget *ConfigModule::module()
void ConfigModule::deleteClient() void ConfigModule::deleteClient()
{ {
if (_embedWidget) if (_embedWidget)
XKillClient(qt_xdisplay(), _embedWidget->embeddedWinId()); XKillClient(tqt_xdisplay(), _embedWidget->embeddedWinId());
delete _rootProcess; delete _rootProcess;
_rootProcess = 0; _rootProcess = 0;
@ -229,7 +229,7 @@ void ConfigModule::runAsRoot()
void ConfigModule::rootExited(KProcess *) void ConfigModule::rootExited(KProcess *)
{ {
if (_embedWidget->embeddedWinId()) if (_embedWidget->embeddedWinId())
XDestroyWindow(qt_xdisplay(), _embedWidget->embeddedWinId()); XDestroyWindow(tqt_xdisplay(), _embedWidget->embeddedWinId());
delete _embedWidget; delete _embedWidget;
_embedWidget = 0; _embedWidget = 0;

@ -139,10 +139,10 @@ void ModifiersModule::setupMacModifierKeys()
//const int CODE_Alt_L = 0x40, CODE_Alt_R = 0x71; //const int CODE_Alt_L = 0x40, CODE_Alt_R = 0x71;
int keyCodeMin, keyCodeMax, nKeyCodes, nSymsPerCode; int keyCodeMin, keyCodeMax, nKeyCodes, nSymsPerCode;
XDisplayKeycodes( qt_xdisplay(), &keyCodeMin, &keyCodeMax ); XDisplayKeycodes( tqt_xdisplay(), &keyCodeMin, &keyCodeMax );
nKeyCodes = keyCodeMax - keyCodeMin + 1; nKeyCodes = keyCodeMax - keyCodeMin + 1;
KeySym* rgKeySyms = XGetKeyboardMapping( qt_xdisplay(), keyCodeMin, nKeyCodes, &nSymsPerCode ); KeySym* rgKeySyms = XGetKeyboardMapping( tqt_xdisplay(), keyCodeMin, nKeyCodes, &nSymsPerCode );
XModifierKeymap* xmk = XGetModifierMapping( qt_xdisplay() ); XModifierKeymap* xmk = XGetModifierMapping( tqt_xdisplay() );
SET_CODE_SYM( CODE_Ctrl_L, XK_Super_L ) SET_CODE_SYM( CODE_Ctrl_L, XK_Super_L )
SET_CODE_SYM( CODE_Ctrl_R, XK_Super_R ) SET_CODE_SYM( CODE_Ctrl_R, XK_Super_R )
@ -159,8 +159,8 @@ void ModifiersModule::setupMacModifierKeys()
//SET_MOD_CODE( Mod1MapIndex, CODE_Win_L, CODE_Win_R ); //SET_MOD_CODE( Mod1MapIndex, CODE_Win_L, CODE_Win_R );
//SET_MOD_CODE( Mod4MapIndex, CODE_Ctrl_L, CODE_Ctrl_R ); //SET_MOD_CODE( Mod4MapIndex, CODE_Ctrl_L, CODE_Ctrl_R );
XSetModifierMapping( qt_xdisplay(), xmk ); XSetModifierMapping( tqt_xdisplay(), xmk );
XChangeKeyboardMapping( qt_xdisplay(), keyCodeMin, nSymsPerCode, rgKeySyms, nKeyCodes ); XChangeKeyboardMapping( tqt_xdisplay(), keyCodeMin, nSymsPerCode, rgKeySyms, nKeyCodes );
XFree( rgKeySyms ); XFree( rgKeySyms );
XFreeModifiermap( xmk ); XFreeModifiermap( xmk );
} }
@ -291,7 +291,7 @@ void ModifiersModule::updateWidgets()
m_pchkMacSwap->setEnabled( false ); m_pchkMacSwap->setEnabled( false );
} }
XModifierKeymap* xmk = XGetModifierMapping( qt_xdisplay() ); XModifierKeymap* xmk = XGetModifierMapping( tqt_xdisplay() );
for( int iKey = m_plstXMods->columns()-1; iKey < xmk->max_keypermod; iKey++ ) for( int iKey = m_plstXMods->columns()-1; iKey < xmk->max_keypermod; iKey++ )
m_plstXMods->addColumn( i18n("Key %1").arg(iKey+1) ); m_plstXMods->addColumn( i18n("Key %1").arg(iKey+1) );
@ -300,7 +300,7 @@ void ModifiersModule::updateWidgets()
for( int iMod = 0; iMod < 8; iMod++ ) { for( int iMod = 0; iMod < 8; iMod++ ) {
// Find the default modifier index for the Win key. // Find the default modifier index for the Win key.
/*if( iMod > Mod2Index ) { /*if( iMod > Mod2Index ) {
uint symX = XKeycodeToKeysym( qt_xdisplay(), xmk->modifiermap[xmk->max_keypermod * iMod], 0 ); uint symX = XKeycodeToKeysym( tqt_xdisplay(), xmk->modifiermap[xmk->max_keypermod * iMod], 0 );
if( symX == XK_Super_L || symX == XK_Super_R ) if( symX == XK_Super_L || symX == XK_Super_R )
iModWinDef = iMod; iModWinDef = iMod;
else if( iModWinDef == -1 && (symX == XK_Meta_L || symX == XK_Meta_R) ) else if( iModWinDef == -1 && (symX == XK_Meta_L || symX == XK_Meta_R) )
@ -309,7 +309,7 @@ void ModifiersModule::updateWidgets()
// Insert items into X modifier map list // Insert items into X modifier map list
for( int iKey = 0; iKey < xmk->max_keypermod; iKey++ ) { for( int iKey = 0; iKey < xmk->max_keypermod; iKey++ ) {
uint symX = XKeycodeToKeysym( qt_xdisplay(), xmk->modifiermap[xmk->max_keypermod * iMod + iKey], 0 ); uint symX = XKeycodeToKeysym( tqt_xdisplay(), xmk->modifiermap[xmk->max_keypermod * iMod + iKey], 0 );
m_plstXMods->itemAtIndex( iMod )->setText( 1 + iKey, XKeysymToString( symX ) ); m_plstXMods->itemAtIndex( iMod )->setText( 1 + iKey, XKeysymToString( symX ) );
} }
} }

@ -57,7 +57,7 @@ KickerConfig::KickerConfig(TQWidget *parent, const char *name)
configFileWatch(new KDirWatch(this)), configFileWatch(new KDirWatch(this)),
m_currentPanelIndex(0) m_currentPanelIndex(0)
{ {
m_screenNumber = qt_xdisplay() ? DefaultScreen(qt_xdisplay()) : 0; m_screenNumber = tqt_xdisplay() ? DefaultScreen(tqt_xdisplay()) : 0;
KickerSettings::instance(configName().latin1()); KickerSettings::instance(configName().latin1());

@ -128,12 +128,12 @@ void KDesktopConfig::load()
void KDesktopConfig::load( bool useDefaults ) void KDesktopConfig::load( bool useDefaults )
{ {
// get number of desktops // get number of desktops
NETRootInfo info( qt_xdisplay(), NET::NumberOfDesktops | NET::DesktopNames ); NETRootInfo info( tqt_xdisplay(), NET::NumberOfDesktops | NET::DesktopNames );
int n = info.numberOfDesktops(); int n = info.numberOfDesktops();
int konq_screen_number = 0; int konq_screen_number = 0;
if (qt_xdisplay()) if (tqt_xdisplay())
konq_screen_number = DefaultScreen(qt_xdisplay()); konq_screen_number = DefaultScreen(tqt_xdisplay());
TQCString groupname; TQCString groupname;
if (konq_screen_number == 0) if (konq_screen_number == 0)
@ -193,7 +193,7 @@ void KDesktopConfig::load( bool useDefaults )
void KDesktopConfig::save() void KDesktopConfig::save()
{ {
NETRootInfo info( qt_xdisplay(), NET::NumberOfDesktops | NET::DesktopNames ); NETRootInfo info( tqt_xdisplay(), NET::NumberOfDesktops | NET::DesktopNames );
// set desktop names // set desktop names
for(int i = 1; i <= maxDesktops; i++) for(int i = 1; i <= maxDesktops; i++)
{ {
@ -204,11 +204,11 @@ void KDesktopConfig::save()
info.setNumberOfDesktops(_numInput->value()); info.setNumberOfDesktops(_numInput->value());
info.activate(); info.activate();
XSync(qt_xdisplay(), FALSE); XSync(tqt_xdisplay(), FALSE);
int konq_screen_number = 0; int konq_screen_number = 0;
if (qt_xdisplay()) if (tqt_xdisplay())
konq_screen_number = DefaultScreen(qt_xdisplay()); konq_screen_number = DefaultScreen(tqt_xdisplay());
TQCString appname; TQCString appname;
if (konq_screen_number == 0) if (konq_screen_number == 0)

@ -596,13 +596,13 @@ void runRdb( uint flags )
if (!qt_settings_timestamp) { if (!qt_settings_timestamp) {
TQString atomname("_QT_SETTINGS_TIMESTAMP_"); TQString atomname("_QT_SETTINGS_TIMESTAMP_");
atomname += XDisplayName( 0 ); // Use the $DISPLAY envvar. atomname += XDisplayName( 0 ); // Use the $DISPLAY envvar.
qt_settings_timestamp = XInternAtom( qt_xdisplay(), atomname.latin1(), False); qt_settings_timestamp = XInternAtom( tqt_xdisplay(), atomname.latin1(), False);
} }
TQBuffer stamp; TQBuffer stamp;
TQDataStream s(stamp.buffer(), IO_WriteOnly); TQDataStream s(stamp.buffer(), IO_WriteOnly);
s << settingsstamp; s << settingsstamp;
XChangeProperty( qt_xdisplay(), qt_xrootwin(), qt_settings_timestamp, XChangeProperty( tqt_xdisplay(), tqt_xrootwin(), qt_settings_timestamp,
qt_settings_timestamp, 8, PropModeReplace, qt_settings_timestamp, 8, PropModeReplace,
(unsigned char*) stamp.buffer().data(), (unsigned char*) stamp.buffer().data(),
stamp.buffer().size() ); stamp.buffer().size() );

@ -869,7 +869,7 @@ void KTheme::addPreview()
{ {
TQString file = m_kgd->saveLocation( "themes", m_name + "/" ) + m_name + ".preview.png"; TQString file = m_kgd->saveLocation( "themes", m_name + "/" ) + m_name + ".preview.png";
kdDebug() << "Adding preview: " << file << endl; kdDebug() << "Adding preview: " << file << endl;
TQPixmap snapshot = TQPixmap::grabWindow( qt_xrootwin() ); TQPixmap snapshot = TQPixmap::grabWindow( tqt_xrootwin() );
snapshot.save( file, "PNG" ); snapshot.save( file, "PNG" );
} }

@ -56,7 +56,7 @@ extern "C"
KDE_EXPORT bool test_randr() KDE_EXPORT bool test_randr()
{ {
int eventBase, errorBase; int eventBase, errorBase;
if( XRRQueryExtension(qt_xdisplay(), &eventBase, &errorBase ) ) if( XRRQueryExtension(tqt_xdisplay(), &eventBase, &errorBase ) )
return true; return true;
return false; return false;
} }

@ -45,7 +45,7 @@ KRandrPassivePopup* KRandrPassivePopup::message( const TQString &caption, const
void KRandrPassivePopup::startWatchingWidget( TQWidget* widget_P ) void KRandrPassivePopup::startWatchingWidget( TQWidget* widget_P )
{ {
static Atom wm_state = XInternAtom( qt_xdisplay() , "WM_STATE", False ); static Atom wm_state = XInternAtom( tqt_xdisplay() , "WM_STATE", False );
Window win = widget_P->winId(); Window win = widget_P->winId();
bool x11_events = false; bool x11_events = false;
for(;;) for(;;)
@ -53,7 +53,7 @@ void KRandrPassivePopup::startWatchingWidget( TQWidget* widget_P )
Window root, parent; Window root, parent;
Window* children; Window* children;
unsigned int nchildren; unsigned int nchildren;
XQueryTree( qt_xdisplay(), win, &root, &parent, &children, &nchildren ); XQueryTree( tqt_xdisplay(), win, &root, &parent, &children, &nchildren );
if( children != NULL ) if( children != NULL )
XFree( children ); XFree( children );
if( win == root ) // huh? if( win == root ) // huh?
@ -69,8 +69,8 @@ void KRandrPassivePopup::startWatchingWidget( TQWidget* widget_P )
else else
{ {
XWindowAttributes attrs; XWindowAttributes attrs;
XGetWindowAttributes( qt_xdisplay(), win, &attrs ); XGetWindowAttributes( tqt_xdisplay(), win, &attrs );
XSelectInput( qt_xdisplay(), win, attrs.your_event_mask | StructureNotifyMask ); XSelectInput( tqt_xdisplay(), win, attrs.your_event_mask | StructureNotifyMask );
watched_windows.append( win ); watched_windows.append( win );
x11_events = true; x11_events = true;
} }
@ -78,7 +78,7 @@ void KRandrPassivePopup::startWatchingWidget( TQWidget* widget_P )
int format; int format;
unsigned long nitems, after; unsigned long nitems, after;
unsigned char* data; unsigned char* data;
if( XGetWindowProperty( qt_xdisplay(), win, wm_state, 0, 0, False, AnyPropertyType, if( XGetWindowProperty( tqt_xdisplay(), win, wm_state, 0, 0, False, AnyPropertyType,
&type, &format, &nitems, &after, &data ) == Success ) &type, &format, &nitems, &after, &data ) == Success )
{ {
if( data != NULL ) if( data != NULL )

@ -582,7 +582,7 @@ void KScreenSaver::slotPreviewExited(KProcess *)
(mMonitorLabel->height()-186)/2+14, 151, 115); (mMonitorLabel->height()-186)/2+14, 151, 115);
mMonitor->show(); mMonitor->show();
// So that hacks can XSelectInput ButtonPressMask // So that hacks can XSelectInput ButtonPressMask
XSelectInput(qt_xdisplay(), mMonitor->winId(), widgetEventMask ); XSelectInput(tqt_xdisplay(), mMonitor->winId(), widgetEventMask );
if (mSelected >= 0) { if (mSelected >= 0) {
mPreviewProc->clearArguments(); mPreviewProc->clearArguments();
@ -781,7 +781,7 @@ void KScreenSaver::slotTest()
mTestWin->raise(); mTestWin->raise();
mTestWin->setFocus(); mTestWin->setFocus();
// So that hacks can XSelectInput ButtonPressMask // So that hacks can XSelectInput ButtonPressMask
XSelectInput(qt_xdisplay(), mTestWin->winId(), widgetEventMask ); XSelectInput(tqt_xdisplay(), mTestWin->winId(), widgetEventMask );
grabMouse(); grabMouse();
grabKeyboard(); grabKeyboard();

@ -97,12 +97,12 @@ extern "C"
TQDataStream d(properties, IO_WriteOnly); TQDataStream d(properties, IO_WriteOnly);
d.setVersion( 3 ); // Qt2 apps need this. d.setVersion( 3 ); // Qt2 apps need this.
d << kapp->palette() << KGlobalSettings::generalFont(); d << kapp->palette() << KGlobalSettings::generalFont();
Atom a = XInternAtom(qt_xdisplay(), "_QT_DESKTOP_PROPERTIES", false); Atom a = XInternAtom(tqt_xdisplay(), "_QT_DESKTOP_PROPERTIES", false);
// do it for all root windows - multihead support // do it for all root windows - multihead support
int screen_count = ScreenCount(qt_xdisplay()); int screen_count = ScreenCount(tqt_xdisplay());
for (int i = 0; i < screen_count; i++) for (int i = 0; i < screen_count; i++)
XChangeProperty(qt_xdisplay(), RootWindow(qt_xdisplay(), i), XChangeProperty(tqt_xdisplay(), RootWindow(tqt_xdisplay(), i),
a, a, 8, PropModeReplace, a, a, 8, PropModeReplace,
(unsigned char*) properties.data(), properties.size()); (unsigned char*) properties.data(), properties.size());
#endif #endif

@ -64,7 +64,7 @@ KBackgroundManager::KBackgroundManager(TQWidget *desktop, KWinModule* twinModule
{ {
if( !properties_inited ) if( !properties_inited )
{ {
prop_root = XInternAtom(qt_xdisplay(), "_XROOTPMAP_ID", False); prop_root = XInternAtom(tqt_xdisplay(), "_XROOTPMAP_ID", False);
properties_inited = true; properties_inited = true;
} }
m_bBgInitDone = false; m_bBgInitDone = false;
@ -146,7 +146,7 @@ KBackgroundManager::~KBackgroundManager()
int format; int format;
unsigned long length, after; unsigned long length, after;
unsigned char* data_root; unsigned char* data_root;
if( XGetWindowProperty( qt_xdisplay(), qt_xrootwin(), prop_root, 0L, 1L, False, AnyPropertyType, if( XGetWindowProperty( tqt_xdisplay(), tqt_xrootwin(), prop_root, 0L, 1L, False, AnyPropertyType,
&type, &format, &length, &after, &data_root) == Success && data_root != NULL ) &type, &format, &length, &after, &data_root) == Success && data_root != NULL )
{ {
if (type == XA_PIXMAP) if (type == XA_PIXMAP)
@ -155,7 +155,7 @@ KBackgroundManager::~KBackgroundManager()
} }
// only if it's our pixmap // only if it's our pixmap
if( pm == m_xrootpmap ) if( pm == m_xrootpmap )
XDeleteProperty(qt_xdisplay(), qt_xrootwin(), prop_root); XDeleteProperty(tqt_xdisplay(), tqt_xrootwin(), prop_root);
m_xrootpmap = None; m_xrootpmap = None;
if (m_bExport) if (m_bExport)
@ -488,7 +488,7 @@ void KBackgroundManager::setPixmap(KPixmap *pm, int hash, int desk)
&& !myApp->cmBackground()) && !myApp->cmBackground())
{ {
XRenderPictFormat *format; XRenderPictFormat *format;
format = XRenderFindStandardFormat (qt_xdisplay(), PictStandardARGB32); format = XRenderFindStandardFormat (tqt_xdisplay(), PictStandardARGB32);
XRenderColor fillColor; XRenderColor fillColor;
@ -498,18 +498,18 @@ void KBackgroundManager::setPixmap(KPixmap *pm, int hash, int desk)
fillColor.blue = color; fillColor.blue = color;
fillColor.alpha = color; fillColor.alpha = color;
Picture fill = XRenderCreateSolidFill (qt_xdisplay(), &fillColor); Picture fill = XRenderCreateSolidFill (tqt_xdisplay(), &fillColor);
Picture src = XRenderCreatePicture(qt_xdisplay(), pm->handle(), Picture src = XRenderCreatePicture(tqt_xdisplay(), pm->handle(),
format, 0, NULL); format, 0, NULL);
Picture dst = XRenderCreatePicture(qt_xdisplay(), ep->handle(), Picture dst = XRenderCreatePicture(tqt_xdisplay(), ep->handle(),
format, 0, NULL); format, 0, NULL);
XRenderComposite (qt_xdisplay(), PictOpSrc, src, fill, dst, 0, 0, 0, XRenderComposite (tqt_xdisplay(), PictOpSrc, src, fill, dst, 0, 0, 0,
0, 0, 0, pm->width(), pm->height()); 0, 0, 0, pm->width(), pm->height());
XRenderFreePicture (qt_xdisplay(), fill); XRenderFreePicture (tqt_xdisplay(), fill);
XRenderFreePicture (qt_xdisplay(), src); XRenderFreePicture (tqt_xdisplay(), src);
XRenderFreePicture (qt_xdisplay(), dst); XRenderFreePicture (tqt_xdisplay(), dst);
} }
} }
#endif #endif
@ -546,7 +546,7 @@ void KBackgroundManager::setPixmap(KPixmap *pm, int hash, int desk)
// don't set the ESETROOT_PMAP_ID property - that would result in possible XKillClient() // don't set the ESETROOT_PMAP_ID property - that would result in possible XKillClient()
// done on kdesktop // done on kdesktop
XChangeProperty(qt_xdisplay(), qt_xrootwin(), prop_root, XA_PIXMAP, 32, PropModeReplace, XChangeProperty(tqt_xdisplay(), tqt_xrootwin(), prop_root, XA_PIXMAP, 32, PropModeReplace,
(unsigned char *) &bgPm, 1); (unsigned char *) &bgPm, 1);
m_xrootpmap = bgPm; m_xrootpmap = bgPm;

@ -140,7 +140,7 @@ KDesktop::KDesktop( bool x_root_hack, bool wait_for_kded ) :
// those two WStyle_ break kdesktop when the root-hack isn't used (no Dnd) // those two WStyle_ break kdesktop when the root-hack isn't used (no Dnd)
startup_id( NULL ), m_waitForKicker(0) startup_id( NULL ), m_waitForKicker(0)
{ {
NETRootInfo i( qt_xdisplay(), NET::Supported ); NETRootInfo i( tqt_xdisplay(), NET::Supported );
m_wmSupport = i.isSupported( NET::WM2ShowingDesktop ); m_wmSupport = i.isSupported( NET::WM2ShowingDesktop );
m_bWaitForKded = wait_for_kded; m_bWaitForKded = wait_for_kded;
@ -173,8 +173,8 @@ KDesktop::KDesktop( bool x_root_hack, bool wait_for_kded ) :
unsigned long data[2]; unsigned long data[2];
data[0] = (unsigned long) 1; data[0] = (unsigned long) 1;
data[1] = (unsigned long) 0; // None; (Werner) data[1] = (unsigned long) 0; // None; (Werner)
Atom wm_state = XInternAtom(qt_xdisplay(), "WM_STATE", False); Atom wm_state = XInternAtom(tqt_xdisplay(), "WM_STATE", False);
XChangeProperty(qt_xdisplay(), winId(), wm_state, wm_state, 32, XChangeProperty(tqt_xdisplay(), winId(), wm_state, wm_state, 32,
PropModeReplace, (unsigned char *)data, 2); PropModeReplace, (unsigned char *)data, 2);
} }
@ -210,7 +210,7 @@ KDesktop::KDesktop( bool x_root_hack, bool wait_for_kded ) :
void void
KDesktop::initRoot() KDesktop::initRoot()
{ {
Display *dpy = qt_xdisplay(); Display *dpy = tqt_xdisplay();
Window root = RootWindow(dpy, kdesktop_screen_number); Window root = RootWindow(dpy, kdesktop_screen_number);
XDefineCursor(dpy, root, cursor().handle()); XDefineCursor(dpy, root, cursor().handle());
@ -515,7 +515,7 @@ void KDesktop::popupExecuteCommand(const TQString& command)
m_miniCli->setCommand(command); m_miniCli->setCommand(command);
// Move minicli to the current desktop // Move minicli to the current desktop
NETWinInfo info( qt_xdisplay(), m_miniCli->winId(), qt_xrootwin(), NET::WMDesktop ); NETWinInfo info( tqt_xdisplay(), m_miniCli->winId(), tqt_xrootwin(), NET::WMDesktop );
int currentDesktop = twinModule()->currentDesktop(); int currentDesktop = twinModule()->currentDesktop();
if ( info.desktop() != currentDesktop ) if ( info.desktop() != currentDesktop )
info.setDesktop( currentDesktop ); info.setDesktop( currentDesktop );
@ -523,7 +523,7 @@ void KDesktop::popupExecuteCommand(const TQString& command)
if ( m_miniCli->isVisible() ) { if ( m_miniCli->isVisible() ) {
KWin::forceActiveWindow( m_miniCli->winId() ); KWin::forceActiveWindow( m_miniCli->winId() );
} else { } else {
NETRootInfo i( qt_xdisplay(), NET::Supported ); NETRootInfo i( tqt_xdisplay(), NET::Supported );
if( !i.isSupported( NET::WM2FullPlacement )) { if( !i.isSupported( NET::WM2FullPlacement )) {
TQRect rect = KGlobalSettings::desktopGeometry(TQCursor::pos()); TQRect rect = KGlobalSettings::desktopGeometry(TQCursor::pos());
m_miniCli->move(rect.x() + (rect.width() - m_miniCli->width())/2, m_miniCli->move(rect.x() + (rect.width() - m_miniCli->width())/2,
@ -607,7 +607,7 @@ void KDesktop::setShowDesktop( bool b )
if( m_wmSupport ) if( m_wmSupport )
{ {
NETRootInfo i( qt_xdisplay(), 0 ); NETRootInfo i( tqt_xdisplay(), 0 );
i.setShowingDesktop( b ); i.setShowingDesktop( b );
return; return;
} }
@ -624,7 +624,7 @@ void KDesktop::setShowDesktop( bool b )
{ {
WId w = *it; WId w = *it;
NETWinInfo info( qt_xdisplay(), w, qt_xrootwin(), NETWinInfo info( tqt_xdisplay(), w, tqt_xrootwin(),
NET::XAWMState | NET::WMDesktop ); NET::XAWMState | NET::WMDesktop );
if (info.mappingState() == NET::Visible && if (info.mappingState() == NET::Visible &&
@ -689,7 +689,7 @@ void KDesktop::slotWindowAdded(WId w)
return; return;
} }
NETWinInfo inf(qt_xdisplay(), w, qt_xrootwin(), NETWinInfo inf(tqt_xdisplay(), w, tqt_xrootwin(),
NET::XAWMState | NET::WMWindowType); NET::XAWMState | NET::WMWindowType);
NET::WindowType windowType = inf.windowType(NET::AllTypesMask); NET::WindowType windowType = inf.windowType(NET::AllTypesMask);
@ -723,7 +723,7 @@ void KDesktop::slotWindowChanged(WId w, unsigned int dirty)
if (dirty & NET::XAWMState) if (dirty & NET::XAWMState)
{ {
NETWinInfo inf(qt_xdisplay(), w, qt_xrootwin(), NETWinInfo inf(tqt_xdisplay(), w, tqt_xrootwin(),
NET::XAWMState | NET::WMWindowType); NET::XAWMState | NET::WMWindowType);
NET::WindowType windowType = inf.windowType(NET::AllTypesMask); NET::WindowType windowType = inf.windowType(NET::AllTypesMask);
@ -852,15 +852,15 @@ void KDesktop::slotSetVRoot()
return; return;
} }
unsigned long rw = RootWindowOfScreen(ScreenOfDisplay(qt_xdisplay(), qt_xscreen())); unsigned long rw = RootWindowOfScreen(ScreenOfDisplay(tqt_xdisplay(), tqt_xscreen()));
unsigned long vroot_data[1] = { m_pIconView->viewport()->winId() }; unsigned long vroot_data[1] = { m_pIconView->viewport()->winId() };
static Atom vroot = XInternAtom(qt_xdisplay(), "__SWM_VROOT", False); static Atom vroot = XInternAtom(tqt_xdisplay(), "__SWM_VROOT", False);
Window rootReturn, parentReturn, *children; Window rootReturn, parentReturn, *children;
unsigned int numChildren; unsigned int numChildren;
Window top = winId(); Window top = winId();
while (1) { while (1) {
/*int ret = */XQueryTree(qt_xdisplay(), top , &rootReturn, &parentReturn, /*int ret = */XQueryTree(tqt_xdisplay(), top , &rootReturn, &parentReturn,
&children, &numChildren); &children, &numChildren);
if (children) if (children)
XFree((char *)children); XFree((char *)children);
@ -870,10 +870,10 @@ void KDesktop::slotSetVRoot()
top = parentReturn; top = parentReturn;
} }
if ( set_vroot ) if ( set_vroot )
XChangeProperty(qt_xdisplay(), top, vroot, XA_WINDOW, 32, XChangeProperty(tqt_xdisplay(), top, vroot, XA_WINDOW, 32,
PropModeReplace, (unsigned char *)vroot_data, 1); PropModeReplace, (unsigned char *)vroot_data, 1);
else else
XDeleteProperty (qt_xdisplay(), top, vroot); XDeleteProperty (tqt_xdisplay(), top, vroot);
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------

@ -45,11 +45,11 @@ void KDesktopApp::initCmBackground()
m_bgSupported = false; m_bgSupported = false;
m_cmBackground = m_cmBackground =
XInternAtom (qt_xdisplay(), "_COMPIZ_WALLPAPER_SUPPORTED", false); XInternAtom (tqt_xdisplay(), "_COMPIZ_WALLPAPER_SUPPORTED", false);
XSelectInput (qt_xdisplay(), qt_xrootwin(), PropertyChangeMask); XSelectInput (tqt_xdisplay(), tqt_xrootwin(), PropertyChangeMask);
if (XGetWindowProperty (qt_xdisplay(), qt_xrootwin(), m_cmBackground, if (XGetWindowProperty (tqt_xdisplay(), tqt_xrootwin(), m_cmBackground,
0, 1, FALSE, XA_CARDINAL, &type, &format, &num, 0, 1, FALSE, XA_CARDINAL, &type, &format, &num,
&rest, &data) == Success && num) &rest, &data) == Success && num)
{ {
@ -62,7 +62,7 @@ void KDesktopApp::initCmBackground()
bool KDesktopApp::x11EventFilter (XEvent * xevent) bool KDesktopApp::x11EventFilter (XEvent * xevent)
{ {
if (xevent->type == PropertyNotify && if (xevent->type == PropertyNotify &&
xevent->xproperty.window == qt_xrootwin() && xevent->xproperty.window == tqt_xrootwin() &&
xevent->xproperty.atom == m_cmBackground) xevent->xproperty.atom == m_cmBackground)
{ {
Atom type; Atom type;
@ -72,7 +72,7 @@ bool KDesktopApp::x11EventFilter (XEvent * xevent)
Bool supported = false; Bool supported = false;
if (XGetWindowProperty (qt_xdisplay(), qt_xrootwin(), m_cmBackground, if (XGetWindowProperty (tqt_xdisplay(), tqt_xrootwin(), m_cmBackground,
0, 1, FALSE, XA_CARDINAL, &type, &format, &num, 0, 1, FALSE, XA_CARDINAL, &type, &format, &num,
&rest, &data) == Success && num) &rest, &data) == Success && num)
{ {

@ -579,8 +579,8 @@ void KRootWm::activateMenu( menuChoice choice, const TQPoint& global )
case APPMENU: case APPMENU:
{ {
// This allows the menu to disappear when clicking on the background another time // This allows the menu to disappear when clicking on the background another time
XUngrabPointer(qt_xdisplay(), CurrentTime); XUngrabPointer(tqt_xdisplay(), CurrentTime);
XSync(qt_xdisplay(), False); XSync(tqt_xdisplay(), False);
// Ask kicker to showup the menu // Ask kicker to showup the menu
DCOPRef( kicker_name, kicker_name ).send( "popupKMenu", global ); DCOPRef( kicker_name, kicker_name ).send( "popupKMenu", global );

@ -36,8 +36,8 @@ AutoLogout::AutoLogout(LockProcess *parent) : TQDialog(parent, "password dialog"
if (trinity_desktop_lock_use_system_modal_dialogs) { if (trinity_desktop_lock_use_system_modal_dialogs) {
// Signal that we do not want any window controls to be shown at all // Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification; Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False); kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False);
XChangeProperty(qt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L); XChangeProperty(tqt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
} }
setCaption(i18n("Automatic Logout Notification")); setCaption(i18n("Automatic Logout Notification"));

@ -68,8 +68,8 @@ InfoDlg::InfoDlg(LockProcess *parent)
if (trinity_desktop_lock_use_system_modal_dialogs) { if (trinity_desktop_lock_use_system_modal_dialogs) {
// Signal that we do not want any window controls to be shown at all // Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification; Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False); kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False);
XChangeProperty(qt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L); XChangeProperty(tqt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
} }
setCaption(i18n("Information")); setCaption(i18n("Information"));

@ -103,8 +103,8 @@ void PasswordDlg::init(GreeterPluginHandle *plugin)
if (trinity_desktop_lock_use_system_modal_dialogs) { if (trinity_desktop_lock_use_system_modal_dialogs) {
// Signal that we do not want any window controls to be shown at all // Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification; Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False); kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False);
XChangeProperty(qt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L); XChangeProperty(tqt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
} }
setCaption(i18n("Desktop Session Locked")); setCaption(i18n("Desktop Session Locked"));
@ -617,8 +617,8 @@ void PasswordDlg::slotStartNewSession()
if (trinity_desktop_lock_use_system_modal_dialogs) { if (trinity_desktop_lock_use_system_modal_dialogs) {
// Signal that we do not want any window controls to be shown at all // Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification; Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False); kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False);
XChangeProperty(qt_xdisplay(), dialog->winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L); XChangeProperty(tqt_xdisplay(), dialog->winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
} }
dialog->setCaption(i18n("New Session")); dialog->setCaption(i18n("New Session"));
@ -743,8 +743,8 @@ void PasswordDlg::slotSwitchUser()
if (trinity_desktop_lock_use_system_modal_dialogs) { if (trinity_desktop_lock_use_system_modal_dialogs) {
// Signal that we do not want any window controls to be shown at all // Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification; Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False); kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False);
XChangeProperty(qt_xdisplay(), dialog.winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L); XChangeProperty(tqt_xdisplay(), dialog.winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
} }
dialog.setCaption(i18n("Switch User")); dialog.setCaption(i18n("Switch User"));
@ -840,7 +840,7 @@ void PasswordDlg::capsLocked()
unsigned int lmask; unsigned int lmask;
Window dummy1, dummy2; Window dummy1, dummy2;
int dummy3, dummy4, dummy5, dummy6; int dummy3, dummy4, dummy5, dummy6;
XQueryPointer(qt_xdisplay(), DefaultRootWindow( qt_xdisplay() ), &dummy1, &dummy2, &dummy3, &dummy4, &dummy5, &dummy6, &lmask); XQueryPointer(tqt_xdisplay(), DefaultRootWindow( tqt_xdisplay() ), &dummy1, &dummy2, &dummy3, &dummy4, &dummy5, &dummy6, &lmask);
mCapsLocked = lmask & LockMask; mCapsLocked = lmask & LockMask;
updateLabel(); updateLabel();
} }

@ -132,7 +132,7 @@ static void segv_handler(int)
sleep(1); 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_use_system_modal_dialogs;
extern bool trinity_desktop_lock_delay_screensaver_start; extern bool trinity_desktop_lock_delay_screensaver_start;
extern bool trinity_desktop_lock_use_sak; extern bool trinity_desktop_lock_use_sak;
@ -220,15 +220,15 @@ LockProcess::LockProcess(bool child, bool useBlankOnly)
// Get root window size // Get root window size
XWindowAttributes rootAttr; XWindowAttributes rootAttr;
XGetWindowAttributes(qt_xdisplay(), RootWindow(qt_xdisplay(), XGetWindowAttributes(tqt_xdisplay(), RootWindow(tqt_xdisplay(),
qt_xscreen()), &rootAttr); tqt_xscreen()), &rootAttr);
mRootWidth = rootAttr.width; mRootWidth = rootAttr.width;
mRootHeight = rootAttr.height; mRootHeight = rootAttr.height;
{ // trigger creation of QToolTipManager, it does XSelectInput() on the root window { // trigger creation of QToolTipManager, it does XSelectInput() on the root window
TQWidget w; TQWidget w;
TQToolTip::add( &w, "foo" ); TQToolTip::add( &w, "foo" );
} }
XSelectInput( qt_xdisplay(), qt_xrootwin(), XSelectInput( tqt_xdisplay(), tqt_xrootwin(),
SubstructureNotifyMask | rootAttr.your_event_mask ); SubstructureNotifyMask | rootAttr.your_event_mask );
// Add non-KDE path // Add non-KDE path
@ -249,8 +249,8 @@ LockProcess::LockProcess(bool child, bool useBlankOnly)
relPath); relPath);
// virtual root property // virtual root property
gXA_VROOT = XInternAtom (qt_xdisplay(), "__SWM_VROOT", False); gXA_VROOT = XInternAtom (tqt_xdisplay(), "__SWM_VROOT", False);
gXA_SCREENSAVER_VERSION = XInternAtom (qt_xdisplay(), "_SCREENSAVER_VERSION", False); gXA_SCREENSAVER_VERSION = XInternAtom (tqt_xdisplay(), "_SCREENSAVER_VERSION", False);
connect(&mHackProc, TQT_SIGNAL(processExited(KProcess *)), connect(&mHackProc, TQT_SIGNAL(processExited(KProcess *)),
TQT_SLOT(hackExited(KProcess *))); TQT_SLOT(hackExited(KProcess *)));
@ -270,7 +270,7 @@ LockProcess::LockProcess(bool child, bool useBlankOnly)
if (mDPMSDepend) { if (mDPMSDepend) {
BOOL on; BOOL on;
CARD16 state; CARD16 state;
DPMSInfo(qt_xdisplay(), &state, &on); DPMSInfo(tqt_xdisplay(), &state, &on);
if (on) if (on)
{ {
connect(&mCheckDPMS, TQT_SIGNAL(timeout()), TQT_SLOT(checkDPMSActive())); connect(&mCheckDPMS, TQT_SIGNAL(timeout()), TQT_SLOT(checkDPMSActive()));
@ -876,14 +876,14 @@ void LockProcess::createSaverWindow()
// Some xscreensaver hacks check for this property // Some xscreensaver hacks check for this property
const char *version = "KDE 2.0"; const char *version = "KDE 2.0";
XChangeProperty (qt_xdisplay(), winId(), XChangeProperty (tqt_xdisplay(), winId(),
gXA_SCREENSAVER_VERSION, XA_STRING, 8, PropModeReplace, gXA_SCREENSAVER_VERSION, XA_STRING, 8, PropModeReplace,
(unsigned char *) version, strlen(version)); (unsigned char *) version, strlen(version));
XSetWindowAttributes attr; XSetWindowAttributes attr;
attr.event_mask = KeyPressMask | ButtonPressMask | PointerMotionMask | attr.event_mask = KeyPressMask | ButtonPressMask | PointerMotionMask |
VisibilityChangeMask | ExposureMask; VisibilityChangeMask | ExposureMask;
XChangeWindowAttributes(qt_xdisplay(), winId(), XChangeWindowAttributes(tqt_xdisplay(), winId(),
CWEventMask, &attr); CWEventMask, &attr);
// erase(); // erase();
@ -905,7 +905,7 @@ void LockProcess::desktopResized()
// Get root window size // Get root window size
XWindowAttributes rootAttr; XWindowAttributes rootAttr;
XGetWindowAttributes(qt_xdisplay(), RootWindow(qt_xdisplay(), qt_xscreen()), &rootAttr); XGetWindowAttributes(tqt_xdisplay(), RootWindow(tqt_xdisplay(), tqt_xscreen()), &rootAttr);
mRootWidth = rootAttr.width; mRootWidth = rootAttr.width;
mRootHeight = rootAttr.height; mRootHeight = rootAttr.height;
@ -958,14 +958,14 @@ void LockProcess::hideSaverWindow()
hide(); hide();
lower(); lower();
removeVRoot(winId()); removeVRoot(winId());
XDeleteProperty(qt_xdisplay(), winId(), gXA_SCREENSAVER_VERSION); XDeleteProperty(tqt_xdisplay(), winId(), gXA_SCREENSAVER_VERSION);
if ( gVRoot ) { if ( gVRoot ) {
unsigned long vroot_data[1] = { gVRootData }; 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); PropModeReplace, (unsigned char *)vroot_data, 1);
gVRoot = 0; gVRoot = 0;
} }
XSync(qt_xdisplay(), False); XSync(tqt_xdisplay(), False);
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@ -982,7 +982,7 @@ void LockProcess::saveVRoot()
{ {
Window rootReturn, parentReturn, *children; Window rootReturn, parentReturn, *children;
unsigned int numChildren; unsigned int numChildren;
Window root = RootWindowOfScreen(ScreenOfDisplay(qt_xdisplay(), qt_xscreen())); Window root = RootWindowOfScreen(ScreenOfDisplay(tqt_xdisplay(), tqt_xscreen()));
gVRoot = 0; gVRoot = 0;
gVRootData = 0; gVRootData = 0;
@ -990,7 +990,7 @@ void LockProcess::saveVRoot()
int (*oldHandler)(Display *, XErrorEvent *); int (*oldHandler)(Display *, XErrorEvent *);
oldHandler = XSetErrorHandler(ignoreXError); oldHandler = XSetErrorHandler(ignoreXError);
if (XQueryTree(qt_xdisplay(), root, &rootReturn, &parentReturn, if (XQueryTree(tqt_xdisplay(), root, &rootReturn, &parentReturn,
&children, &numChildren)) &children, &numChildren))
{ {
for (unsigned int i = 0; i < numChildren; i++) for (unsigned int i = 0; i < numChildren; i++)
@ -1000,7 +1000,7 @@ void LockProcess::saveVRoot()
unsigned long nitems, bytesafter; unsigned long nitems, bytesafter;
unsigned char *newRoot = 0; 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, False, XA_WINDOW, &actual_type, &actual_format, &nitems, &bytesafter,
&newRoot) == Success) && newRoot) &newRoot) == Success) && newRoot)
{ {
@ -1029,14 +1029,14 @@ void LockProcess::setVRoot(Window win, Window vr)
if (gVRoot) if (gVRoot)
removeVRoot(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 }; unsigned long vroot_data[1] = { vr };
Window rootReturn, parentReturn, *children; Window rootReturn, parentReturn, *children;
unsigned int numChildren; unsigned int numChildren;
Window top = win; Window top = win;
while (1) { while (1) {
XQueryTree(qt_xdisplay(), top , &rootReturn, &parentReturn, XQueryTree(tqt_xdisplay(), top , &rootReturn, &parentReturn,
&children, &numChildren); &children, &numChildren);
if (children) if (children)
XFree((char *)children); XFree((char *)children);
@ -1046,7 +1046,7 @@ void LockProcess::setVRoot(Window win, Window vr)
top = parentReturn; 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); PropModeReplace, (unsigned char *)vroot_data, 1);
} }
@ -1056,7 +1056,7 @@ void LockProcess::setVRoot(Window win, Window vr)
// //
void LockProcess::removeVRoot(Window win) void LockProcess::removeVRoot(Window win)
{ {
XDeleteProperty (qt_xdisplay(), win, gXA_VROOT); XDeleteProperty (tqt_xdisplay(), win, gXA_VROOT);
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@ -1065,7 +1065,7 @@ void LockProcess::removeVRoot(Window win)
// //
bool LockProcess::grabKeyboard() bool LockProcess::grabKeyboard()
{ {
int rv = XGrabKeyboard( qt_xdisplay(), TQApplication::desktop()->winId(), int rv = XGrabKeyboard( tqt_xdisplay(), TQApplication::desktop()->winId(),
True, GrabModeAsync, GrabModeAsync, CurrentTime ); True, GrabModeAsync, GrabModeAsync, CurrentTime );
return (rv == GrabSuccess); return (rv == GrabSuccess);
@ -1080,7 +1080,7 @@ bool LockProcess::grabKeyboard()
// //
bool LockProcess::grabMouse() bool LockProcess::grabMouse()
{ {
int rv = XGrabPointer( qt_xdisplay(), TQApplication::desktop()->winId(), int rv = XGrabPointer( tqt_xdisplay(), TQApplication::desktop()->winId(),
True, GRABEVENTS, GrabModeAsync, GrabModeAsync, None, True, GRABEVENTS, GrabModeAsync, GrabModeAsync, None,
TQCursor(tqbusyCursor).handle(), CurrentTime ); TQCursor(tqbusyCursor).handle(), CurrentTime );
@ -1093,7 +1093,7 @@ bool LockProcess::grabMouse()
// //
bool LockProcess::grabInput() bool LockProcess::grabInput()
{ {
XSync(qt_xdisplay(), False); XSync(tqt_xdisplay(), False);
if (!grabKeyboard()) if (!grabKeyboard())
{ {
@ -1110,7 +1110,7 @@ bool LockProcess::grabInput()
usleep(100000); usleep(100000);
if (!grabMouse()) if (!grabMouse())
{ {
XUngrabKeyboard(qt_xdisplay(), CurrentTime); XUngrabKeyboard(tqt_xdisplay(), CurrentTime);
return false; return false;
} }
} }
@ -1127,8 +1127,8 @@ bool LockProcess::grabInput()
// //
void LockProcess::ungrabInput() void LockProcess::ungrabInput()
{ {
XUngrabKeyboard(qt_xdisplay(), CurrentTime); XUngrabKeyboard(tqt_xdisplay(), CurrentTime);
XUngrabPointer(qt_xdisplay(), CurrentTime); XUngrabPointer(tqt_xdisplay(), CurrentTime);
unlockXF86(); unlockXF86();
} }
@ -1171,7 +1171,7 @@ bool LockProcess::startSaver()
show(); show();
raise(); raise();
XSync(qt_xdisplay(), False); XSync(tqt_xdisplay(), False);
setVRoot( winId(), winId() ); setVRoot( winId(), winId() );
if (!(trinity_desktop_lock_delay_screensaver_start && (trinity_desktop_lock_forced || trinity_desktop_lock_in_sec_dlg))) { if (!(trinity_desktop_lock_delay_screensaver_start && (trinity_desktop_lock_forced || trinity_desktop_lock_in_sec_dlg))) {
if (backingPixmap.isNull()) if (backingPixmap.isNull())
@ -1551,7 +1551,7 @@ void LockProcess::resume( bool force )
} }
if ((mSuspended) && (mHackProc.isRunning())) if ((mSuspended) && (mHackProc.isRunning()))
{ {
XForceScreenSaver(qt_xdisplay(), ScreenSaverReset ); XForceScreenSaver(tqt_xdisplay(), ScreenSaverReset );
bitBlt( this, 0, 0, &mSavedScreen ); bitBlt( this, 0, 0, &mSavedScreen );
TQApplication::syncX(); TQApplication::syncX();
mHackProc.kill(SIGCONT); mHackProc.kill(SIGCONT);
@ -1597,12 +1597,12 @@ bool LockProcess::checkPass()
mForceReject = false; mForceReject = false;
XWindowAttributes rootAttr; XWindowAttributes rootAttr;
XGetWindowAttributes(qt_xdisplay(), RootWindow(qt_xdisplay(), XGetWindowAttributes(tqt_xdisplay(), RootWindow(tqt_xdisplay(),
qt_xscreen()), &rootAttr); tqt_xscreen()), &rootAttr);
if(( rootAttr.your_event_mask & SubstructureNotifyMask ) == 0 ) if(( rootAttr.your_event_mask & SubstructureNotifyMask ) == 0 )
{ {
kdWarning() << "ERROR: Something removed SubstructureNotifyMask from the root window!!!" << endl; kdWarning() << "ERROR: Something removed SubstructureNotifyMask from the root window!!!" << endl;
XSelectInput( qt_xdisplay(), qt_xrootwin(), XSelectInput( tqt_xdisplay(), tqt_xrootwin(),
SubstructureNotifyMask | rootAttr.your_event_mask ); SubstructureNotifyMask | rootAttr.your_event_mask );
} }
@ -1621,12 +1621,12 @@ static void fakeFocusIn( WId window )
// window, so that it will correctly show cursor in the dialog. // window, so that it will correctly show cursor in the dialog.
XEvent ev; XEvent ev;
memset(&ev, 0, sizeof(ev)); memset(&ev, 0, sizeof(ev));
ev.xfocus.display = qt_xdisplay(); ev.xfocus.display = tqt_xdisplay();
ev.xfocus.type = FocusIn; ev.xfocus.type = FocusIn;
ev.xfocus.window = window; ev.xfocus.window = window;
ev.xfocus.mode = NotifyNormal; ev.xfocus.mode = NotifyNormal;
ev.xfocus.detail = NotifyAncestor; ev.xfocus.detail = NotifyAncestor;
XSendEvent( qt_xdisplay(), window, False, NoEventMask, &ev ); XSendEvent( tqt_xdisplay(), window, False, NoEventMask, &ev );
} }
void LockProcess::resumeUnforced() void LockProcess::resumeUnforced()
@ -1646,7 +1646,7 @@ int LockProcess::execDialog( TQDialog *dlg )
if (mDialogs.isEmpty()) if (mDialogs.isEmpty())
{ {
suspend(); suspend();
XChangeActivePointerGrab( qt_xdisplay(), GRABEVENTS, XChangeActivePointerGrab( tqt_xdisplay(), GRABEVENTS,
TQCursor(tqarrowCursor).handle(), CurrentTime); TQCursor(tqarrowCursor).handle(), CurrentTime);
} }
mDialogs.prepend( dlg ); mDialogs.prepend( dlg );
@ -1661,7 +1661,7 @@ int LockProcess::execDialog( TQDialog *dlg )
currentDialog = NULL; currentDialog = NULL;
mDialogs.remove( dlg ); mDialogs.remove( dlg );
if( mDialogs.isEmpty() ) { if( mDialogs.isEmpty() ) {
XChangeActivePointerGrab( qt_xdisplay(), GRABEVENTS, XChangeActivePointerGrab( tqt_xdisplay(), GRABEVENTS,
TQCursor(tqbusyCursor).handle(), CurrentTime); TQCursor(tqbusyCursor).handle(), CurrentTime);
if (trinity_desktop_lock_use_system_modal_dialogs) { if (trinity_desktop_lock_use_system_modal_dialogs) {
// Slight delay before screensaver resume to allow the dialog window to fully disappear // Slight delay before screensaver resume to allow the dialog window to fully disappear
@ -1744,7 +1744,7 @@ void LockProcess::doFunctionKeyBroadcast() {
if ((!trinity_desktop_lock_use_system_modal_dialogs) && (!trinity_desktop_lock_use_sak)) { if ((!trinity_desktop_lock_use_system_modal_dialogs) && (!trinity_desktop_lock_use_sak)) {
mBusy=true; mBusy=true;
TQTimer::singleShot(1000, this, TQT_SLOT(slotDeadTimePassed())); TQTimer::singleShot(1000, this, TQT_SLOT(slotDeadTimePassed()));
if (mkeyCode == XKeysymToKeycode(qt_xdisplay(), XF86XK_Display)) { if (mkeyCode == XKeysymToKeycode(tqt_xdisplay(), XF86XK_Display)) {
while (mDialogControlLock == true) usleep(100000); while (mDialogControlLock == true) usleep(100000);
mDialogControlLock = true; mDialogControlLock = true;
currentDialog->close(); // DO NOT use closeCurrentWindow() here! currentDialog->close(); // DO NOT use closeCurrentWindow() here!
@ -1845,7 +1845,7 @@ bool LockProcess::x11Event(XEvent *event)
break; break;
case ConfigureNotify: // from SubstructureNotifyMask on the root window case ConfigureNotify: // from SubstructureNotifyMask on the root window
if(event->xconfigure.event == qt_xrootwin()) if(event->xconfigure.event == tqt_xrootwin())
stayOnTop(); stayOnTop();
for( TQValueList< VkbdWindow >::Iterator it = mVkbdWindows.begin(); for( TQValueList< VkbdWindow >::Iterator it = mVkbdWindows.begin();
it != mVkbdWindows.end(); it != mVkbdWindows.end();
@ -1859,7 +1859,7 @@ bool LockProcess::x11Event(XEvent *event)
break; break;
case MapNotify: // from SubstructureNotifyMask on the root window case MapNotify: // from SubstructureNotifyMask on the root window
windowAdded( event->xmap.window, false ); windowAdded( event->xmap.window, false );
if( event->xmap.event == qt_xrootwin()) if( event->xmap.event == tqt_xrootwin())
stayOnTop(); stayOnTop();
break; break;
case DestroyNotify: case DestroyNotify:
@ -1903,9 +1903,9 @@ void LockProcess::stayOnTop()
// and no ConfigureNotify will be generated, // and no ConfigureNotify will be generated,
// thus avoiding possible infinite loops // thus avoiding possible infinite loops
if( !mVkbdWindows.isEmpty()) if( !mVkbdWindows.isEmpty())
XRaiseWindow( qt_xdisplay(), mVkbdWindows.first().id ); XRaiseWindow( tqt_xdisplay(), mVkbdWindows.first().id );
else else
XRaiseWindow( qt_xdisplay(), mDialogs.first()->winId()); // raise topmost XRaiseWindow( tqt_xdisplay(), mDialogs.first()->winId()); // raise topmost
// and stack others below it // and stack others below it
Window* stack = new Window[ mDialogs.count() + mVkbdWindows.count() + 1 ]; Window* stack = new Window[ mDialogs.count() + mVkbdWindows.count() + 1 ];
int count = 0; int count = 0;
@ -1922,7 +1922,7 @@ void LockProcess::stayOnTop()
delete[] stack; delete[] stack;
} }
else else
XRaiseWindow(qt_xdisplay(), winId()); XRaiseWindow(tqt_xdisplay(), winId());
} }
void LockProcess::checkDPMSActive() void LockProcess::checkDPMSActive()
@ -1930,7 +1930,7 @@ void LockProcess::checkDPMSActive()
#ifdef HAVE_DPMS #ifdef HAVE_DPMS
BOOL on; BOOL on;
CARD16 state; CARD16 state;
DPMSInfo(qt_xdisplay(), &state, &on); DPMSInfo(tqt_xdisplay(), &state, &on);
//kdDebug() << "checkDPMSActive " << on << " " << state << endl; //kdDebug() << "checkDPMSActive " << on << " " << state << endl;
if (state == DPMSModeStandby || state == DPMSModeSuspend || state == DPMSModeOff) if (state == DPMSModeStandby || state == DPMSModeSuspend || state == DPMSModeOff)
{ {
@ -1952,7 +1952,7 @@ void LockProcess::lockXF86()
if( can_do_xf86_lock == Unknown ) if( can_do_xf86_lock == Unknown )
{ {
int major, minor; int major, minor;
if( XF86MiscQueryVersion( qt_xdisplay(), &major, &minor ) if( XF86MiscQueryVersion( tqt_xdisplay(), &major, &minor )
&& major >= 0 && minor >= 5 ) && major >= 0 && minor >= 5 )
can_do_xf86_lock = Yes; can_do_xf86_lock = Yes;
else else
@ -1962,7 +1962,7 @@ void LockProcess::lockXF86()
return; return;
if( mRestoreXF86Lock ) if( mRestoreXF86Lock )
return; return;
if( XF86MiscSetGrabKeysState( qt_xdisplay(), False ) != MiscExtGrabStateSuccess ) if( XF86MiscSetGrabKeysState( tqt_xdisplay(), False ) != MiscExtGrabStateSuccess )
return; return;
// success // success
mRestoreXF86Lock = true; mRestoreXF86Lock = true;
@ -1974,7 +1974,7 @@ void LockProcess::unlockXF86()
return; return;
if( !mRestoreXF86Lock ) if( !mRestoreXF86Lock )
return; return;
XF86MiscSetGrabKeysState( qt_xdisplay(), True ); XF86MiscSetGrabKeysState( tqt_xdisplay(), True );
mRestoreXF86Lock = false; mRestoreXF86Lock = false;
} }
#else #else
@ -2059,13 +2059,13 @@ void LockProcess::windowAdded( WId w, bool managed )
if( managed ) { if( managed ) {
// withdraw the window, wait for it to be withdrawn, reparent it directly // withdraw the window, wait for it to be withdrawn, reparent it directly
// to root at the right position // to root at the right position
XWithdrawWindow( qt_xdisplay(), w, qt_xscreen()); XWithdrawWindow( tqt_xdisplay(), w, tqt_xscreen());
for(;;) { for(;;) {
Atom type; Atom type;
int format; int format;
unsigned long length, after; unsigned long length, after;
unsigned char *data; unsigned char *data;
int r = XGetWindowProperty( qt_xdisplay(), w, qt_wm_state, 0, 2, int r = XGetWindowProperty( tqt_xdisplay(), w, tqt_wm_state, 0, 2,
false, AnyPropertyType, &type, &format, false, AnyPropertyType, &type, &format,
&length, &after, &data ); &length, &after, &data );
bool withdrawn = true; bool withdrawn = true;
@ -2078,18 +2078,18 @@ void LockProcess::windowAdded( WId w, bool managed )
break; break;
} }
} }
XSelectInput( qt_xdisplay(), w, StructureNotifyMask ); XSelectInput( tqt_xdisplay(), w, StructureNotifyMask );
XWindowAttributes attr_geom; XWindowAttributes attr_geom;
if( !XGetWindowAttributes( qt_xdisplay(), w, &attr_geom )) if( !XGetWindowAttributes( tqt_xdisplay(), w, &attr_geom ))
return; return;
int x = XDisplayWidth( qt_xdisplay(), qt_xscreen()) - attr_geom.width; int x = XDisplayWidth( tqt_xdisplay(), tqt_xscreen()) - attr_geom.width;
int y = XDisplayHeight( qt_xdisplay(), qt_xscreen()) - attr_geom.height; int y = XDisplayHeight( tqt_xdisplay(), tqt_xscreen()) - attr_geom.height;
if( managed ) { if( managed ) {
XSetWindowAttributes attr; XSetWindowAttributes attr;
attr.override_redirect = True; attr.override_redirect = True;
XChangeWindowAttributes( qt_xdisplay(), w, CWOverrideRedirect, &attr ); XChangeWindowAttributes( tqt_xdisplay(), w, CWOverrideRedirect, &attr );
XReparentWindow( qt_xdisplay(), w, qt_xrootwin(), x, y ); XReparentWindow( tqt_xdisplay(), w, tqt_xrootwin(), x, y );
XMapWindow( qt_xdisplay(), w ); XMapWindow( tqt_xdisplay(), w );
} }
VkbdWindow data; VkbdWindow data;
data.id = w; data.id = w;
@ -2129,7 +2129,7 @@ bool LockProcess::forwardVkbdEvent( XEvent* event )
int root_x, root_y, x, y; int root_x, root_y, x, y;
unsigned int mask; unsigned int mask;
for(;;) { for(;;) {
if( !XQueryPointer( qt_xdisplay(), window, &root, &child, &root_x, &root_y, &x, &y, &mask )) if( !XQueryPointer( tqt_xdisplay(), window, &root, &child, &root_x, &root_y, &x, &y, &mask ))
return false; return false;
if( child == None ) if( child == None )
break; break;
@ -2151,7 +2151,7 @@ bool LockProcess::forwardVkbdEvent( XEvent* event )
} }
event->xany.window = window; event->xany.window = window;
sendVkbdFocusInOut( window, time ); sendVkbdFocusInOut( window, time );
XSendEvent( qt_xdisplay(), window, False, 0, event ); XSendEvent( tqt_xdisplay(), window, False, 0, event );
return true; return true;
} }
} }
@ -2169,9 +2169,9 @@ void LockProcess::sendVkbdFocusInOut( WId window, Time t )
if( mVkbdLastEventWindow != None ) { if( mVkbdLastEventWindow != None ) {
XEvent e; XEvent e;
e.xcrossing.type = LeaveNotify; e.xcrossing.type = LeaveNotify;
e.xcrossing.display = qt_xdisplay(); e.xcrossing.display = tqt_xdisplay();
e.xcrossing.window = mVkbdLastEventWindow; e.xcrossing.window = mVkbdLastEventWindow;
e.xcrossing.root = qt_xrootwin(); e.xcrossing.root = tqt_xrootwin();
e.xcrossing.subwindow = None; e.xcrossing.subwindow = None;
e.xcrossing.time = t; e.xcrossing.time = t;
e.xcrossing.x = 0; e.xcrossing.x = 0;
@ -2183,15 +2183,15 @@ void LockProcess::sendVkbdFocusInOut( WId window, Time t )
e.xcrossing.same_screen = True; e.xcrossing.same_screen = True;
e.xcrossing.focus = False; e.xcrossing.focus = False;
e.xcrossing.state = 0; e.xcrossing.state = 0;
XSendEvent( qt_xdisplay(), mVkbdLastEventWindow, False, 0, &e ); XSendEvent( tqt_xdisplay(), mVkbdLastEventWindow, False, 0, &e );
} }
mVkbdLastEventWindow = window; mVkbdLastEventWindow = window;
if( mVkbdLastEventWindow != None ) { if( mVkbdLastEventWindow != None ) {
XEvent e; XEvent e;
e.xcrossing.type = EnterNotify; e.xcrossing.type = EnterNotify;
e.xcrossing.display = qt_xdisplay(); e.xcrossing.display = tqt_xdisplay();
e.xcrossing.window = mVkbdLastEventWindow; e.xcrossing.window = mVkbdLastEventWindow;
e.xcrossing.root = qt_xrootwin(); e.xcrossing.root = tqt_xrootwin();
e.xcrossing.subwindow = None; e.xcrossing.subwindow = None;
e.xcrossing.time = t; e.xcrossing.time = t;
e.xcrossing.x = 0; e.xcrossing.x = 0;
@ -2203,7 +2203,7 @@ void LockProcess::sendVkbdFocusInOut( WId window, Time t )
e.xcrossing.same_screen = True; e.xcrossing.same_screen = True;
e.xcrossing.focus = False; e.xcrossing.focus = False;
e.xcrossing.state = 0; e.xcrossing.state = 0;
XSendEvent( qt_xdisplay(), mVkbdLastEventWindow, False, 0, &e ); XSendEvent( tqt_xdisplay(), mVkbdLastEventWindow, False, 0, &e );
} }
} }
@ -2228,10 +2228,10 @@ void LockProcess::slotMouseActivity(XEvent *event)
// Clicked inside dialog; set focus // Clicked inside dialog; set focus
if (inFrame == TRUE) { if (inFrame == TRUE) {
WId window = mDialogs.first()->winId(); WId window = mDialogs.first()->winId();
XSetInputFocus(qt_xdisplay(), window, RevertToParent, CurrentTime); XSetInputFocus(tqt_xdisplay(), window, RevertToParent, CurrentTime);
fakeFocusIn(window); fakeFocusIn(window);
// Why this needs to be repeated I have no idea... // Why this needs to be repeated I have no idea...
XSetInputFocus(qt_xdisplay(), window, RevertToParent, CurrentTime); XSetInputFocus(tqt_xdisplay(), window, RevertToParent, CurrentTime);
fakeFocusIn(window); fakeFocusIn(window);
} }
@ -2243,7 +2243,7 @@ void LockProcess::slotMouseActivity(XEvent *event)
m_dialogPrevY = oldPoint.y(); m_dialogPrevY = oldPoint.y();
m_mousePrevX = be->x_root; m_mousePrevX = be->x_root;
m_mousePrevY = be->y_root; m_mousePrevY = be->y_root;
XChangeActivePointerGrab( qt_xdisplay(), GRABEVENTS, TQCursor(tqsizeAllCursor).handle(), CurrentTime); XChangeActivePointerGrab( tqt_xdisplay(), GRABEVENTS, TQCursor(tqsizeAllCursor).handle(), CurrentTime);
} }
} }
@ -2263,7 +2263,7 @@ void LockProcess::slotMouseActivity(XEvent *event)
if (event->type == ButtonRelease) { if (event->type == ButtonRelease) {
m_mouseDown = 0; m_mouseDown = 0;
XChangeActivePointerGrab( qt_xdisplay(), GRABEVENTS, TQCursor(tqarrowCursor).handle(), CurrentTime); XChangeActivePointerGrab( tqt_xdisplay(), GRABEVENTS, TQCursor(tqarrowCursor).handle(), CurrentTime);
} }
} }

@ -68,8 +68,8 @@ QueryDlg::QueryDlg(LockProcess *parent)
if (trinity_desktop_lock_use_system_modal_dialogs) { if (trinity_desktop_lock_use_system_modal_dialogs) {
// Signal that we do not want any window controls to be shown at all // Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification; Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False); kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False);
XChangeProperty(qt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L); XChangeProperty(tqt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
} }
setCaption(i18n("Information Needed")); setCaption(i18n("Information Needed"));

@ -70,8 +70,8 @@ SAKDlg::SAKDlg(LockProcess *parent)
if (trinity_desktop_lock_use_system_modal_dialogs) { if (trinity_desktop_lock_use_system_modal_dialogs) {
// Signal that we do not want any window controls to be shown at all // Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification; Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False); kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False);
XChangeProperty(qt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L); XChangeProperty(tqt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
} }
setCaption(i18n("Desktop Session Locked")); setCaption(i18n("Desktop Session Locked"));

@ -70,8 +70,8 @@ SecureDlg::SecureDlg(LockProcess *parent)
if (trinity_desktop_lock_use_system_modal_dialogs) { if (trinity_desktop_lock_use_system_modal_dialogs) {
// Signal that we do not want any window controls to be shown at all // Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification; Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False); kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False);
XChangeProperty(qt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L); XChangeProperty(tqt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
} }
setCaption(i18n("Secure Desktop Area")); setCaption(i18n("Secure Desktop Area"));

@ -62,7 +62,7 @@ SaverEngine::SaverEngine()
sigaction(SIGUSR1, &act, 0L); sigaction(SIGUSR1, &act, 0L);
// Save X screensaver parameters // Save X screensaver parameters
XGetScreenSaver(qt_xdisplay(), &mXTimeout, &mXInterval, XGetScreenSaver(tqt_xdisplay(), &mXTimeout, &mXInterval,
&mXBlanking, &mXExposures); &mXBlanking, &mXExposures);
mState = Waiting; mState = Waiting;
@ -108,7 +108,7 @@ SaverEngine::~SaverEngine()
delete mXAutoLock; delete mXAutoLock;
// Restore X screensaver parameters // Restore X screensaver parameters
XSetScreenSaver(qt_xdisplay(), mXTimeout, mXInterval, mXBlanking, XSetScreenSaver(tqt_xdisplay(), mXTimeout, mXInterval, mXBlanking,
mXExposures); mXExposures);
} }
@ -208,7 +208,7 @@ bool SaverEngine::enable( bool e )
//mXAutoLock->changeCornerLockStatus( mLockCornerTopLeft, mLockCornerTopRight, mLockCornerBottomLeft, mLockCornerBottomRight); //mXAutoLock->changeCornerLockStatus( mLockCornerTopLeft, mLockCornerTopRight, mLockCornerBottomLeft, mLockCornerBottomRight);
// We'll handle blanking // We'll handle blanking
XSetScreenSaver(qt_xdisplay(), mTimeout + 10, mXInterval, PreferBlanking, mXExposures); XSetScreenSaver(tqt_xdisplay(), mTimeout + 10, mXInterval, PreferBlanking, mXExposures);
kdDebug() << "XSetScreenSaver " << mTimeout + 10 << endl; kdDebug() << "XSetScreenSaver " << mTimeout + 10 << endl;
mXAutoLock->start(); mXAutoLock->start();
@ -223,8 +223,8 @@ bool SaverEngine::enable( bool e )
mXAutoLock = 0; mXAutoLock = 0;
} }
XForceScreenSaver(qt_xdisplay(), ScreenSaverReset ); XForceScreenSaver(tqt_xdisplay(), ScreenSaverReset );
XSetScreenSaver(qt_xdisplay(), 0, mXInterval, PreferBlanking, DontAllowExposures); XSetScreenSaver(tqt_xdisplay(), 0, mXInterval, PreferBlanking, DontAllowExposures);
kdDebug(1204) << "Saver Engine disabled" << endl; kdDebug(1204) << "Saver Engine disabled" << endl;
} }
@ -355,7 +355,7 @@ bool SaverEngine::startLockProcess( LockType lock_type )
} }
mLockProcess.kill(SIGTTOU); // Start lock mLockProcess.kill(SIGTTOU); // Start lock
XSetScreenSaver(qt_xdisplay(), 0, mXInterval, PreferBlanking, mXExposures); XSetScreenSaver(tqt_xdisplay(), 0, mXInterval, PreferBlanking, mXExposures);
mState = Preparing; mState = Preparing;
if (mXAutoLock) if (mXAutoLock)
@ -388,8 +388,8 @@ void SaverEngine::stopLockProcess()
{ {
mXAutoLock->start(); mXAutoLock->start();
} }
XForceScreenSaver(qt_xdisplay(), ScreenSaverReset ); XForceScreenSaver(tqt_xdisplay(), ScreenSaverReset );
XSetScreenSaver(qt_xdisplay(), mTimeout + 10, mXInterval, PreferBlanking, mXExposures); XSetScreenSaver(tqt_xdisplay(), mTimeout + 10, mXInterval, PreferBlanking, mXExposures);
} }
processLockTransactions(); processLockTransactions();
mState = Waiting; mState = Waiting;
@ -457,8 +457,8 @@ void SaverEngine::lockProcessWaiting()
{ {
mXAutoLock->start(); mXAutoLock->start();
} }
XForceScreenSaver(qt_xdisplay(), ScreenSaverReset ); XForceScreenSaver(tqt_xdisplay(), ScreenSaverReset );
XSetScreenSaver(qt_xdisplay(), mTimeout + 10, mXInterval, PreferBlanking, mXExposures); XSetScreenSaver(tqt_xdisplay(), mTimeout + 10, mXInterval, PreferBlanking, mXExposures);
} }
processLockTransactions(); processLockTransactions();
mState = Waiting; mState = Waiting;
@ -471,8 +471,8 @@ void SaverEngine::lockProcessWaiting()
void SaverEngine::idleTimeout() void SaverEngine::idleTimeout()
{ {
// disable X screensaver // disable X screensaver
XForceScreenSaver(qt_xdisplay(), ScreenSaverReset ); XForceScreenSaver(tqt_xdisplay(), ScreenSaverReset );
XSetScreenSaver(qt_xdisplay(), 0, mXInterval, PreferBlanking, DontAllowExposures); XSetScreenSaver(tqt_xdisplay(), 0, mXInterval, PreferBlanking, DontAllowExposures);
mSAKProcess->kill(SIGTERM); mSAKProcess->kill(SIGTERM);
startLockProcess( DefaultLock ); startLockProcess( DefaultLock );
} }

@ -322,7 +322,7 @@ void Minicli::accept()
if ( lock ) if ( lock )
{ {
TQCString appname( "kdesktop" ); TQCString appname( "kdesktop" );
int kicker_screen_number = qt_xscreen(); int kicker_screen_number = tqt_xscreen();
if ( kicker_screen_number ) if ( kicker_screen_number )
appname.sprintf("kdesktop-screen-%d", kicker_screen_number); appname.sprintf("kdesktop-screen-%d", kicker_screen_number);
kapp->dcopClient()->send(appname, "KScreensaverIface", "lock()", TQString("")); kapp->dcopClient()->send(appname, "KScreensaverIface", "lock()", TQString(""));

@ -40,7 +40,7 @@ KPixmapServer::KPixmapServer()
: TQWidget(0L, "shpixmap comm window") : TQWidget(0L, "shpixmap comm window")
{ {
kapp->installX11EventFilter(this); kapp->installX11EventFilter(this);
pixmap = XInternAtom(qt_xdisplay(), "PIXMAP", false); pixmap = XInternAtom(tqt_xdisplay(), "PIXMAP", false);
} }
@ -48,7 +48,7 @@ KPixmapServer::~KPixmapServer()
{ {
SelectionIterator it; SelectionIterator it;
for (it=m_Selections.begin(); it!=m_Selections.end(); it++) for (it=m_Selections.begin(); it!=m_Selections.end(); it++)
XSetSelectionOwner(qt_xdisplay(), it.key(), None, CurrentTime); XSetSelectionOwner(tqt_xdisplay(), it.key(), None, CurrentTime);
DataIterator it2; DataIterator it2;
for (it2=m_Data.begin(); it2!=m_Data.end(); it2++) for (it2=m_Data.begin(); it2!=m_Data.end(); it2++)
@ -66,7 +66,7 @@ void KPixmapServer::add(TQString name, TQPixmap *pm, bool overwrite)
} }
TQString str = TQString("KDESHPIXMAP:%1").arg(name); TQString str = TQString("KDESHPIXMAP:%1").arg(name);
Atom sel = XInternAtom(qt_xdisplay(), str.latin1(), false); Atom sel = XInternAtom(tqt_xdisplay(), str.latin1(), false);
KPixmapInode pi; KPixmapInode pi;
pi.handle = pm->handle(); pi.handle = pm->handle();
pi.selection = sel; pi.selection = sel;
@ -88,7 +88,7 @@ void KPixmapServer::add(TQString name, TQPixmap *pm, bool overwrite)
} else } else
it.data().refcount++; it.data().refcount++;
XSetSelectionOwner(qt_xdisplay(), sel, winId(), CurrentTime); XSetSelectionOwner(tqt_xdisplay(), sel, winId(), CurrentTime);
} }
@ -105,7 +105,7 @@ void KPixmapServer::remove(TQString name)
SelectionIterator it2 = m_Selections.find(pi.selection); SelectionIterator it2 = m_Selections.find(pi.selection);
assert(it2 != m_Selections.end()); assert(it2 != m_Selections.end());
m_Selections.remove(it2); m_Selections.remove(it2);
XSetSelectionOwner(qt_xdisplay(), pi.selection, None, CurrentTime); XSetSelectionOwner(tqt_xdisplay(), pi.selection, None, CurrentTime);
// Decrease refcount on data // Decrease refcount on data
DataIterator it3 = m_Data.find(pi.handle); DataIterator it3 = m_Data.find(pi.handle);
@ -135,7 +135,7 @@ void KPixmapServer::setOwner(TQString name)
if (it == m_Names.end()) if (it == m_Names.end())
return; return;
XSetSelectionOwner(qt_xdisplay(), it.data().selection, winId(), CurrentTime); XSetSelectionOwner(tqt_xdisplay(), it.data().selection, winId(), CurrentTime);
} }
@ -151,7 +151,7 @@ bool KPixmapServer::x11Event(XEvent *event)
// Build negative reply // Build negative reply
XEvent reply; XEvent reply;
reply.type = SelectionNotify; reply.type = SelectionNotify;
reply.xselection.display = qt_xdisplay(); reply.xselection.display = tqt_xdisplay();
reply.xselection.requestor = ev->requestor; reply.xselection.requestor = ev->requestor;
reply.xselection.selection = ev->selection; reply.xselection.selection = ev->selection;
reply.xselection.target = pixmap; reply.xselection.target = pixmap;
@ -169,7 +169,7 @@ bool KPixmapServer::x11Event(XEvent *event)
if (ev->target != pixmap) if (ev->target != pixmap)
{ {
kdDebug(1204) << ID << "illegal target\n"; kdDebug(1204) << ID << "illegal target\n";
XSendEvent(qt_xdisplay(), ev->requestor, false, 0, &reply); XSendEvent(tqt_xdisplay(), ev->requestor, false, 0, &reply);
return true; return true;
} }
@ -177,7 +177,7 @@ bool KPixmapServer::x11Event(XEvent *event)
if (m_Active.contains(ev->property)) if (m_Active.contains(ev->property))
{ {
kdDebug(1204) << ID << "selection is busy.\n"; kdDebug(1204) << ID << "selection is busy.\n";
XSendEvent(qt_xdisplay(), ev->requestor, false, 0, &reply); XSendEvent(tqt_xdisplay(), ev->requestor, false, 0, &reply);
return true; return true;
} }
@ -186,25 +186,25 @@ bool KPixmapServer::x11Event(XEvent *event)
if (it2 == m_Data.end()) if (it2 == m_Data.end())
{ {
kdDebug(1204) << ID << "selection has been deleted.\n"; kdDebug(1204) << ID << "selection has been deleted.\n";
XSendEvent(qt_xdisplay(), ev->requestor, false, 0, &reply); XSendEvent(tqt_xdisplay(), ev->requestor, false, 0, &reply);
return true; return true;
} }
kdDebug(1204) << ID << "request for " << si.name << "\n"; kdDebug(1204) << ID << "request for " << si.name << "\n";
// All OK: pass the pixmap handle. // All OK: pass the pixmap handle.
XChangeProperty(qt_xdisplay(), ev->requestor, ev->property, pixmap, XChangeProperty(tqt_xdisplay(), ev->requestor, ev->property, pixmap,
32, PropModeReplace, (unsigned char *) &si.handle, 1); 32, PropModeReplace, (unsigned char *) &si.handle, 1);
it2.data().usecount++; it2.data().usecount++;
m_Active[ev->property] = si.handle; m_Active[ev->property] = si.handle;
// Request PropertyNotify events for the target window // Request PropertyNotify events for the target window
// XXX: The target window better not be handled by us! // XXX: The target window better not be handled by us!
XSelectInput(qt_xdisplay(), ev->requestor, PropertyChangeMask); XSelectInput(tqt_xdisplay(), ev->requestor, PropertyChangeMask);
// Acknowledge to the client and return // Acknowledge to the client and return
reply.xselection.property = ev->property; reply.xselection.property = ev->property;
XSendEvent(qt_xdisplay(), ev->requestor, false, 0, &reply); XSendEvent(tqt_xdisplay(), ev->requestor, false, 0, &reply);
return true; return true;
} }

@ -50,10 +50,10 @@ StartupId::StartupId( TQWidget* parent, const char* name )
hide(); // is TQWidget only because of x11Event() hide(); // is TQWidget only because of x11Event()
if( kde_startup_status == StartupPre ) if( kde_startup_status == StartupPre )
{ {
kde_splash_progress = XInternAtom( qt_xdisplay(), "_KDE_SPLASH_PROGRESS", False ); kde_splash_progress = XInternAtom( tqt_xdisplay(), "_KDE_SPLASH_PROGRESS", False );
XWindowAttributes attrs; XWindowAttributes attrs;
XGetWindowAttributes( qt_xdisplay(), qt_xrootwin(), &attrs); XGetWindowAttributes( tqt_xdisplay(), tqt_xrootwin(), &attrs);
XSelectInput( qt_xdisplay(), qt_xrootwin(), attrs.your_event_mask | SubstructureNotifyMask); XSelectInput( tqt_xdisplay(), tqt_xrootwin(), attrs.your_event_mask | SubstructureNotifyMask);
kapp->installX11EventFilter( this ); kapp->installX11EventFilter( this );
} }
connect( &update_timer, TQT_SIGNAL( timeout()), TQT_SLOT( update_startupid())); connect( &update_timer, TQT_SIGNAL( timeout()), TQT_SLOT( update_startupid()));
@ -119,7 +119,7 @@ void StartupId::gotRemoveStartup( const KStartupInfoId& id_P )
bool StartupId::x11Event( XEvent* e ) bool StartupId::x11Event( XEvent* e )
{ {
if( e->type == ClientMessage && e->xclient.window == qt_xrootwin() if( e->type == ClientMessage && e->xclient.window == tqt_xrootwin()
&& e->xclient.message_type == kde_splash_progress ) && e->xclient.message_type == kde_splash_progress )
{ {
const char* s = e->xclient.data.b; const char* s = e->xclient.data.b;
@ -188,7 +188,7 @@ void StartupId::start_startupid( const TQString& icon_P )
startup_widget = new TQWidget( NULL, NULL, WX11BypassWM ); startup_widget = new TQWidget( NULL, NULL, WX11BypassWM );
XSetWindowAttributes attr; XSetWindowAttributes attr;
attr.save_under = True; // useful saveunder if possible to avoid redrawing attr.save_under = True; // useful saveunder if possible to avoid redrawing
XChangeWindowAttributes( qt_xdisplay(), startup_widget->winId(), CWSaveUnder, &attr ); XChangeWindowAttributes( tqt_xdisplay(), startup_widget->winId(), CWSaveUnder, &attr );
} }
startup_widget->resize( icon_pixmap.width(), icon_pixmap.height()); startup_widget->resize( icon_pixmap.width(), icon_pixmap.height());
if( blinking ) if( blinking )
@ -268,7 +268,7 @@ void StartupId::update_startupid()
int x, y; int x, y;
int dummy3, dummy4; int dummy3, dummy4;
unsigned int dummy5; unsigned int dummy5;
if( !XQueryPointer( qt_xdisplay(), qt_xrootwin(), &dummy1, &dummy2, &x, &y, &dummy3, &dummy4, &dummy5 )) if( !XQueryPointer( tqt_xdisplay(), tqt_xrootwin(), &dummy1, &dummy2, &x, &y, &dummy3, &dummy4, &dummy5 ))
{ {
startup_widget->hide(); startup_widget->hide();
update_timer.start( 100, true ); update_timer.start( 100, true );
@ -277,7 +277,7 @@ void StartupId::update_startupid()
TQPoint c_pos( x, y ); TQPoint c_pos( x, y );
int cursor_size = 0; int cursor_size = 0;
#ifdef HAVE_XCURSOR #ifdef HAVE_XCURSOR
cursor_size = XcursorGetDefaultSize( qt_xdisplay()); cursor_size = XcursorGetDefaultSize( tqt_xdisplay());
#endif #endif
int X_DIFF; int X_DIFF;
if( cursor_size <= 16 ) if( cursor_size <= 16 )
@ -293,7 +293,7 @@ void StartupId::update_startupid()
|| startup_widget->y() != c_pos.y() + Y_DIFF + yoffset ) || startup_widget->y() != c_pos.y() + Y_DIFF + yoffset )
startup_widget->move( c_pos.x() + X_DIFF, c_pos.y() + Y_DIFF + yoffset ); startup_widget->move( c_pos.x() + X_DIFF, c_pos.y() + Y_DIFF + yoffset );
startup_widget->show(); startup_widget->show();
XRaiseWindow( qt_xdisplay(), startup_widget->winId()); XRaiseWindow( tqt_xdisplay(), startup_widget->winId());
update_timer.start( bouncing ? 30 : 100, true ); update_timer.start( bouncing ? 30 : 100, true );
TQApplication::flushX(); TQApplication::flushX();
} }

@ -62,21 +62,21 @@ XAutoLock::XAutoLock()
xautolock_useMit = 0; xautolock_useMit = 0;
#ifdef HAVE_XIDLE #ifdef HAVE_XIDLE
int dummy1; int dummy1;
xautolock_useXidle = XidleQueryExtension( qt_xdisplay(), &dummy1, &dummy1 ); xautolock_useXidle = XidleQueryExtension( tqt_xdisplay(), &dummy1, &dummy1 );
#endif #endif
#ifdef HAVE_XSCREENSAVER #ifdef HAVE_XSCREENSAVER
int dummy2; int dummy2;
if( !xautolock_useXidle ) if( !xautolock_useXidle )
xautolock_useMit = XScreenSaverQueryExtension( qt_xdisplay(), &dummy2, &dummy2 ); xautolock_useMit = XScreenSaverQueryExtension( tqt_xdisplay(), &dummy2, &dummy2 );
#endif #endif
if( !xautolock_useXidle && !xautolock_useMit ) if( !xautolock_useXidle && !xautolock_useMit )
{ {
kapp->installX11EventFilter( this ); kapp->installX11EventFilter( this );
int (*oldHandler)(Display *, XErrorEvent *); int (*oldHandler)(Display *, XErrorEvent *);
oldHandler = XSetErrorHandler(catchFalseAlarms); oldHandler = XSetErrorHandler(catchFalseAlarms);
XSync(qt_xdisplay(), False ); XSync(tqt_xdisplay(), False );
xautolock_initDiy( qt_xdisplay()); xautolock_initDiy( tqt_xdisplay());
XSync(qt_xdisplay(), False ); XSync(tqt_xdisplay(), False );
XSetErrorHandler(oldHandler); XSetErrorHandler(oldHandler);
} }
@ -115,7 +115,7 @@ void XAutoLock::setDPMS(bool s)
#ifdef HAVE_DPMS #ifdef HAVE_DPMS
BOOL on; BOOL on;
CARD16 state; CARD16 state;
DPMSInfo( qt_xdisplay(), &state, &on ); DPMSInfo( tqt_xdisplay(), &state, &on );
if (!on) if (!on)
s = false; s = false;
#endif #endif
@ -184,7 +184,7 @@ void XAutoLock::timerEvent(TQTimerEvent *ev)
int (*oldHandler)(Display *, XErrorEvent *) = NULL; int (*oldHandler)(Display *, XErrorEvent *) = NULL;
if( !xautolock_useXidle && !xautolock_useMit ) if( !xautolock_useXidle && !xautolock_useMit )
{ // only the diy way needs special X handler { // only the diy way needs special X handler
XSync( qt_xdisplay(), False ); XSync( tqt_xdisplay(), False );
oldHandler = XSetErrorHandler(catchFalseAlarms); oldHandler = XSetErrorHandler(catchFalseAlarms);
} }
@ -202,8 +202,8 @@ void XAutoLock::timerEvent(TQTimerEvent *ev)
mLastTimeout = now; mLastTimeout = now;
xautolock_queryIdleTime( qt_xdisplay()); xautolock_queryIdleTime( tqt_xdisplay());
xautolock_queryPointer( qt_xdisplay()); xautolock_queryPointer( tqt_xdisplay());
if( !xautolock_useXidle && !xautolock_useMit ) if( !xautolock_useXidle && !xautolock_useMit )
XSetErrorHandler(oldHandler); XSetErrorHandler(oldHandler);
@ -220,7 +220,7 @@ void XAutoLock::timerEvent(TQTimerEvent *ev)
#ifdef HAVE_DPMS #ifdef HAVE_DPMS
BOOL on; BOOL on;
CARD16 state; CARD16 state;
DPMSInfo( qt_xdisplay(), &state, &on ); DPMSInfo( tqt_xdisplay(), &state, &on );
//kdDebug() << "DPMSInfo " << state << " " << on << endl; //kdDebug() << "DPMSInfo " << state << " " << on << endl;
// If DPMS is active, it makes XScreenSaverQueryInfo() report idle time // If DPMS is active, it makes XScreenSaverQueryInfo() report idle time
@ -232,7 +232,7 @@ void XAutoLock::timerEvent(TQTimerEvent *ev)
if(!on && mDPMS) { if(!on && mDPMS) {
activate = false; activate = false;
#ifdef HAVE_XSCREENSAVER #ifdef HAVE_XSCREENSAVER
XForceScreenSaver(qt_xdisplay(), ScreenSaverReset ); XForceScreenSaver(tqt_xdisplay(), ScreenSaverReset );
#endif #endif
resetTrigger(); resetTrigger();
} }
@ -241,7 +241,7 @@ void XAutoLock::timerEvent(TQTimerEvent *ev)
#ifdef HAVE_XSCREENSAVER #ifdef HAVE_XSCREENSAVER
static XScreenSaverInfo* mitInfo = 0; static XScreenSaverInfo* mitInfo = 0;
if (!mitInfo) mitInfo = XScreenSaverAllocInfo (); if (!mitInfo) mitInfo = XScreenSaverAllocInfo ();
if (XScreenSaverQueryInfo (qt_xdisplay(), DefaultRootWindow (qt_xdisplay()), mitInfo)) { if (XScreenSaverQueryInfo (tqt_xdisplay(), DefaultRootWindow (tqt_xdisplay()), mitInfo)) {
//kdDebug() << "XScreenSaverQueryInfo " << mitInfo->state << " " << ScreenSaverDisabled << endl; //kdDebug() << "XScreenSaverQueryInfo " << mitInfo->state << " " << ScreenSaverDisabled << endl;
if (mitInfo->state == ScreenSaverDisabled) if (mitInfo->state == ScreenSaverDisabled)
activate = false; activate = false;
@ -265,7 +265,7 @@ bool XAutoLock::x11Event( XEvent* ev )
bool XAutoLock::ignoreWindow( WId w ) bool XAutoLock::ignoreWindow( WId w )
{ {
if( w != qt_xrootwin() && TQWidget::find( w )) if( w != tqt_xrootwin() && TQWidget::find( w ))
return true; return true;
return false; return false;
} }

@ -57,12 +57,12 @@ WId WindowSelector::findRealWindow( WId w, int depth )
{ {
if( depth > 5 ) if( depth > 5 )
return None; return None;
static Atom wm_state = XInternAtom( qt_xdisplay(), "WM_STATE", False ); static Atom wm_state = XInternAtom( tqt_xdisplay(), "WM_STATE", False );
Atom type; Atom type;
int format; int format;
unsigned long nitems, after; unsigned long nitems, after;
unsigned char* prop; unsigned char* prop;
if( XGetWindowProperty( qt_xdisplay(), w, wm_state, 0, 0, False, AnyPropertyType, if( XGetWindowProperty( tqt_xdisplay(), w, wm_state, 0, 0, False, AnyPropertyType,
&type, &format, &nitems, &after, &prop ) == Success ) &type, &format, &nitems, &after, &prop ) == Success )
{ {
if( prop != NULL ) if( prop != NULL )
@ -74,7 +74,7 @@ WId WindowSelector::findRealWindow( WId w, int depth )
Window* children; Window* children;
unsigned int nchildren; unsigned int nchildren;
Window ret = None; Window ret = None;
if( XQueryTree( qt_xdisplay(), w, &root, &parent, &children, &nchildren ) != 0 ) if( XQueryTree( tqt_xdisplay(), w, &root, &parent, &children, &nchildren ) != 0 )
{ {
for( unsigned int i = 0; for( unsigned int i = 0;
i < nchildren && ret == None; i < nchildren && ret == None;

@ -385,7 +385,7 @@ void Keyboard_input_action::execute()
if( key == "Enter" && KKey( key ).keyCodeQt() == 0 ) if( key == "Enter" && KKey( key ).keyCodeQt() == 0 )
key = "Return"; key = "Return";
keyboard_handler->send_macro_key( KKey( key ), w ); // the rest keyboard_handler->send_macro_key( KKey( key ), w ); // the rest
XFlush( qt_xdisplay()); XFlush( tqt_xdisplay());
} }
TQString Keyboard_input_action::description() const TQString Keyboard_input_action::description() const

@ -154,8 +154,8 @@ bool Gesture::x11Event( XEvent* ev_P )
if( gesture.isEmpty()) if( gesture.isEmpty())
{ {
kdDebug( 1217 ) << "GESTURE: replay" << endl; kdDebug( 1217 ) << "GESTURE: replay" << endl;
XAllowEvents( qt_xdisplay(), AsyncPointer, CurrentTime ); XAllowEvents( tqt_xdisplay(), AsyncPointer, CurrentTime );
XUngrabPointer( qt_xdisplay(), CurrentTime ); XUngrabPointer( tqt_xdisplay(), CurrentTime );
mouse_replay( true ); mouse_replay( true );
return true; return true;
} }
@ -178,8 +178,8 @@ bool Gesture::x11Event( XEvent* ev_P )
void Gesture::stroke_timeout() void Gesture::stroke_timeout()
{ {
kdDebug( 1217 ) << "GESTURE: timeout" << endl; kdDebug( 1217 ) << "GESTURE: timeout" << endl;
XAllowEvents( qt_xdisplay(), AsyncPointer, CurrentTime ); XAllowEvents( tqt_xdisplay(), AsyncPointer, CurrentTime );
XUngrabPointer( qt_xdisplay(), CurrentTime ); XUngrabPointer( tqt_xdisplay(), CurrentTime );
mouse_replay( false ); mouse_replay( false );
recording = false; recording = false;
} }
@ -215,7 +215,7 @@ void Gesture::grab_mouse( bool grab_P )
for( int i = 0; for( int i = 0;
i < 8; i < 8;
++i ) ++i )
XGrabButton( qt_xdisplay(), button, mods[ i ], qt_xrootwin(), False, XGrabButton( tqt_xdisplay(), button, mods[ i ], tqt_xrootwin(), False,
ButtonPressMask | ButtonReleaseMask | mask[ button ], GrabModeAsync, GrabModeAsync, ButtonPressMask | ButtonReleaseMask | mask[ button ], GrabModeAsync, GrabModeAsync,
None, None ); None, None );
bool err = handler.error( true ); bool err = handler.error( true );
@ -224,7 +224,7 @@ void Gesture::grab_mouse( bool grab_P )
else else
{ {
kdDebug( 1217 ) << "Gesture ungrab" << endl; kdDebug( 1217 ) << "Gesture ungrab" << endl;
XUngrabButton( qt_xdisplay(), button, AnyModifier, qt_xrootwin()); XUngrabButton( tqt_xdisplay(), button, AnyModifier, tqt_xrootwin());
} }
} }

@ -169,7 +169,7 @@ static bool xtest()
xtest_inited = true; xtest_inited = true;
int dummy1, dummy2, dummy3, dummy4; int dummy1, dummy2, dummy3, dummy4;
xtest_available = xtest_available =
( XTestQueryExtension( qt_xdisplay(), &dummy1, &dummy2, &dummy3, &dummy4 ) == True ); ( XTestQueryExtension( tqt_xdisplay(), &dummy1, &dummy2, &dummy3, &dummy4 ) == True );
return xtest_available; return xtest_available;
} }
#endif #endif
@ -178,7 +178,7 @@ static bool xtest()
bool Kbd::send_macro_key( const KKey& key, Window window_P ) bool Kbd::send_macro_key( const KKey& key, Window window_P )
{ {
unsigned int keysym = KKeyNative( key ).sym(); unsigned int keysym = KKeyNative( key ).sym();
KeyCode x_keycode = XKeysymToKeycode( qt_xdisplay(), keysym ); KeyCode x_keycode = XKeysymToKeycode( tqt_xdisplay(), keysym );
if( x_keycode == NoSymbol ) if( x_keycode == NoSymbol )
return false; return false;
unsigned int x_mod = KKeyNative( key ).mod(); unsigned int x_mod = KKeyNative( key ).mod();
@ -186,8 +186,8 @@ bool Kbd::send_macro_key( const KKey& key, Window window_P )
if( xtest() && window_P == None ) if( xtest() && window_P == None )
{ {
// CHECKME tohle jeste potrebuje modifikatory // CHECKME tohle jeste potrebuje modifikatory
bool ret = XTestFakeKeyEvent( qt_xdisplay(), x_keycode, True, CurrentTime ); bool ret = XTestFakeKeyEvent( tqt_xdisplay(), x_keycode, True, CurrentTime );
ret = ret && XTestFakeKeyEvent( qt_xdisplay(), x_keycode, False, CurrentTime ); ret = ret && XTestFakeKeyEvent( tqt_xdisplay(), x_keycode, False, CurrentTime );
return ret; return ret;
} }
#endif #endif
@ -197,9 +197,9 @@ bool Kbd::send_macro_key( const KKey& key, Window window_P )
window_P = InputFocus; window_P = InputFocus;
XEvent ev; XEvent ev;
ev.type = KeyPress; ev.type = KeyPress;
ev.xkey.display = qt_xdisplay(); ev.xkey.display = tqt_xdisplay();
ev.xkey.window = window_P; ev.xkey.window = window_P;
ev.xkey.root = qt_xrootwin(); // I don't know whether these have to be set ev.xkey.root = tqt_xrootwin(); // I don't know whether these have to be set
ev.xkey.subwindow = None; // to these values, but it seems to work, hmm ev.xkey.subwindow = None; // to these values, but it seems to work, hmm
ev.xkey.time = CurrentTime; ev.xkey.time = CurrentTime;
ev.xkey.x = 0; ev.xkey.x = 0;
@ -209,12 +209,12 @@ bool Kbd::send_macro_key( const KKey& key, Window window_P )
ev.xkey.keycode = x_keycode; ev.xkey.keycode = x_keycode;
ev.xkey.state = x_mod; ev.xkey.state = x_mod;
ev.xkey.same_screen = True; ev.xkey.same_screen = True;
bool ret = XSendEvent( qt_xdisplay(), window_P, True, KeyPressMask, &ev ); bool ret = XSendEvent( tqt_xdisplay(), window_P, True, KeyPressMask, &ev );
#if 1 #if 1
ev.type = KeyRelease; // is this actually really needed ?? ev.type = KeyRelease; // is this actually really needed ??
ev.xkey.display = qt_xdisplay(); ev.xkey.display = tqt_xdisplay();
ev.xkey.window = window_P; ev.xkey.window = window_P;
ev.xkey.root = qt_xrootwin(); ev.xkey.root = tqt_xrootwin();
ev.xkey.subwindow = None; ev.xkey.subwindow = None;
ev.xkey.time = CurrentTime; ev.xkey.time = CurrentTime;
ev.xkey.x = 0; ev.xkey.x = 0;
@ -224,11 +224,11 @@ bool Kbd::send_macro_key( const KKey& key, Window window_P )
ev.xkey.state = x_mod; ev.xkey.state = x_mod;
ev.xkey.keycode = x_keycode; ev.xkey.keycode = x_keycode;
ev.xkey.same_screen = True; ev.xkey.same_screen = True;
ret = ret && XSendEvent( qt_xdisplay(), window_P, True, KeyReleaseMask, &ev ); ret = ret && XSendEvent( tqt_xdisplay(), window_P, True, KeyReleaseMask, &ev );
#endif #endif
// Qt's autorepeat compression is broken and can create "aab" from "aba" // Qt's autorepeat compression is broken and can create "aab" from "aba"
// XSync() should create delay longer than Qt's max autorepeat interval // XSync() should create delay longer than Qt's max autorepeat interval
XSync( qt_xdisplay(), False ); XSync( tqt_xdisplay(), False );
return ret; return ret;
} }
@ -239,9 +239,9 @@ bool Mouse::send_mouse_button( int button_P, bool release_P )
{ {
// CHECKME tohle jeste potrebuje modifikatory // CHECKME tohle jeste potrebuje modifikatory
// a asi i spravnou timestamp misto CurrentTime // a asi i spravnou timestamp misto CurrentTime
bool ret = XTestFakeButtonEvent( qt_xdisplay(), button_P, True, CurrentTime ); bool ret = XTestFakeButtonEvent( tqt_xdisplay(), button_P, True, CurrentTime );
if( release_P ) if( release_P )
ret = ret && XTestFakeButtonEvent( qt_xdisplay(), button_P, False, CurrentTime ); ret = ret && XTestFakeButtonEvent( tqt_xdisplay(), button_P, False, CurrentTime );
return ret; return ret;
} }
#endif #endif

@ -30,7 +30,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
extern Atom qt_window_role; extern Atom tqt_window_role;
namespace KHotKeys namespace KHotKeys
{ {
@ -94,13 +94,13 @@ void Windows::window_changed_slot( WId window_P, unsigned int flags_P )
TQString Windows::get_window_role( WId id_P ) TQString Windows::get_window_role( WId id_P )
{ {
// TODO this is probably just a hack // TODO this is probably just a hack
return KWin::readNameProperty( id_P, qt_window_role ); return KWin::readNameProperty( id_P, tqt_window_role );
} }
TQString Windows::get_window_class( WId id_P ) TQString Windows::get_window_class( WId id_P )
{ {
XClassHint hints_ret; XClassHint hints_ret;
if( XGetClassHint( qt_xdisplay(), id_P, &hints_ret ) == 0 ) // 0 means error if( XGetClassHint( tqt_xdisplay(), id_P, &hints_ret ) == 0 ) // 0 means error
return ""; return "";
TQString ret( hints_ret.res_name ); TQString ret( hints_ret.res_name );
ret += ' '; ret += ' ';
@ -141,19 +141,19 @@ WId Windows::find_window( const Windowdef_list* window_P )
WId Windows::window_at_position( int x, int y ) WId Windows::window_at_position( int x, int y )
{ {
Window child, dummy; Window child, dummy;
Window parent = qt_xrootwin(); Window parent = tqt_xrootwin();
Atom wm_state = XInternAtom( qt_xdisplay(), "WM_STATE", False ); Atom wm_state = XInternAtom( tqt_xdisplay(), "WM_STATE", False );
for( int i = 0; for( int i = 0;
i < 10; i < 10;
++i ) ++i )
{ {
int destx, desty; int destx, desty;
// find child at that position // find child at that position
if( !XTranslateCoordinates( qt_xdisplay(), parent, parent, x, y, &destx, &desty, &child ) if( !XTranslateCoordinates( tqt_xdisplay(), parent, parent, x, y, &destx, &desty, &child )
|| child == None ) || child == None )
return 0; return 0;
// and now transform coordinates to the child // and now transform coordinates to the child
if( !XTranslateCoordinates( qt_xdisplay(), parent, child, x, y, &destx, &desty, &dummy )) if( !XTranslateCoordinates( tqt_xdisplay(), parent, child, x, y, &destx, &desty, &dummy ))
return 0; return 0;
x = destx; x = destx;
y = desty; y = desty;
@ -161,7 +161,7 @@ WId Windows::window_at_position( int x, int y )
int format; int format;
unsigned long nitems, after; unsigned long nitems, after;
unsigned char* prop; unsigned char* prop;
if( XGetWindowProperty( qt_xdisplay(), child, wm_state, 0, 0, False, AnyPropertyType, if( XGetWindowProperty( tqt_xdisplay(), child, wm_state, 0, 0, False, AnyPropertyType,
&type, &format, &nitems, &after, &prop ) == Success ) &type, &format, &nitems, &after, &prop ) == Success )
{ {
if( prop != NULL ) if( prop != NULL )

@ -143,7 +143,7 @@ int Lockout::heightForWidth( int width ) const
void Lockout::lock() void Lockout::lock()
{ {
TQCString appname( "kdesktop" ); TQCString appname( "kdesktop" );
int kicker_screen_number = qt_xscreen(); int kicker_screen_number = tqt_xscreen();
if ( kicker_screen_number ) if ( kicker_screen_number )
appname.sprintf("kdesktop-screen-%d", kicker_screen_number); appname.sprintf("kdesktop-screen-%d", kicker_screen_number);
kapp->dcopClient()->send(appname, "KScreensaverIface", "lock()", TQString("")); kapp->dcopClient()->send(appname, "KScreensaverIface", "lock()", TQString(""));

@ -107,7 +107,7 @@ Applet::~Applet()
void Applet::windowAdded( WId w_P ) void Applet::windowAdded( WId w_P )
{ {
NETWinInfo info( qt_xdisplay(), w_P, qt_xrootwin(), NET::WMWindowType ); NETWinInfo info( tqt_xdisplay(), w_P, tqt_xrootwin(), NET::WMWindowType );
if( info.windowType( SUPPORTED_WINDOW_TYPES ) != NET::TopMenu ) if( info.windowType( SUPPORTED_WINDOW_TYPES ) != NET::TopMenu )
return; return;
// kdDebug() << "embedding:" << w_P << endl; // kdDebug() << "embedding:" << w_P << endl;
@ -115,7 +115,7 @@ void Applet::windowAdded( WId w_P )
if( transient_for == None ) if( transient_for == None )
return; return;
MenuEmbed* embed; MenuEmbed* embed;
if( transient_for == qt_xrootwin()) if( transient_for == tqt_xrootwin())
{ {
embed = new MenuEmbed( transient_for, true, this ); embed = new MenuEmbed( transient_for, true, this );
} }
@ -224,7 +224,7 @@ WId Applet::tryTransientFor( WId w_P )
if( info.state() & NET::Modal ) if( info.state() & NET::Modal )
return None; return None;
WId ret = KWin::transientFor( w_P ); WId ret = KWin::transientFor( w_P );
if( ret == qt_xrootwin()) if( ret == tqt_xrootwin())
ret = None; ret = None;
return ret; return ret;
} }
@ -292,7 +292,7 @@ void Applet::setBackground()
void Applet::claimSelection() void Applet::claimSelection()
{ {
assert( selection == NULL ); assert( selection == NULL );
selection = new KSelectionOwner( makeSelectionAtom(), DefaultScreen( qt_xdisplay())); selection = new KSelectionOwner( makeSelectionAtom(), DefaultScreen( tqt_xdisplay()));
// force taking the selection, but don't kill previous owner // force taking the selection, but don't kill previous owner
if( selection->claim( true, false )) if( selection->claim( true, false ))
{ {
@ -327,7 +327,7 @@ void Applet::lostSelection()
active_menu = NULL; active_menu = NULL;
if( selection_watcher == NULL ) if( selection_watcher == NULL )
{ {
selection_watcher = new KSelectionWatcher( makeSelectionAtom(), DefaultScreen( qt_xdisplay())); selection_watcher = new KSelectionWatcher( makeSelectionAtom(), DefaultScreen( tqt_xdisplay()));
connect( selection_watcher, TQT_SIGNAL( lostOwner()), this, TQT_SLOT( claimSelection())); connect( selection_watcher, TQT_SIGNAL( lostOwner()), this, TQT_SLOT( claimSelection()));
} }
delete module; delete module;
@ -378,11 +378,11 @@ static
void initAtoms() void initAtoms()
{ {
char nm[ 100 ]; char nm[ 100 ];
sprintf( nm, "_KDE_TOPMENU_OWNER_S%d", DefaultScreen( qt_xdisplay())); sprintf( nm, "_KDE_TOPMENU_OWNER_S%d", DefaultScreen( tqt_xdisplay()));
char nm2[] = "_KDE_TOPMENU_MINSIZE"; char nm2[] = "_KDE_TOPMENU_MINSIZE";
char* names[ 2 ] = { nm, nm2 }; char* names[ 2 ] = { nm, nm2 };
Atom atoms[ 2 ]; Atom atoms[ 2 ];
XInternAtoms( qt_xdisplay(), names, 2, False, atoms ); XInternAtoms( tqt_xdisplay(), names, 2, False, atoms );
selection_atom = atoms[ 0 ]; selection_atom = atoms[ 0 ];
msg_type_atom = atoms[ 1 ]; msg_type_atom = atoms[ 1 ];
} }
@ -432,7 +432,7 @@ bool MenuEmbed::x11Event( XEvent* ev_P )
// int x, y; // int x, y;
// unsigned int w, h, d, b; // unsigned int w, h, d, b;
// Window root; // Window root;
// XGetGeometry( qt_xdisplay(), embeddedWinId(), &root, &x, &y, &w, &h, &b, &d ); // XGetGeometry( tqt_xdisplay(), embeddedWinId(), &root, &x, &y, &w, &h, &b, &d );
// kdDebug() << "RES3:" << width() << ":" << height() << ":" << w << ":" << h << endl; // kdDebug() << "RES3:" << width() << ":" << height() << ":" << w << ":" << h << endl;
return true; return true;
} }
@ -446,7 +446,7 @@ void MenuEmbed::sendSyntheticConfigureNotifyEvent()
XConfigureEvent c; XConfigureEvent c;
memset(&c, 0, sizeof(c)); memset(&c, 0, sizeof(c));
c.type = ConfigureNotify; c.type = ConfigureNotify;
c.display = qt_xdisplay(); c.display = tqt_xdisplay();
c.send_event = True; c.send_event = True;
c.event = embeddedWinId(); c.event = embeddedWinId();
c.window = winId(); c.window = winId();
@ -457,7 +457,7 @@ void MenuEmbed::sendSyntheticConfigureNotifyEvent()
c.border_width = 0; c.border_width = 0;
c.above = None; c.above = None;
c.override_redirect = 0; c.override_redirect = 0;
XSendEvent(qt_xdisplay(), c.event, true, StructureNotifyMask, (XEvent*)&c); XSendEvent(tqt_xdisplay(), c.event, true, StructureNotifyMask, (XEvent*)&c);
} }
} }
@ -470,7 +470,7 @@ void MenuEmbed::setMinimumSize( int w, int h )
{ {
// kdDebug() << "RES2:" << width() << ":" << height() << ":" << minimumWidth() << ":" << minimumHeight() << endl; // kdDebug() << "RES2:" << width() << ":" << height() << ":" << minimumWidth() << ":" << minimumHeight() << endl;
XEvent ev; XEvent ev;
ev.xclient.display = qt_xdisplay(); ev.xclient.display = tqt_xdisplay();
ev.xclient.type = ClientMessage; ev.xclient.type = ClientMessage;
ev.xclient.window = embeddedWinId(); ev.xclient.window = embeddedWinId();
assert( msg_type_atom != None ); assert( msg_type_atom != None );
@ -481,7 +481,7 @@ void MenuEmbed::setMinimumSize( int w, int h )
ev.xclient.data.l[2] = minimumHeight(); ev.xclient.data.l[2] = minimumHeight();
ev.xclient.data.l[3] = 0; ev.xclient.data.l[3] = 0;
ev.xclient.data.l[4] = 0; ev.xclient.data.l[4] = 0;
XSendEvent( qt_xdisplay(), embeddedWinId(), False, NoEventMask, &ev ); XSendEvent( tqt_xdisplay(), embeddedWinId(), False, NoEventMask, &ev );
} }
} }

@ -364,7 +364,7 @@ void KMiniPager::updateDesktopLayout(int o, int x, int y)
y = 0; y = 0;
if( m_desktopLayoutOwner == NULL ) if( m_desktopLayoutOwner == NULL )
{ // must own manager selection before setting global desktop layout { // must own manager selection before setting global desktop layout
int screen = DefaultScreen( qt_xdisplay()); int screen = DefaultScreen( tqt_xdisplay());
m_desktopLayoutOwner = new KSelectionOwner( TQString( "_NET_DESKTOP_LAYOUT_S%1" ).arg( screen ).latin1(), m_desktopLayoutOwner = new KSelectionOwner( TQString( "_NET_DESKTOP_LAYOUT_S%1" ).arg( screen ).latin1(),
screen, TQT_TQOBJECT(this) ); screen, TQT_TQOBJECT(this) );
if( !m_desktopLayoutOwner->claim( false )) if( !m_desktopLayoutOwner->claim( false ))
@ -375,7 +375,7 @@ void KMiniPager::updateDesktopLayout(int o, int x, int y)
} }
} }
NET::Orientation orient = o == Qt::Horizontal ? NET::OrientationHorizontal : NET::OrientationVertical; NET::Orientation orient = o == Qt::Horizontal ? NET::OrientationHorizontal : NET::OrientationVertical;
NETRootInfo i( qt_xdisplay(), 0 ); NETRootInfo i( tqt_xdisplay(), 0 );
i.setDesktopLayout( orient, x, y, NET::DesktopLayoutCornerTopLeft ); i.setDesktopLayout( orient, x, y, NET::DesktopLayoutCornerTopLeft );
} }

@ -220,7 +220,7 @@ void KMiniPagerButton::loadBgPixmap()
} }
TQCString kdesktop_name; TQCString kdesktop_name;
int screen_number = DefaultScreen(qt_xdisplay()); int screen_number = DefaultScreen(tqt_xdisplay());
if (screen_number == 0) if (screen_number == 0)
kdesktop_name = "kdesktop"; kdesktop_name = "kdesktop";
else else

@ -307,7 +307,7 @@ void SwallowApp::windowAdded(WId win)
{ {
// determine title of newly mapped window // determine title of newly mapped window
XTextProperty nameProp; XTextProperty nameProp;
XGetWMName(qt_xdisplay(), win, &nameProp); XGetWMName(tqt_xdisplay(), win, &nameProp);
char **names; char **names;
int count; int count;
XTextPropertyToStringList(&nameProp, &names, &count); XTextPropertyToStringList(&nameProp, &names, &count);
@ -328,7 +328,7 @@ void SwallowApp::windowAdded(WId win)
resize( r.width(), r.height() ); resize( r.width(), r.height() );
embed(win); embed(win);
XReparentWindow(qt_xdisplay(), win, winId(), 0, 0); XReparentWindow(tqt_xdisplay(), win, winId(), 0, 0);
disconnect(SwallowApplet::winModule(), TQT_SIGNAL(windowAdded(WId)), disconnect(SwallowApplet::winModule(), TQT_SIGNAL(windowAdded(WId)),
this, TQT_SLOT(windowAdded(WId))); this, TQT_SLOT(windowAdded(WId)));

@ -145,10 +145,10 @@ void SystemTrayApplet::initialize()
this, TQT_SLOT( updateTrayWindows() ) ); this, TQT_SLOT( updateTrayWindows() ) );
TQCString screenstr; TQCString screenstr;
screenstr.setNum(qt_xscreen()); screenstr.setNum(tqt_xscreen());
TQCString trayatom = "_NET_SYSTEM_TRAY_S" + screenstr; TQCString trayatom = "_NET_SYSTEM_TRAY_S" + screenstr;
Display *display = qt_xdisplay(); Display *display = tqt_xdisplay();
net_system_tray_selection = XInternAtom(display, trayatom, false); net_system_tray_selection = XInternAtom(display, trayatom, false);
net_system_tray_opcode = XInternAtom(display, "_NET_SYSTEM_TRAY_OPCODE", false); net_system_tray_opcode = XInternAtom(display, "_NET_SYSTEM_TRAY_OPCODE", false);
@ -159,7 +159,7 @@ void SystemTrayApplet::initialize()
winId(), winId(),
CurrentTime); CurrentTime);
WId root = qt_xrootwin(); WId root = tqt_xrootwin();
if (XGetSelectionOwner (display, net_system_tray_selection) == winId()) if (XGetSelectionOwner (display, net_system_tray_selection) == winId())
{ {
@ -531,10 +531,10 @@ void SystemTrayApplet::embedWindow( WId w, bool kde_tray )
if (kde_tray) if (kde_tray)
{ {
static Atom hack_atom = XInternAtom( qt_xdisplay(), "_KDE_SYSTEM_TRAY_EMBEDDING", False ); static Atom hack_atom = XInternAtom( tqt_xdisplay(), "_KDE_SYSTEM_TRAY_EMBEDDING", False );
XChangeProperty( qt_xdisplay(), w, hack_atom, hack_atom, 32, PropModeReplace, NULL, 0 ); XChangeProperty( tqt_xdisplay(), w, hack_atom, hack_atom, 32, PropModeReplace, NULL, 0 );
emb->embed(w); emb->embed(w);
XDeleteProperty( qt_xdisplay(), w, hack_atom ); XDeleteProperty( tqt_xdisplay(), w, hack_atom );
} }
else else
{ {

@ -97,14 +97,14 @@ void DockBarExtension::windowAdded(WId win)
int argc; int argc;
char **argv; char **argv;
TQString command; TQString command;
if (XGetCommand(qt_xdisplay(), win, &argv, &argc)) { if (XGetCommand(tqt_xdisplay(), win, &argv, &argc)) {
command = KShell::joinArgs(argv, argc); command = KShell::joinArgs(argv, argc);
XFreeStringList(argv); XFreeStringList(argv);
} }
// try to read wm hints // try to read wm hints
WId resIconwin = 0; WId resIconwin = 0;
XWMHints *wmhints = XGetWMHints(qt_xdisplay(), win); XWMHints *wmhints = XGetWMHints(tqt_xdisplay(), win);
if (0 != wmhints) { // we managed to read wm hints if (0 != wmhints) { // we managed to read wm hints
// read IconWindowHint // read IconWindowHint
bool is_valid = false; bool is_valid = false;
@ -146,7 +146,7 @@ void DockBarExtension::windowAdded(WId win)
// try to read class hint // try to read class hint
XClassHint hint; XClassHint hint;
TQString resClass, resName; TQString resClass, resName;
if (XGetClassHint(qt_xdisplay(), win, &hint)) { if (XGetClassHint(tqt_xdisplay(), win, &hint)) {
resName = hint.res_name; resName = hint.res_name;
resClass = hint.res_class; resClass = hint.res_class;
} }
@ -158,7 +158,7 @@ void DockBarExtension::windowAdded(WId win)
which causes the double-launch bug (one instance from the twin which causes the double-launch bug (one instance from the twin
session, and one from the dockbar) bug when kde is restarted */ session, and one from the dockbar) bug when kde is restarted */
if (resIconwin != win) { if (resIconwin != win) {
XWithdrawWindow( qt_xdisplay(), win, qt_xscreen() ); XWithdrawWindow( tqt_xdisplay(), win, tqt_xscreen() );
while( KWin::windowInfo(win, NET::XAWMState).mappingState() != NET::Withdrawn ); while( KWin::windowInfo(win, NET::XAWMState).mappingState() != NET::Withdrawn );
} }

@ -49,7 +49,7 @@ DockContainer::DockContainer( TQString command, TQWidget *parent,
_resName(resname), _resName(resname),
_resClass(resclass) _resClass(resclass)
{ {
XSelectInput( qt_xdisplay(), winId(), XSelectInput( tqt_xdisplay(), winId(),
KeyPressMask | KeyReleaseMask | KeyPressMask | KeyReleaseMask |
ButtonPressMask | ButtonReleaseMask | ButtonPressMask | ButtonReleaseMask |
KeymapStateMask | KeymapStateMask |
@ -79,21 +79,21 @@ void DockContainer::embed( WId id )
TQRect geom = KWin::windowInfo(id,NET::WMKDEFrameStrut).frameGeometry(); TQRect geom = KWin::windowInfo(id,NET::WMKDEFrameStrut).frameGeometry();
// does the same as KWM::prepareForSwallowing() // does the same as KWM::prepareForSwallowing()
XWithdrawWindow( qt_xdisplay(), id, qt_xscreen() ); XWithdrawWindow( tqt_xdisplay(), id, tqt_xscreen() );
while( KWin::windowInfo(id, NET::XAWMState).mappingState() != NET::Withdrawn ); while( KWin::windowInfo(id, NET::XAWMState).mappingState() != NET::Withdrawn );
XReparentWindow( qt_xdisplay(), id, winId(), 0, 0 ); XReparentWindow( tqt_xdisplay(), id, winId(), 0, 0 );
// resize if window is bigger than frame // resize if window is bigger than frame
if( (geom.width() > width()) || if( (geom.width() > width()) ||
(geom.height() > height()) ) (geom.height() > height()) )
XResizeWindow( qt_xdisplay(), id, width(), height() ); XResizeWindow( tqt_xdisplay(), id, width(), height() );
else else
XMoveWindow(qt_xdisplay(), id, XMoveWindow(tqt_xdisplay(), id,
(sz() - geom.width())/2 - border(), (sz() - geom.width())/2 - border(),
(sz() - geom.height())/2 - border()); (sz() - geom.height())/2 - border());
XMapWindow( qt_xdisplay(), id ); XMapWindow( tqt_xdisplay(), id );
XUngrabButton( qt_xdisplay(), AnyButton, AnyModifier, winId() ); XUngrabButton( tqt_xdisplay(), AnyButton, AnyModifier, winId() );
_embeddedWinId = id; _embeddedWinId = id;
} }
@ -101,13 +101,13 @@ void DockContainer::embed( WId id )
void DockContainer::unembed() void DockContainer::unembed()
{ {
if( _embeddedWinId ) if( _embeddedWinId )
XReparentWindow( qt_xdisplay(), _embeddedWinId, qt_xrootwin(), 0, 0 ); XReparentWindow( tqt_xdisplay(), _embeddedWinId, tqt_xrootwin(), 0, 0 );
} }
void DockContainer::kill() void DockContainer::kill()
{ {
if ( _embeddedWinId ) { if ( _embeddedWinId ) {
XKillClient( qt_xdisplay(), _embeddedWinId ); XKillClient( tqt_xdisplay(), _embeddedWinId );
_embeddedWinId = 0; // in case the window does not exist anymore.. _embeddedWinId = 0; // in case the window does not exist anymore..
} }
else emit embeddedWindowDestroyed(this); /* enable killing of empty windows.. */ else emit embeddedWindowDestroyed(this); /* enable killing of empty windows.. */

@ -292,7 +292,7 @@ TQSize ExtensionContainer::sizeHint(KPanelExtension::Position p, const TQSize &m
static bool isnetwm12_below() static bool isnetwm12_below()
{ {
NETRootInfo info( qt_xdisplay(), NET::Supported ); NETRootInfo info( tqt_xdisplay(), NET::Supported );
return info.supportedProperties()[ NETRootInfo::STATES ] & NET::KeepBelow; return info.supportedProperties()[ NETRootInfo::STATES ] & NET::KeepBelow;
} }

@ -4,6 +4,6 @@ void KMenuBase::init()
{ {
XSetWindowAttributes attrs; XSetWindowAttributes attrs;
attrs.override_redirect = True; attrs.override_redirect = True;
XChangeWindowAttributes( qt_xdisplay(), winId(), CWOverrideRedirect, &attrs ); XChangeWindowAttributes( tqt_xdisplay(), winId(), CWOverrideRedirect, &attrs );
setWFlags( (WFlags)TQt::WType_Popup ); setWFlags( (WFlags)TQt::WType_Popup );
} }

@ -45,7 +45,7 @@ ShowDesktop::ShowDesktop()
{ {
// This feature is implemented in KWin. Keep old code in Kicker for the case // This feature is implemented in KWin. Keep old code in Kicker for the case
// KDE is running with another WM without the feature. // KDE is running with another WM without the feature.
NETRootInfo i( qt_xdisplay(), NET::Supported ); NETRootInfo i( tqt_xdisplay(), NET::Supported );
m_wmSupport = i.isSupported( NET::WM2ShowingDesktop ); m_wmSupport = i.isSupported( NET::WM2ShowingDesktop );
if( m_wmSupport ) if( m_wmSupport )
{ {
@ -67,7 +67,7 @@ void ShowDesktop::slotWindowAdded(WId w)
return; return;
} }
NETWinInfo inf(qt_xdisplay(), w, qt_xrootwin(), NETWinInfo inf(tqt_xdisplay(), w, tqt_xrootwin(),
NET::XAWMState | NET::WMWindowType); NET::XAWMState | NET::WMWindowType);
NET::WindowType windowType = inf.windowType(NET::AllTypesMask); NET::WindowType windowType = inf.windowType(NET::AllTypesMask);
@ -99,7 +99,7 @@ void ShowDesktop::slotWindowChanged(WId w, unsigned int dirty)
if (dirty & NET::XAWMState) if (dirty & NET::XAWMState)
{ {
NETWinInfo inf(qt_xdisplay(), w, qt_xrootwin(), NETWinInfo inf(tqt_xdisplay(), w, tqt_xrootwin(),
NET::XAWMState | NET::WMWindowType); NET::XAWMState | NET::WMWindowType);
NET::WindowType windowType = inf.windowType(NET::AllTypesMask); NET::WindowType windowType = inf.windowType(NET::AllTypesMask);
@ -123,7 +123,7 @@ void ShowDesktop::showDesktop( bool b )
if( m_wmSupport ) if( m_wmSupport )
{ {
NETRootInfo i( qt_xdisplay(), 0 ); NETRootInfo i( tqt_xdisplay(), 0 );
i.setShowingDesktop( b ); i.setShowingDesktop( b );
return; return;
} }
@ -140,7 +140,7 @@ void ShowDesktop::showDesktop( bool b )
{ {
WId w = *it; WId w = *it;
NETWinInfo info( qt_xdisplay(), w, qt_xrootwin(), NETWinInfo info( tqt_xdisplay(), w, tqt_xrootwin(),
NET::XAWMState | NET::WMDesktop ); NET::XAWMState | NET::WMDesktop );
if (info.mappingState() == NET::Visible && if (info.mappingState() == NET::Visible &&

@ -1509,7 +1509,7 @@ void KMenu::searchAccept()
if ( lock ) if ( lock )
{ {
TQCString appname( "kdesktop" ); TQCString appname( "kdesktop" );
int kicker_screen_number = qt_xscreen(); int kicker_screen_number = tqt_xscreen();
if ( kicker_screen_number ) if ( kicker_screen_number )
appname.sprintf("kdesktop-screen-%d", kicker_screen_number); appname.sprintf("kdesktop-screen-%d", kicker_screen_number);
kapp->dcopClient()->send(appname, "KScreensaverIface", "lock()", TQString("")); kapp->dcopClient()->send(appname, "KScreensaverIface", "lock()", TQString(""));

@ -105,8 +105,8 @@ void KickerTip::display()
{ {
// prevent tips from showing when the active window is fullscreened // prevent tips from showing when the active window is fullscreened
NETRootInfo ri(qt_xdisplay(), NET::ActiveWindow); NETRootInfo ri(tqt_xdisplay(), NET::ActiveWindow);
NETWinInfo wi(qt_xdisplay(), ri.activeWindow(), ri.rootWindow(), NET::WMState); NETWinInfo wi(tqt_xdisplay(), ri.activeWindow(), ri.rootWindow(), NET::WMState);
if (wi.state() & NET::FullScreen) if (wi.state() & NET::FullScreen)
{ {
return; return;

@ -280,8 +280,8 @@ void AppletProxy::dock(const TQCString& callbackID)
// we use "call" to know whether it was sucessful // we use "call" to know whether it was sucessful
int screen_number = 0; int screen_number = 0;
if (qt_xdisplay()) if (tqt_xdisplay())
screen_number = DefaultScreen(qt_xdisplay()); screen_number = DefaultScreen(tqt_xdisplay());
TQCString appname; TQCString appname;
if (screen_number == 0) if (screen_number == 0)
appname = "kicker"; appname = "kicker";
@ -455,8 +455,8 @@ void AppletProxy::slotUpdateLayout()
TQByteArray data; TQByteArray data;
int screen_number = 0; int screen_number = 0;
if (qt_xdisplay()) if (tqt_xdisplay())
screen_number = DefaultScreen(qt_xdisplay()); screen_number = DefaultScreen(tqt_xdisplay());
TQCString appname; TQCString appname;
if (screen_number == 0) if (screen_number == 0)
appname = "kicker"; appname = "kicker";
@ -472,8 +472,8 @@ void AppletProxy::slotRequestFocus()
TQByteArray data; TQByteArray data;
int screen_number = 0; int screen_number = 0;
if (qt_xdisplay()) if (tqt_xdisplay())
screen_number = DefaultScreen(qt_xdisplay()); screen_number = DefaultScreen(tqt_xdisplay());
TQCString appname; TQCString appname;
if (screen_number == 0) if (screen_number == 0)
appname = "kicker"; appname = "kicker";
@ -486,8 +486,8 @@ void AppletProxy::slotRequestFocus()
void AppletProxy::slotApplicationRemoved(const TQCString& appId) void AppletProxy::slotApplicationRemoved(const TQCString& appId)
{ {
int screen_number = 0; int screen_number = 0;
if (qt_xdisplay()) if (tqt_xdisplay())
screen_number = DefaultScreen(qt_xdisplay()); screen_number = DefaultScreen(tqt_xdisplay());
TQCString appname; TQCString appname;
if (screen_number == 0) if (screen_number == 0)
appname = "kicker"; appname = "kicker";

@ -220,8 +220,8 @@ void ExtensionProxy::dock(const TQCString& callbackID)
// we use "call" to know whether it was sucessful // we use "call" to know whether it was sucessful
int screen_number = 0; int screen_number = 0;
if (qt_xdisplay()) if (tqt_xdisplay())
screen_number = DefaultScreen(qt_xdisplay()); screen_number = DefaultScreen(tqt_xdisplay());
TQCString appname; TQCString appname;
if (screen_number == 0) if (screen_number == 0)
appname = "kicker"; appname = "kicker";
@ -372,8 +372,8 @@ void ExtensionProxy::slotUpdateLayout()
TQByteArray data; TQByteArray data;
int screen_number = 0; int screen_number = 0;
if (qt_xdisplay()) if (tqt_xdisplay())
screen_number = DefaultScreen(qt_xdisplay()); screen_number = DefaultScreen(tqt_xdisplay());
TQCString appname; TQCString appname;
if (screen_number == 0) if (screen_number == 0)
appname = "kicker"; appname = "kicker";
@ -386,8 +386,8 @@ void ExtensionProxy::slotUpdateLayout()
void ExtensionProxy::slotApplicationRemoved(const TQCString& appId) void ExtensionProxy::slotApplicationRemoved(const TQCString& appId)
{ {
int screen_number = 0; int screen_number = 0;
if (qt_xdisplay()) if (tqt_xdisplay())
screen_number = DefaultScreen(qt_xdisplay()); screen_number = DefaultScreen(tqt_xdisplay());
TQCString appname; TQCString appname;
if (screen_number == 0) if (screen_number == 0)
appname = "kicker"; appname = "kicker";

@ -263,7 +263,7 @@ Task::Ptr TaskManager::findTask(int desktop, const TQPoint& p)
void TaskManager::windowAdded(WId w ) void TaskManager::windowAdded(WId w )
{ {
NETWinInfo info(qt_xdisplay(), w, qt_xrootwin(), NETWinInfo info(tqt_xdisplay(), w, tqt_xrootwin(),
NET::WMWindowType | NET::WMPid | NET::WMState); NET::WMWindowType | NET::WMPid | NET::WMState);
// ignore NET::Tool and other special window types // ignore NET::Tool and other special window types
@ -290,7 +290,7 @@ void TaskManager::windowAdded(WId w )
} }
Window transient_for_tmp; Window transient_for_tmp;
if (XGetTransientForHint( qt_xdisplay(), (Window) w, &transient_for_tmp )) if (XGetTransientForHint( tqt_xdisplay(), (Window) w, &transient_for_tmp ))
{ {
WId transient_for = (WId) transient_for_tmp; WId transient_for = (WId) transient_for_tmp;
@ -299,7 +299,7 @@ void TaskManager::windowAdded(WId w )
return; return;
// lets see if this is a transient for an existing task // lets see if this is a transient for an existing task
if( transient_for != qt_xrootwin() if( transient_for != tqt_xrootwin()
&& transient_for != 0 && transient_for != 0
&& wType != NET::Utility ) && wType != NET::Utility )
{ {
@ -358,7 +358,7 @@ void TaskManager::windowChanged(WId w, unsigned int dirty)
{ {
if (dirty & NET::WMState) if (dirty & NET::WMState)
{ {
NETWinInfo info (qt_xdisplay(), w, qt_xrootwin(), NETWinInfo info (tqt_xdisplay(), w, tqt_xrootwin(),
NET::WMState | NET::XAWMState); NET::WMState | NET::XAWMState);
if (info.state() & NET::SkipTaskbar) if (info.state() & NET::SkipTaskbar)
{ {
@ -828,7 +828,7 @@ void Task::updateDemandsAttentionState( WId w )
if (window() != w) if (window() != w)
{ {
// 'w' is a transient for this task // 'w' is a transient for this task
NETWinInfo i( qt_xdisplay(), w, qt_xrootwin(), NET::WMState ); NETWinInfo i( tqt_xdisplay(), w, tqt_xrootwin(), NET::WMState );
if(i.state() & NET::DemandsAttention) if(i.state() & NET::DemandsAttention)
{ {
if (!_transients_demanding_attention.contains(w)) if (!_transients_demanding_attention.contains(w))
@ -862,7 +862,7 @@ void Task::removeTransient(WId w)
TQString Task::className() TQString Task::className()
{ {
XClassHint hint; XClassHint hint;
if(XGetClassHint(qt_xdisplay(), _win, &hint)) { if(XGetClassHint(tqt_xdisplay(), _win, &hint)) {
TQString nh( hint.res_name ); TQString nh( hint.res_name );
XFree( hint.res_name ); XFree( hint.res_name );
XFree( hint.res_class ); XFree( hint.res_class );
@ -874,7 +874,7 @@ TQString Task::className()
TQString Task::classClass() TQString Task::classClass()
{ {
XClassHint hint; XClassHint hint;
if(XGetClassHint(qt_xdisplay(), _win, &hint)) { if(XGetClassHint(tqt_xdisplay(), _win, &hint)) {
TQString ch( hint.res_class ); TQString ch( hint.res_class );
XFree( hint.res_name ); XFree( hint.res_name );
XFree( hint.res_class ); XFree( hint.res_class );
@ -1012,7 +1012,7 @@ void Task::move()
TQRect geom = _info.geometry(); TQRect geom = _info.geometry();
TQCursor::setPos(geom.center()); TQCursor::setPos(geom.center());
NETRootInfo ri(qt_xdisplay(), NET::WMMoveResize); NETRootInfo ri(tqt_xdisplay(), NET::WMMoveResize);
ri.moveResizeRequest(_win, geom.center().x(), ri.moveResizeRequest(_win, geom.center().x(),
geom.center().y(), NET::Move); geom.center().y(), NET::Move);
} }
@ -1035,7 +1035,7 @@ void Task::resize()
TQRect geom = _info.geometry(); TQRect geom = _info.geometry();
TQCursor::setPos(geom.bottomRight()); TQCursor::setPos(geom.bottomRight());
NETRootInfo ri(qt_xdisplay(), NET::WMMoveResize); NETRootInfo ri(tqt_xdisplay(), NET::WMMoveResize);
ri.moveResizeRequest(_win, geom.bottomRight().x(), ri.moveResizeRequest(_win, geom.bottomRight().x(),
geom.bottomRight().y(), NET::BottomRight); geom.bottomRight().y(), NET::BottomRight);
} }
@ -1055,7 +1055,7 @@ void Task::setMaximized(bool maximize)
KWin::deIconifyWindow(_win); KWin::deIconifyWindow(_win);
} }
NETWinInfo ni(qt_xdisplay(), _win, qt_xrootwin(), NET::WMState); NETWinInfo ni(tqt_xdisplay(), _win, tqt_xrootwin(), NET::WMState);
if (maximize) if (maximize)
{ {
@ -1092,7 +1092,7 @@ void Task::restore()
KWin::deIconifyWindow(_win); KWin::deIconifyWindow(_win);
} }
NETWinInfo ni(qt_xdisplay(), _win, qt_xrootwin(), NET::WMState); NETWinInfo ni(tqt_xdisplay(), _win, tqt_xrootwin(), NET::WMState);
ni.setState(0, NET::Max); ni.setState(0, NET::Max);
if (!on_current) if (!on_current)
@ -1133,7 +1133,7 @@ void Task::toggleIconified()
void Task::close() void Task::close()
{ {
NETRootInfo ri( qt_xdisplay(), NET::CloseWindow ); NETRootInfo ri( tqt_xdisplay(), NET::CloseWindow );
ri.closeWindowRequest( _win ); ri.closeWindowRequest( _win );
} }
@ -1178,7 +1178,7 @@ void Task::activateRaiseOrIconify()
void Task::toDesktop(int desk) void Task::toDesktop(int desk)
{ {
NETWinInfo ni(qt_xdisplay(), _win, qt_xrootwin(), NET::WMDesktop); NETWinInfo ni(tqt_xdisplay(), _win, tqt_xrootwin(), NET::WMDesktop);
if (desk == 0) if (desk == 0)
{ {
if (_info.valid() && _info.onAllDesktops()) if (_info.valid() && _info.onAllDesktops())
@ -1205,7 +1205,7 @@ void Task::toCurrentDesktop()
void Task::setAlwaysOnTop(bool stay) void Task::setAlwaysOnTop(bool stay)
{ {
NETWinInfo ni( qt_xdisplay(), _win, qt_xrootwin(), NET::WMState); NETWinInfo ni( tqt_xdisplay(), _win, tqt_xrootwin(), NET::WMState);
if(stay) if(stay)
ni.setState( NET::StaysOnTop, NET::StaysOnTop ); ni.setState( NET::StaysOnTop, NET::StaysOnTop );
else else
@ -1219,7 +1219,7 @@ void Task::toggleAlwaysOnTop()
void Task::setKeptBelowOthers(bool below) void Task::setKeptBelowOthers(bool below)
{ {
NETWinInfo ni(qt_xdisplay(), _win, qt_xrootwin(), NET::WMState); NETWinInfo ni(tqt_xdisplay(), _win, tqt_xrootwin(), NET::WMState);
if (below) if (below)
{ {
@ -1238,7 +1238,7 @@ void Task::toggleKeptBelowOthers()
void Task::setFullScreen(bool fullscreen) void Task::setFullScreen(bool fullscreen)
{ {
NETWinInfo ni(qt_xdisplay(), _win, qt_xrootwin(), NET::WMState); NETWinInfo ni(tqt_xdisplay(), _win, tqt_xrootwin(), NET::WMState);
if (fullscreen) if (fullscreen)
{ {
@ -1257,7 +1257,7 @@ void Task::toggleFullScreen()
void Task::setShaded(bool shade) void Task::setShaded(bool shade)
{ {
NETWinInfo ni( qt_xdisplay(), _win, qt_xrootwin(), NET::WMState); NETWinInfo ni( tqt_xdisplay(), _win, tqt_xrootwin(), NET::WMState);
if(shade) if(shade)
ni.setState( NET::Shaded, NET::Shaded ); ni.setState( NET::Shaded, NET::Shaded );
else else
@ -1277,7 +1277,7 @@ void Task::publishIconGeometry(TQRect rect)
} }
m_iconGeometry = rect; m_iconGeometry = rect;
NETWinInfo ni(qt_xdisplay(), _win, qt_xrootwin(), 0); NETWinInfo ni(tqt_xdisplay(), _win, tqt_xrootwin(), 0);
NETRect r; NETRect r;
if (rect.isValid()) if (rect.isValid())

@ -71,7 +71,7 @@ ClipboardPoll::ClipboardPoll( TQWidget* parent )
"KLIPPER_SELECTION_TIMESTAMP", "KLIPPER_SELECTION_TIMESTAMP",
"KLIPPER_CLIPBOARD_TIMESTAMP" }; "KLIPPER_CLIPBOARD_TIMESTAMP" };
Atom atoms[ 6 ]; Atom atoms[ 6 ];
XInternAtoms( qt_xdisplay(), const_cast< char** >( names ), 6, False, atoms ); XInternAtoms( tqt_xdisplay(), const_cast< char** >( names ), 6, False, atoms );
selection.sentinel_atom = atoms[ 0 ]; selection.sentinel_atom = atoms[ 0 ];
clipboard.sentinel_atom = atoms[ 1 ]; clipboard.sentinel_atom = atoms[ 1 ];
xa_clipboard = atoms[ 2 ]; xa_clipboard = atoms[ 2 ];
@ -82,13 +82,13 @@ ClipboardPoll::ClipboardPoll( TQWidget* parent )
kapp->installX11EventFilter( this ); kapp->installX11EventFilter( this );
#ifdef HAVE_XFIXES #ifdef HAVE_XFIXES
int dummy; int dummy;
if( XFixesQueryExtension( qt_xdisplay(), &xfixes_event_base, &dummy )) if( XFixesQueryExtension( tqt_xdisplay(), &xfixes_event_base, &dummy ))
{ {
XFixesSelectSelectionInput( qt_xdisplay(), qt_xrootwin( 0 ), XA_PRIMARY, XFixesSelectSelectionInput( tqt_xdisplay(), tqt_xrootwin( 0 ), XA_PRIMARY,
XFixesSetSelectionOwnerNotifyMask | XFixesSetSelectionOwnerNotifyMask |
XFixesSelectionWindowDestroyNotifyMask | XFixesSelectionWindowDestroyNotifyMask |
XFixesSelectionClientCloseNotifyMask ); XFixesSelectionClientCloseNotifyMask );
XFixesSelectSelectionInput( qt_xdisplay(), qt_xrootwin( 0 ), xa_clipboard, XFixesSelectSelectionInput( tqt_xdisplay(), tqt_xrootwin( 0 ), xa_clipboard,
XFixesSetSelectionOwnerNotifyMask | XFixesSetSelectionOwnerNotifyMask |
XFixesSelectionWindowDestroyNotifyMask | XFixesSelectionWindowDestroyNotifyMask |
XFixesSelectionClientCloseNotifyMask ); XFixesSelectionClientCloseNotifyMask );
@ -116,11 +116,11 @@ void ClipboardPoll::initPolling()
selection.atom = XA_PRIMARY; selection.atom = XA_PRIMARY;
clipboard.atom = xa_clipboard; clipboard.atom = xa_clipboard;
selection.last_change = clipboard.last_change = GET_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 ); selection.last_owner = XGetSelectionOwner( tqt_xdisplay(), XA_PRIMARY );
#ifdef NOISY_KLIPPER_ #ifdef NOISY_KLIPPER_
kdDebug() << "(1) Setting last_owner for =" << "selection" << ":" << selection.last_owner << endl; kdDebug() << "(1) Setting last_owner for =" << "selection" << ":" << selection.last_owner << endl;
#endif #endif
clipboard.last_owner = XGetSelectionOwner( qt_xdisplay(), xa_clipboard ); clipboard.last_owner = XGetSelectionOwner( tqt_xdisplay(), xa_clipboard );
#ifdef NOISY_KLIPPER_ #ifdef NOISY_KLIPPER_
kdDebug() << "(2) Setting last_owner for =" << "clipboard" << ":" << clipboard.last_owner << endl; kdDebug() << "(2) Setting last_owner for =" << "clipboard" << ":" << clipboard.last_owner << endl;
#endif #endif
@ -193,7 +193,7 @@ void ClipboardPoll::updateQtOwnership( SelectionData& data )
unsigned long nitems; unsigned long nitems;
unsigned long after; unsigned long after;
unsigned char* prop = NULL; unsigned char* prop = NULL;
if( XGetWindowProperty( qt_xdisplay(), qt_xrootwin( 0 ), data.sentinel_atom, 0, 2, False, if( XGetWindowProperty( tqt_xdisplay(), tqt_xrootwin( 0 ), data.sentinel_atom, 0, 2, False,
XA_WINDOW, &type, &format, &nitems, &after, &prop ) != Success XA_WINDOW, &type, &format, &nitems, &after, &prop ) != Success
|| type != XA_WINDOW || format != 32 || nitems != 2 || prop == NULL ) || type != XA_WINDOW || format != 32 || nitems != 2 || prop == NULL )
{ {
@ -207,7 +207,7 @@ void ClipboardPoll::updateQtOwnership( SelectionData& data )
} }
Window owner = reinterpret_cast< long* >( prop )[ 0 ]; // [0] is new owner, [1] is previous Window owner = reinterpret_cast< long* >( prop )[ 0 ]; // [0] is new owner, [1] is previous
XFree( prop ); XFree( prop );
Window current_owner = XGetSelectionOwner( qt_xdisplay(), data.atom ); Window current_owner = XGetSelectionOwner( tqt_xdisplay(), data.atom );
data.owner_is_qt = ( owner == current_owner ); data.owner_is_qt = ( owner == current_owner );
#ifdef REALLY_NOISY_KLIPPER_ #ifdef REALLY_NOISY_KLIPPER_
kdDebug() << "owner=" << owner << "; current_owner=" << current_owner << endl; kdDebug() << "owner=" << owner << "; current_owner=" << current_owner << endl;
@ -235,7 +235,7 @@ void ClipboardPoll::timeout()
bool ClipboardPoll::checkTimestamp( SelectionData& data ) bool ClipboardPoll::checkTimestamp( SelectionData& data )
{ {
Window current_owner = XGetSelectionOwner( qt_xdisplay(), data.atom ); Window current_owner = XGetSelectionOwner( tqt_xdisplay(), data.atom );
bool signal = false; bool signal = false;
updateQtOwnership( data ); updateQtOwnership( data );
if( data.owner_is_qt ) if( data.owner_is_qt )
@ -269,8 +269,8 @@ bool ClipboardPoll::checkTimestamp( SelectionData& data )
// We're already waiting for the timestamp of the last check // We're already waiting for the timestamp of the last check
return false; return false;
} }
XDeleteProperty( qt_xdisplay(), winId(), data.timestamp_atom ); XDeleteProperty( tqt_xdisplay(), winId(), data.timestamp_atom );
XConvertSelection( qt_xdisplay(), data.atom, xa_timestamp, data.timestamp_atom, winId(), GET_QT_X_TIME() ); XConvertSelection( tqt_xdisplay(), data.atom, xa_timestamp, data.timestamp_atom, winId(), GET_QT_X_TIME() );
data.waiting_for_timestamp = true; data.waiting_for_timestamp = true;
data.waiting_x_time = GET_QT_X_TIME(); data.waiting_x_time = GET_QT_X_TIME();
#ifdef REALLY_NOISY_KLIPPER_ #ifdef REALLY_NOISY_KLIPPER_
@ -300,7 +300,7 @@ bool ClipboardPoll::changedTimestamp( SelectionData& data, const XEvent& ev )
unsigned long nitems; unsigned long nitems;
unsigned long after; unsigned long after;
unsigned char* prop = NULL; unsigned char* prop = NULL;
if( XGetWindowProperty( qt_xdisplay(), winId(), ev.xselection.property, 0, 1, False, if( XGetWindowProperty( tqt_xdisplay(), winId(), ev.xselection.property, 0, 1, False,
AnyPropertyType, &type, &format, &nitems, &after, &prop ) != Success AnyPropertyType, &type, &format, &nitems, &after, &prop ) != Success
|| format != 32 || nitems != 1 || prop == NULL ) || format != 32 || nitems != 1 || prop == NULL )
{ {

@ -118,7 +118,7 @@ private:
KlipperWidget* klipper; KlipperWidget* klipper;
}; };
extern bool qt_qclipboard_bailout_hack; extern bool tqt_qclipboard_bailout_hack;
#if KDE_IS_VERSION( 15, 0, 0 ) #if KDE_IS_VERSION( 15, 0, 0 )
#error Check status of #80072 with Qt4. #error Check status of #80072 with Qt4.
#endif #endif
@ -135,7 +135,7 @@ KlipperWidget::KlipperWidget( TQWidget *parent, KConfig* config )
, m_pendingContentsCheck( false ) , m_pendingContentsCheck( false )
, session_managed( new KlipperSessionManaged( this )) , session_managed( new KlipperSessionManaged( this ))
{ {
qt_qclipboard_bailout_hack = true; tqt_qclipboard_bailout_hack = true;
// We don't use the clipboardsynchronizer anymore, and it confuses Klipper // We don't use the clipboardsynchronizer anymore, and it confuses Klipper
ensureGlobalSyncOff(m_config); ensureGlobalSyncOff(m_config);
@ -240,7 +240,7 @@ KlipperWidget::~KlipperWidget()
delete myURLGrabber; delete myURLGrabber;
if( m_config != kapp->config()) if( m_config != kapp->config())
delete m_config; delete m_config;
qt_qclipboard_bailout_hack = false; tqt_qclipboard_bailout_hack = false;
} }
void KlipperWidget::adjustSize() void KlipperWidget::adjustSize()
@ -1028,11 +1028,11 @@ bool KlipperWidget::ignoreClipboardChanges() const
return false; return false;
} }
// TQClipboard uses qt_x_time as the timestamp for selection operations. // TQClipboard uses tqt_x_time as the timestamp for selection operations.
// It is updated mainly from user actions, but Klipper polls the clipboard // It is updated mainly from user actions, but Klipper polls the clipboard
// without any user action triggering it, so qt_x_time may be old, // without any user action triggering it, so tqt_x_time may be old,
// which could possibly lead to TQClipboard reporting empty clipboard. // which could possibly lead to TQClipboard reporting empty clipboard.
// Therefore, qt_x_time needs to be updated to current X server timestamp. // Therefore, tqt_x_time needs to be updated to current X server timestamp.
// Call KApplication::updateUserTime() only from functions that are // Call KApplication::updateUserTime() only from functions that are
// called from outside (DCOP), or from TQTimer timeout ! // called from outside (DCOP), or from TQTimer timeout !
@ -1074,7 +1074,7 @@ static Bool update_x_time_predicate( Display*, XEvent* event, XPointer )
} }
void KlipperWidget::updateTimestamp() void KlipperWidget::updateTimestamp()
{ // Qt3.3.0 and 3.3.1 use qt_x_user_time for clipboard operations { // Qt3.3.0 and 3.3.1 use tqt_x_user_time for clipboard operations
Time time = ( strcmp( tqVersion(), "3.3.1" ) == 0 Time time = ( strcmp( tqVersion(), "3.3.1" ) == 0
|| strcmp( tqVersion(), "3.3.0" ) == 0 ) || strcmp( tqVersion(), "3.3.0" ) == 0 )
? GET_QT_X_USER_TIME() : GET_QT_X_TIME(); ? GET_QT_X_USER_TIME() : GET_QT_X_TIME();
@ -1082,19 +1082,19 @@ void KlipperWidget::updateTimestamp()
if ( !w ) if ( !w )
w = new TQWidget; w = new TQWidget;
unsigned char data[ 1 ]; unsigned char data[ 1 ];
XChangeProperty( qt_xdisplay(), w->winId(), XA_ATOM, XA_ATOM, 8, PropModeAppend, data, 1 ); XChangeProperty( tqt_xdisplay(), w->winId(), XA_ATOM, XA_ATOM, 8, PropModeAppend, data, 1 );
next_x_time = CurrentTime; next_x_time = CurrentTime;
XEvent dummy; XEvent dummy;
XCheckIfEvent( qt_xdisplay(), &dummy, update_x_time_predicate, NULL ); XCheckIfEvent( tqt_xdisplay(), &dummy, update_x_time_predicate, NULL );
if( next_x_time == CurrentTime ) if( next_x_time == CurrentTime )
{ {
XSync( qt_xdisplay(), False ); XSync( tqt_xdisplay(), False );
XCheckIfEvent( qt_xdisplay(), &dummy, update_x_time_predicate, NULL ); XCheckIfEvent( tqt_xdisplay(), &dummy, update_x_time_predicate, NULL );
} }
Q_ASSERT( next_x_time != CurrentTime ); Q_ASSERT( next_x_time != CurrentTime );
time = next_x_time; time = next_x_time;
XEvent ev; // remove the PropertyNotify event from the events queue XEvent ev; // remove the PropertyNotify event from the events queue
XWindowEvent( qt_xdisplay(), w->winId(), PropertyChangeMask, &ev ); XWindowEvent( tqt_xdisplay(), w->winId(), PropertyChangeMask, &ev );
} }
static const char * const description = static const char * const description =

@ -334,7 +334,7 @@ void URLGrabber::writeConfiguration( KConfig *kc )
// digged a little bit in netwm.cpp // digged a little bit in netwm.cpp
bool URLGrabber::isAvoidedWindow() const bool URLGrabber::isAvoidedWindow() const
{ {
Display *d = qt_xdisplay(); Display *d = tqt_xdisplay();
static Atom wm_class = XInternAtom( d, "WM_CLASS", true ); static Atom wm_class = XInternAtom( d, "WM_CLASS", true );
static Atom active_window = XInternAtom( d, "_NET_ACTIVE_WINDOW", true ); static Atom active_window = XInternAtom( d, "_NET_ACTIVE_WINDOW", true );
Atom type_ret; Atom type_ret;

@ -241,7 +241,7 @@ void KonquerorIface::comboCleared( TQCString objId )
bool KonquerorIface::processCanBeReused( int screen ) bool KonquerorIface::processCanBeReused( int screen )
{ {
if( qt_xscreen() != screen ) if( tqt_xscreen() != screen )
return false; // this instance run on different screen, and Qt apps can't migrate return false; // this instance run on different screen, and Qt apps can't migrate
if( KonqMainWindow::isPreloaded()) if( KonqMainWindow::isPreloaded())
return false; // will be handled by preloading related code instead return false; // will be handled by preloading related code instead

@ -232,8 +232,8 @@ static bool startNewKonqueror( TQString url, TQString mimetype, const TQString&
static int currentScreen() static int currentScreen()
{ {
if( qt_xdisplay() != NULL ) if( tqt_xdisplay() != NULL )
return qt_xscreen(); return tqt_xscreen();
// case when there's no KApplication instance // case when there's no KApplication instance
const char* env = getenv( "DISPLAY" ); const char* env = getenv( "DISPLAY" );
if( env == NULL ) if( env == NULL )
@ -286,12 +286,12 @@ void clientApp::sendASNChange()
KStartupInfoData data; KStartupInfoData data;
data.addPid( 0 ); // say there's another process for this ASN with unknown PID data.addPid( 0 ); // say there's another process for this ASN with unknown PID
data.setHostname(); // ( no need to bother to get this konqy's PID ) data.setHostname(); // ( no need to bother to get this konqy's PID )
Display* dpy = qt_xdisplay(); Display* dpy = tqt_xdisplay();
if( dpy == NULL ) // we may be running without TQApplication here if( dpy == NULL ) // we may be running without TQApplication here
dpy = XOpenDisplay( NULL ); dpy = XOpenDisplay( NULL );
if( dpy != NULL ) if( dpy != NULL )
KStartupInfo::sendChangeX( dpy, id, data ); KStartupInfo::sendChangeX( dpy, id, data );
if( dpy != NULL && dpy != qt_xdisplay()) if( dpy != NULL && dpy != tqt_xdisplay())
XCloseDisplay( dpy ); XCloseDisplay( dpy );
} }

@ -133,7 +133,7 @@ extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
{ {
DCOPRef ref( "kded", "konqy_preloader" ); DCOPRef ref( "kded", "konqy_preloader" );
if( !ref.callExt( "registerPreloadedKonqy", DCOPRef::NoEventLoop, 5000, if( !ref.callExt( "registerPreloadedKonqy", DCOPRef::NoEventLoop, 5000,
app.dcopClient()->appId(), qt_xscreen())) app.dcopClient()->appId(), tqt_xscreen()))
return 0; // too many preloaded or failed return 0; // too many preloaded or failed
KonqMainWindow* win = new KonqMainWindow( KURL(), false ); // prepare an empty window too KonqMainWindow* win = new KonqMainWindow( KURL(), false ); // prepare an empty window too
// KonqMainWindow ctor sets always the preloaded flag to false, so create the window before this // KonqMainWindow ctor sets always the preloaded flag to false, so create the window before this

@ -1295,7 +1295,7 @@ void KonqMainWindow::slotCreateNewWindow( const KURL &url, const KParts::URLArgs
Time saved_last_input_time = GET_QT_X_USER_TIME(); Time saved_last_input_time = GET_QT_X_USER_TIME();
if ( windowArgs.lowerWindow ) if ( windowArgs.lowerWindow )
{ {
NETRootInfo wm_info( qt_xdisplay(), NET::Supported ); NETRootInfo wm_info( tqt_xdisplay(), NET::Supported );
wm_usertime_support = wm_info.isSupported( NET::WM2UserTime ); wm_usertime_support = wm_info.isSupported( NET::WM2UserTime );
if( wm_usertime_support ) if( wm_usertime_support )
{ {
@ -5803,28 +5803,28 @@ void KonqMainWindow::resetWindow()
char data[ 1 ]; char data[ 1 ];
// empty append to get current X timestamp // empty append to get current X timestamp
TQWidget tmp_widget; TQWidget tmp_widget;
XChangeProperty( qt_xdisplay(), tmp_widget.winId(), XA_WM_CLASS, XA_STRING, 8, XChangeProperty( tqt_xdisplay(), tmp_widget.winId(), XA_WM_CLASS, XA_STRING, 8,
PropModeAppend, (unsigned char*) &data, 0 ); PropModeAppend, (unsigned char*) &data, 0 );
XEvent ev; XEvent ev;
XWindowEvent( qt_xdisplay(), tmp_widget.winId(), PropertyChangeMask, &ev ); XWindowEvent( tqt_xdisplay(), tmp_widget.winId(), PropertyChangeMask, &ev );
long x_time = ev.xproperty.time; long x_time = ev.xproperty.time;
// bad hack - without updating the _KDE_NET_WM_USER_CREATION_TIME property, // bad hack - without updating the _KDE_NET_WM_USER_CREATION_TIME property,
// KWin will apply don't_steal_focus to this window, and will not make it active // KWin will apply don't_steal_focus to this window, and will not make it active
// (shows mainly with 'konqueror --preload') // (shows mainly with 'konqueror --preload')
static Atom atom = XInternAtom( qt_xdisplay(), "_KDE_NET_WM_USER_CREATION_TIME", False ); static Atom atom = XInternAtom( tqt_xdisplay(), "_KDE_NET_WM_USER_CREATION_TIME", False );
XChangeProperty( qt_xdisplay(), winId(), atom, XA_CARDINAL, 32, XChangeProperty( tqt_xdisplay(), winId(), atom, XA_CARDINAL, 32,
PropModeReplace, (unsigned char *) &x_time, 1); PropModeReplace, (unsigned char *) &x_time, 1);
SET_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 #if !KDE_IS_VERSION( 3, 2, 90 ) // _KDE_NET_USER_TIME is obsolete
static Atom atom2 = XInternAtom( qt_xdisplay(), "_KDE_NET_USER_TIME", False ); static Atom atom2 = XInternAtom( tqt_xdisplay(), "_KDE_NET_USER_TIME", False );
timeval tv; timeval tv;
gettimeofday( &tv, NULL ); gettimeofday( &tv, NULL );
unsigned long now = tv.tv_sec * 10 + tv.tv_usec / 100000; unsigned long now = tv.tv_sec * 10 + tv.tv_usec / 100000;
XChangeProperty(qt_xdisplay(), winId(), atom2, XA_CARDINAL, XChangeProperty(tqt_xdisplay(), winId(), atom2, XA_CARDINAL,
32, PropModeReplace, (unsigned char *)&now, 1); 32, PropModeReplace, (unsigned char *)&now, 1);
#endif #endif
static Atom atom3 = XInternAtom( qt_xdisplay(), "_NET_WM_USER_TIME", False ); static Atom atom3 = XInternAtom( tqt_xdisplay(), "_NET_WM_USER_TIME", False );
XDeleteProperty( qt_xdisplay(), winId(), atom3 ); XDeleteProperty( tqt_xdisplay(), winId(), atom3 );
// Qt remembers the iconic state if the window was withdrawn while on another virtual desktop // Qt remembers the iconic state if the window was withdrawn while on another virtual desktop
clearWState( WState_Minimized ); clearWState( WState_Minimized );
ignoreInitialGeometry(); ignoreInitialGeometry();
@ -5866,7 +5866,7 @@ bool KonqMainWindow::stayPreloaded()
return false; return false;
DCOPRef ref( "kded", "konqy_preloader" ); DCOPRef ref( "kded", "konqy_preloader" );
if( !ref.callExt( "registerPreloadedKonqy", DCOPRef::NoEventLoop, 5000, if( !ref.callExt( "registerPreloadedKonqy", DCOPRef::NoEventLoop, 5000,
kapp->dcopClient()->appId(), qt_xscreen())) kapp->dcopClient()->appId(), tqt_xscreen()))
{ {
return false; return false;
} }

@ -1321,7 +1321,7 @@ static int xkb_init()
int xkb_lmaj = XkbMajorVersion; int xkb_lmaj = XkbMajorVersion;
int xkb_lmin = XkbMinorVersion; int xkb_lmin = XkbMinorVersion;
return XkbLibraryVersion( &xkb_lmaj, &xkb_lmin ) return XkbLibraryVersion( &xkb_lmaj, &xkb_lmin )
&& XkbQueryExtension( qt_xdisplay(), &xkb_opcode, &xkb_event, &xkb_error, && XkbQueryExtension( tqt_xdisplay(), &xkb_opcode, &xkb_event, &xkb_error,
&xkb_lmaj, &xkb_lmin ); &xkb_lmaj, &xkb_lmin );
} }
@ -1355,7 +1355,7 @@ static unsigned int xkb_mask_modifier( XkbDescPtr xkb, const char *name )
static unsigned int xkb_scrolllock_mask() static unsigned int xkb_scrolllock_mask()
{ {
XkbDescPtr xkb; XkbDescPtr xkb;
if(( xkb = XkbGetKeyboard( qt_xdisplay(), XkbAllComponentsMask, XkbUseCoreKbd )) != NULL ) if(( xkb = XkbGetKeyboard( tqt_xdisplay(), XkbAllComponentsMask, XkbUseCoreKbd )) != NULL )
{ {
unsigned int mask = xkb_mask_modifier( xkb, "ScrollLock" ); unsigned int mask = xkb_mask_modifier( xkb, "ScrollLock" );
XkbFreeKeyboard( xkb, 0, True ); XkbFreeKeyboard( xkb, 0, True );
@ -1368,8 +1368,8 @@ static unsigned int xkb_scrolllock_mask()
static unsigned int xkb_scrolllock_mask() static unsigned int xkb_scrolllock_mask()
{ {
int scrolllock_mask = 0; int scrolllock_mask = 0;
XModifierKeymap* map = XGetModifierMapping( qt_xdisplay() ); XModifierKeymap* map = XGetModifierMapping( tqt_xdisplay() );
KeyCode scrolllock_keycode = XKeysymToKeycode( qt_xdisplay(), XK_Scroll_Lock ); KeyCode scrolllock_keycode = XKeysymToKeycode( tqt_xdisplay(), XK_Scroll_Lock );
if( scrolllock_keycode == NoSymbol ) { if( scrolllock_keycode == NoSymbol ) {
XFreeModifiermap(map); XFreeModifiermap(map);
return 0; return 0;
@ -1400,7 +1400,7 @@ static int xkb_set_on()
if( scrolllock_mask == 0 ) if( scrolllock_mask == 0 )
return 0; return 0;
} }
XkbLockModifiers ( qt_xdisplay(), XkbUseCoreKbd, scrolllock_mask, scrolllock_mask); XkbLockModifiers ( tqt_xdisplay(), XkbUseCoreKbd, scrolllock_mask, scrolllock_mask);
return 1; return 1;
} }
@ -1414,7 +1414,7 @@ static int xkb_set_off()
if( scrolllock_mask == 0 ) if( scrolllock_mask == 0 )
return 0; return 0;
} }
XkbLockModifiers ( qt_xdisplay(), XkbUseCoreKbd, scrolllock_mask, 0); XkbLockModifiers ( tqt_xdisplay(), XkbUseCoreKbd, scrolllock_mask, 0);
return 1; return 1;
} }

@ -350,8 +350,8 @@ Konsole::Konsole(const char* name, int histon, bool menubaron, bool tabbaron, bo
// Signal that we want to be transparent to the desktop, not to windows behind us... // Signal that we want to be transparent to the desktop, not to windows behind us...
Atom kde_wm_transparent_to_desktop; Atom kde_wm_transparent_to_desktop;
kde_wm_transparent_to_desktop = XInternAtom(qt_xdisplay(), "_KDE_TRANSPARENT_TO_DESKTOP", False); kde_wm_transparent_to_desktop = XInternAtom(tqt_xdisplay(), "_KDE_TRANSPARENT_TO_DESKTOP", False);
XChangeProperty(qt_xdisplay(), winId(), kde_wm_transparent_to_desktop, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L); XChangeProperty(tqt_xdisplay(), winId(), kde_wm_transparent_to_desktop, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
} }

@ -348,7 +348,7 @@ void Desktop::dropEvent(TQDropEvent *ev)
convertCoordP2S(x,y); convertCoordP2S(x,y);
// kdDebug() << "moving window " << win << "d from " << origdesk << " to " << m_desk << endl; // kdDebug() << "moving window " << win << "d from " << origdesk << " to " << m_desk << endl;
// NETWinInfo NETinfo( qt_xdisplay(), win, qt_xrootwin(), NET::Client | NET::WMDesktop); // NETWinInfo NETinfo( tqt_xdisplay(), win, tqt_xrootwin(), NET::Client | NET::WMDesktop);
if (m_desk==0) if (m_desk==0)
{ {

@ -85,7 +85,7 @@ KPagerMainWindow::KPagerMainWindow(TQWidget *parent, const char *name)
move(xpos,ypos); move(xpos,ypos);
else else
{ {
// NETRootInfo ri( qt_xdisplay(), NET::WorkArea ); // NETRootInfo ri( tqt_xdisplay(), NET::WorkArea );
// NETRect rect=ri.workArea(1); // NETRect rect=ri.workArea(1);
// move(rect.pos.x+rect.size.width-m_pPager->width(), // move(rect.pos.x+rect.size.width-m_pPager->width(),
// rect.pos.y+rect.size.height-m_pPager->height()); // rect.pos.y+rect.size.height-m_pPager->height());
@ -609,10 +609,10 @@ void KPager::clientPopupActivated( int id )
switch ( id ) { switch ( id ) {
case MaximizeOp: case MaximizeOp:
if ( (m_winfo.state() & NET::Max) == 0 ) { if ( (m_winfo.state() & NET::Max) == 0 ) {
NETWinInfo ni( qt_xdisplay(), m_winfo.win(), qt_xrootwin(), 0); NETWinInfo ni( tqt_xdisplay(), m_winfo.win(), tqt_xrootwin(), 0);
ni.setState( NET::Max, NET::Max ); ni.setState( NET::Max, NET::Max );
} else { } else {
NETWinInfo ni( qt_xdisplay(), m_winfo.win(), qt_xrootwin(), 0); NETWinInfo ni( tqt_xdisplay(), m_winfo.win(), tqt_xrootwin(), 0);
ni.setState( 0, NET::Max ); ni.setState( 0, NET::Max );
} }
break; break;
@ -631,7 +631,7 @@ void KPager::clientPopupActivated( int id )
} }
break; break;
case CloseOp: { case CloseOp: {
NETRootInfo ri( qt_xdisplay(), 0 ); NETRootInfo ri( tqt_xdisplay(), 0 );
ri.closeWindowRequest( m_winfo.win() ); ri.closeWindowRequest( m_winfo.win() );
} break; } break;
default: default:

@ -87,7 +87,7 @@ KRootBacking::~KRootBacking()
int KRootBacking::currentDesktop() const int KRootBacking::currentDesktop() const
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETRootInfo rinfo( qt_xdisplay(), NET::CurrentDesktop ); NETRootInfo rinfo( tqt_xdisplay(), NET::CurrentDesktop );
rinfo.activate(); rinfo.activate();
return rinfo.currentDesktop(); return rinfo.currentDesktop();
#endif #endif
@ -180,7 +180,7 @@ bool KRootBacking::isAvailable() const
TQString KRootBacking::pixmapName(int desk) { TQString KRootBacking::pixmapName(int desk) {
TQString pattern = TQString("DESKTOP%1"); TQString pattern = TQString("DESKTOP%1");
#ifdef Q_WS_X11 #ifdef Q_WS_X11
int screen_number = DefaultScreen(qt_xdisplay()); int screen_number = DefaultScreen(tqt_xdisplay());
if (screen_number) { if (screen_number) {
pattern = TQString("SCREEN%1-DESKTOP").arg(screen_number) + "%1"; pattern = TQString("SCREEN%1-DESKTOP").arg(screen_number) + "%1";
} }
@ -201,7 +201,7 @@ void KRootBacking::enableExports()
args << 1; args << 1;
TQCString appname( "kdesktop" ); TQCString appname( "kdesktop" );
int screen_number = DefaultScreen(qt_xdisplay()); int screen_number = DefaultScreen(tqt_xdisplay());
if ( screen_number ) if ( screen_number )
appname.sprintf("kdesktop-screen-%d", screen_number ); appname.sprintf("kdesktop-screen-%d", screen_number );

@ -125,7 +125,7 @@ int main(int argc, char *argv[])
if (args->isSet("root")) if (args->isSet("root"))
{ {
windowId = RootWindow(qt_xdisplay(), qt_xscreen()); windowId = RootWindow(tqt_xdisplay(), tqt_xscreen());
} }
KGlobal::dirs()->addResourceType("scrsav", KGlobal::dirs()->addResourceType("scrsav",
@ -250,10 +250,10 @@ int main(int argc, char *argv[])
// If we end up here then we couldn't start a saver. // If we end up here then we couldn't start a saver.
// If we have been supplied a window id or root window then blank it. // If we have been supplied a window id or root window then blank it.
Window win = windowId ? windowId : RootWindow(qt_xdisplay(), qt_xscreen()); Window win = windowId ? windowId : RootWindow(tqt_xdisplay(), tqt_xscreen());
XSetWindowBackground(qt_xdisplay(), win, XSetWindowBackground(tqt_xdisplay(), win,
BlackPixel(qt_xdisplay(), qt_xscreen())); BlackPixel(tqt_xdisplay(), tqt_xscreen()));
XClearWindow(qt_xdisplay(), win); XClearWindow(tqt_xdisplay(), win);
} }

@ -92,7 +92,7 @@ void KSMServer::performLegacySessionSave()
Atom atoms[ 3 ]; Atom atoms[ 3 ];
const char* const names[] const char* const names[]
= { "WM_SAVE_YOURSELF", "WM_PROTOCOLS", "WM_CLIENT_LEADER" }; = { "WM_SAVE_YOURSELF", "WM_PROTOCOLS", "WM_CLIENT_LEADER" };
XInternAtoms( qt_xdisplay(), const_cast< char** >( names ), 3, XInternAtoms( tqt_xdisplay(), const_cast< char** >( names ), 3,
False, atoms ); False, atoms );
wm_save_yourself = atoms[ 0 ]; wm_save_yourself = atoms[ 0 ];
wm_protocols = atoms[ 1 ]; wm_protocols = atoms[ 1 ];
@ -105,7 +105,7 @@ void KSMServer::performLegacySessionSave()
SMType wtype = SM_WMCOMMAND; SMType wtype = SM_WMCOMMAND;
int nprotocols = 0; int nprotocols = 0;
Atom *protocols = 0; Atom *protocols = 0;
if( XGetWMProtocols(qt_xdisplay(), leader, &protocols, &nprotocols)) { if( XGetWMProtocols(tqt_xdisplay(), leader, &protocols, &nprotocols)) {
for (int i=0; i<nprotocols; i++) for (int i=0; i<nprotocols; i++)
if (protocols[i] == wm_save_yourself) { if (protocols[i] == wm_save_yourself) {
wtype = SM_WMSAVEYOURSELF; wtype = SM_WMSAVEYOURSELF;
@ -116,7 +116,7 @@ void KSMServer::performLegacySessionSave()
SMData data; SMData data;
data.type = wtype; data.type = wtype;
XClassHint classHint; XClassHint classHint;
if( XGetClassHint( qt_xdisplay(), leader, &classHint ) ) { if( XGetClassHint( tqt_xdisplay(), leader, &classHint ) ) {
data.wmclass1 = classHint.res_name; data.wmclass1 = classHint.res_name;
data.wmclass2 = classHint.res_class; data.wmclass2 = classHint.res_class;
XFree( classHint.res_name ); XFree( classHint.res_name );
@ -126,8 +126,8 @@ void KSMServer::performLegacySessionSave()
} }
} }
// Open fresh display for sending WM_SAVE_YOURSELF // Open fresh display for sending WM_SAVE_YOURSELF
XSync(qt_xdisplay(), False); XSync(tqt_xdisplay(), False);
Display *newdisplay = XOpenDisplay(DisplayString(qt_xdisplay())); Display *newdisplay = XOpenDisplay(DisplayString(tqt_xdisplay()));
if (!newdisplay) { if (!newdisplay) {
windowMapPtr = NULL; windowMapPtr = NULL;
XSetErrorHandler(oldHandler); XSetErrorHandler(oldHandler);
@ -194,7 +194,7 @@ void KSMServer::performLegacySessionSave()
XSync(newdisplay, False); XSync(newdisplay, False);
XCloseDisplay(newdisplay); XCloseDisplay(newdisplay);
// Restore old error handler // Restore old error handler
XSync(qt_xdisplay(), False); XSync(tqt_xdisplay(), False);
XSetErrorHandler(oldHandler); XSetErrorHandler(oldHandler);
for (WindowMap::Iterator it = legacyWindows.begin(); it != legacyWindows.end(); ++it) { for (WindowMap::Iterator it = legacyWindows.begin(); it != legacyWindows.end(); ++it) {
if ( (*it).type != SM_ERROR) { if ( (*it).type != SM_ERROR) {
@ -288,7 +288,7 @@ static TQCString getQCStringProperty(WId w, Atom prop)
unsigned long extra = 0; unsigned long extra = 0;
unsigned char *data = 0; unsigned char *data = 0;
TQCString result = ""; TQCString result = "";
status = XGetWindowProperty( qt_xdisplay(), w, prop, 0, 10000, status = XGetWindowProperty( tqt_xdisplay(), w, prop, 0, 10000,
FALSE, XA_STRING, &type, &format, FALSE, XA_STRING, &type, &format,
&nitems, &extra, &data ); &nitems, &extra, &data );
if ( status == Success) { if ( status == Success) {
@ -308,7 +308,7 @@ static TQStringList getQStringListProperty(WId w, Atom prop)
unsigned char *data = 0; unsigned char *data = 0;
TQStringList result; TQStringList result;
status = XGetWindowProperty( qt_xdisplay(), w, prop, 0, 10000, status = XGetWindowProperty( tqt_xdisplay(), w, prop, 0, 10000,
FALSE, XA_STRING, &type, &format, FALSE, XA_STRING, &type, &format,
&nitems, &extra, &data ); &nitems, &extra, &data );
if ( status == Success) { if ( status == Success) {
@ -374,7 +374,7 @@ WId KSMServer::windowWmClientLeader(WId w)
unsigned long extra = 0; unsigned long extra = 0;
unsigned char *data = 0; unsigned char *data = 0;
Window result = w; Window result = w;
status = XGetWindowProperty( qt_xdisplay(), w, wm_client_leader, 0, 10000, status = XGetWindowProperty( tqt_xdisplay(), w, wm_client_leader, 0, 10000,
FALSE, XA_WINDOW, &type, &format, FALSE, XA_WINDOW, &type, &format,
&nitems, &extra, &data ); &nitems, &extra, &data );
if (status == Success ) { if (status == Success ) {
@ -390,11 +390,11 @@ WId KSMServer::windowWmClientLeader(WId w)
Returns sessionId for this client, Returns sessionId for this client,
taken either from its window or from the leader window. taken either from its window or from the leader window.
*/ */
extern Atom qt_sm_client_id; extern Atom tqt_sm_client_id;
TQCString KSMServer::windowSessionId(WId w, WId leader) TQCString KSMServer::windowSessionId(WId w, WId leader)
{ {
TQCString result = getQCStringProperty(w, qt_sm_client_id); TQCString result = getQCStringProperty(w, tqt_sm_client_id);
if (result.isEmpty() && leader != (WId)None && leader != w) if (result.isEmpty() && leader != (WId)None && leader != w)
result = getQCStringProperty(leader, qt_sm_client_id); result = getQCStringProperty(leader, tqt_sm_client_id);
return result; return result;
} }

@ -191,7 +191,7 @@ extern "C" KDE_EXPORT int kdemain( int argc, char* argv[] )
putenv((char*)"SESSION_MANAGER="); putenv((char*)"SESSION_MANAGER=");
KApplication a(KApplication::openX11RGBADisplay(), false); // Disable styles until we need them. KApplication a(KApplication::openX11RGBADisplay(), false); // Disable styles until we need them.
fcntl(ConnectionNumber(qt_xdisplay()), F_SETFD, 1); fcntl(ConnectionNumber(tqt_xdisplay()), F_SETFD, 1);
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
@ -228,7 +228,7 @@ extern "C" KDE_EXPORT int kdemain( int argc, char* argv[] )
KConfig *config = KGlobal::config(); KConfig *config = KGlobal::config();
config->setGroup( "General" ); config->setGroup( "General" );
int realScreenCount = ScreenCount( qt_xdisplay() ); int realScreenCount = ScreenCount( tqt_xdisplay() );
bool screenCountChanged = bool screenCountChanged =
( config->readNumEntry( "screenCount", realScreenCount ) != realScreenCount ); ( config->readNumEntry( "screenCount", realScreenCount ) != realScreenCount );

@ -885,7 +885,7 @@ void KSMServer::storeSession()
config->writeEntry( "count", count ); config->writeEntry( "count", count );
config->setGroup("General"); config->setGroup("General");
config->writeEntry( "screenCount", ScreenCount(qt_xdisplay())); config->writeEntry( "screenCount", ScreenCount(tqt_xdisplay()));
storeLegacySession( config ); storeLegacySession( config );
config->sync(); config->sync();

@ -95,7 +95,7 @@ KSMShutdownFeedback::KSMShutdownFeedback()
else { else {
// The hacks below aren't needed any more because Qt3 supports true transparency for the fading logout screen when composition is available // The hacks below aren't needed any more because Qt3 supports true transparency for the fading logout screen when composition is available
DCOPRef("kicker", "KMenu").call("hideMenu"); // Make sure the K Menu is completely removed from the screen before taking a snapshot... DCOPRef("kicker", "KMenu").call("hideMenu"); // Make sure the K Menu is completely removed from the screen before taking a snapshot...
m_grayImage = TQPixmap(TQPixmap::grabWindow(qt_xrootwin(), 0, 0, TQApplication::desktop()->width(), TQApplication::desktop()->height())).convertToImage(); m_grayImage = TQPixmap(TQPixmap::grabWindow(tqt_xrootwin(), 0, 0, TQApplication::desktop()->width(), TQApplication::desktop()->height())).convertToImage();
} }
m_unfadedImage = m_grayImage; m_unfadedImage = m_grayImage;
resize(0, 0); resize(0, 0);
@ -500,13 +500,13 @@ void KSMShutdownFeedback::slotPaintEffect()
if ( m_currentY == 0 ) { if ( m_currentY == 0 ) {
KPixmap pixmap; KPixmap pixmap;
pixmap = TQPixmap(TQPixmap::grabWindow( qt_xrootwin(), 0, 0, width(), height() )); pixmap = TQPixmap(TQPixmap::grabWindow( tqt_xrootwin(), 0, 0, width(), height() ));
bitBlt( this, 0, 0, &pixmap ); bitBlt( this, 0, 0, &pixmap );
bitBlt( &m_root, 0, 0, &pixmap ); bitBlt( &m_root, 0, 0, &pixmap );
} }
KPixmap pixmap; KPixmap pixmap;
pixmap = TQPixmap(TQPixmap::grabWindow( qt_xrootwin(), 0, m_currentY, width(), 10 )); pixmap = TQPixmap(TQPixmap::grabWindow( tqt_xrootwin(), 0, m_currentY, width(), 10 ));
TQImage image = pixmap.convertToImage(); TQImage image = pixmap.convertToImage();
KImageEffect::blend( Qt::black, image, 0.4 ); KImageEffect::blend( Qt::black, image, 0.4 );
KImageEffect::toGray( image, true ); KImageEffect::toGray( image, true );

@ -467,13 +467,13 @@ void KSMServer::upAndRunning( const TQString& msg )
DCOPRef( "ksplash" ).send( "upAndRunning", msg ); DCOPRef( "ksplash" ).send( "upAndRunning", msg );
XEvent e; XEvent e;
e.xclient.type = ClientMessage; e.xclient.type = ClientMessage;
e.xclient.message_type = XInternAtom( qt_xdisplay(), "_KDE_SPLASH_PROGRESS", False ); e.xclient.message_type = XInternAtom( tqt_xdisplay(), "_KDE_SPLASH_PROGRESS", False );
e.xclient.display = qt_xdisplay(); e.xclient.display = tqt_xdisplay();
e.xclient.window = qt_xrootwin(); e.xclient.window = tqt_xrootwin();
e.xclient.format = 8; e.xclient.format = 8;
assert( strlen( msg.latin1()) < 20 ); assert( strlen( msg.latin1()) < 20 );
strcpy( e.xclient.data.b, msg.latin1()); strcpy( e.xclient.data.b, msg.latin1());
XSendEvent( qt_xdisplay(), qt_xrootwin(), False, SubstructureNotifyMask, &e ); XSendEvent( tqt_xdisplay(), tqt_xrootwin(), False, SubstructureNotifyMask, &e );
} }
// these two are in the DCOP interface but I have no idea what uses them // these two are in the DCOP interface but I have no idea what uses them

@ -48,9 +48,9 @@ ThemeEngine::ThemeEngine( TQWidget *, const char *, const TQStringList& args )
kapp->installEventFilter( this ); kapp->installEventFilter( this );
(void)kapp->desktop(); (void)kapp->desktop();
XWindowAttributes rootAttr; XWindowAttributes rootAttr;
XGetWindowAttributes(qt_xdisplay(), RootWindow(qt_xdisplay(), XGetWindowAttributes(tqt_xdisplay(), RootWindow(tqt_xdisplay(),
qt_xscreen()), &rootAttr); tqt_xscreen()), &rootAttr);
XSelectInput( qt_xdisplay(), qt_xrootwin(), XSelectInput( tqt_xdisplay(), tqt_xrootwin(),
SubstructureNotifyMask | rootAttr.your_event_mask ); SubstructureNotifyMask | rootAttr.your_event_mask );
if (args.isEmpty()) if (args.isEmpty())
mTheme = new ObjKsTheme( "Default" ); mTheme = new ObjKsTheme( "Default" );
@ -98,7 +98,7 @@ void ThemeEngine::addSplashWindow( TQWidget* w )
static_cast< HackWidget* >( w )->setWFlags( WX11BypassWM ); static_cast< HackWidget* >( w )->setWFlags( WX11BypassWM );
XSetWindowAttributes attrs; XSetWindowAttributes attrs;
attrs.override_redirect = True; attrs.override_redirect = True;
XChangeWindowAttributes( qt_xdisplay(), w->winId(), CWOverrideRedirect, &attrs ); XChangeWindowAttributes( tqt_xdisplay(), w->winId(), CWOverrideRedirect, &attrs );
} }
d->mSplashWindows.prepend( w->winId()); d->mSplashWindows.prepend( w->winId());
connect( w, TQT_SIGNAL( destroyed( TQObject* )), TQT_SLOT( splashWindowDestroyed( TQObject* ))); connect( w, TQT_SIGNAL( destroyed( TQObject* )), TQT_SLOT( splashWindowDestroyed( TQObject* )));
@ -114,9 +114,9 @@ bool ThemeEngine::x11Event( XEvent* e )
{ {
if( e->type != ConfigureNotify && e->type != MapNotify ) if( e->type != ConfigureNotify && e->type != MapNotify )
return false; return false;
if( e->type == ConfigureNotify && e->xconfigure.event != qt_xrootwin()) if( e->type == ConfigureNotify && e->xconfigure.event != tqt_xrootwin())
return false; return false;
if( e->type == MapNotify && e->xmap.event != qt_xrootwin()) if( e->type == MapNotify && e->xmap.event != tqt_xrootwin())
return false; return false;
if( d->mSplashWindows.count() == 0 ) if( d->mSplashWindows.count() == 0 )
return false; return false;
@ -125,7 +125,7 @@ bool ThemeEngine::x11Event( XEvent* e )
// all restacking operations will be no-op, // all restacking operations will be no-op,
// and no ConfigureNotify will be generated, // and no ConfigureNotify will be generated,
// thus avoiding possible infinite loops // thus avoiding possible infinite loops
XRaiseWindow( qt_xdisplay(), d->mSplashWindows.first()); // raise topmost XRaiseWindow( tqt_xdisplay(), d->mSplashWindows.first()); // raise topmost
// and stack others below it // and stack others below it
Window* stack = new Window[ d->mSplashWindows.count() ]; Window* stack = new Window[ d->mSplashWindows.count() ];
int count = 0; int count = 0;

@ -48,7 +48,7 @@ static KWinModule* twinmodule;
KStart::KStart() KStart::KStart()
:TQObject() :TQObject()
{ {
NETRootInfo i( qt_xdisplay(), NET::Supported ); NETRootInfo i( tqt_xdisplay(), NET::Supported );
bool useRule = !toSysTray && i.isSupported( NET::WM2KDETemporaryRules ); bool useRule = !toSysTray && i.isSupported( NET::WM2KDETemporaryRules );
if( useRule ) if( useRule )
@ -151,7 +151,7 @@ void KStart::windowAdded(WId w){
} }
if ( windowclass != 0 ) { if ( windowclass != 0 ) {
XClassHint hint; XClassHint hint;
if( !XGetClassHint( qt_xdisplay(), w, &hint )) if( !XGetClassHint( tqt_xdisplay(), w, &hint ))
return; return;
TQCString cls = windowclass.contains( ' ' ) TQCString cls = windowclass.contains( ' ' )
? TQCString( hint.res_name ) + ' ' + hint.res_class : TQCString( hint.res_class ); ? TQCString( hint.res_name ) + ' ' + hint.res_class : TQCString( hint.res_class );
@ -173,14 +173,14 @@ void KStart::windowAdded(WId w){
} }
extern Atom qt_wm_state; // defined in qapplication_x11.cpp extern Atom tqt_wm_state; // defined in qapplication_x11.cpp
static bool wstate_withdrawn( WId winid ) static bool wstate_withdrawn( WId winid )
{ {
Atom type; Atom type;
int format; int format;
unsigned long length, after; unsigned long length, after;
unsigned char *data; unsigned char *data;
int r = XGetWindowProperty( qt_xdisplay(), winid, qt_wm_state, 0, 2, int r = XGetWindowProperty( tqt_xdisplay(), winid, tqt_wm_state, 0, 2,
FALSE, AnyPropertyType, &type, &format, FALSE, AnyPropertyType, &type, &format,
&length, &after, &data ); &length, &after, &data );
bool withdrawn = TRUE; bool withdrawn = TRUE;
@ -197,25 +197,25 @@ void KStart::applyStyle(WId w ) {
if ( toSysTray || state || iconify || windowtype != NET::Unknown || desktop >= 1 ) { if ( toSysTray || state || iconify || windowtype != NET::Unknown || desktop >= 1 ) {
XWithdrawWindow(qt_xdisplay(), w, qt_xscreen()); XWithdrawWindow(tqt_xdisplay(), w, tqt_xscreen());
TQApplication::flushX(); TQApplication::flushX();
while ( !wstate_withdrawn(w) ) while ( !wstate_withdrawn(w) )
; ;
} }
NETWinInfo info( qt_xdisplay(), w, qt_xrootwin(), NET::WMState ); NETWinInfo info( tqt_xdisplay(), w, tqt_xrootwin(), NET::WMState );
if ( ( desktop > 0 && desktop <= twinmodule->numberOfDesktops() ) if ( ( desktop > 0 && desktop <= twinmodule->numberOfDesktops() )
|| desktop == NETWinInfo::OnAllDesktops ) || desktop == NETWinInfo::OnAllDesktops )
info.setDesktop( desktop ); info.setDesktop( desktop );
if (iconify) { if (iconify) {
XWMHints * hints = XGetWMHints(qt_xdisplay(), w ); XWMHints * hints = XGetWMHints(tqt_xdisplay(), w );
if (hints ) { if (hints ) {
hints->flags |= StateHint; hints->flags |= StateHint;
hints->initial_state = IconicState; hints->initial_state = IconicState;
XSetWMHints( qt_xdisplay(), w, hints ); XSetWMHints( tqt_xdisplay(), w, hints );
XFree(hints); XFree(hints);
} }
} }
@ -229,19 +229,19 @@ void KStart::applyStyle(WId w ) {
if ( toSysTray ) { if ( toSysTray ) {
TQApplication::beep(); TQApplication::beep();
KWin::setSystemTrayWindowFor( w, qt_xrootwin() ); KWin::setSystemTrayWindowFor( w, tqt_xrootwin() );
} }
if ( fullscreen ) { if ( fullscreen ) {
TQRect r = TQApplication::desktop()->geometry(); TQRect r = TQApplication::desktop()->geometry();
XMoveResizeWindow( qt_xdisplay(), w, r.x(), r.y(), r.width(), r.height() ); XMoveResizeWindow( tqt_xdisplay(), w, r.x(), r.y(), r.width(), r.height() );
} }
XSync(qt_xdisplay(), False); XSync(tqt_xdisplay(), False);
XMapWindow(qt_xdisplay(), w ); XMapWindow(tqt_xdisplay(), w );
XSync(qt_xdisplay(), False); XSync(tqt_xdisplay(), False);
if (activate) if (activate)
KWin::forceActiveWindow( w ); KWin::forceActiveWindow( w );
@ -385,7 +385,7 @@ int main( int argc, char *argv[] )
iconify = args->isSet("iconify"); iconify = args->isSet("iconify");
toSysTray = args->isSet("tosystray"); toSysTray = args->isSet("tosystray");
if ( args->isSet("fullscreen") ) { if ( args->isSet("fullscreen") ) {
NETRootInfo i( qt_xdisplay(), NET::Supported ); NETRootInfo i( tqt_xdisplay(), NET::Supported );
if( i.isSupported( NET::FullScreen )) { if( i.isSupported( NET::FullScreen )) {
state |= NET::FullScreen; state |= NET::FullScreen;
mask |= NET::FullScreen; mask |= NET::FullScreen;
@ -395,7 +395,7 @@ int main( int argc, char *argv[] )
} }
} }
fcntl(ConnectionNumber(qt_xdisplay()), F_SETFD, 1); fcntl(ConnectionNumber(tqt_xdisplay()), F_SETFD, 1);
args->clear(); args->clear();
KStart start; KStart start;

@ -81,9 +81,9 @@ void KSysTrayCmd::showWindow()
isVisible = true; isVisible = true;
if ( !win ) if ( !win )
return; return;
XMapWindow( qt_xdisplay(), win ); XMapWindow( tqt_xdisplay(), win );
// We move the window to the memorized position // We move the window to the memorized position
XMoveWindow( qt_xdisplay(), win, left, top); XMoveWindow( tqt_xdisplay(), win, left, top);
// Window always on top // Window always on top
if (onTop) if (onTop)
@ -104,7 +104,7 @@ void KSysTrayCmd::hideWindow()
left = KWin::windowInfo(win).frameGeometry().left(); left = KWin::windowInfo(win).frameGeometry().left();
top=KWin::windowInfo(win).frameGeometry().top(); top=KWin::windowInfo(win).frameGeometry().top();
XUnmapWindow( qt_xdisplay(), win ); XUnmapWindow( tqt_xdisplay(), win );
} }
void KSysTrayCmd::setTargetWindow( WId w ) void KSysTrayCmd::setTargetWindow( WId w )
@ -202,8 +202,8 @@ void KSysTrayCmd::quitClient()
{ {
if ( win ) { if ( win ) {
// Before sending the close request we have to show the window // Before sending the close request we have to show the window
XMapWindow( qt_xdisplay(), win ); XMapWindow( tqt_xdisplay(), win );
NETRootInfo ri( qt_xdisplay(), NET::CloseWindow ); NETRootInfo ri( tqt_xdisplay(), NET::CloseWindow );
ri.closeWindowRequest( win ); ri.closeWindowRequest( win );
win=0; win=0;
noquit = false; noquit = false;
@ -251,7 +251,7 @@ void KSysTrayCmd::execContextMenu( const TQPoint &pos )
} }
else if ( quitOnHide && ( hasRunningClient() ) && isVisible ) else if ( quitOnHide && ( hasRunningClient() ) && isVisible )
{ {
NETRootInfo ri( qt_xdisplay(), NET::CloseWindow ); NETRootInfo ri( tqt_xdisplay(), NET::CloseWindow );
ri.closeWindowRequest( win ); ri.closeWindowRequest( win );
isVisible=false; isVisible=false;
} }
@ -301,7 +301,7 @@ void KSysTrayCmd::mousePressEvent( TQMouseEvent *e )
} }
else if ( quitOnHide && ( hasRunningClient() ) && isVisible ) else if ( quitOnHide && ( hasRunningClient() ) && isVisible )
{ {
NETRootInfo ri( qt_xdisplay(), NET::CloseWindow ); NETRootInfo ri( tqt_xdisplay(), NET::CloseWindow );
ri.closeWindowRequest( win ); ri.closeWindowRequest( win );
isVisible=false; isVisible=false;
} }
@ -313,12 +313,12 @@ WId KSysTrayCmd::findRealWindow( WId w, int depth )
{ {
if( depth > 5 ) if( depth > 5 )
return None; return None;
static Atom wm_state = XInternAtom( qt_xdisplay(), "WM_STATE", False ); static Atom wm_state = XInternAtom( tqt_xdisplay(), "WM_STATE", False );
Atom type; Atom type;
int format; int format;
unsigned long nitems, after; unsigned long nitems, after;
unsigned char* prop; unsigned char* prop;
if( XGetWindowProperty( qt_xdisplay(), w, wm_state, 0, 0, False, AnyPropertyType, if( XGetWindowProperty( tqt_xdisplay(), w, wm_state, 0, 0, False, AnyPropertyType,
&type, &format, &nitems, &after, &prop ) == Success ) { &type, &format, &nitems, &after, &prop ) == Success ) {
if( prop != NULL ) if( prop != NULL )
XFree( prop ); XFree( prop );
@ -329,7 +329,7 @@ WId KSysTrayCmd::findRealWindow( WId w, int depth )
Window* children; Window* children;
unsigned int nchildren; unsigned int nchildren;
Window ret = None; Window ret = None;
if( XQueryTree( qt_xdisplay(), w, &root, &parent, &children, &nchildren ) != 0 ) { if( XQueryTree( tqt_xdisplay(), w, &root, &parent, &children, &nchildren ) != 0 ) {
for( unsigned int i = 0; for( unsigned int i = 0;
i < nchildren && ret == None; i < nchildren && ret == None;
++i ) ++i )

@ -135,7 +135,7 @@ int main( int argc, char *argv[] )
return 1; return 1;
} }
fcntl(ConnectionNumber(qt_xdisplay()), F_SETFD, 1); fcntl(ConnectionNumber(tqt_xdisplay()), F_SETFD, 1);
args->clear(); args->clear();
return app.exec(); return app.exec();

@ -38,7 +38,7 @@ TQString XKBExtension::getPrecompiledLayoutFilename(const TQString& layoutKey)
XKBExtension::XKBExtension(Display *d) XKBExtension::XKBExtension(Display *d)
{ {
if ( d == NULL ) if ( d == NULL )
d = qt_xdisplay(); d = tqt_xdisplay();
m_dpy = d; m_dpy = d;
// TQStringList dirs = KGlobal::dirs()->findDirs ( "tmp", "" ); // TQStringList dirs = KGlobal::dirs()->findDirs ( "tmp", "" );

@ -274,7 +274,7 @@ DEALINGS IN THE SOFTWARE.
#if defined(HAVE_XTEST) || defined(HAVE_XKB) #if defined(HAVE_XTEST) || defined(HAVE_XKB)
Display* dpy = qt_xdisplay(); Display* dpy = tqt_xdisplay();
/* the XKB stuff is based on code created by Oswald Buddenhagen <ossi@kde.org> */ /* the XKB stuff is based on code created by Oswald Buddenhagen <ossi@kde.org> */
#ifdef HAVE_XKB #ifdef HAVE_XKB
@ -487,7 +487,7 @@ void numlockx_change_numlock_state( bool ) {} // dummy
#include <X11/extensions/xf86misc.h> #include <X11/extensions/xf86misc.h>
void set_repeatrate(int delay, double rate) void set_repeatrate(int delay, double rate)
{ {
Display* dpy = qt_xdisplay(); Display* dpy = tqt_xdisplay();
XF86MiscKbdSettings values; XF86MiscKbdSettings values;
XF86MiscGetKbdSettings(dpy, &values); XF86MiscGetKbdSettings(dpy, &values);
@ -500,7 +500,7 @@ void set_repeatrate(int delay, double rate)
void set_repeatrate(int delay, double rate) void set_repeatrate(int delay, double rate)
{ {
#if HAVE_XKB #if HAVE_XKB
Display* dpy = qt_xdisplay(); Display* dpy = tqt_xdisplay();
int xkbmajor = XkbMajorVersion, xkbminor = XkbMinorVersion; int xkbmajor = XkbMajorVersion, xkbminor = XkbMinorVersion;
int xkbopcode, xkbevent, xkberror; int xkbopcode, xkbevent, xkberror;

@ -42,7 +42,7 @@ void LayoutMap::setCurrentWindow(WId winId)
{ {
m_currentWinId = winId; m_currentWinId = winId;
if( m_kxkbConfig.m_switchingPolicy == SWITCH_POLICY_WIN_CLASS ) if( m_kxkbConfig.m_switchingPolicy == SWITCH_POLICY_WIN_CLASS )
m_currentWinClass = X11Helper::getWindowClass(winId, qt_xdisplay()); m_currentWinClass = X11Helper::getWindowClass(winId, tqt_xdisplay());
} }
// private // private
@ -54,7 +54,7 @@ TQPtrQueue<LayoutState>& LayoutMap::getCurrentLayoutQueueInternal(WId winId)
switch( m_kxkbConfig.m_switchingPolicy ) { switch( m_kxkbConfig.m_switchingPolicy ) {
case SWITCH_POLICY_WIN_CLASS: { case SWITCH_POLICY_WIN_CLASS: {
// TQString winClass = X11Helper::getWindowClass(winId, qt_xdisplay()); // TQString winClass = X11Helper::getWindowClass(winId, tqt_xdisplay());
return m_appLayouts[ m_currentWinClass ]; return m_appLayouts[ m_currentWinClass ];
} }
case SWITCH_POLICY_WINDOW: case SWITCH_POLICY_WINDOW:

@ -26,7 +26,7 @@ XkbRules::XkbRules(bool layoutsOnly):
return; return;
} }
TQString rulesFile = X11Helper::findXkbRulesFile(X11_DIR, qt_xdisplay()); TQString rulesFile = X11Helper::findXkbRulesFile(X11_DIR, tqt_xdisplay());
if( rulesFile.isEmpty() ) { if( rulesFile.isEmpty() ) {
kdError() << "Cannot find rules file in " << X11_DIR << endl; kdError() << "Cannot find rules file in " << X11_DIR << endl;

@ -351,7 +351,7 @@ void KonqOperations::doDrop( const KFileItem * destItem, const KURL & dest, TQDr
Window child; Window child;
int root_x, root_y, win_x, win_y; int root_x, root_y, win_x, win_y;
uint keybstate; uint keybstate;
XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child, XQueryPointer( tqt_xdisplay(), tqt_xrootwin(), &root, &child,
&root_x, &root_y, &win_x, &win_y, &keybstate ); &root_x, &root_y, &win_x, &win_y, &keybstate );
TQDropEvent::Action action = ev->action(); TQDropEvent::Action action = ev->action();

@ -74,7 +74,7 @@ const int XKeyRelease = KeyRelease;
#undef KeyPress #undef KeyPress
#undef KeyRelease #undef KeyRelease
extern Atom qt_wm_state; extern Atom tqt_wm_state;
//#define HAVE_MOTIF //#define HAVE_MOTIF
#ifdef HAVE_MOTIF #ifdef HAVE_MOTIF
@ -145,13 +145,13 @@ void reparentChildrenOf(TQWidget* parent)
for ( TQObjectListIt it( *parent->children() ); it.current(); ++it ) { for ( TQObjectListIt it( *parent->children() ); it.current(); ++it ) {
if ( it.current()->isWidgetType() ) { if ( it.current()->isWidgetType() ) {
TQWidget* widget = (TQWidget*)it.current(); TQWidget* widget = (TQWidget*)it.current();
XReparentWindow( qt_xdisplay(), XReparentWindow( tqt_xdisplay(),
widget->winId(), widget->winId(),
parent->winId(), parent->winId(),
widget->x(), widget->x(),
widget->y() ); widget->y() );
if ( widget->isVisible() ) if ( widget->isVisible() )
XMapWindow( qt_xdisplay(), widget->winId() ); XMapWindow( tqt_xdisplay(), widget->winId() );
} }
} }
@ -170,7 +170,7 @@ void qwidget_realize(
reparentChildrenOf(qxtw); reparentChildrenOf(qxtw);
} }
qxtw->show(); qxtw->show();
XMapWindow( qt_xdisplay(), qxtw->winId() ); XMapWindow( tqt_xdisplay(), qxtw->winId() );
} }
static static
@ -232,7 +232,7 @@ void installXtEventFilters()
// Get Xt out of our face - install filter on every event type // Get Xt out of our face - install filter on every event type
for (int et=2; et < LASTEvent; et++) { for (int et=2; et < LASTEvent; et++) {
qt_np_cascade_event_handler[et] = XtSetEventDispatcher( qt_np_cascade_event_handler[et] = XtSetEventDispatcher(
qt_xdisplay(), et, qt_event_handler_wrapper ); tqt_xdisplay(), et, qt_event_handler_wrapper );
} }
filters_installed = TRUE; filters_installed = TRUE;
} }
@ -244,7 +244,7 @@ void removeXtEventFilters()
// We aren't needed any more... slink back into the shadows. // We aren't needed any more... slink back into the shadows.
for (int et=2; et < LASTEvent; et++) { for (int et=2; et < LASTEvent; et++) {
XtSetEventDispatcher( XtSetEventDispatcher(
qt_xdisplay(), et, qt_np_cascade_event_handler[et] ); tqt_xdisplay(), et, qt_np_cascade_event_handler[et] );
} }
filters_installed = FALSE; filters_installed = FALSE;
} }
@ -321,7 +321,7 @@ KXtApplication::KXtApplication(int& argc, char** argv,
XtToolkitInitialize(); XtToolkitInitialize();
appcon = XtCreateApplicationContext(); appcon = XtCreateApplicationContext();
if (resources) XtAppSetFallbackResources(appcon, (char**)resources); if (resources) XtAppSetFallbackResources(appcon, (char**)resources);
XtDisplayInitialize(appcon, qt_xdisplay(), name(), rAppName, options, XtDisplayInitialize(appcon, tqt_xdisplay(), name(), rAppName, options,
num_options, &argc, argv); num_options, &argc, argv);
init(); init();
} }
@ -403,8 +403,8 @@ void KXtWidget::init(const char* name, WidgetClass widget_class,
Q_ASSERT(!managed); Q_ASSERT(!managed);
String n, c; String n, c;
XtGetApplicationNameAndClass(qt_xdisplay(), &n, &c); XtGetApplicationNameAndClass(tqt_xdisplay(), &n, &c);
xtw = XtAppCreateShell(n, c, widget_class, qt_xdisplay(), xtw = XtAppCreateShell(n, c, widget_class, tqt_xdisplay(),
args, num_args); args, num_args);
if ( widget_class == qWidgetClass ) if ( widget_class == qWidgetClass )
((QWidgetRec*)xtw)->qwidget.qxtwidget = this; ((QWidgetRec*)xtw)->qwidget.qxtwidget = this;
@ -414,8 +414,8 @@ void KXtWidget::init(const char* name, WidgetClass widget_class,
XtResizeWidget( xtw, 100, 100, 0 ); XtResizeWidget( xtw, 100, 100, 0 );
XtSetMappedWhenManaged(xtw, False); XtSetMappedWhenManaged(xtw, False);
XtRealizeWidget(xtw); XtRealizeWidget(xtw);
XSync(qt_xdisplay(), False); // I want all windows to be created now XSync(tqt_xdisplay(), False); // I want all windows to be created now
XReparentWindow(qt_xdisplay(), XtWindow(xtw), qparent->winId(), x(), y()); XReparentWindow(tqt_xdisplay(), XtWindow(xtw), qparent->winId(), x(), y());
XtSetMappedWhenManaged(xtw, True); XtSetMappedWhenManaged(xtw, True);
need_reroot=TRUE; need_reroot=TRUE;
} }
@ -505,7 +505,7 @@ KXtWidget::~KXtWidget()
if ( need_reroot ) { if ( need_reroot ) {
hide(); hide();
XReparentWindow(qt_xdisplay(), winId(), tqApp->desktop()->winId(), XReparentWindow(tqt_xdisplay(), winId(), tqApp->desktop()->winId(),
x(), y()); x(), y());
} }
@ -546,7 +546,7 @@ void KXtWidget::setActiveWindow()
e.window = winId(); e.window = winId();
e.mode = NotifyNormal; e.mode = NotifyNormal;
e.detail = NotifyInferior; e.detail = NotifyInferior;
XSendEvent( qt_xdisplay(), e.window, TRUE, NoEventMask, (XEvent*)&e ); XSendEvent( tqt_xdisplay(), e.window, TRUE, NoEventMask, (XEvent*)&e );
} }
} else { } else {
TQWidget::setActiveWindow(); TQWidget::setActiveWindow();
@ -560,7 +560,7 @@ bool KXtWidget::isActiveWindow() const
{ {
Window win; Window win;
int revert; int revert;
XGetInputFocus( qt_xdisplay(), &win, &revert ); XGetInputFocus( tqt_xdisplay(), &win, &revert );
if ( win == None) return FALSE; if ( win == None) return FALSE;
@ -574,7 +574,7 @@ bool KXtWidget::isActiveWindow() const
Window cursor = winId(); Window cursor = winId();
Window *ch; Window *ch;
unsigned int nch; unsigned int nch;
while ( XQueryTree(qt_xdisplay(), cursor, &root, &parent, &ch, &nch) ) { while ( XQueryTree(tqt_xdisplay(), cursor, &root, &parent, &ch, &nch) ) {
if (ch) XFree( (char*)ch); if (ch) XFree( (char*)ch);
if ( parent == win ) return TRUE; if ( parent == win ) return TRUE;
if ( parent == root ) return FALSE; if ( parent == root ) return FALSE;
@ -599,7 +599,7 @@ void KXtWidget::moveEvent( TQMoveEvent* )
c.width = width(); c.width = width();
c.height = height(); c.height = height();
c.border_width = 0; c.border_width = 0;
XSendEvent( qt_xdisplay(), c.event, TRUE, NoEventMask, (XEvent*)&c ); XSendEvent( tqt_xdisplay(), c.event, TRUE, NoEventMask, (XEvent*)&c );
XtMoveWidget( xtw, x(), y() ); XtMoveWidget( xtw, x(), y() );
} }
@ -620,7 +620,7 @@ void KXtWidget::resizeEvent( TQResizeEvent* )
c.width = width(); c.width = width();
c.height = height(); c.height = height();
c.border_width = 0; c.border_width = 0;
XSendEvent( qt_xdisplay(), c.event, TRUE, NoEventMask, (XEvent*)&c ); XSendEvent( tqt_xdisplay(), c.event, TRUE, NoEventMask, (XEvent*)&c );
XtResizeWidget( xtw, width(), height(), preferred.border_width ); XtResizeWidget( xtw, width(), height(), preferred.border_width );
} }

@ -164,10 +164,10 @@ NPError g_NPN_GetValue(NPP /*instance*/, NPNVariable variable, void *value)
switch (variable) switch (variable)
{ {
case NPNVxDisplay: case NPNVxDisplay:
*(void**)value = qt_xdisplay(); *(void**)value = tqt_xdisplay();
return NPERR_NO_ERROR; return NPERR_NO_ERROR;
case NPNVxtAppContext: case NPNVxtAppContext:
*(void**)value = XtDisplayToApplicationContext(qt_xdisplay()); *(void**)value = XtDisplayToApplicationContext(tqt_xdisplay());
return NPERR_NO_ERROR; return NPERR_NO_ERROR;
case NPNVjavascriptEnabledBool: case NPNVjavascriptEnabledBool:
*(bool*)value = true; *(bool*)value = true;
@ -638,10 +638,10 @@ NSPluginInstance::NSPluginInstance(NPP privateData, NPPluginFuncs *pluginFuncs,
XtSetArg(args[nargs], XtNborderWidth, 0); nargs++; XtSetArg(args[nargs], XtNborderWidth, 0); nargs++;
String n, c; String n, c;
XtGetApplicationNameAndClass(qt_xdisplay(), &n, &c); XtGetApplicationNameAndClass(tqt_xdisplay(), &n, &c);
_toplevel = XtAppCreateShell("drawingArea", c, applicationShellWidgetClass, _toplevel = XtAppCreateShell("drawingArea", c, applicationShellWidgetClass,
qt_xdisplay(), args, nargs); tqt_xdisplay(), args, nargs);
// What exactly does widget mapping mean? Without this call the widget isn't // What exactly does widget mapping mean? Without this call the widget isn't
// embedded correctly. With it the viewer doesn't show anything in standalone mode. // embedded correctly. With it the viewer doesn't show anything in standalone mode.
@ -655,13 +655,13 @@ NSPluginInstance::NSPluginInstance(NPP privateData, NPPluginFuncs *pluginFuncs,
XtSetArg(args[nargs], XtNdepth, TQPaintDevice::x11AppDepth()); nargs++; XtSetArg(args[nargs], XtNdepth, TQPaintDevice::x11AppDepth()); nargs++;
XtSetArg(args[nargs], XtNcolormap, TQPaintDevice::x11AppColormap()); nargs++; XtSetArg(args[nargs], XtNcolormap, TQPaintDevice::x11AppColormap()); nargs++;
XtSetValues(_form, args, nargs); XtSetValues(_form, args, nargs);
XSync(qt_xdisplay(), false); XSync(tqt_xdisplay(), false);
// From mozilla - not sure if it's needed yet, nor what to use for embedder // From mozilla - not sure if it's needed yet, nor what to use for embedder
#if 0 #if 0
/* this little trick seems to finish initializing the widget */ /* this little trick seems to finish initializing the widget */
#if XlibSpecificationRelease >= 6 #if XlibSpecificationRelease >= 6
XtRegisterDrawable(qt_xdisplay(), embedderid, _toplevel); XtRegisterDrawable(tqt_xdisplay(), embedderid, _toplevel);
#else #else
_XtRegisterWindow(embedderid, _toplevel); _XtRegisterWindow(embedderid, _toplevel);
#endif #endif
@ -674,7 +674,7 @@ NSPluginInstance::NSPluginInstance(NPP privateData, NPPluginFuncs *pluginFuncs,
False, forwarder, (XtPointer)this ); False, forwarder, (XtPointer)this );
XtAddEventHandler(_form, (KeyPressMask|KeyReleaseMask), XtAddEventHandler(_form, (KeyPressMask|KeyReleaseMask),
False, forwarder, (XtPointer)this ); False, forwarder, (XtPointer)this );
XSync(qt_xdisplay(), false); XSync(tqt_xdisplay(), false);
} }
} }
@ -942,10 +942,10 @@ int NSPluginInstance::setWindow(TQ_INT8 remove)
if( _xembed_window ) { if( _xembed_window ) {
_win.window = (void*) _xembed_window; _win.window = (void*) _xembed_window;
_win_info.type = NP_SETWINDOW; _win_info.type = NP_SETWINDOW;
_win_info.display = qt_xdisplay(); _win_info.display = tqt_xdisplay();
_win_info.visual = DefaultVisualOfScreen(DefaultScreenOfDisplay(qt_xdisplay())); _win_info.visual = DefaultVisualOfScreen(DefaultScreenOfDisplay(tqt_xdisplay()));
_win_info.colormap = DefaultColormapOfScreen(DefaultScreenOfDisplay(qt_xdisplay())); _win_info.colormap = DefaultColormapOfScreen(DefaultScreenOfDisplay(tqt_xdisplay()));
_win_info.depth = DefaultDepthOfScreen(DefaultScreenOfDisplay(qt_xdisplay())); _win_info.depth = DefaultDepthOfScreen(DefaultScreenOfDisplay(tqt_xdisplay()));
} else { } else {
_win.window = (void*) XtWindow(_form); _win.window = (void*) XtWindow(_form);
@ -971,9 +971,9 @@ static void resizeWidgets(Window w, int width, int height) {
Window rroot, parent, *children; Window rroot, parent, *children;
unsigned int nchildren = 0; unsigned int nchildren = 0;
if (XQueryTree(qt_xdisplay(), w, &rroot, &parent, &children, &nchildren)) { if (XQueryTree(tqt_xdisplay(), w, &rroot, &parent, &children, &nchildren)) {
for (unsigned int i = 0; i < nchildren; i++) { for (unsigned int i = 0; i < nchildren; i++) {
XResizeWindow(qt_xdisplay(), children[i], width, height); XResizeWindow(tqt_xdisplay(), children[i], width, height);
} }
XFree(children); XFree(children);
} }
@ -991,8 +991,8 @@ void NSPluginInstance::resizePlugin(TQ_INT32 w, TQ_INT32 h)
_height = h; _height = h;
if( _form != 0 ) { if( _form != 0 ) {
XResizeWindow(qt_xdisplay(), XtWindow(_form), w, h); XResizeWindow(tqt_xdisplay(), XtWindow(_form), w, h);
XResizeWindow(qt_xdisplay(), XtWindow(_toplevel), w, h); XResizeWindow(tqt_xdisplay(), XtWindow(_toplevel), w, h);
Arg args[7]; Arg args[7];
Cardinal nargs = 0; Cardinal nargs = 0;

@ -47,8 +47,8 @@ FDialog::FDialog( TQWidget *parent, bool framed )
if (framed) { if (framed) {
// Signal that we do not want any window controls to be shown at all // Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification; Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False); kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False);
XChangeProperty(qt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L); XChangeProperty(tqt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
} }
if (framed) { if (framed) {

@ -118,7 +118,7 @@ void
GreeterApp::timerEvent( TQTimerEvent * ) GreeterApp::timerEvent( TQTimerEvent * )
{ {
alarm( 0 ); alarm( 0 );
if (!PingServer( qt_xdisplay() )) if (!PingServer( tqt_xdisplay() ))
::exit( EX_RESERVER_DPY ); ::exit( EX_RESERVER_DPY );
alarm( pingInterval * 70 ); // sic! give the "proper" pinger enough time alarm( pingInterval * 70 ); // sic! give the "proper" pinger enough time
} }
@ -259,7 +259,7 @@ kg_main( const char *argv0 )
TQString login_user; TQString login_user;
TQString login_session_wm; TQString login_session_wm;
Display *dpy = qt_xdisplay(); Display *dpy = tqt_xdisplay();
if (!_GUIStyle.isEmpty()) if (!_GUIStyle.isEmpty())
app->setStyle( _GUIStyle ); app->setStyle( _GUIStyle );
@ -466,7 +466,7 @@ kg_main( const char *argv0 )
UnsecureDisplay( dpy ); UnsecureDisplay( dpy );
restore_modifiers(); restore_modifiers();
XSetInputFocus( qt_xdisplay(), PointerRoot, PointerRoot, CurrentTime ); XSetInputFocus( tqt_xdisplay(), PointerRoot, PointerRoot, CurrentTime );
delete app; delete app;
} }

@ -834,7 +834,7 @@ KGVerify::updateLockStatus()
unsigned int lmask; unsigned int lmask;
Window dummy1, dummy2; Window dummy1, dummy2;
int dummy3, dummy4, dummy5, dummy6; int dummy3, dummy4, dummy5, dummy6;
XQueryPointer( qt_xdisplay(), DefaultRootWindow( qt_xdisplay() ), XQueryPointer( tqt_xdisplay(), DefaultRootWindow( tqt_xdisplay() ),
&dummy1, &dummy2, &dummy3, &dummy4, &dummy5, &dummy6, &dummy1, &dummy2, &dummy3, &dummy4, &dummy5, &dummy6,
&lmask ); &lmask );
capsLocked = lmask & LockMask; capsLocked = lmask & LockMask;

@ -59,7 +59,7 @@ MyApplication::MyApplication( const char *conf )
renderer.start(); renderer.start();
if( !properties_inited ) { if( !properties_inited ) {
prop_root = XInternAtom(qt_xdisplay(), "_XROOTPMAP_ID", False); prop_root = XInternAtom(tqt_xdisplay(), "_XROOTPMAP_ID", False);
properties_inited = true; properties_inited = true;
} }
} }
@ -77,7 +77,7 @@ MyApplication::renderDone()
// ...and export it via Esetroot-style so that composition managers can use it! // ...and export it via Esetroot-style so that composition managers can use it!
Pixmap bgPm = pm.handle(); // fetch the actual X handle to it Pixmap bgPm = pm.handle(); // fetch the actual X handle to it
XChangeProperty(qt_xdisplay(), qt_xrootwin(), prop_root, XA_PIXMAP, 32, PropModeReplace, (unsigned char *) &bgPm, 1); XChangeProperty(tqt_xdisplay(), tqt_xrootwin(), prop_root, XA_PIXMAP, 32, PropModeReplace, (unsigned char *) &bgPm, 1);
renderer.saveCacheFile(); renderer.saveCacheFile();
renderer.cleanup(); renderer.cleanup();
@ -132,7 +132,7 @@ main( int argc, char *argv[] )
app.flushX(); app.flushX();
// Keep color resources after termination // Keep color resources after termination
XSetCloseDownMode( qt_xdisplay(), RetainTemporary ); XSetCloseDownMode( tqt_xdisplay(), RetainTemporary );
return 0; return 0;
} }

@ -91,8 +91,8 @@ SAKDlg::SAKDlg(TQWidget *parent)
if (trinity_desktop_lock_use_system_modal_dialogs) { if (trinity_desktop_lock_use_system_modal_dialogs) {
// Signal that we do not want any window controls to be shown at all // Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification; Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False); kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False);
XChangeProperty(qt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L); XChangeProperty(tqt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
} }
setCaption(TDM_LOGIN_SCREEN_BASE_TITLE); setCaption(TDM_LOGIN_SCREEN_BASE_TITLE);

@ -31,7 +31,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
extern Time qt_x_time; extern Time tqt_x_time;
static TQString convertFileFilter( const TQString& filter ) static TQString convertFileFilter( const TQString& filter )
{ {
@ -98,7 +98,7 @@ static DCOPClient* dcopClient()
// defined in qapplication_x11.cpp // defined in qapplication_x11.cpp
typedef int (*QX11EventFilter) (XEvent*); typedef int (*QX11EventFilter) (XEvent*);
extern QX11EventFilter qt_set_x11_event_filter (QX11EventFilter filter); extern QX11EventFilter tqt_set_x11_event_filter (QX11EventFilter filter);
static QX11EventFilter old_filter; static QX11EventFilter old_filter;
@ -125,9 +125,9 @@ static int input_filter( XEvent* e )
void qtkde_EventLoop::block( bool b ) void qtkde_EventLoop::block( bool b )
{ {
if( b ) if( b )
old_filter = qt_set_x11_event_filter( input_filter ); old_filter = tqt_set_x11_event_filter( input_filter );
else else
qt_set_x11_event_filter( old_filter ); tqt_set_x11_event_filter( old_filter );
} }
// duped in kded module // duped in kded module

@ -52,7 +52,7 @@ static void prepareDialog( TQWidget* w, long parent, const TQCString& wmclass1,
XClassHint hints; XClassHint hints;
hints.res_name = ( char* ) ( const char* ) wmclass1; hints.res_name = ( char* ) ( const char* ) wmclass1;
hints.res_class = ( char* ) ( const char* ) wmclass2; hints.res_class = ( char* ) ( const char* ) wmclass2;
XSetClassHint( qt_xdisplay(), w->winId(), &hints ); XSetClassHint( tqt_xdisplay(), w->winId(), &hints );
KWin::setMainWindow( w, parent ); KWin::setMainWindow( w, parent );
KWin::setState( w->winId(), NET::Modal ); KWin::setState( w->winId(), NET::Modal );
KWin::WindowInfo info = KWin::windowInfo( parent, (unsigned long)NET::WMGeometry ); KWin::WindowInfo info = KWin::windowInfo( parent, (unsigned long)NET::WMGeometry );

@ -500,8 +500,8 @@ void generateTQtKde()
stream << "\n"; stream << "\n";
stream << stream <<
" {\n" " {\n"
" if( qt_xdisplay() != NULL )\n" " if( tqt_xdisplay() != NULL )\n"
" XSync( qt_xdisplay(), False );\n"; " XSync( tqt_xdisplay(), False );\n";
TQString parent_arg; TQString parent_arg;
for( TQValueList< Arg >::ConstIterator it2 = function.args.begin(); for( TQValueList< Arg >::ConstIterator it2 = function.args.begin();
it2 != function.args.end(); it2 != function.args.end();
@ -519,7 +519,7 @@ void generateTQtKde()
if( !parent_arg.isEmpty()) if( !parent_arg.isEmpty())
{ {
stream << " if( " << parent_arg << " == 0 )\n"; stream << " if( " << parent_arg << " == 0 )\n";
stream << " DCOPRef( \"kded\", \"MainApplication-Interface\" ).call( \"updateUserTimestamp\", qt_x_time );\n"; stream << " DCOPRef( \"kded\", \"MainApplication-Interface\" ).call( \"updateUserTimestamp\", tqt_x_time );\n";
} }
stream << stream <<
" TQByteArray data, replyData;\n" " TQByteArray data, replyData;\n"

@ -687,7 +687,7 @@ Time Client::readUserCreationTime() const
unsigned long extra = 0; unsigned long extra = 0;
unsigned char *data = 0; unsigned char *data = 0;
KXErrorHandler handler; // ignore errors? KXErrorHandler handler; // ignore errors?
status = XGetWindowProperty( qt_xdisplay(), window(), status = XGetWindowProperty( tqt_xdisplay(), window(),
atoms->kde_net_wm_user_creation_time, 0, 10000, FALSE, XA_CARDINAL, atoms->kde_net_wm_user_creation_time, 0, 10000, FALSE, XA_CARDINAL,
&type, &format, &nitems, &extra, &data ); &type, &format, &nitems, &extra, &data );
if (status == Success ) if (status == Success )

@ -103,7 +103,7 @@ Atoms::Atoms()
assert( n <= max ); assert( n <= max );
XInternAtoms( qt_xdisplay(), names, n, FALSE, atoms_return ); XInternAtoms( tqt_xdisplay(), names, n, FALSE, atoms_return );
for (int i = 0; i < n; i++ ) for (int i = 0; i < n; i++ )
*atoms[i] = atoms_return[i]; *atoms[i] = atoms_return[i];
} }

@ -38,9 +38,9 @@ License. See the file "COPYING" for the exact licensing terms.
// put all externs before the namespace statement to allow the linker // put all externs before the namespace statement to allow the linker
// to resolve them properly // to resolve them properly
extern Atom qt_wm_state; extern Atom tqt_wm_state;
extern Atom qt_window_role; extern Atom tqt_window_role;
extern Atom qt_sm_client_id; extern Atom tqt_sm_client_id;
// wait 200 ms before drawing shadow after move/resize // wait 200 ms before drawing shadow after move/resize
static const int SHADOW_DELAY = 200; static const int SHADOW_DELAY = 200;
@ -227,7 +227,7 @@ void Client::releaseWindow( bool on_shutdown )
hidden = true; // so that it's not considered visible anymore (can't use hideClient(), it would set flags) hidden = true; // so that it's not considered visible anymore (can't use hideClient(), it would set flags)
if( !on_shutdown ) if( !on_shutdown )
workspace()->clientHidden( this ); workspace()->clientHidden( this );
XUnmapWindow( qt_xdisplay(), frameId()); // destroying decoration would cause ugly visual effect XUnmapWindow( tqt_xdisplay(), frameId()); // destroying decoration would cause ugly visual effect
destroyDecoration(); destroyDecoration();
cleanGrouping(); cleanGrouping();
if( !on_shutdown ) if( !on_shutdown )
@ -239,27 +239,27 @@ void Client::releaseWindow( bool on_shutdown )
desk = 0; desk = 0;
info->setState( 0, info->state()); // reset all state flags info->setState( 0, info->state()); // reset all state flags
} }
XDeleteProperty( qt_xdisplay(), client, atoms->kde_net_wm_user_creation_time); XDeleteProperty( tqt_xdisplay(), client, atoms->kde_net_wm_user_creation_time);
XDeleteProperty( qt_xdisplay(), client, atoms->net_frame_extents ); XDeleteProperty( tqt_xdisplay(), client, atoms->net_frame_extents );
XDeleteProperty( qt_xdisplay(), client, atoms->kde_net_wm_frame_strut ); XDeleteProperty( tqt_xdisplay(), client, atoms->kde_net_wm_frame_strut );
XReparentWindow( qt_xdisplay(), client, workspace()->rootWin(), x(), y()); XReparentWindow( tqt_xdisplay(), client, workspace()->rootWin(), x(), y());
XRemoveFromSaveSet( qt_xdisplay(), client ); XRemoveFromSaveSet( tqt_xdisplay(), client );
XSelectInput( qt_xdisplay(), client, NoEventMask ); XSelectInput( tqt_xdisplay(), client, NoEventMask );
if( on_shutdown ) if( on_shutdown )
{ // map the window, so it can be found after another WM is started { // map the window, so it can be found after another WM is started
XMapWindow( qt_xdisplay(), client ); XMapWindow( tqt_xdisplay(), client );
// TODO preserve minimized, shaded etc. state? // TODO preserve minimized, shaded etc. state?
} }
else else
{ {
// Make sure it's not mapped if the app unmapped it (#65279). The app // Make sure it's not mapped if the app unmapped it (#65279). The app
// may do map+unmap before we initially map the window by calling rawShow() from manage(). // may do map+unmap before we initially map the window by calling rawShow() from manage().
XUnmapWindow( qt_xdisplay(), client ); XUnmapWindow( tqt_xdisplay(), client );
} }
client = None; client = None;
XDestroyWindow( qt_xdisplay(), wrapper ); XDestroyWindow( tqt_xdisplay(), wrapper );
wrapper = None; wrapper = None;
XDestroyWindow( qt_xdisplay(), frame ); XDestroyWindow( tqt_xdisplay(), frame );
frame = None; frame = None;
--postpone_geometry_updates; // don't use GeometryUpdatesBlocker, it would now set the geometry --postpone_geometry_updates; // don't use GeometryUpdatesBlocker, it would now set the geometry
checkNonExistentClients(); checkNonExistentClients();
@ -288,9 +288,9 @@ void Client::destroyClient()
cleanGrouping(); cleanGrouping();
workspace()->removeClient( this, Allowed ); workspace()->removeClient( this, Allowed );
client = None; // invalidate client = None; // invalidate
XDestroyWindow( qt_xdisplay(), wrapper ); XDestroyWindow( tqt_xdisplay(), wrapper );
wrapper = None; wrapper = None;
XDestroyWindow( qt_xdisplay(), frame ); XDestroyWindow( tqt_xdisplay(), frame );
frame = None; frame = None;
--postpone_geometry_updates; // don't use GeometryUpdatesBlocker, it would now set the geometry --postpone_geometry_updates; // don't use GeometryUpdatesBlocker, it would now set the geometry
checkNonExistentClients(); checkNonExistentClients();
@ -313,7 +313,7 @@ void Client::updateDecoration( bool check_workspace_pos, bool force )
// TODO check decoration's minimum size? // TODO check decoration's minimum size?
decoration->init(); decoration->init();
decoration->widget()->installEventFilter( this ); decoration->widget()->installEventFilter( this );
XReparentWindow( qt_xdisplay(), decoration->widget()->winId(), frameId(), 0, 0 ); XReparentWindow( tqt_xdisplay(), decoration->widget()->winId(), frameId(), 0, 0 );
decoration->widget()->lower(); decoration->widget()->lower();
decoration->borders( border_left, border_right, border_top, border_bottom ); decoration->borders( border_left, border_right, border_top, border_bottom );
options->onlyDecoTranslucent ? options->onlyDecoTranslucent ?
@ -507,7 +507,7 @@ bool Client::isModalSystemNotification() const
Atom actual; Atom actual;
int format, result; int format, result;
unsigned long n, left; unsigned long n, left;
result = XGetWindowProperty(qt_xdisplay(), window(), atoms->net_wm_system_modal_notification, 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, /*(unsigned char **)*/ &data); result = XGetWindowProperty(tqt_xdisplay(), window(), atoms->net_wm_system_modal_notification, 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, /*(unsigned char **)*/ &data);
if (result == Success && data != None && format == 32 ) if (result == Success && data != None && format == 32 )
{ {
return TRUE; return TRUE;
@ -526,7 +526,7 @@ void Client::updateShape()
updateOpacityCache(); updateOpacityCache();
if ( shape() ) if ( shape() )
{ {
XShapeCombineShape(qt_xdisplay(), frameId(), ShapeBounding, XShapeCombineShape(tqt_xdisplay(), frameId(), ShapeBounding,
clientPos().x(), clientPos().y(), clientPos().x(), clientPos().y(),
window(), ShapeBounding, ShapeSet); window(), ShapeBounding, ShapeSet);
setShapable(TRUE); setShapable(TRUE);
@ -546,18 +546,18 @@ void Client::updateShape()
// the window lose focus (which is a problem with mouse focus policies) // the window lose focus (which is a problem with mouse focus policies)
static Window helper_window = None; static Window helper_window = None;
if( helper_window == None ) if( helper_window == None )
helper_window = XCreateSimpleWindow( qt_xdisplay(), qt_xrootwin(), helper_window = XCreateSimpleWindow( tqt_xdisplay(), tqt_xrootwin(),
0, 0, 1, 1, 0, 0, 0 ); 0, 0, 1, 1, 0, 0, 0 );
XResizeWindow( qt_xdisplay(), helper_window, width(), height()); XResizeWindow( tqt_xdisplay(), helper_window, width(), height());
XShapeCombineShape( qt_xdisplay(), helper_window, ShapeInput, 0, 0, XShapeCombineShape( tqt_xdisplay(), helper_window, ShapeInput, 0, 0,
frameId(), ShapeBounding, ShapeSet ); frameId(), ShapeBounding, ShapeSet );
XShapeCombineShape( qt_xdisplay(), helper_window, ShapeInput, XShapeCombineShape( tqt_xdisplay(), helper_window, ShapeInput,
clientPos().x(), clientPos().y(), clientPos().x(), clientPos().y(),
window(), ShapeBounding, ShapeSubtract ); window(), ShapeBounding, ShapeSubtract );
XShapeCombineShape( qt_xdisplay(), helper_window, ShapeInput, XShapeCombineShape( tqt_xdisplay(), helper_window, ShapeInput,
clientPos().x(), clientPos().y(), clientPos().x(), clientPos().y(),
window(), ShapeInput, ShapeUnion ); window(), ShapeInput, ShapeUnion );
XShapeCombineShape( qt_xdisplay(), frameId(), ShapeInput, 0, 0, XShapeCombineShape( tqt_xdisplay(), frameId(), ShapeInput, 0, 0,
helper_window, ShapeInput, ShapeSet ); helper_window, ShapeInput, ShapeSet );
} }
} }
@ -566,10 +566,10 @@ void Client::setMask( const TQRegion& reg, int mode )
{ {
_mask = reg; _mask = reg;
if( reg.isNull()) if( reg.isNull())
XShapeCombineMask( qt_xdisplay(), frameId(), ShapeBounding, 0, 0, XShapeCombineMask( tqt_xdisplay(), frameId(), ShapeBounding, 0, 0,
None, ShapeSet ); None, ShapeSet );
else if( mode == X::Unsorted ) else if( mode == X::Unsorted )
XShapeCombineRegion( qt_xdisplay(), frameId(), ShapeBounding, 0, 0, XShapeCombineRegion( tqt_xdisplay(), frameId(), ShapeBounding, 0, 0,
reg.handle(), ShapeSet ); reg.handle(), ShapeSet );
else else
{ {
@ -584,7 +584,7 @@ void Client::setMask( const TQRegion& reg, int mode )
xrects[ i ].width = rects[ i ].width(); xrects[ i ].width = rects[ i ].width();
xrects[ i ].height = rects[ i ].height(); xrects[ i ].height = rects[ i ].height();
} }
XShapeCombineRectangles( qt_xdisplay(), frameId(), ShapeBounding, 0, 0, XShapeCombineRectangles( tqt_xdisplay(), frameId(), ShapeBounding, 0, 0,
xrects, rects.count(), ShapeSet, mode ); xrects, rects.count(), ShapeSet, mode );
delete[] xrects; delete[] xrects;
} }
@ -601,7 +601,7 @@ TQRegion Client::mask() const
void Client::setShapable(bool b) void Client::setShapable(bool b)
{ {
long tmp = b?1:0; long tmp = b?1:0;
XChangeProperty(qt_xdisplay(), frameId(), atoms->net_wm_window_shapable, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &tmp, 1L); XChangeProperty(tqt_xdisplay(), frameId(), atoms->net_wm_window_shapable, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &tmp, 1L);
} }
void Client::hideClient( bool hide ) void Client::hideClient( bool hide )
@ -767,7 +767,7 @@ void Client::animateMinimizeOrUnminimize( bool minimize )
if (area2 != area) if (area2 != area)
{ {
pm = animationPixmap( area.width() ); pm = animationPixmap( area.width() );
pm2 = TQPixmap::grabWindow( qt_xrootwin(), area.x(), area.y(), area.width(), area.height() ); pm2 = TQPixmap::grabWindow( tqt_xrootwin(), area.x(), area.y(), area.width(), area.height() );
p.drawPixmap( area.x(), area.y(), pm ); p.drawPixmap( area.x(), area.y(), pm );
if ( need_to_clear ) if ( need_to_clear )
{ {
@ -776,8 +776,8 @@ void Client::animateMinimizeOrUnminimize( bool minimize )
} }
area2 = area; area2 = area;
} }
XFlush(qt_xdisplay()); XFlush(tqt_xdisplay());
XSync( qt_xdisplay(), FALSE ); XSync( tqt_xdisplay(), FALSE );
diff = t.elapsed(); diff = t.elapsed();
if (diff > step) if (diff > step)
diff = step; diff = step;
@ -867,16 +867,16 @@ void Client::setShade( ShadeMode mode )
{ // shade_mode == ShadeNormal { // shade_mode == ShadeNormal
// we're about to shade, texx xcompmgr to prepare // we're about to shade, texx xcompmgr to prepare
long _shade = 1; long _shade = 1;
XChangeProperty(qt_xdisplay(), frameId(), atoms->net_wm_window_shade, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &_shade, 1L); XChangeProperty(tqt_xdisplay(), frameId(), atoms->net_wm_window_shade, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &_shade, 1L);
// shade // shade
int h = height(); int h = height();
shade_geometry_change = true; shade_geometry_change = true;
TQSize s( sizeForClientSize( TQSize( clientSize()))); TQSize s( sizeForClientSize( TQSize( clientSize())));
s.setHeight( border_top + border_bottom ); s.setHeight( border_top + border_bottom );
XSelectInput( qt_xdisplay(), wrapper, ClientWinMask ); // avoid getting UnmapNotify XSelectInput( tqt_xdisplay(), wrapper, ClientWinMask ); // avoid getting UnmapNotify
XUnmapWindow( qt_xdisplay(), wrapper ); XUnmapWindow( tqt_xdisplay(), wrapper );
XUnmapWindow( qt_xdisplay(), client ); XUnmapWindow( tqt_xdisplay(), client );
XSelectInput( qt_xdisplay(), wrapper, ClientWinMask | SubstructureNotifyMask ); XSelectInput( tqt_xdisplay(), wrapper, ClientWinMask | SubstructureNotifyMask );
//as we hid the unmap event, xcompmgr didn't recognize the client wid has vanished, so we'll extra inform it //as we hid the unmap event, xcompmgr didn't recognize the client wid has vanished, so we'll extra inform it
//done xcompmgr workaround //done xcompmgr workaround
// FRAME repaint( FALSE ); // FRAME repaint( FALSE );
@ -886,7 +886,7 @@ void Client::setShade( ShadeMode mode )
do do
{ {
h -= step; h -= step;
XResizeWindow( qt_xdisplay(), frameId(), s.width(), h ); XResizeWindow( tqt_xdisplay(), frameId(), s.width(), h );
resizeDecoration( TQSize( s.width(), h )); resizeDecoration( TQSize( s.width(), h ));
TQApplication::syncX(); TQApplication::syncX();
} while ( h > s.height() + step ); } while ( h > s.height() + step );
@ -903,7 +903,7 @@ void Client::setShade( ShadeMode mode )
} }
// tell xcompmgr shade's done // tell xcompmgr shade's done
_shade = 2; _shade = 2;
XChangeProperty(qt_xdisplay(), frameId(), atoms->net_wm_window_shade, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &_shade, 1L); XChangeProperty(tqt_xdisplay(), frameId(), atoms->net_wm_window_shade, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &_shade, 1L);
} }
else else
{ {
@ -916,7 +916,7 @@ void Client::setShade( ShadeMode mode )
do do
{ {
h += step; h += step;
XResizeWindow( qt_xdisplay(), frameId(), s.width(), h ); XResizeWindow( tqt_xdisplay(), frameId(), s.width(), h );
resizeDecoration( TQSize( s.width(), h )); resizeDecoration( TQSize( s.width(), h ));
// assume a border // assume a border
// we do not have time to wait for X to send us paint events // we do not have time to wait for X to send us paint events
@ -929,9 +929,9 @@ void Client::setShade( ShadeMode mode )
plainResize( s ); plainResize( s );
if( shade_mode == ShadeHover || shade_mode == ShadeActivated ) if( shade_mode == ShadeHover || shade_mode == ShadeActivated )
setActive( TRUE ); setActive( TRUE );
XMapWindow( qt_xdisplay(), wrapperId()); XMapWindow( tqt_xdisplay(), wrapperId());
XMapWindow( qt_xdisplay(), window()); XMapWindow( tqt_xdisplay(), window());
XDeleteProperty (qt_xdisplay(), client, atoms->net_wm_window_shade); XDeleteProperty (tqt_xdisplay(), client, atoms->net_wm_window_shade);
if (options->shadowEnabled(false)) if (options->shadowEnabled(false))
{ {
for (ClientList::ConstIterator it = transients().begin(); for (ClientList::ConstIterator it = transients().begin();
@ -1211,7 +1211,7 @@ void Client::drawShadow()
* this type of window. Otherwise, drawIntersectingShadows() won't update * this type of window. Otherwise, drawIntersectingShadows() won't update
* properly when this window is moved/resized/hidden/closed. * properly when this window is moved/resized/hidden/closed.
*/ */
shapes = XShapeGetRectangles(qt_xdisplay(), frameId(), ShapeBounding, shapes = XShapeGetRectangles(tqt_xdisplay(), frameId(), ShapeBounding,
&count, &ordering); &count, &ordering);
if (!shapes) if (!shapes)
// XShape extension not supported // XShape extension not supported
@ -1265,7 +1265,7 @@ void Client::drawShadow()
// Create a fake drop-down shadow effect via blended Xwindows // Create a fake drop-down shadow effect via blended Xwindows
shadowWidget = new TQWidget(0, 0, (WFlags)(WStyle_Customize | WX11BypassWM)); shadowWidget = new TQWidget(0, 0, (WFlags)(WStyle_Customize | WX11BypassWM));
shadowWidget->setGeometry(shadow); shadowWidget->setGeometry(shadow);
XSelectInput(qt_xdisplay(), shadowWidget->winId(), XSelectInput(tqt_xdisplay(), shadowWidget->winId(),
ButtonPressMask | ButtonReleaseMask | StructureNotifyMask); ButtonPressMask | ButtonReleaseMask | StructureNotifyMask);
shadowWidget->installEventFilter(this); shadowWidget->installEventFilter(this);
@ -1309,7 +1309,7 @@ void Client::drawShadow()
shadowShapes[i].height = (*it).height(); shadowShapes[i].height = (*it).height();
i++; i++;
} }
XShapeCombineRectangles(qt_xdisplay(), shadowWidget->winId(), XShapeCombineRectangles(tqt_xdisplay(), shadowWidget->winId(),
ShapeBounding, -x() + thickness - xOffset, ShapeBounding, -x() + thickness - xOffset,
-y() + thickness - yOffset, shadowShapes, i, ShapeSet, -y() + thickness - yOffset, shadowShapes, i, ShapeSet,
Unsorted); Unsorted);
@ -1347,11 +1347,11 @@ void Client::drawShadow()
shadows[1] = shadowWidget->winId(); shadows[1] = shadowWidget->winId();
} }
XRestackWindows(qt_xdisplay(), shadows, 2); XRestackWindows(tqt_xdisplay(), shadows, 2);
// Don't use TQWidget::show() so we don't confuse QEffects, thus causing // Don't use TQWidget::show() so we don't confuse QEffects, thus causing
// broken focus. // broken focus.
XMapWindow(qt_xdisplay(), shadowWidget->winId()); XMapWindow(tqt_xdisplay(), shadowWidget->winId());
// Tell whatever Clients are listening that this Client's shadow has been drawn. // Tell whatever Clients are listening that this Client's shadow has been drawn.
emit shadowDrawn(); emit shadowDrawn();
@ -1431,7 +1431,7 @@ void Client::imposeCachedShadow(TQPixmap &pixmap, TQRegion exposed)
int thickness, windowX, windowY, xOffset, yOffset; int thickness, windowX, windowY, xOffset, yOffset;
rectangles = exposed.rects(); rectangles = exposed.rects();
rootWindow = qt_xrootwin(); rootWindow = tqt_xrootwin();
thickness = options->shadowThickness(isActive()); thickness = options->shadowThickness(isActive());
windowX = this->x(); windowX = this->x();
windowY = this->y(); windowY = this->y();
@ -1491,7 +1491,7 @@ void Client::imposeRegionShadow(TQPixmap &pixmap, TQRegion occluded,
int windowX, windowY, xOffset, yOffset; int windowX, windowY, xOffset, yOffset;
rectangles = exposed.rects(); rectangles = exposed.rects();
rootWindow = qt_xrootwin(); rootWindow = tqt_xrootwin();
windowX = this->x(); windowX = this->x();
windowY = this->y(); windowY = this->y();
xOffset = options->shadowXOffset(isActive()); xOffset = options->shadowXOffset(isActive());
@ -1623,7 +1623,7 @@ void Client::setMappingState(int s)
mapping_state = s; mapping_state = s;
if( mapping_state == WithdrawnState ) if( mapping_state == WithdrawnState )
{ {
XDeleteProperty( qt_xdisplay(), window(), qt_wm_state ); XDeleteProperty( tqt_xdisplay(), window(), tqt_wm_state );
return; return;
} }
assert( s == NormalState || s == IconicState ); assert( s == NormalState || s == IconicState );
@ -1631,7 +1631,7 @@ void Client::setMappingState(int s)
unsigned long data[2]; unsigned long data[2];
data[0] = (unsigned long) s; data[0] = (unsigned long) s;
data[1] = (unsigned long) None; data[1] = (unsigned long) None;
XChangeProperty(qt_xdisplay(), window(), qt_wm_state, qt_wm_state, 32, XChangeProperty(tqt_xdisplay(), window(), tqt_wm_state, tqt_wm_state, 32,
PropModeReplace, (unsigned char *)data, 2); PropModeReplace, (unsigned char *)data, 2);
if( was_unmanaged ) // manage() did postpone_geometry_updates = 1, now it's ok to finally set the geometry if( was_unmanaged ) // manage() did postpone_geometry_updates = 1, now it's ok to finally set the geometry
@ -1646,11 +1646,11 @@ void Client::rawShow()
{ {
if( decoration != NULL ) if( decoration != NULL )
decoration->widget()->show(); // not really necessary, but let it know the state decoration->widget()->show(); // not really necessary, but let it know the state
XMapWindow( qt_xdisplay(), frame ); XMapWindow( tqt_xdisplay(), frame );
if( !isShade()) if( !isShade())
{ {
XMapWindow( qt_xdisplay(), wrapper ); XMapWindow( tqt_xdisplay(), wrapper );
XMapWindow( qt_xdisplay(), client ); XMapWindow( tqt_xdisplay(), client );
} }
if (options->shadowEnabled(isActive())) if (options->shadowEnabled(isActive()))
drawDelayedShadow(); drawDelayedShadow();
@ -1671,11 +1671,11 @@ void Client::rawHide()
// here. // here.
removeShadow(); removeShadow();
drawIntersectingShadows(); drawIntersectingShadows();
XSelectInput( qt_xdisplay(), wrapper, ClientWinMask ); // avoid getting UnmapNotify XSelectInput( tqt_xdisplay(), wrapper, ClientWinMask ); // avoid getting UnmapNotify
XUnmapWindow( qt_xdisplay(), frame ); XUnmapWindow( tqt_xdisplay(), frame );
XUnmapWindow( qt_xdisplay(), wrapper ); XUnmapWindow( tqt_xdisplay(), wrapper );
XUnmapWindow( qt_xdisplay(), client ); XUnmapWindow( tqt_xdisplay(), client );
XSelectInput( qt_xdisplay(), wrapper, ClientWinMask | SubstructureNotifyMask ); XSelectInput( tqt_xdisplay(), wrapper, ClientWinMask | SubstructureNotifyMask );
if( decoration != NULL ) if( decoration != NULL )
decoration->widget()->hide(); // not really necessary, but let it know the state decoration->widget()->hide(); // not really necessary, but let it know the state
workspace()->clientHidden( this ); workspace()->clientHidden( this );
@ -1697,9 +1697,9 @@ void Client::sendClientMessage(Window w, Atom a, Atom protocol, long data1, long
ev.xclient.data.l[3] = data2; ev.xclient.data.l[3] = data2;
ev.xclient.data.l[4] = data3; ev.xclient.data.l[4] = data3;
mask = 0L; mask = 0L;
if (w == qt_xrootwin()) if (w == tqt_xrootwin())
mask = SubstructureRedirectMask; /* magic! */ mask = SubstructureRedirectMask; /* magic! */
XSendEvent(qt_xdisplay(), w, False, mask, &ev); XSendEvent(tqt_xdisplay(), w, False, mask, &ev);
} }
/* /*
@ -1753,7 +1753,7 @@ void Client::killWindow()
Notify::raise( Notify::Delete ); Notify::raise( Notify::Delete );
killProcess( false ); killProcess( false );
// always kill this client at the server // always kill this client at the server
XKillClient(qt_xdisplay(), window() ); XKillClient(tqt_xdisplay(), window() );
destroyClient(); destroyClient();
} }
@ -2206,7 +2206,7 @@ void Client::takeFocus( allowed_t )
#endif #endif
if ( rules()->checkAcceptFocus( input )) if ( rules()->checkAcceptFocus( input ))
{ {
XSetInputFocus( qt_xdisplay(), window(), RevertToPointerRoot, GET_QT_X_TIME() ); XSetInputFocus( tqt_xdisplay(), window(), RevertToPointerRoot, GET_QT_X_TIME() );
} }
if ( Ptakefocus ) if ( Ptakefocus )
sendClientMessage(window(), atoms->wm_protocols, atoms->wm_take_focus); sendClientMessage(window(), atoms->wm_protocols, atoms->wm_take_focus);
@ -2340,7 +2340,7 @@ TQString Client::caption( bool full ) const
void Client::getWMHints() void Client::getWMHints()
{ {
XWMHints *hints = XGetWMHints(qt_xdisplay(), window() ); XWMHints *hints = XGetWMHints(tqt_xdisplay(), window() );
input = true; input = true;
window_group = None; window_group = None;
urgency = false; urgency = false;
@ -2431,7 +2431,7 @@ void Client::getWindowProtocols()
Pcontexthelp = 0; Pcontexthelp = 0;
Pping = 0; Pping = 0;
if (XGetWMProtocols(qt_xdisplay(), window(), &p, &n)) if (XGetWMProtocols(tqt_xdisplay(), window(), &p, &n))
{ {
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
if (p[i] == atoms->wm_delete_window) if (p[i] == atoms->wm_delete_window)
@ -2459,7 +2459,7 @@ static int nullErrorHandler(Display *, XErrorEvent *)
*/ */
TQCString Client::staticWindowRole(WId w) TQCString Client::staticWindowRole(WId w)
{ {
return getStringProperty(w, qt_window_role).lower(); return getStringProperty(w, tqt_window_role).lower();
} }
/*! /*!
@ -2467,7 +2467,7 @@ TQCString Client::staticWindowRole(WId w)
*/ */
TQCString Client::staticSessionId(WId w) TQCString Client::staticSessionId(WId w)
{ {
return getStringProperty(w, qt_sm_client_id); return getStringProperty(w, tqt_sm_client_id);
} }
/*! /*!
@ -2490,7 +2490,7 @@ Window Client::staticWmClientLeader(WId w)
unsigned char *data = 0; unsigned char *data = 0;
Window result = w; Window result = w;
XErrorHandler oldHandler = XSetErrorHandler(nullErrorHandler); XErrorHandler oldHandler = XSetErrorHandler(nullErrorHandler);
status = XGetWindowProperty( qt_xdisplay(), w, atoms->wm_client_leader, 0, 10000, status = XGetWindowProperty( tqt_xdisplay(), w, atoms->wm_client_leader, 0, 10000,
FALSE, XA_WINDOW, &type, &format, FALSE, XA_WINDOW, &type, &format,
&nitems, &extra, &data ); &nitems, &extra, &data );
XSetErrorHandler(oldHandler); XSetErrorHandler(oldHandler);
@ -2708,7 +2708,7 @@ void Client::setCursor( const TQCursor& c )
cursor = c; cursor = c;
if( decoration != NULL ) if( decoration != NULL )
decoration->widget()->setCursor( cursor ); decoration->widget()->setCursor( cursor );
XDefineCursor( qt_xdisplay(), frameId(), cursor.handle()); XDefineCursor( tqt_xdisplay(), frameId(), cursor.handle());
} }
Client::Position Client::mousePosition( const TQPoint& p ) const Client::Position Client::mousePosition( const TQPoint& p ) const
@ -2763,21 +2763,21 @@ void Client::setOpacity(bool translucent, uint opacity)
{ {
if (isDesktop()) if (isDesktop())
return; // xcompmgr does not like non solid desktops and the user could set it accidently by mouse scrolling return; // xcompmgr does not like non solid desktops and the user could set it accidently by mouse scrolling
// tqWarning("setting opacity for %d",qt_xdisplay()); // tqWarning("setting opacity for %d",tqt_xdisplay());
//rule out activated translulcency with 100% opacity //rule out activated translulcency with 100% opacity
if (!translucent || opacity == 0xFFFFFFFF) if (!translucent || opacity == 0xFFFFFFFF)
{ {
opacity_ = 0xFFFFFFFF; opacity_ = 0xFFFFFFFF;
XDeleteProperty (qt_xdisplay(), frameId(), atoms->net_wm_window_opacity); XDeleteProperty (tqt_xdisplay(), frameId(), atoms->net_wm_window_opacity);
XDeleteProperty (qt_xdisplay(), window(), atoms->net_wm_window_opacity); // ??? frameId() is necessary for visible changes, window() is the winId() that would be set by apps - we set both to be sure the app knows what's currently displayd XDeleteProperty (tqt_xdisplay(), window(), atoms->net_wm_window_opacity); // ??? frameId() is necessary for visible changes, window() is the winId() that would be set by apps - we set both to be sure the app knows what's currently displayd
} }
else{ else{
if(opacity == opacity_) if(opacity == opacity_)
return; return;
opacity_ = opacity; opacity_ = opacity;
long data = opacity; // 32bit XChangeProperty needs long long data = opacity; // 32bit XChangeProperty needs long
XChangeProperty(qt_xdisplay(), frameId(), atoms->net_wm_window_opacity, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &data, 1L); XChangeProperty(tqt_xdisplay(), frameId(), atoms->net_wm_window_opacity, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &data, 1L);
XChangeProperty(qt_xdisplay(), window(), atoms->net_wm_window_opacity, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &data, 1L); XChangeProperty(tqt_xdisplay(), window(), atoms->net_wm_window_opacity, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &data, 1L);
} }
} }
@ -2786,7 +2786,7 @@ void Client::setShadowSize(uint shadowSize)
// ignoring all individual settings - if we control a window, we control it's shadow // ignoring all individual settings - if we control a window, we control it's shadow
// TODO somehow handle individual settings for docks (besides custom sizes) // TODO somehow handle individual settings for docks (besides custom sizes)
long data = shadowSize; long data = shadowSize;
XChangeProperty(qt_xdisplay(), frameId(), atoms->net_wm_window_shadow, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &data, 1L); XChangeProperty(tqt_xdisplay(), frameId(), atoms->net_wm_window_shadow, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &data, 1L);
} }
void Client::updateOpacity() void Client::updateOpacity()
@ -2974,7 +2974,7 @@ bool Client::getWindowOpacity() //query translucency settings from X, returns tr
Atom actual; Atom actual;
int format, result; int format, result;
unsigned long n, left; unsigned long n, left;
result = XGetWindowProperty(qt_xdisplay(), window(), atoms->net_wm_window_opacity, 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, /*(unsigned char **)*/ &data); result = XGetWindowProperty(tqt_xdisplay(), window(), atoms->net_wm_window_opacity, 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, /*(unsigned char **)*/ &data);
if (result == Success && data != None && format == 32 ) if (result == Success && data != None && format == 32 )
{ {
opacity_ = *reinterpret_cast< long* >( data ); opacity_ = *reinterpret_cast< long* >( data );
@ -3021,12 +3021,12 @@ void Client::setDecoHashProperty(uint topHeight, uint rightWidth, uint bottomHei
(rightWidth < 255 ? rightWidth : 255) << 16 | (rightWidth < 255 ? rightWidth : 255) << 16 |
(bottomHeight < 255 ? bottomHeight : 255) << 8 | (bottomHeight < 255 ? bottomHeight : 255) << 8 |
(leftWidth < 255 ? leftWidth : 255); (leftWidth < 255 ? leftWidth : 255);
XChangeProperty(qt_xdisplay(), frameId(), atoms->net_wm_window_decohash, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &data, 1L); XChangeProperty(tqt_xdisplay(), frameId(), atoms->net_wm_window_decohash, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &data, 1L);
} }
void Client::unsetDecoHashProperty() void Client::unsetDecoHashProperty()
{ {
XDeleteProperty( qt_xdisplay(), frameId(), atoms->net_wm_window_decohash); XDeleteProperty( tqt_xdisplay(), frameId(), atoms->net_wm_window_decohash);
} }
#ifndef NDEBUG #ifndef NDEBUG

@ -440,8 +440,8 @@ bool B2Client::isModalSystemNotification()
int format, result; int format, result;
unsigned long n, left; unsigned long n, left;
Atom kde_wm_system_modal_notification; Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False); kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False);
result = XGetWindowProperty(qt_xdisplay(), windowId(), kde_wm_system_modal_notification, 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, /*(unsigned char **)*/ &data); result = XGetWindowProperty(tqt_xdisplay(), windowId(), kde_wm_system_modal_notification, 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, /*(unsigned char **)*/ &data);
if (result == Success && data != None && format == 32 ) if (result == Success && data != None && format == 32 )
{ {
return TRUE; return TRUE;
@ -1324,7 +1324,7 @@ bool B2Titlebar::x11Event(XEvent *e)
{ {
if (!set_x11mask) { if (!set_x11mask) {
set_x11mask = true; set_x11mask = true;
XSelectInput(qt_xdisplay(), winId(), XSelectInput(tqt_xdisplay(), winId(),
KeyPressMask | KeyReleaseMask | KeyPressMask | KeyReleaseMask |
ButtonPressMask | ButtonReleaseMask | ButtonPressMask | ButtonReleaseMask |
KeymapStateMask | KeymapStateMask |

@ -1031,8 +1031,8 @@ bool KeramikClient::isModalSystemNotification()
int format, result; int format, result;
unsigned long n, left; unsigned long n, left;
Atom kde_wm_system_modal_notification; Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False); kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False);
result = XGetWindowProperty(qt_xdisplay(), windowId(), kde_wm_system_modal_notification, 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, /*(unsigned char **)*/ &data); result = XGetWindowProperty(tqt_xdisplay(), windowId(), kde_wm_system_modal_notification, 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, /*(unsigned char **)*/ &data);
if (result == Success && data != None && format == 32 ) if (result == Success && data != None && format == 32 )
{ {
return TRUE; return TRUE;

@ -30,7 +30,7 @@ License. See the file "COPYING" for the exact licensing terms.
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include <stdlib.h> #include <stdlib.h>
extern Atom qt_window_role; extern Atom tqt_window_role;
namespace KWinInternal namespace KWinInternal
{ {
@ -197,7 +197,7 @@ bool Workspace::workspaceEvent( XEvent * e )
if ( mouse_emulation && (e->type == ButtonPress || e->type == ButtonRelease ) ) if ( mouse_emulation && (e->type == ButtonPress || e->type == ButtonRelease ) )
{ {
mouse_emulation = FALSE; mouse_emulation = FALSE;
XUngrabKeyboard( qt_xdisplay(), GET_QT_X_TIME() ); XUngrabKeyboard( tqt_xdisplay(), GET_QT_X_TIME() );
} }
if( e->type == PropertyNotify || e->type == ClientMessage ) if( e->type == PropertyNotify || e->type == ClientMessage )
@ -293,7 +293,7 @@ bool Workspace::workspaceEvent( XEvent * e )
{ {
// see comments for allowClientActivation() // see comments for allowClientActivation()
Time my_qtx_time = GET_QT_X_TIME(); Time my_qtx_time = GET_QT_X_TIME();
XChangeProperty(qt_xdisplay(), e->xcreatewindow.window, XChangeProperty(tqt_xdisplay(), e->xcreatewindow.window,
atoms->kde_net_wm_user_creation_time, XA_CARDINAL, atoms->kde_net_wm_user_creation_time, XA_CARDINAL,
32, PropModeReplace, (unsigned char *)&my_qtx_time, 1); 32, PropModeReplace, (unsigned char *)&my_qtx_time, 1);
SET_QT_X_TIME(my_qtx_time); SET_QT_X_TIME(my_qtx_time);
@ -314,12 +314,12 @@ bool Workspace::workspaceEvent( XEvent * e )
// window. // window.
XEvent ev; XEvent ev;
WId w = e->xunmap.window; WId w = e->xunmap.window;
if ( XCheckTypedWindowEvent (qt_xdisplay(), w, if ( XCheckTypedWindowEvent (tqt_xdisplay(), w,
ReparentNotify, &ev) ) ReparentNotify, &ev) )
{ {
if ( ev.xreparent.parent != root ) if ( ev.xreparent.parent != root )
{ {
XReparentWindow( qt_xdisplay(), w, root, 0, 0 ); XReparentWindow( tqt_xdisplay(), w, root, 0, 0 );
addSystemTrayWin( w ); addSystemTrayWin( w );
} }
} }
@ -364,13 +364,13 @@ bool Workspace::workspaceEvent( XEvent * e )
if ( addSystemTrayWin( e->xmaprequest.window ) ) if ( addSystemTrayWin( e->xmaprequest.window ) )
return TRUE; return TRUE;
c = createClient( e->xmaprequest.window, false ); c = createClient( e->xmaprequest.window, false );
if ( c != NULL && root != qt_xrootwin() ) if ( c != NULL && root != tqt_xrootwin() )
{ // TODO what is this? { // TODO what is this?
// TODO may use TQWidget::create // TODO may use TQWidget::create
XReparentWindow( qt_xdisplay(), c->frameId(), root, 0, 0 ); XReparentWindow( tqt_xdisplay(), c->frameId(), root, 0, 0 );
} }
if( c == NULL ) // refused to manage, simply map it (most probably override redirect) if( c == NULL ) // refused to manage, simply map it (most probably override redirect)
XMapRaised( qt_xdisplay(), e->xmaprequest.window ); XMapRaised( tqt_xdisplay(), e->xmaprequest.window );
return true; return true;
} }
if( c ) if( c )
@ -417,7 +417,7 @@ bool Workspace::workspaceEvent( XEvent * e )
wc.stack_mode = Above; wc.stack_mode = Above;
unsigned int value_mask = e->xconfigurerequest.value_mask unsigned int value_mask = e->xconfigurerequest.value_mask
& ( CWX | CWY | CWWidth | CWHeight | CWBorderWidth ); & ( CWX | CWY | CWWidth | CWHeight | CWBorderWidth );
XConfigureWindow( qt_xdisplay(), e->xconfigurerequest.window, value_mask, &wc ); XConfigureWindow( tqt_xdisplay(), e->xconfigurerequest.window, value_mask, &wc );
return true; return true;
} }
break; break;
@ -434,10 +434,10 @@ bool Workspace::workspaceEvent( XEvent * e )
if( e->xfocus.window == rootWin() && TQCString( getenv("TDE_MULTIHEAD")).lower() != "true" if( e->xfocus.window == rootWin() && TQCString( getenv("TDE_MULTIHEAD")).lower() != "true"
&& ( e->xfocus.detail == NotifyDetailNone || e->xfocus.detail == NotifyPointerRoot )) && ( e->xfocus.detail == NotifyDetailNone || e->xfocus.detail == NotifyPointerRoot ))
{ {
updateXTime(); // focusToNull() uses qt_x_time, which is old now (FocusIn has no timestamp) updateXTime(); // focusToNull() uses tqt_x_time, which is old now (FocusIn has no timestamp)
Window focus; Window focus;
int revert; int revert;
XGetInputFocus( qt_xdisplay(), &focus, &revert ); XGetInputFocus( tqt_xdisplay(), &focus, &revert );
if( focus == None || focus == PointerRoot ) if( focus == None || focus == PointerRoot )
{ {
//kdWarning( 1212 ) << "X focus set to None/PointerRoot, reseting focus" << endl; //kdWarning( 1212 ) << "X focus set to None/PointerRoot, reseting focus" << endl;
@ -712,7 +712,7 @@ void Client::unmapNotifyEvent( XUnmapEvent* e )
case NormalState: case NormalState:
// maybe we will be destroyed soon. Check this first. // maybe we will be destroyed soon. Check this first.
XEvent ev; XEvent ev;
if( XCheckTypedWindowEvent (qt_xdisplay(), window(), if( XCheckTypedWindowEvent (tqt_xdisplay(), window(),
DestroyNotify, &ev) ) // TODO I don't like this much DestroyNotify, &ev) ) // TODO I don't like this much
{ {
destroyClient(); // deletes this destroyClient(); // deletes this
@ -808,7 +808,7 @@ void Client::configureRequestEvent( XConfigureRequestEvent* e )
wc.border_width = 0; wc.border_width = 0;
value_mask = CWBorderWidth; value_mask = CWBorderWidth;
XConfigureWindow( qt_xdisplay(), window(), value_mask, & wc ); XConfigureWindow( tqt_xdisplay(), window(), value_mask, & wc );
} }
if( e->value_mask & ( CWX | CWY | CWHeight | CWWidth )) if( e->value_mask & ( CWX | CWY | CWHeight | CWWidth ))
@ -859,7 +859,7 @@ void Client::propertyNotifyEvent( XPropertyEvent* e )
getWindowProtocols(); getWindowProtocols();
else if (e->atom == atoms->wm_client_leader ) else if (e->atom == atoms->wm_client_leader )
getWmClientLeader(); getWmClientLeader();
else if( e->atom == qt_window_role ) else if( e->atom == tqt_window_role )
window_role = staticWindowRole( window()); window_role = staticWindowRole( window());
else if( e->atom == atoms->motif_wm_hints ) else if( e->atom == atoms->motif_wm_hints )
getMotifHints(); getMotifHints();
@ -939,7 +939,7 @@ void Client::leaveNotifyEvent( XCrossingEvent* e )
int d1, d2, d3, d4; int d1, d2, d3, d4;
unsigned int d5; unsigned int d5;
Window w, child; Window w, child;
if( XQueryPointer( qt_xdisplay(), frameId(), &w, &child, &d1, &d2, &d3, &d4, &d5 ) == False if( XQueryPointer( tqt_xdisplay(), frameId(), &w, &child, &d1, &d2, &d3, &d4, &d5 ) == False
|| child == None ) || child == None )
lostMouse = true; // really lost the mouse lostMouse = true; // really lost the mouse
} }
@ -972,7 +972,7 @@ void Client::grabButton( int modifier )
for( int i = 0; for( int i = 0;
i < 8; i < 8;
++i ) ++i )
XGrabButton( qt_xdisplay(), AnyButton, XGrabButton( tqt_xdisplay(), AnyButton,
modifier | mods[ i ], modifier | mods[ i ],
wrapperId(), FALSE, ButtonPressMask, wrapperId(), FALSE, ButtonPressMask,
GrabModeSync, GrabModeAsync, None, None ); GrabModeSync, GrabModeAsync, None, None );
@ -989,7 +989,7 @@ void Client::ungrabButton( int modifier )
for( int i = 0; for( int i = 0;
i < 8; i < 8;
++i ) ++i )
XUngrabButton( qt_xdisplay(), AnyButton, XUngrabButton( tqt_xdisplay(), AnyButton,
modifier | mods[ i ], wrapperId()); modifier | mods[ i ], wrapperId());
} }
#undef XCapL #undef XCapL
@ -1006,7 +1006,7 @@ void Client::updateMouseGrab()
{ {
if( workspace()->globalShortcutsDisabled()) if( workspace()->globalShortcutsDisabled())
{ {
XUngrabButton( qt_xdisplay(), AnyButton, AnyModifier, wrapperId()); XUngrabButton( tqt_xdisplay(), AnyButton, AnyModifier, wrapperId());
// keep grab for the simple click without modifiers if needed (see below) // keep grab for the simple click without modifiers if needed (see below)
bool not_obscured = workspace()->topClientOnDesktop( workspace()->currentDesktop(), true, false ) == this; bool not_obscured = workspace()->topClientOnDesktop( workspace()->currentDesktop(), true, false ) == this;
if( !( !options->clickRaise || not_obscured )) if( !( !options->clickRaise || not_obscured ))
@ -1016,7 +1016,7 @@ void Client::updateMouseGrab()
if( isActive() && !workspace()->forcedGlobalMouseGrab()) // see Workspace::establishTabBoxGrab() if( isActive() && !workspace()->forcedGlobalMouseGrab()) // see Workspace::establishTabBoxGrab()
{ {
// first grab all modifier combinations // first grab all modifier combinations
XGrabButton(qt_xdisplay(), AnyButton, AnyModifier, wrapperId(), FALSE, XGrabButton(tqt_xdisplay(), AnyButton, AnyModifier, wrapperId(), FALSE,
ButtonPressMask, ButtonPressMask,
GrabModeSync, GrabModeAsync, GrabModeSync, GrabModeAsync,
None, None ); None, None );
@ -1035,9 +1035,9 @@ void Client::updateMouseGrab()
} }
else else
{ {
XUngrabButton( qt_xdisplay(), AnyButton, AnyModifier, wrapperId()); XUngrabButton( tqt_xdisplay(), AnyButton, AnyModifier, wrapperId());
// simply grab all modifier combinations // simply grab all modifier combinations
XGrabButton(qt_xdisplay(), AnyButton, AnyModifier, wrapperId(), FALSE, XGrabButton(tqt_xdisplay(), AnyButton, AnyModifier, wrapperId(), FALSE,
ButtonPressMask, ButtonPressMask,
GrabModeSync, GrabModeAsync, GrabModeSync, GrabModeAsync,
None, None ); None, None );
@ -1108,8 +1108,8 @@ bool Client::eventFilter( TQObject* o, TQEvent* e )
// find the window under the cursor that should receive the // find the window under the cursor that should receive the
// simulated events // simulated events
root_window = qt_xrootwin(); root_window = tqt_xrootwin();
XQueryPointer(qt_xdisplay(), root_window, &root_window, XQueryPointer(tqt_xdisplay(), root_window, &root_window,
&pointer_window, &x_root, &y_root, &x, &y, &mask); &pointer_window, &x_root, &y_root, &x, &y, &mask);
if (pointer_window != None) if (pointer_window != None)
@ -1119,7 +1119,7 @@ bool Client::eventFilter( TQObject* o, TQEvent* e )
// the immediate descendant of a window's window decoration, // the immediate descendant of a window's window decoration,
// which causes KWin to refocus windows properly // which causes KWin to refocus windows properly
parent_window = pointer_window; parent_window = pointer_window;
XQueryPointer(qt_xdisplay(), parent_window, &root_window, XQueryPointer(tqt_xdisplay(), parent_window, &root_window,
&pointer_window, &x_root, &y_root, &x, &y, &mask); &pointer_window, &x_root, &y_root, &x, &y, &mask);
inner_window = pointer_window; inner_window = pointer_window;
@ -1130,7 +1130,7 @@ bool Client::eventFilter( TQObject* o, TQEvent* e )
// the subsequent query. When no child window is left, we've // the subsequent query. When no child window is left, we've
// found the child that will receive the simulated event // found the child that will receive the simulated event
parent_window = pointer_window; parent_window = pointer_window;
XQueryPointer(qt_xdisplay(), parent_window, &root_window, XQueryPointer(tqt_xdisplay(), parent_window, &root_window,
&pointer_window, &x_root, &y_root, &x, &y, &mask); &pointer_window, &x_root, &y_root, &x, &y, &mask);
} }
pointer_window = parent_window; pointer_window = parent_window;
@ -1140,8 +1140,8 @@ bool Client::eventFilter( TQObject* o, TQEvent* e )
// simulate a mouse button press // simulate a mouse button press
xe.type = ButtonPress; xe.type = ButtonPress;
xe.display = qt_xdisplay(); xe.display = tqt_xdisplay();
xe.root = qt_xrootwin(); xe.root = tqt_xrootwin();
xe.subwindow = None; xe.subwindow = None;
xe.time = CurrentTime; xe.time = CurrentTime;
xe.x = x; xe.x = x;
@ -1154,17 +1154,17 @@ bool Client::eventFilter( TQObject* o, TQEvent* e )
if (inner_window != None && inner_window != pointer_window) if (inner_window != None && inner_window != pointer_window)
{ {
xe.window = inner_window; xe.window = inner_window;
XSendEvent(qt_xdisplay(), inner_window, True, ButtonPressMask, XSendEvent(tqt_xdisplay(), inner_window, True, ButtonPressMask,
(XEvent *)&xe); (XEvent *)&xe);
} }
xe.window = pointer_window; xe.window = pointer_window;
XSendEvent(qt_xdisplay(), pointer_window, True, ButtonPressMask, XSendEvent(tqt_xdisplay(), pointer_window, True, ButtonPressMask,
(XEvent *)&xe); (XEvent *)&xe);
// simulate a mouse button release // simulate a mouse button release
xe.type = ButtonRelease; xe.type = ButtonRelease;
xe.display = qt_xdisplay(); xe.display = tqt_xdisplay();
xe.root = qt_xrootwin(); xe.root = tqt_xrootwin();
xe.subwindow = None; xe.subwindow = None;
xe.time = CurrentTime; xe.time = CurrentTime;
xe.x = x; xe.x = x;
@ -1177,11 +1177,11 @@ bool Client::eventFilter( TQObject* o, TQEvent* e )
if (inner_window != None && inner_window != pointer_window) if (inner_window != None && inner_window != pointer_window)
{ {
xe.window = inner_window; xe.window = inner_window;
XSendEvent(qt_xdisplay(), inner_window, True, ButtonReleaseMask, XSendEvent(tqt_xdisplay(), inner_window, True, ButtonReleaseMask,
(XEvent *)&xe); (XEvent *)&xe);
} }
xe.window = pointer_window; xe.window = pointer_window;
XSendEvent(qt_xdisplay(), pointer_window, True, ButtonReleaseMask, XSendEvent(tqt_xdisplay(), pointer_window, True, ButtonReleaseMask,
(XEvent *)&xe); (XEvent *)&xe);
drawDelayedShadow(); drawDelayedShadow();
@ -1206,8 +1206,8 @@ bool Client::eventFilter( TQObject* o, TQEvent* e )
// find the window under the cursor that should receive the // find the window under the cursor that should receive the
// simulated events // simulated events
root_window = qt_xrootwin(); root_window = tqt_xrootwin();
XQueryPointer(qt_xdisplay(), root_window, &root_window, XQueryPointer(tqt_xdisplay(), root_window, &root_window,
&pointer_window, &x_root, &y_root, &x, &y, &mask); &pointer_window, &x_root, &y_root, &x, &y, &mask);
if (pointer_window != None) if (pointer_window != None)
@ -1217,7 +1217,7 @@ bool Client::eventFilter( TQObject* o, TQEvent* e )
// the immediate descendant of a window's window decoration, // the immediate descendant of a window's window decoration,
// which causes KWin to refocus windows properly // which causes KWin to refocus windows properly
parent_window = pointer_window; parent_window = pointer_window;
XQueryPointer(qt_xdisplay(), parent_window, &root_window, XQueryPointer(tqt_xdisplay(), parent_window, &root_window,
&pointer_window, &x_root, &y_root, &x, &y, &mask); &pointer_window, &x_root, &y_root, &x, &y, &mask);
inner_window = pointer_window; inner_window = pointer_window;
@ -1228,7 +1228,7 @@ bool Client::eventFilter( TQObject* o, TQEvent* e )
// the subsequent query. When no child window is left, we've // the subsequent query. When no child window is left, we've
// found the child that will receive the simulated event // found the child that will receive the simulated event
parent_window = pointer_window; parent_window = pointer_window;
XQueryPointer(qt_xdisplay(), parent_window, &root_window, XQueryPointer(tqt_xdisplay(), parent_window, &root_window,
&pointer_window, &x_root, &y_root, &x, &y, &mask); &pointer_window, &x_root, &y_root, &x, &y, &mask);
} }
pointer_window = parent_window; pointer_window = parent_window;
@ -1238,8 +1238,8 @@ bool Client::eventFilter( TQObject* o, TQEvent* e )
// simulate a mouse button press // simulate a mouse button press
xe.type = ButtonPress; xe.type = ButtonPress;
xe.display = qt_xdisplay(); xe.display = tqt_xdisplay();
xe.root = qt_xrootwin(); xe.root = tqt_xrootwin();
xe.subwindow = None; xe.subwindow = None;
xe.time = CurrentTime; xe.time = CurrentTime;
xe.x = x; xe.x = x;
@ -1252,18 +1252,18 @@ bool Client::eventFilter( TQObject* o, TQEvent* e )
{ {
xe.button = buttonPressed; xe.button = buttonPressed;
xe.window = inner_window; xe.window = inner_window;
XSendEvent(qt_xdisplay(), inner_window, True, ButtonPressMask, XSendEvent(tqt_xdisplay(), inner_window, True, ButtonPressMask,
(XEvent *)&xe); (XEvent *)&xe);
} }
xe.button = buttonPressed; xe.button = buttonPressed;
xe.window = pointer_window; xe.window = pointer_window;
XSendEvent(qt_xdisplay(), pointer_window, True, ButtonPressMask, XSendEvent(tqt_xdisplay(), pointer_window, True, ButtonPressMask,
(XEvent *)&xe); (XEvent *)&xe);
// simulate a mouse button release // simulate a mouse button release
xe.type = ButtonRelease; xe.type = ButtonRelease;
xe.display = qt_xdisplay(); xe.display = tqt_xdisplay();
xe.root = qt_xrootwin(); xe.root = tqt_xrootwin();
xe.subwindow = None; xe.subwindow = None;
xe.time = CurrentTime; xe.time = CurrentTime;
xe.x = x; xe.x = x;
@ -1276,13 +1276,13 @@ bool Client::eventFilter( TQObject* o, TQEvent* e )
xe.window = inner_window; xe.window = inner_window;
xe.state = buttonMask; xe.state = buttonMask;
xe.button = buttonPressed; xe.button = buttonPressed;
XSendEvent(qt_xdisplay(), inner_window, True, ButtonReleaseMask, XSendEvent(tqt_xdisplay(), inner_window, True, ButtonReleaseMask,
(XEvent *)&xe); (XEvent *)&xe);
} }
xe.state = buttonMask; xe.state = buttonMask;
xe.button = buttonPressed; xe.button = buttonPressed;
xe.window = pointer_window; xe.window = pointer_window;
XSendEvent(qt_xdisplay(), pointer_window, True, ButtonReleaseMask, XSendEvent(tqt_xdisplay(), pointer_window, True, ButtonReleaseMask,
(XEvent *)&xe); (XEvent *)&xe);
drawDelayedShadow(); drawDelayedShadow();
@ -1339,7 +1339,7 @@ bool Client::buttonPressEvent( Window w, int button, int state, int x, int y, in
if (buttonDown) if (buttonDown)
{ {
if( w == wrapperId()) if( w == wrapperId())
XAllowEvents(qt_xdisplay(), SyncPointer, CurrentTime ); //qt_x_time); XAllowEvents(tqt_xdisplay(), SyncPointer, CurrentTime ); //tqt_x_time);
return true; return true;
} }
@ -1358,7 +1358,7 @@ bool Client::buttonPressEvent( Window w, int button, int state, int x, int y, in
{ // hide splashwindow if the user clicks on it { // hide splashwindow if the user clicks on it
hideClient( true ); hideClient( true );
if( w == wrapperId()) if( w == wrapperId())
XAllowEvents(qt_xdisplay(), SyncPointer, CurrentTime ); //qt_x_time); XAllowEvents(tqt_xdisplay(), SyncPointer, CurrentTime ); //tqt_x_time);
return true; return true;
} }
@ -1423,14 +1423,14 @@ bool Client::buttonPressEvent( Window w, int button, int state, int x, int y, in
replay = TRUE; replay = TRUE;
if( w == wrapperId()) // these can come only from a grab if( w == wrapperId()) // these can come only from a grab
XAllowEvents(qt_xdisplay(), replay? ReplayPointer : SyncPointer, CurrentTime ); //qt_x_time); XAllowEvents(tqt_xdisplay(), replay? ReplayPointer : SyncPointer, CurrentTime ); //tqt_x_time);
return true; return true;
} }
} }
if( w == wrapperId()) // these can come only from a grab if( w == wrapperId()) // these can come only from a grab
{ {
XAllowEvents(qt_xdisplay(), ReplayPointer, CurrentTime ); //qt_x_time); XAllowEvents(tqt_xdisplay(), ReplayPointer, CurrentTime ); //tqt_x_time);
return true; return true;
} }
if( w == decorationId()) if( w == decorationId())
@ -1503,7 +1503,7 @@ bool Client::buttonReleaseEvent( Window w, int /*button*/, int state, int x, int
return false; return false;
if( w == wrapperId()) if( w == wrapperId())
{ {
XAllowEvents(qt_xdisplay(), SyncPointer, CurrentTime ); //qt_x_time); XAllowEvents(tqt_xdisplay(), SyncPointer, CurrentTime ); //tqt_x_time);
return true; return true;
} }
if( w != frameId() && w != decorationId() && w != moveResizeGrabWindow()) if( w != frameId() && w != decorationId() && w != moveResizeGrabWindow())
@ -1553,9 +1553,9 @@ static bool waitingMotionEvent()
&& timestampCompare( GET_QT_X_TIME(), next_motion_time ) < 0 ) && timestampCompare( GET_QT_X_TIME(), next_motion_time ) < 0 )
return true; return true;
was_motion = false; was_motion = false;
XSync( qt_xdisplay(), False ); // this helps to discard more MotionNotify events XSync( tqt_xdisplay(), False ); // this helps to discard more MotionNotify events
XEvent dummy; XEvent dummy;
XCheckIfEvent( qt_xdisplay(), &dummy, motion_predicate, NULL ); XCheckIfEvent( tqt_xdisplay(), &dummy, motion_predicate, NULL );
return was_motion; return was_motion;
} }
@ -1648,7 +1648,7 @@ static bool check_follows_focusin( Client* c )
// XCheckIfEvent() is used to make the search non-blocking, the predicate // XCheckIfEvent() is used to make the search non-blocking, the predicate
// always returns False, so nothing is removed from the events queue. // always returns False, so nothing is removed from the events queue.
// XPeekIfEvent() would block. // XPeekIfEvent() would block.
XCheckIfEvent( qt_xdisplay(), &dummy, predicate_follows_focusin, (XPointer)c ); XCheckIfEvent( tqt_xdisplay(), &dummy, predicate_follows_focusin, (XPointer)c );
return follows_focusin; return follows_focusin;
} }

@ -680,10 +680,10 @@ void Workspace::updateTopMenuGeometry( Client* c )
if( c != NULL ) if( c != NULL )
{ {
XEvent ev; XEvent ev;
ev.xclient.display = qt_xdisplay(); ev.xclient.display = tqt_xdisplay();
ev.xclient.type = ClientMessage; ev.xclient.type = ClientMessage;
ev.xclient.window = c->window(); ev.xclient.window = c->window();
static Atom msg_type_atom = XInternAtom( qt_xdisplay(), "_KDE_TOPMENU_MINSIZE", False ); static Atom msg_type_atom = XInternAtom( tqt_xdisplay(), "_KDE_TOPMENU_MINSIZE", False );
ev.xclient.message_type = msg_type_atom; ev.xclient.message_type = msg_type_atom;
ev.xclient.format = 32; ev.xclient.format = 32;
ev.xclient.data.l[0] = GET_QT_X_TIME(); ev.xclient.data.l[0] = GET_QT_X_TIME();
@ -691,7 +691,7 @@ void Workspace::updateTopMenuGeometry( Client* c )
ev.xclient.data.l[2] = topmenu_space->height(); ev.xclient.data.l[2] = topmenu_space->height();
ev.xclient.data.l[3] = 0; ev.xclient.data.l[3] = 0;
ev.xclient.data.l[4] = 0; ev.xclient.data.l[4] = 0;
XSendEvent( qt_xdisplay(), c->window(), False, NoEventMask, &ev ); XSendEvent( tqt_xdisplay(), c->window(), False, NoEventMask, &ev );
KWin::setStrut( c->window(), 0, 0, topmenu_height, 0 ); // so that kicker etc. know KWin::setStrut( c->window(), 0, 0, topmenu_height, 0 ); // so that kicker etc. know
c->checkWorkspacePosition(); c->checkWorkspacePosition();
return; return;
@ -859,25 +859,25 @@ NETExtendedStrut Client::strut() const
{ {
ext.left_width = str.left; ext.left_width = str.left;
ext.left_start = 0; ext.left_start = 0;
ext.left_end = XDisplayHeight( qt_xdisplay(), DefaultScreen( qt_xdisplay())); ext.left_end = XDisplayHeight( tqt_xdisplay(), DefaultScreen( tqt_xdisplay()));
} }
if( str.right != 0 ) if( str.right != 0 )
{ {
ext.right_width = str.right; ext.right_width = str.right;
ext.right_start = 0; ext.right_start = 0;
ext.right_end = XDisplayHeight( qt_xdisplay(), DefaultScreen( qt_xdisplay())); ext.right_end = XDisplayHeight( tqt_xdisplay(), DefaultScreen( tqt_xdisplay()));
} }
if( str.top != 0 ) if( str.top != 0 )
{ {
ext.top_width = str.top; ext.top_width = str.top;
ext.top_start = 0; ext.top_start = 0;
ext.top_end = XDisplayWidth( qt_xdisplay(), DefaultScreen( qt_xdisplay())); ext.top_end = XDisplayWidth( tqt_xdisplay(), DefaultScreen( tqt_xdisplay()));
} }
if( str.bottom != 0 ) if( str.bottom != 0 )
{ {
ext.bottom_width = str.bottom; ext.bottom_width = str.bottom;
ext.bottom_start = 0; ext.bottom_start = 0;
ext.bottom_end = XDisplayWidth( qt_xdisplay(), DefaultScreen( qt_xdisplay())); ext.bottom_end = XDisplayWidth( tqt_xdisplay(), DefaultScreen( tqt_xdisplay()));
} }
} }
return ext; return ext;
@ -1284,7 +1284,7 @@ TQSize Client::sizeForClientSize( const TQSize& wsize, Sizemode mode, bool nofra
void Client::getWmNormalHints() void Client::getWmNormalHints()
{ {
long msize; long msize;
if (XGetWMNormalHints(qt_xdisplay(), window(), &xSizeHint, &msize) == 0 ) if (XGetWMNormalHints(tqt_xdisplay(), window(), &xSizeHint, &msize) == 0 )
xSizeHint.flags = 0; xSizeHint.flags = 0;
// set defined values for the fields, even if they're not in flags // set defined values for the fields, even if they're not in flags
@ -1386,7 +1386,7 @@ void Client::sendSyntheticConfigureNotify()
c.border_width = 0; c.border_width = 0;
c.above = None; c.above = None;
c.override_redirect = 0; c.override_redirect = 0;
XSendEvent( qt_xdisplay(), c.event, TRUE, StructureNotifyMask, (XEvent*)&c ); XSendEvent( tqt_xdisplay(), c.event, TRUE, StructureNotifyMask, (XEvent*)&c );
} }
const TQPoint Client::calculateGravitation( bool invert, int gravity ) const const TQPoint Client::calculateGravitation( bool invert, int gravity ) const
@ -1758,14 +1758,14 @@ void Client::setGeometry( int x, int y, int w, int h, ForceGeometry_t force )
return; return;
} }
resizeDecoration( TQSize( w, h )); resizeDecoration( TQSize( w, h ));
XMoveResizeWindow( qt_xdisplay(), frameId(), x, y, w, h ); XMoveResizeWindow( tqt_xdisplay(), frameId(), x, y, w, h );
// resizeDecoration( TQSize( w, h )); // resizeDecoration( TQSize( w, h ));
if( !isShade()) if( !isShade())
{ {
TQSize cs = clientSize(); TQSize cs = clientSize();
XMoveResizeWindow( qt_xdisplay(), wrapperId(), clientPos().x(), clientPos().y(), XMoveResizeWindow( tqt_xdisplay(), wrapperId(), clientPos().x(), clientPos().y(),
cs.width(), cs.height()); cs.width(), cs.height());
XMoveResizeWindow( qt_xdisplay(), window(), 0, 0, cs.width(), cs.height()); XMoveResizeWindow( tqt_xdisplay(), window(), 0, 0, cs.width(), cs.height());
} }
updateShape(); updateShape();
// SELI TODO won't this be too expensive? // SELI TODO won't this be too expensive?
@ -1813,14 +1813,14 @@ void Client::plainResize( int w, int h, ForceGeometry_t force )
return; return;
} }
resizeDecoration( TQSize( w, h )); resizeDecoration( TQSize( w, h ));
XResizeWindow( qt_xdisplay(), frameId(), w, h ); XResizeWindow( tqt_xdisplay(), frameId(), w, h );
// resizeDecoration( TQSize( w, h )); // resizeDecoration( TQSize( w, h ));
if( !isShade()) if( !isShade())
{ {
TQSize cs = clientSize(); TQSize cs = clientSize();
XMoveResizeWindow( qt_xdisplay(), wrapperId(), clientPos().x(), clientPos().y(), XMoveResizeWindow( tqt_xdisplay(), wrapperId(), clientPos().x(), clientPos().y(),
cs.width(), cs.height()); cs.width(), cs.height());
XMoveResizeWindow( qt_xdisplay(), window(), 0, 0, cs.width(), cs.height()); XMoveResizeWindow( tqt_xdisplay(), window(), 0, 0, cs.width(), cs.height());
} }
updateShape(); updateShape();
updateWorkareaDiffs(); updateWorkareaDiffs();
@ -1844,7 +1844,7 @@ void Client::move( int x, int y, ForceGeometry_t force )
pending_geometry_update = true; pending_geometry_update = true;
return; return;
} }
XMoveWindow( qt_xdisplay(), frameId(), x, y ); XMoveWindow( tqt_xdisplay(), frameId(), x, y );
sendSyntheticConfigureNotify(); sendSyntheticConfigureNotify();
updateWindowRules(); updateWindowRules();
checkMaximizeGeometry(); checkMaximizeGeometry();
@ -2314,18 +2314,18 @@ bool Client::startMoveResize()
// (http://lists.kde.org/?t=107302193400001&r=1&w=2) // (http://lists.kde.org/?t=107302193400001&r=1&w=2)
XSetWindowAttributes attrs; XSetWindowAttributes attrs;
TQRect r = workspace()->clientArea( FullArea, this ); TQRect r = workspace()->clientArea( FullArea, this );
move_resize_grab_window = XCreateWindow( qt_xdisplay(), workspace()->rootWin(), r.x(), r.y(), move_resize_grab_window = XCreateWindow( tqt_xdisplay(), workspace()->rootWin(), r.x(), r.y(),
r.width(), r.height(), 0, CopyFromParent, InputOnly, CopyFromParent, 0, &attrs ); r.width(), r.height(), 0, CopyFromParent, InputOnly, CopyFromParent, 0, &attrs );
XMapRaised( qt_xdisplay(), move_resize_grab_window ); XMapRaised( tqt_xdisplay(), move_resize_grab_window );
if( XGrabPointer( qt_xdisplay(), move_resize_grab_window, False, if( XGrabPointer( tqt_xdisplay(), move_resize_grab_window, False,
ButtonPressMask | ButtonReleaseMask | PointerMotionMask | EnterWindowMask | LeaveWindowMask, ButtonPressMask | ButtonReleaseMask | PointerMotionMask | EnterWindowMask | LeaveWindowMask,
GrabModeAsync, GrabModeAsync, move_resize_grab_window, cursor.handle(), GET_QT_X_TIME() ) == Success ) GrabModeAsync, GrabModeAsync, move_resize_grab_window, cursor.handle(), GET_QT_X_TIME() ) == Success )
has_grab = true; has_grab = true;
if( XGrabKeyboard( qt_xdisplay(), frameId(), False, GrabModeAsync, GrabModeAsync, GET_QT_X_TIME() ) == Success ) if( XGrabKeyboard( tqt_xdisplay(), frameId(), False, GrabModeAsync, GrabModeAsync, GET_QT_X_TIME() ) == Success )
has_grab = true; has_grab = true;
if( !has_grab ) // at least one grab is necessary in order to be able to finish move/resize if( !has_grab ) // at least one grab is necessary in order to be able to finish move/resize
{ {
XDestroyWindow( qt_xdisplay(), move_resize_grab_window ); XDestroyWindow( tqt_xdisplay(), move_resize_grab_window );
move_resize_grab_window = None; move_resize_grab_window = None;
return false; return false;
} }
@ -2389,9 +2389,9 @@ void Client::leaveMoveResize()
if ( ( isMove() && rules()->checkMoveResizeMode( options->moveMode ) != Options::Opaque ) if ( ( isMove() && rules()->checkMoveResizeMode( options->moveMode ) != Options::Opaque )
|| ( isResize() && rules()->checkMoveResizeMode( options->resizeMode ) != Options::Opaque ) ) || ( isResize() && rules()->checkMoveResizeMode( options->resizeMode ) != Options::Opaque ) )
ungrabXServer(); ungrabXServer();
XUngrabKeyboard( qt_xdisplay(), GET_QT_X_TIME() ); XUngrabKeyboard( tqt_xdisplay(), GET_QT_X_TIME() );
XUngrabPointer( qt_xdisplay(), GET_QT_X_TIME() ); XUngrabPointer( tqt_xdisplay(), GET_QT_X_TIME() );
XDestroyWindow( qt_xdisplay(), move_resize_grab_window ); XDestroyWindow( tqt_xdisplay(), move_resize_grab_window );
move_resize_grab_window = None; move_resize_grab_window = None;
workspace()->setClientIsMoving(0); workspace()->setClientIsMoving(0);
if( move_faked_activity ) if( move_faked_activity )

@ -26,7 +26,7 @@ GeometryTip::GeometryTip( const XSizeHints* xSizeHints, bool save_under ):
{ {
XSetWindowAttributes attr; XSetWindowAttributes attr;
attr.save_under = True; // use saveunder if possible to avoid weird effects in transparent mode attr.save_under = True; // use saveunder if possible to avoid weird effects in transparent mode
XChangeWindowAttributes( qt_xdisplay(), winId(), CWSaveUnder, &attr ); XChangeWindowAttributes( tqt_xdisplay(), winId(), CWSaveUnder, &attr );
} }
} }

@ -209,7 +209,7 @@ Group::Group( Window leader_P, Workspace* workspace_P )
{ {
leader_client = workspace_P->findClient( WindowMatchPredicate( leader_P )); leader_client = workspace_P->findClient( WindowMatchPredicate( leader_P ));
unsigned long properties[ 2 ] = { 0, NET::WM2StartupId }; unsigned long properties[ 2 ] = { 0, NET::WM2StartupId };
leader_info = new NETWinInfo( qt_xdisplay(), leader_P, workspace()->rootWin(), leader_info = new NETWinInfo( tqt_xdisplay(), leader_P, workspace()->rootWin(),
properties, 2 ); properties, 2 );
} }
workspace()->addGroup( this, Allowed ); workspace()->addGroup( this, Allowed );
@ -580,7 +580,7 @@ void Client::readTransient()
{ {
TRANSIENCY_CHECK( this ); TRANSIENCY_CHECK( this );
Window new_transient_for_id; Window new_transient_for_id;
if( XGetTransientForHint( qt_xdisplay(), window(), &new_transient_for_id )) if( XGetTransientForHint( tqt_xdisplay(), window(), &new_transient_for_id ))
{ {
original_transient_for_id = new_transient_for_id; original_transient_for_id = new_transient_for_id;
new_transient_for_id = verifyTransientFor( new_transient_for_id, true ); new_transient_for_id = verifyTransientFor( new_transient_for_id, true );
@ -787,7 +787,7 @@ Window Client::verifyTransientFor( Window new_transient_for, bool defined )
Window root_return, parent_return; Window root_return, parent_return;
Window* wins = NULL; Window* wins = NULL;
unsigned int nwins; unsigned int nwins;
int r = XQueryTree(qt_xdisplay(), new_transient_for, &root_return, &parent_return, &wins, &nwins); int r = XQueryTree(tqt_xdisplay(), new_transient_for, &root_return, &parent_return, &wins, &nwins);
if ( wins ) if ( wins )
XFree((void *) wins); XFree((void *) wins);
if ( r == 0) if ( r == 0)
@ -828,7 +828,7 @@ Window Client::verifyTransientFor( Window new_transient_for, bool defined )
new_transient_for = workspace()->rootWin(); new_transient_for = workspace()->rootWin();
} }
if( new_property_value != original_transient_for_id ) if( new_property_value != original_transient_for_id )
XSetTransientForHint( qt_xdisplay(), window(), new_property_value ); XSetTransientForHint( tqt_xdisplay(), window(), new_property_value );
return new_transient_for; return new_transient_for;
} }

@ -145,7 +145,7 @@ void KDecorationPreview::setPreviewMask( const TQRegion& reg, int mode, bool act
// FRAME duped from client.cpp // FRAME duped from client.cpp
if( mode == Unsorted ) if( mode == Unsorted )
{ {
XShapeCombineRegion( qt_xdisplay(), widget->winId(), ShapeBounding, 0, 0, XShapeCombineRegion( tqt_xdisplay(), widget->winId(), ShapeBounding, 0, 0,
reg.handle(), ShapeSet ); reg.handle(), ShapeSet );
} }
else else
@ -161,7 +161,7 @@ void KDecorationPreview::setPreviewMask( const TQRegion& reg, int mode, bool act
xrects[ i ].width = rects[ i ].width(); xrects[ i ].width = rects[ i ].width();
xrects[ i ].height = rects[ i ].height(); xrects[ i ].height = rects[ i ].height();
} }
XShapeCombineRectangles( qt_xdisplay(), widget->winId(), ShapeBounding, 0, 0, XShapeCombineRectangles( tqt_xdisplay(), widget->winId(), ShapeBounding, 0, 0,
xrects, rects.count(), ShapeSet, mode ); xrects, rects.count(), ShapeSet, mode );
delete[] xrects; delete[] xrects;
} }

@ -191,13 +191,13 @@ WId DetectDialog::findWindow()
Window child; Window child;
uint mask; uint mask;
int rootX, rootY, x, y; int rootX, rootY, x, y;
Window parent = qt_xrootwin(); Window parent = tqt_xrootwin();
Atom wm_state = XInternAtom( qt_xdisplay(), "WM_STATE", False ); Atom wm_state = XInternAtom( tqt_xdisplay(), "WM_STATE", False );
for( int i = 0; for( int i = 0;
i < 10; i < 10;
++i ) ++i )
{ {
XQueryPointer( qt_xdisplay(), parent, &root, &child, XQueryPointer( tqt_xdisplay(), parent, &root, &child,
&rootX, &rootY, &x, &y, &mask ); &rootX, &rootY, &x, &y, &mask );
if( child == None ) if( child == None )
return 0; return 0;
@ -205,7 +205,7 @@ WId DetectDialog::findWindow()
int format; int format;
unsigned long nitems, after; unsigned long nitems, after;
unsigned char* prop; unsigned char* prop;
if( XGetWindowProperty( qt_xdisplay(), child, wm_state, 0, 0, False, AnyPropertyType, if( XGetWindowProperty( tqt_xdisplay(), child, wm_state, 0, 0, False, AnyPropertyType,
&type, &format, &nitems, &after, &prop ) == Success ) &type, &format, &nitems, &after, &prop ) == Success )
{ {
if( prop != NULL ) if( prop != NULL )

@ -83,6 +83,6 @@ int main( int argc, char* argv[] )
} }
else else
::kill( pid, SIGKILL ); ::kill( pid, SIGKILL );
XKillClient( qt_xdisplay(), id ); XKillClient( tqt_xdisplay(), id );
} }
} }

@ -35,16 +35,16 @@ void KillWindow::start()
{ {
static Cursor kill_cursor = 0; static Cursor kill_cursor = 0;
if (!kill_cursor) if (!kill_cursor)
kill_cursor = XCreateFontCursor(qt_xdisplay(), XC_pirate); kill_cursor = XCreateFontCursor(tqt_xdisplay(), XC_pirate);
if (XGrabPointer(qt_xdisplay(), qt_xrootwin(), False, if (XGrabPointer(tqt_xdisplay(), tqt_xrootwin(), False,
ButtonPressMask | ButtonReleaseMask | ButtonPressMask | ButtonReleaseMask |
PointerMotionMask | PointerMotionMask |
EnterWindowMask | LeaveWindowMask, EnterWindowMask | LeaveWindowMask,
GrabModeAsync, GrabModeAsync, None, GrabModeAsync, GrabModeAsync, None,
kill_cursor, CurrentTime) == GrabSuccess) kill_cursor, CurrentTime) == GrabSuccess)
{ {
XGrabKeyboard(qt_xdisplay(), qt_xrootwin(), False, XGrabKeyboard(tqt_xdisplay(), tqt_xrootwin(), False,
GrabModeAsync, GrabModeAsync, CurrentTime); GrabModeAsync, GrabModeAsync, CurrentTime);
XEvent ev; XEvent ev;
@ -56,12 +56,12 @@ void KillWindow::start()
while (!return_pressed && !escape_pressed && !button_released) while (!return_pressed && !escape_pressed && !button_released)
{ {
XMaskEvent(qt_xdisplay(), KeyPressMask | ButtonPressMask | XMaskEvent(tqt_xdisplay(), KeyPressMask | ButtonPressMask |
ButtonReleaseMask | PointerMotionMask, &ev); ButtonReleaseMask | PointerMotionMask, &ev);
if (ev.type == KeyPress) if (ev.type == KeyPress)
{ {
int kc = XKeycodeToKeysym(qt_xdisplay(), ev.xkey.keycode, 0); int kc = XKeycodeToKeysym(tqt_xdisplay(), ev.xkey.keycode, 0);
int mx = 0; int mx = 0;
int my = 0; int my = 0;
return_pressed = (kc == XK_Return) || (kc == XK_space); return_pressed = (kc == XK_Return) || (kc == XK_space);
@ -96,7 +96,7 @@ void KillWindow::start()
Window root, child; Window root, child;
int dummy1, dummy2, dummy3, dummy4; int dummy1, dummy2, dummy3, dummy4;
unsigned int dummy5; unsigned int dummy5;
if( XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child, if( XQueryPointer( tqt_xdisplay(), tqt_xrootwin(), &root, &child,
&dummy1, &dummy2, &dummy3, &dummy4, &dummy5 ) == true &dummy1, &dummy2, &dummy3, &dummy4, &dummy5 ) == true
&& child != None ) && child != None )
workspace->killWindowId( child ); workspace->killWindowId( child );
@ -104,8 +104,8 @@ void KillWindow::start()
ungrabXServer(); ungrabXServer();
XUngrabKeyboard(qt_xdisplay(), CurrentTime); XUngrabKeyboard(tqt_xdisplay(), CurrentTime);
XUngrabPointer(qt_xdisplay(), CurrentTime); XUngrabPointer(tqt_xdisplay(), CurrentTime);
} }
} }

@ -211,10 +211,10 @@ void Workspace::propagateClients( bool propagate_new_clients )
assert( new_stack[ 0 ] = supportWindow->winId()); assert( new_stack[ 0 ] = supportWindow->winId());
#endif #endif
#if 0 #if 0
XRestackWindows(qt_xdisplay(), new_stack, pos); XRestackWindows(tqt_xdisplay(), new_stack, pos);
delete [] new_stack; delete [] new_stack;
#endif #endif
XRestackWindows(qt_xdisplay(), window_stack, pos); XRestackWindows(tqt_xdisplay(), window_stack, pos);
delete [] dock_shadow_stack; delete [] dock_shadow_stack;
delete [] window_stack; delete [] window_stack;

@ -328,8 +328,8 @@ bool KCommonDecoration::isModalSystemNotification()
int format, result; int format, result;
unsigned long n, left; unsigned long n, left;
Atom kde_wm_system_modal_notification; Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False); kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False);
result = XGetWindowProperty(qt_xdisplay(), windowId(), kde_wm_system_modal_notification, 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, /*(unsigned char **)*/ &data); result = XGetWindowProperty(tqt_xdisplay(), windowId(), kde_wm_system_modal_notification, 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, /*(unsigned char **)*/ &data);
if (result == Success && data != None && format == 32 ) if (result == Success && data != None && format == 32 )
{ {
return TRUE; return TRUE;

@ -96,11 +96,11 @@ Application::Application( )
} }
if (screen_number == -1) if (screen_number == -1)
screen_number = DefaultScreen(qt_xdisplay()); screen_number = DefaultScreen(tqt_xdisplay());
if( !owner.claim( args->isSet( "replace" ), true )) if( !owner.claim( args->isSet( "replace" ), true ))
{ {
Display* dpy = qt_xdisplay(); Display* dpy = tqt_xdisplay();
Window w; Window w;
Atom a; Atom a;
static char net_wm_sm[] = "WM_Sxx"; static char net_wm_sm[] = "WM_Sxx";
@ -156,7 +156,7 @@ Application::Application( )
XSetErrorHandler( x11ErrorHandler ); XSetErrorHandler( x11ErrorHandler );
// check whether another windowmanager is running // check whether another windowmanager is running
XSelectInput(qt_xdisplay(), qt_xrootwin(), SubstructureRedirectMask ); XSelectInput(tqt_xdisplay(), tqt_xrootwin(), SubstructureRedirectMask );
syncX(); // trigger error now syncX(); // trigger error now
options = new Options; options = new Options;
@ -164,8 +164,8 @@ Application::Application( )
// Signal that we are The KWin! // Signal that we are The KWin!
Atom kde_wm_system_modal_notification; Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_IS_KWIN", False); kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_KDE_WM_IS_KWIN", False);
XChangeProperty(qt_xdisplay(), owner.ownerWindow(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L); XChangeProperty(tqt_xdisplay(), owner.ownerWindow(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
// create workspace. // create workspace.
(void) new Workspace( isSessionRestored() ); (void) new Workspace( isSessionRestored() );
@ -180,12 +180,12 @@ Application::Application( )
dcopClient()->send( "ksplash", "", "upAndRunning(TQString)", TQString("wm started")); dcopClient()->send( "ksplash", "", "upAndRunning(TQString)", TQString("wm started"));
XEvent e; XEvent e;
e.xclient.type = ClientMessage; e.xclient.type = ClientMessage;
e.xclient.message_type = XInternAtom( qt_xdisplay(), "_KDE_SPLASH_PROGRESS", False ); e.xclient.message_type = XInternAtom( tqt_xdisplay(), "_KDE_SPLASH_PROGRESS", False );
e.xclient.display = qt_xdisplay(); e.xclient.display = tqt_xdisplay();
e.xclient.window = qt_xrootwin(); e.xclient.window = tqt_xrootwin();
e.xclient.format = 8; e.xclient.format = 8;
strcpy( e.xclient.data.b, "wm started" ); strcpy( e.xclient.data.b, "wm started" );
XSendEvent( qt_xdisplay(), qt_xrootwin(), False, SubstructureNotifyMask, &e ); XSendEvent( tqt_xdisplay(), tqt_xrootwin(), False, SubstructureNotifyMask, &e );
} }
Application::~Application() Application::~Application()
@ -193,7 +193,7 @@ Application::~Application()
delete Workspace::self(); delete Workspace::self();
if( owner.ownerWindow() != None ) // if there was no --replace (no new WM) if( owner.ownerWindow() != None ) // if there was no --replace (no new WM)
{ {
XSetInputFocus( qt_xdisplay(), PointerRoot, RevertToPointerRoot, GET_QT_X_TIME() ); XSetInputFocus( tqt_xdisplay(), PointerRoot, RevertToPointerRoot, GET_QT_X_TIME() );
DCOPRef ref( "kded", "kded" ); DCOPRef ref( "kded", "kded" );
if( !ref.send( "loadModule", TQCString( "kdetrayproxy" ))) if( !ref.send( "loadModule", TQCString( "kdetrayproxy" )))
kdWarning( 176 ) << "Loading of kdetrayproxy failed." << endl; kdWarning( 176 ) << "Loading of kdetrayproxy failed." << endl;
@ -205,7 +205,7 @@ void Application::lostSelection()
{ {
delete Workspace::self(); delete Workspace::self();
// remove windowmanager privileges // remove windowmanager privileges
XSelectInput(qt_xdisplay(), qt_xrootwin(), PropertyChangeMask ); XSelectInput(tqt_xdisplay(), tqt_xrootwin(), PropertyChangeMask );
DCOPRef ref( "kded", "kded" ); DCOPRef ref( "kded", "kded" );
if( !ref.send( "loadModule", TQCString( "kdetrayproxy" ))) if( !ref.send( "loadModule", TQCString( "kdetrayproxy" )))
kdWarning( 176 ) << "Loading of kdetrayproxy failed." << endl; kdWarning( 176 ) << "Loading of kdetrayproxy failed." << endl;
@ -332,7 +332,7 @@ KDE_EXPORT int kdemain( int argc, char * argv[] )
KWinInternal::SessionManaged weAreIndeed; KWinInternal::SessionManaged weAreIndeed;
KWinInternal::SessionSaveDoneHelper helper; KWinInternal::SessionSaveDoneHelper helper;
fcntl(ConnectionNumber(qt_xdisplay()), F_SETFD, 1); fcntl(ConnectionNumber(tqt_xdisplay()), F_SETFD, 1);
TQCString appname; TQCString appname;
if (KWinInternal::screen_number == 0) if (KWinInternal::screen_number == 0)

@ -36,7 +36,7 @@ namespace KWinInternal
bool Client::manage( Window w, bool isMapped ) bool Client::manage( Window w, bool isMapped )
{ {
XWindowAttributes attr; XWindowAttributes attr;
if( !XGetWindowAttributes(qt_xdisplay(), w, &attr)) if( !XGetWindowAttributes(tqt_xdisplay(), w, &attr))
return false; return false;
grabXServer(); grabXServer();
@ -50,7 +50,7 @@ bool Client::manage( Window w, bool isMapped )
// SELI order all these things in some sane manner // SELI order all these things in some sane manner
bool init_minimize = false; bool init_minimize = false;
XWMHints * hints = XGetWMHints(qt_xdisplay(), w ); XWMHints * hints = XGetWMHints(tqt_xdisplay(), w );
if (hints && (hints->flags & StateHint) && hints->initial_state == IconicState) if (hints && (hints->flags & StateHint) && hints->initial_state == IconicState)
init_minimize = true; init_minimize = true;
if (hints) if (hints)
@ -76,12 +76,12 @@ bool Client::manage( Window w, bool isMapped )
NET::WM2ExtendedStrut | NET::WM2ExtendedStrut |
0; 0;
info = new WinInfo( this, qt_xdisplay(), client, qt_xrootwin(), properties, 2 ); info = new WinInfo( this, tqt_xdisplay(), client, tqt_xrootwin(), properties, 2 );
cmap = attr.colormap; cmap = attr.colormap;
XClassHint classHint; XClassHint classHint;
if ( XGetClassHint( qt_xdisplay(), client, &classHint ) ) if ( XGetClassHint( tqt_xdisplay(), client, &classHint ) )
{ {
// Qt3.2 and older had this all lowercase, Qt3.3 capitalized resource class // Qt3.2 and older had this all lowercase, Qt3.3 capitalized resource class
// force lowercase, so that workarounds listing resource classes still work // force lowercase, so that workarounds listing resource classes still work
@ -318,7 +318,7 @@ bool Client::manage( Window w, bool isMapped )
if(( !isSpecialWindow() || isToolbar()) && isMovable()) if(( !isSpecialWindow() || isToolbar()) && isMovable())
keepInArea( area, partial_keep_in_area ); keepInArea( area, partial_keep_in_area );
XShapeSelectInput( qt_xdisplay(), window(), ShapeNotifyMask ); XShapeSelectInput( tqt_xdisplay(), window(), ShapeNotifyMask );
is_shape = Shape::hasShape( window()); is_shape = Shape::hasShape( window());
updateShape(); updateShape();
@ -444,7 +444,7 @@ bool Client::manage( Window w, bool isMapped )
// TODO this should avoid flicker, because real restacking is done // TODO this should avoid flicker, because real restacking is done
// only after manage() finishes, but the window is shown sooner // only after manage() finishes, but the window is shown sooner
// - keep it? // - keep it?
XLowerWindow( qt_xdisplay(), frameId()); XLowerWindow( tqt_xdisplay(), frameId());
// set initial user time directly // set initial user time directly
user_time = readUserTimeMapTimestamp( asn_valid ? &asn_id : NULL, asn_valid ? &asn_data : NULL, session ); user_time = readUserTimeMapTimestamp( asn_valid ? &asn_id : NULL, asn_valid ? &asn_data : NULL, session );
@ -558,30 +558,30 @@ void Client::embedClient( Window w, const XWindowAttributes &attr )
assert( wrapper == None ); assert( wrapper == None );
client = w; client = w;
// we don't want the window to be destroyed when we are destroyed // we don't want the window to be destroyed when we are destroyed
XAddToSaveSet( qt_xdisplay(), client ); XAddToSaveSet( tqt_xdisplay(), client );
XSelectInput( qt_xdisplay(), client, NoEventMask ); XSelectInput( tqt_xdisplay(), client, NoEventMask );
XUnmapWindow( qt_xdisplay(), client ); XUnmapWindow( tqt_xdisplay(), client );
XWindowChanges wc; // set the border width to 0 XWindowChanges wc; // set the border width to 0
wc.border_width = 0; // TODO possibly save this, and also use it for initial configuring of the window wc.border_width = 0; // TODO possibly save this, and also use it for initial configuring of the window
XConfigureWindow( qt_xdisplay(), client, CWBorderWidth, &wc ); XConfigureWindow( tqt_xdisplay(), client, CWBorderWidth, &wc );
XSetWindowAttributes swa; XSetWindowAttributes swa;
swa.colormap = attr.colormap; swa.colormap = attr.colormap;
swa.background_pixmap = None; swa.background_pixmap = None;
swa.border_pixel = 0; swa.border_pixel = 0;
frame = XCreateWindow( qt_xdisplay(), qt_xrootwin(), 0, 0, 1, 1, 0, frame = XCreateWindow( tqt_xdisplay(), tqt_xrootwin(), 0, 0, 1, 1, 0,
attr.depth, InputOutput, attr.visual, attr.depth, InputOutput, attr.visual,
CWColormap | CWBackPixmap | CWBorderPixel, &swa ); CWColormap | CWBackPixmap | CWBorderPixel, &swa );
wrapper = XCreateWindow( qt_xdisplay(), frame, 0, 0, 1, 1, 0, wrapper = XCreateWindow( tqt_xdisplay(), frame, 0, 0, 1, 1, 0,
attr.depth, InputOutput, attr.visual, attr.depth, InputOutput, attr.visual,
CWColormap | CWBackPixmap | CWBorderPixel, &swa ); CWColormap | CWBackPixmap | CWBorderPixel, &swa );
XDefineCursor( qt_xdisplay(), frame, tqarrowCursor.handle()); XDefineCursor( tqt_xdisplay(), frame, tqarrowCursor.handle());
// some apps are stupid and don't define their own cursor - set the arrow one for them // some apps are stupid and don't define their own cursor - set the arrow one for them
XDefineCursor( qt_xdisplay(), wrapper, tqarrowCursor.handle()); XDefineCursor( tqt_xdisplay(), wrapper, tqarrowCursor.handle());
XReparentWindow( qt_xdisplay(), client, wrapper, 0, 0 ); XReparentWindow( tqt_xdisplay(), client, wrapper, 0, 0 );
XSelectInput( qt_xdisplay(), frame, XSelectInput( tqt_xdisplay(), frame,
KeyPressMask | KeyReleaseMask | KeyPressMask | KeyReleaseMask |
ButtonPressMask | ButtonReleaseMask | ButtonPressMask | ButtonReleaseMask |
KeymapStateMask | KeymapStateMask |
@ -592,8 +592,8 @@ void Client::embedClient( Window w, const XWindowAttributes &attr )
ExposureMask | ExposureMask |
PropertyChangeMask | PropertyChangeMask |
StructureNotifyMask | SubstructureRedirectMask ); StructureNotifyMask | SubstructureRedirectMask );
XSelectInput( qt_xdisplay(), wrapper, ClientWinMask | SubstructureNotifyMask ); XSelectInput( tqt_xdisplay(), wrapper, ClientWinMask | SubstructureNotifyMask );
XSelectInput( qt_xdisplay(), client, XSelectInput( tqt_xdisplay(), client,
FocusChangeMask | FocusChangeMask |
PropertyChangeMask | PropertyChangeMask |
ColormapChangeMask | ColormapChangeMask |

@ -109,7 +109,7 @@ void PopupInfo::hide()
TQWidget::hide(); TQWidget::hide();
TQApplication::syncX(); TQApplication::syncX();
XEvent otherEvent; XEvent otherEvent;
while (XCheckTypedEvent (qt_xdisplay(), EnterNotify, &otherEvent ) ) while (XCheckTypedEvent (tqt_xdisplay(), EnterNotify, &otherEvent ) )
; ;
m_shown = false; m_shown = false;
} }

@ -57,22 +57,22 @@ TabBox::TabBox( Workspace *ws, const char *name )
XSetWindowAttributes attr; XSetWindowAttributes attr;
attr.override_redirect = 1; attr.override_redirect = 1;
outline_left = XCreateWindow( qt_xdisplay(), qt_xrootwin(), 0, 0, 1, 1, 0, outline_left = XCreateWindow( tqt_xdisplay(), tqt_xrootwin(), 0, 0, 1, 1, 0,
CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect, &attr ); CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect, &attr );
outline_right = XCreateWindow( qt_xdisplay(), qt_xrootwin(), 0, 0, 1, 1, 0, outline_right = XCreateWindow( tqt_xdisplay(), tqt_xrootwin(), 0, 0, 1, 1, 0,
CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect, &attr ); CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect, &attr );
outline_top = XCreateWindow( qt_xdisplay(), qt_xrootwin(), 0, 0, 1, 1, 0, outline_top = XCreateWindow( tqt_xdisplay(), tqt_xrootwin(), 0, 0, 1, 1, 0,
CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect, &attr ); CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect, &attr );
outline_bottom = XCreateWindow( qt_xdisplay(), qt_xrootwin(), 0, 0, 1, 1, 0, outline_bottom = XCreateWindow( tqt_xdisplay(), tqt_xrootwin(), 0, 0, 1, 1, 0,
CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect, &attr ); CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect, &attr );
} }
TabBox::~TabBox() TabBox::~TabBox()
{ {
XDestroyWindow( qt_xdisplay(), outline_left ); XDestroyWindow( tqt_xdisplay(), outline_left );
XDestroyWindow( qt_xdisplay(), outline_right ); XDestroyWindow( tqt_xdisplay(), outline_right );
XDestroyWindow( qt_xdisplay(), outline_top ); XDestroyWindow( tqt_xdisplay(), outline_top );
XDestroyWindow( qt_xdisplay(), outline_bottom ); XDestroyWindow( tqt_xdisplay(), outline_bottom );
} }
@ -344,10 +344,10 @@ int TabBox::currentDesktop()
void TabBox::showEvent( TQShowEvent* ) void TabBox::showEvent( TQShowEvent* )
{ {
updateOutline(); updateOutline();
XRaiseWindow( qt_xdisplay(), outline_left ); XRaiseWindow( tqt_xdisplay(), outline_left );
XRaiseWindow( qt_xdisplay(), outline_right ); XRaiseWindow( tqt_xdisplay(), outline_right );
XRaiseWindow( qt_xdisplay(), outline_top ); XRaiseWindow( tqt_xdisplay(), outline_top );
XRaiseWindow( qt_xdisplay(), outline_bottom ); XRaiseWindow( tqt_xdisplay(), outline_bottom );
raise(); raise();
} }
@ -357,10 +357,10 @@ void TabBox::showEvent( TQShowEvent* )
*/ */
void TabBox::hideEvent( TQHideEvent* ) void TabBox::hideEvent( TQHideEvent* )
{ {
XUnmapWindow( qt_xdisplay(), outline_left ); XUnmapWindow( tqt_xdisplay(), outline_left );
XUnmapWindow( qt_xdisplay(), outline_right ); XUnmapWindow( tqt_xdisplay(), outline_right );
XUnmapWindow( qt_xdisplay(), outline_top ); XUnmapWindow( tqt_xdisplay(), outline_top );
XUnmapWindow( qt_xdisplay(), outline_bottom ); XUnmapWindow( tqt_xdisplay(), outline_bottom );
} }
/*! /*!
@ -557,17 +557,17 @@ void TabBox::updateOutline()
Client* c = currentClient(); Client* c = currentClient();
if( !options->tabboxOutline || c == NULL || this->isHidden() || !c->isShown( true ) || !c->isOnCurrentDesktop()) if( !options->tabboxOutline || c == NULL || this->isHidden() || !c->isShown( true ) || !c->isOnCurrentDesktop())
{ {
XUnmapWindow( qt_xdisplay(), outline_left ); XUnmapWindow( tqt_xdisplay(), outline_left );
XUnmapWindow( qt_xdisplay(), outline_right ); XUnmapWindow( tqt_xdisplay(), outline_right );
XUnmapWindow( qt_xdisplay(), outline_top ); XUnmapWindow( tqt_xdisplay(), outline_top );
XUnmapWindow( qt_xdisplay(), outline_bottom ); XUnmapWindow( tqt_xdisplay(), outline_bottom );
return; return;
} }
// left/right parts are between top/bottom, they don't reach as far as the corners // left/right parts are between top/bottom, they don't reach as far as the corners
XMoveResizeWindow( qt_xdisplay(), outline_left, c->x(), c->y() + 5, 5, c->height() - 10 ); XMoveResizeWindow( tqt_xdisplay(), outline_left, c->x(), c->y() + 5, 5, c->height() - 10 );
XMoveResizeWindow( qt_xdisplay(), outline_right, c->x() + c->width() - 5, c->y() + 5, 5, c->height() - 10 ); XMoveResizeWindow( tqt_xdisplay(), outline_right, c->x() + c->width() - 5, c->y() + 5, 5, c->height() - 10 );
XMoveResizeWindow( qt_xdisplay(), outline_top, c->x(), c->y(), c->width(), 5 ); XMoveResizeWindow( tqt_xdisplay(), outline_top, c->x(), c->y(), c->width(), 5 );
XMoveResizeWindow( qt_xdisplay(), outline_bottom, c->x(), c->y() + c->height() - 5, c->width(), 5 ); XMoveResizeWindow( tqt_xdisplay(), outline_bottom, c->x(), c->y() + c->height() - 5, c->width(), 5 );
{ {
TQPixmap pix( 5, c->height() - 10 ); TQPixmap pix( 5, c->height() - 10 );
TQPainter p( &pix ); TQPainter p( &pix );
@ -580,8 +580,8 @@ void TabBox::updateOutline()
p.setPen( black ); p.setPen( black );
p.drawLine( 2, 0, 2, pix.height() - 1 ); p.drawLine( 2, 0, 2, pix.height() - 1 );
p.end(); p.end();
XSetWindowBackgroundPixmap( qt_xdisplay(), outline_left, pix.handle()); XSetWindowBackgroundPixmap( tqt_xdisplay(), outline_left, pix.handle());
XSetWindowBackgroundPixmap( qt_xdisplay(), outline_right, pix.handle()); XSetWindowBackgroundPixmap( tqt_xdisplay(), outline_right, pix.handle());
} }
{ {
TQPixmap pix( c->width(), 5 ); TQPixmap pix( c->width(), 5 );
@ -603,7 +603,7 @@ void TabBox::updateOutline()
p.drawLine( 2, 2, 2, 4 ); p.drawLine( 2, 2, 2, 4 );
p.drawLine( pix.width() - 1 - 2, 2, pix.width() - 1 - 2, 4 ); p.drawLine( pix.width() - 1 - 2, 2, pix.width() - 1 - 2, 4 );
p.end(); p.end();
XSetWindowBackgroundPixmap( qt_xdisplay(), outline_top, pix.handle()); XSetWindowBackgroundPixmap( tqt_xdisplay(), outline_top, pix.handle());
} }
{ {
TQPixmap pix( c->width(), 5 ); TQPixmap pix( c->width(), 5 );
@ -625,16 +625,16 @@ void TabBox::updateOutline()
p.drawLine( 2, 0, 2, 2 ); p.drawLine( 2, 0, 2, 2 );
p.drawLine( pix.width() - 1 - 2, 0, pix.width() - 1 - 2, 2 ); p.drawLine( pix.width() - 1 - 2, 0, pix.width() - 1 - 2, 2 );
p.end(); p.end();
XSetWindowBackgroundPixmap( qt_xdisplay(), outline_bottom, pix.handle()); XSetWindowBackgroundPixmap( tqt_xdisplay(), outline_bottom, pix.handle());
} }
XClearWindow( qt_xdisplay(), outline_left ); XClearWindow( tqt_xdisplay(), outline_left );
XClearWindow( qt_xdisplay(), outline_right ); XClearWindow( tqt_xdisplay(), outline_right );
XClearWindow( qt_xdisplay(), outline_top ); XClearWindow( tqt_xdisplay(), outline_top );
XClearWindow( qt_xdisplay(), outline_bottom ); XClearWindow( tqt_xdisplay(), outline_bottom );
XMapWindow( qt_xdisplay(), outline_left ); XMapWindow( tqt_xdisplay(), outline_left );
XMapWindow( qt_xdisplay(), outline_right ); XMapWindow( tqt_xdisplay(), outline_right );
XMapWindow( qt_xdisplay(), outline_top ); XMapWindow( tqt_xdisplay(), outline_top );
XMapWindow( qt_xdisplay(), outline_bottom ); XMapWindow( tqt_xdisplay(), outline_bottom );
} }
void TabBox::hide() void TabBox::hide()
@ -643,7 +643,7 @@ void TabBox::hide()
TQWidget::hide(); TQWidget::hide();
TQApplication::syncX(); TQApplication::syncX();
XEvent otherEvent; XEvent otherEvent;
while (XCheckTypedEvent (qt_xdisplay(), EnterNotify, &otherEvent ) ) while (XCheckTypedEvent (tqt_xdisplay(), EnterNotify, &otherEvent ) )
; ;
} }
@ -692,7 +692,7 @@ void TabBox::delayedShow()
void TabBox::handleMouseEvent( XEvent* e ) void TabBox::handleMouseEvent( XEvent* e )
{ {
XAllowEvents( qt_xdisplay(), AsyncPointer, GET_QT_X_TIME() ); XAllowEvents( tqt_xdisplay(), AsyncPointer, GET_QT_X_TIME() );
if( e->type != ButtonPress ) if( e->type != ButtonPress )
return; return;
TQPoint pos( e->xbutton.x_root, e->xbutton.y_root ); TQPoint pos( e->xbutton.x_root, e->xbutton.y_root );
@ -757,12 +757,12 @@ bool areKeySymXsDepressed( bool bAll, const uint keySyms[], int nKeySyms )
kdDebug(125) << "areKeySymXsDepressed: " << (bAll ? "all of " : "any of ") << nKeySyms << endl; kdDebug(125) << "areKeySymXsDepressed: " << (bAll ? "all of " : "any of ") << nKeySyms << endl;
XQueryKeymap( qt_xdisplay(), keymap ); XQueryKeymap( tqt_xdisplay(), keymap );
for( int iKeySym = 0; iKeySym < nKeySyms; iKeySym++ ) for( int iKeySym = 0; iKeySym < nKeySyms; iKeySym++ )
{ {
uint keySymX = keySyms[ iKeySym ]; uint keySymX = keySyms[ iKeySym ];
uchar keyCodeX = XKeysymToKeycode( qt_xdisplay(), keySymX ); uchar keyCodeX = XKeysymToKeycode( tqt_xdisplay(), keySymX );
int i = keyCodeX / 8; int i = keyCodeX / 8;
char mask = 1 << (keyCodeX - (i * 8)); char mask = 1 << (keyCodeX - (i * 8));
@ -844,13 +844,13 @@ static bool areModKeysDepressed( const KShortcut& cut )
void Workspace::slotWalkThroughWindows() void Workspace::slotWalkThroughWindows()
{ {
if ( root != qt_xrootwin() ) if ( root != tqt_xrootwin() )
return; return;
if ( tab_grab || control_grab ) if ( tab_grab || control_grab )
return; return;
if ( options->altTabStyle == Options::CDE || !options->focusPolicyIsReasonable()) if ( options->altTabStyle == Options::CDE || !options->focusPolicyIsReasonable())
{ {
//XUngrabKeyboard(qt_xdisplay(), GET_QT_X_TIME()); // need that because of accelerator raw mode //XUngrabKeyboard(tqt_xdisplay(), GET_QT_X_TIME()); // need that because of accelerator raw mode
// CDE style raise / lower // CDE style raise / lower
CDEWalkThroughWindows( true ); CDEWalkThroughWindows( true );
} }
@ -870,7 +870,7 @@ void Workspace::slotWalkThroughWindows()
void Workspace::slotWalkBackThroughWindows() void Workspace::slotWalkBackThroughWindows()
{ {
if ( root != qt_xrootwin() ) if ( root != tqt_xrootwin() )
return; return;
if( tab_grab || control_grab ) if( tab_grab || control_grab )
return; return;
@ -895,7 +895,7 @@ void Workspace::slotWalkBackThroughWindows()
void Workspace::slotWalkThroughDesktops() void Workspace::slotWalkThroughDesktops()
{ {
if ( root != qt_xrootwin() ) if ( root != tqt_xrootwin() )
return; return;
if( tab_grab || control_grab ) if( tab_grab || control_grab )
return; return;
@ -912,7 +912,7 @@ void Workspace::slotWalkThroughDesktops()
void Workspace::slotWalkBackThroughDesktops() void Workspace::slotWalkBackThroughDesktops()
{ {
if ( root != qt_xrootwin() ) if ( root != tqt_xrootwin() )
return; return;
if( tab_grab || control_grab ) if( tab_grab || control_grab )
return; return;
@ -929,7 +929,7 @@ void Workspace::slotWalkBackThroughDesktops()
void Workspace::slotWalkThroughDesktopList() void Workspace::slotWalkThroughDesktopList()
{ {
if ( root != qt_xrootwin() ) if ( root != tqt_xrootwin() )
return; return;
if( tab_grab || control_grab ) if( tab_grab || control_grab )
return; return;
@ -946,7 +946,7 @@ void Workspace::slotWalkThroughDesktopList()
void Workspace::slotWalkBackThroughDesktopList() void Workspace::slotWalkBackThroughDesktopList()
{ {
if ( root != qt_xrootwin() ) if ( root != tqt_xrootwin() )
return; return;
if( tab_grab || control_grab ) if( tab_grab || control_grab )
return; return;
@ -1185,7 +1185,7 @@ void Workspace::tabBoxKeyRelease( const XKeyEvent& ev )
release = true; release = true;
else else
{ {
XModifierKeymap* xmk = XGetModifierMapping(qt_xdisplay()); XModifierKeymap* xmk = XGetModifierMapping(tqt_xdisplay());
for (int i=0; i<xmk->max_keypermod; i++) for (int i=0; i<xmk->max_keypermod; i++)
if (xmk->modifiermap[xmk->max_keypermod * mod_index + i] if (xmk->modifiermap[xmk->max_keypermod * mod_index + i]
== ev.keycode) == ev.keycode)
@ -1316,7 +1316,7 @@ Client* Workspace::previousStaticClient( Client* c ) const
bool Workspace::establishTabBoxGrab() bool Workspace::establishTabBoxGrab()
{ {
if( XGrabKeyboard( qt_xdisplay(), root, FALSE, if( XGrabKeyboard( tqt_xdisplay(), root, FALSE,
GrabModeAsync, GrabModeAsync, GET_QT_X_TIME()) != GrabSuccess ) GrabModeAsync, GrabModeAsync, GET_QT_X_TIME()) != GrabSuccess )
return false; return false;
// Don't try to establish a global mouse grab using XGrabPointer, as that would prevent // Don't try to establish a global mouse grab using XGrabPointer, as that would prevent
@ -1333,7 +1333,7 @@ bool Workspace::establishTabBoxGrab()
void Workspace::removeTabBoxGrab() void Workspace::removeTabBoxGrab()
{ {
XUngrabKeyboard(qt_xdisplay(), GET_QT_X_TIME()); XUngrabKeyboard(tqt_xdisplay(), GET_QT_X_TIME());
assert( forced_global_mouse_grab ); assert( forced_global_mouse_grab );
forced_global_mouse_grab = false; forced_global_mouse_grab = false;
if( active_client != NULL ) if( active_client != NULL )

@ -140,7 +140,7 @@ void KDecorationPreview::setPreviewMask( const TQRegion& reg, int mode )
// FRAME duped from client.cpp // FRAME duped from client.cpp
if( mode == Unsorted ) if( mode == Unsorted )
{ {
XShapeCombineRegion( qt_xdisplay(), widget->winId(), ShapeBounding, 0, 0, XShapeCombineRegion( tqt_xdisplay(), widget->winId(), ShapeBounding, 0, 0,
reg.handle(), ShapeSet ); reg.handle(), ShapeSet );
} }
else else
@ -156,7 +156,7 @@ void KDecorationPreview::setPreviewMask( const TQRegion& reg, int mode )
xrects[ i ].width = rects[ i ].width(); xrects[ i ].width = rects[ i ].width();
xrects[ i ].height = rects[ i ].height(); xrects[ i ].height = rects[ i ].height();
} }
XShapeCombineRectangles( qt_xdisplay(), widget->winId(), ShapeBounding, 0, 0, XShapeCombineRectangles( tqt_xdisplay(), widget->winId(), ShapeBounding, 0, 0,
xrects, rects.count(), ShapeSet, mode ); xrects, rects.count(), ShapeSet, mode );
delete[] xrects; delete[] xrects;
} }

@ -58,7 +58,7 @@ bool Shape::hasShape( WId w)
int boundingShaped = 0, clipShaped = 0; int boundingShaped = 0, clipShaped = 0;
if (!available()) if (!available())
return FALSE; return FALSE;
XShapeQueryExtents(qt_xdisplay(), w, XShapeQueryExtents(tqt_xdisplay(), w,
&boundingShaped, &xws, &yws, &wws, &hws, &boundingShaped, &xws, &yws, &wws, &hws,
&clipShaped, &xbs, &ybs, &wbs, &hbs); &clipShaped, &xbs, &ybs, &wbs, &hbs);
return boundingShaped != 0; return boundingShaped != 0;
@ -73,10 +73,10 @@ void Shape::init()
{ {
twin_shape_version = 0; twin_shape_version = 0;
int dummy; int dummy;
if( !XShapeQueryExtension(qt_xdisplay(), &twin_shape_event, &dummy)) if( !XShapeQueryExtension(tqt_xdisplay(), &twin_shape_event, &dummy))
return; return;
int major, minor; int major, minor;
if( !XShapeQueryVersion( qt_xdisplay(), &major, &minor )) if( !XShapeQueryVersion( tqt_xdisplay(), &major, &minor ))
return; return;
twin_shape_version = major * 0x10 + minor; twin_shape_version = major * 0x10 + minor;
} }
@ -89,7 +89,7 @@ void Motif::readFlags( WId w, bool& noborder, bool& resize, bool& move,
unsigned long length, after; unsigned long length, after;
unsigned char* data; unsigned char* data;
MwmHints* hints = 0; MwmHints* hints = 0;
if ( XGetWindowProperty( qt_xdisplay(), w, atoms->motif_wm_hints, 0, 5, if ( XGetWindowProperty( tqt_xdisplay(), w, atoms->motif_wm_hints, 0, 5,
FALSE, atoms->motif_wm_hints, &type, &format, FALSE, atoms->motif_wm_hints, &type, &format,
&length, &after, &data ) == Success ) &length, &after, &data ) == Success )
{ {
@ -142,10 +142,10 @@ KWinSelectionOwner::KWinSelectionOwner( int screen_P )
Atom KWinSelectionOwner::make_selection_atom( int screen_P ) Atom KWinSelectionOwner::make_selection_atom( int screen_P )
{ {
if( screen_P < 0 ) if( screen_P < 0 )
screen_P = DefaultScreen( qt_xdisplay()); screen_P = DefaultScreen( tqt_xdisplay());
char tmp[ 30 ]; char tmp[ 30 ];
sprintf( tmp, "WM_S%d", screen_P ); sprintf( tmp, "WM_S%d", screen_P );
return XInternAtom( qt_xdisplay(), tmp, False ); return XInternAtom( tqt_xdisplay(), tmp, False );
} }
void KWinSelectionOwner::getAtoms() void KWinSelectionOwner::getAtoms()
@ -156,7 +156,7 @@ void KWinSelectionOwner::getAtoms()
Atom atoms[ 1 ]; Atom atoms[ 1 ];
const char* const names[] = const char* const names[] =
{ "VERSION" }; { "VERSION" };
XInternAtoms( qt_xdisplay(), const_cast< char** >( names ), 1, False, atoms ); XInternAtoms( tqt_xdisplay(), const_cast< char** >( names ), 1, False, atoms );
xa_version = atoms[ 0 ]; xa_version = atoms[ 0 ];
} }
} }
@ -166,7 +166,7 @@ void KWinSelectionOwner::replyTargets( Atom property_P, Window requestor_P )
KSelectionOwner::replyTargets( property_P, requestor_P ); KSelectionOwner::replyTargets( property_P, requestor_P );
Atom atoms[ 1 ] = { xa_version }; Atom atoms[ 1 ] = { xa_version };
// PropModeAppend ! // PropModeAppend !
XChangeProperty( qt_xdisplay(), requestor_P, property_P, XA_ATOM, 32, PropModeAppend, XChangeProperty( tqt_xdisplay(), requestor_P, property_P, XA_ATOM, 32, PropModeAppend,
reinterpret_cast< unsigned char* >( atoms ), 1 ); reinterpret_cast< unsigned char* >( atoms ), 1 );
} }
@ -175,7 +175,7 @@ bool KWinSelectionOwner::genericReply( Atom target_P, Atom property_P, Window re
if( target_P == xa_version ) if( target_P == xa_version )
{ {
long version[] = { 2, 0 }; long version[] = { 2, 0 };
XChangeProperty( qt_xdisplay(), requestor_P, property_P, XA_INTEGER, 32, XChangeProperty( tqt_xdisplay(), requestor_P, property_P, XA_INTEGER, 32,
PropModeReplace, reinterpret_cast< unsigned char* >( &version ), 2 ); PropModeReplace, reinterpret_cast< unsigned char* >( &version ), 2 );
} }
else else
@ -195,7 +195,7 @@ TQCString getStringProperty(WId w, Atom prop, char separator)
unsigned char *data = 0; unsigned char *data = 0;
TQCString result = ""; TQCString result = "";
KXErrorHandler handler; // ignore errors KXErrorHandler handler; // ignore errors
status = XGetWindowProperty( qt_xdisplay(), w, prop, 0, 10000, status = XGetWindowProperty( tqt_xdisplay(), w, prop, 0, 10000,
FALSE, XA_STRING, &type, &format, FALSE, XA_STRING, &type, &format,
&nitems, &extra, &data ); &nitems, &extra, &data );
if ( status == Success) if ( status == Success)
@ -250,8 +250,8 @@ static Bool update_x_time_predicate( Display*, XEvent* event, XPointer )
} }
/* /*
Updates qt_x_time. This used to simply fetch current timestamp from the server, Updates tqt_x_time. This used to simply fetch current timestamp from the server,
but that can cause qt_x_time to be newer than timestamp of events that are but that can cause tqt_x_time to be newer than timestamp of events that are
still in our events queue, thus e.g. making XSetInputFocus() caused by such still in our events queue, thus e.g. making XSetInputFocus() caused by such
event to be ignored. Therefore events queue is searched for first event to be ignored. Therefore events queue is searched for first
event with timestamp, and extra PropertyNotify is generated in order to make event with timestamp, and extra PropertyNotify is generated in order to make
@ -263,20 +263,20 @@ void updateXTime()
if ( !w ) if ( !w )
w = new TQWidget; w = new TQWidget;
long data = 1; long data = 1;
XChangeProperty(qt_xdisplay(), w->winId(), atoms->twin_running, atoms->twin_running, 32, XChangeProperty(tqt_xdisplay(), w->winId(), atoms->twin_running, atoms->twin_running, 32,
PropModeAppend, (unsigned char*) &data, 1); PropModeAppend, (unsigned char*) &data, 1);
next_x_time = CurrentTime; next_x_time = CurrentTime;
XEvent dummy; XEvent dummy;
XCheckIfEvent( qt_xdisplay(), &dummy, update_x_time_predicate, NULL ); XCheckIfEvent( tqt_xdisplay(), &dummy, update_x_time_predicate, NULL );
if( next_x_time == CurrentTime ) if( next_x_time == CurrentTime )
{ {
XSync( qt_xdisplay(), False ); XSync( tqt_xdisplay(), False );
XCheckIfEvent( qt_xdisplay(), &dummy, update_x_time_predicate, NULL ); XCheckIfEvent( tqt_xdisplay(), &dummy, update_x_time_predicate, NULL );
} }
assert( next_x_time != CurrentTime ); assert( next_x_time != CurrentTime );
SET_QT_X_TIME(next_x_time); SET_QT_X_TIME(next_x_time);
XEvent ev; // remove the PropertyNotify event from the events queue XEvent ev; // remove the PropertyNotify event from the events queue
XWindowEvent( qt_xdisplay(), w->winId(), PropertyChangeMask, &ev ); XWindowEvent( tqt_xdisplay(), w->winId(), PropertyChangeMask, &ev );
} }
static int server_grab_count = 0; static int server_grab_count = 0;
@ -284,7 +284,7 @@ static int server_grab_count = 0;
void grabXServer() void grabXServer()
{ {
if( ++server_grab_count == 1 ) if( ++server_grab_count == 1 )
XGrabServer( qt_xdisplay()); XGrabServer( tqt_xdisplay());
} }
void ungrabXServer() void ungrabXServer()
@ -292,8 +292,8 @@ void ungrabXServer()
assert( server_grab_count > 0 ); assert( server_grab_count > 0 );
if( --server_grab_count == 0 ) if( --server_grab_count == 0 )
{ {
XUngrabServer( qt_xdisplay()); XUngrabServer( tqt_xdisplay());
XFlush( qt_xdisplay()); XFlush( tqt_xdisplay());
Notify::sendPendingEvents(); Notify::sendPendingEvents();
} }
} }
@ -334,7 +334,7 @@ ShortcutDialog::ShortcutDialog( const KShortcut& cut )
// make it a popup, so that it has the grab // make it a popup, so that it has the grab
XSetWindowAttributes attrs; XSetWindowAttributes attrs;
attrs.override_redirect = True; attrs.override_redirect = True;
XChangeWindowAttributes( qt_xdisplay(), winId(), CWOverrideRedirect, &attrs ); XChangeWindowAttributes( tqt_xdisplay(), winId(), CWOverrideRedirect, &attrs );
setWFlags( WType_Popup ); setWFlags( WType_Popup );
} }

@ -63,9 +63,9 @@ bool supportsCompMgr()
{ {
int i; int i;
bool damageExt = XQueryExtension(qt_xdisplay(), "DAMAGE", &i, &i, &i); bool damageExt = XQueryExtension(tqt_xdisplay(), "DAMAGE", &i, &i, &i);
bool compositeExt = XQueryExtension(qt_xdisplay(), "Composite", &i, &i, &i); bool compositeExt = XQueryExtension(tqt_xdisplay(), "Composite", &i, &i, &i);
bool xfixesExt = XQueryExtension(qt_xdisplay(), "XFIXES", &i, &i, &i); bool xfixesExt = XQueryExtension(tqt_xdisplay(), "XFIXES", &i, &i, &i);
return damageExt && compositeExt && xfixesExt; return damageExt && compositeExt && xfixesExt;
} }
@ -140,8 +140,8 @@ Workspace::Workspace( bool restore )
{ {
_self = this; _self = this;
mgr = new PluginMgr; mgr = new PluginMgr;
root = qt_xrootwin(); root = tqt_xrootwin();
default_colormap = DefaultColormap(qt_xdisplay(), qt_xscreen() ); default_colormap = DefaultColormap(tqt_xdisplay(), tqt_xscreen() );
installed_colormap = default_colormap; installed_colormap = default_colormap;
session.setAutoDelete( TRUE ); session.setAutoDelete( TRUE );
@ -176,7 +176,7 @@ Workspace::Workspace( bool restore )
KStartupInfo::DisableKWinModule | KStartupInfo::AnnounceSilenceChanges, this ); KStartupInfo::DisableKWinModule | KStartupInfo::AnnounceSilenceChanges, this );
// select windowmanager privileges // select windowmanager privileges
XSelectInput(qt_xdisplay(), root, XSelectInput(tqt_xdisplay(), root,
KeyPressMask | KeyPressMask |
PropertyChangeMask | PropertyChangeMask |
ColormapChangeMask | ColormapChangeMask |
@ -191,8 +191,8 @@ Workspace::Workspace( bool restore )
long data = 1; long data = 1;
XChangeProperty( XChangeProperty(
qt_xdisplay(), tqt_xdisplay(),
qt_xrootwin(), tqt_xrootwin(),
atoms->twin_running, atoms->twin_running,
atoms->twin_running, atoms->twin_running,
32, 32,
@ -286,13 +286,13 @@ void Workspace::init()
// maximizedWindowCounter = 0; // maximizedWindowCounter = 0;
supportWindow = new TQWidget; supportWindow = new TQWidget;
XLowerWindow( qt_xdisplay(), supportWindow->winId()); // see usage in layers.cpp XLowerWindow( tqt_xdisplay(), supportWindow->winId()); // see usage in layers.cpp
XSetWindowAttributes attr; XSetWindowAttributes attr;
attr.override_redirect = 1; attr.override_redirect = 1;
null_focus_window = XCreateWindow( qt_xdisplay(), qt_xrootwin(), -1,-1, 1, 1, 0, CopyFromParent, null_focus_window = XCreateWindow( tqt_xdisplay(), tqt_xrootwin(), -1,-1, 1, 1, 0, CopyFromParent,
InputOnly, CopyFromParent, CWOverrideRedirect, &attr ); InputOnly, CopyFromParent, CWOverrideRedirect, &attr );
XMapWindow(qt_xdisplay(), null_focus_window); XMapWindow(tqt_xdisplay(), null_focus_window);
unsigned long protocols[ 5 ] = unsigned long protocols[ 5 ] =
{ {
@ -375,13 +375,13 @@ void Workspace::init()
, ,
}; };
rootInfo = new RootInfo( this, qt_xdisplay(), supportWindow->winId(), "KWin", rootInfo = new RootInfo( this, tqt_xdisplay(), supportWindow->winId(), "KWin",
protocols, 5, qt_xscreen() ); protocols, 5, tqt_xscreen() );
loadDesktopSettings(); loadDesktopSettings();
updateDesktopLayout(); updateDesktopLayout();
// extra NETRootInfo instance in Client mode is needed to get the values of the properties // extra NETRootInfo instance in Client mode is needed to get the values of the properties
NETRootInfo client_info( qt_xdisplay(), NET::ActiveWindow | NET::CurrentDesktop ); NETRootInfo client_info( tqt_xdisplay(), NET::ActiveWindow | NET::CurrentDesktop );
int initial_desktop; int initial_desktop;
if( !kapp->isSessionRestored()) if( !kapp->isSessionRestored())
initial_desktop = client_info.currentDesktop(); initial_desktop = client_info.currentDesktop();
@ -413,8 +413,8 @@ void Workspace::init()
++block_focus; // because it will be set below ++block_focus; // because it will be set below
char nm[ 100 ]; char nm[ 100 ];
sprintf( nm, "_KDE_TOPMENU_OWNER_S%d", DefaultScreen( qt_xdisplay())); sprintf( nm, "_KDE_TOPMENU_OWNER_S%d", DefaultScreen( tqt_xdisplay()));
Atom topmenu_atom = XInternAtom( qt_xdisplay(), nm, False ); Atom topmenu_atom = XInternAtom( tqt_xdisplay(), nm, False );
topmenu_selection = new KSelectionOwner( topmenu_atom ); topmenu_selection = new KSelectionOwner( topmenu_atom );
topmenu_watcher = new KSelectionWatcher( topmenu_atom ); topmenu_watcher = new KSelectionWatcher( topmenu_atom );
// TODO grabXServer(); - where exactly put this? topmenu selection claiming down belong must be before // TODO grabXServer(); - where exactly put this? topmenu selection claiming down belong must be before
@ -429,11 +429,11 @@ void Workspace::init()
unsigned int i, nwins; unsigned int i, nwins;
Window root_return, parent_return, *wins; Window root_return, parent_return, *wins;
XQueryTree(qt_xdisplay(), root, &root_return, &parent_return, &wins, &nwins); XQueryTree(tqt_xdisplay(), root, &root_return, &parent_return, &wins, &nwins);
for (i = 0; i < nwins; i++) for (i = 0; i < nwins; i++)
{ {
XWindowAttributes attr; XWindowAttributes attr;
XGetWindowAttributes(qt_xdisplay(), wins[i], &attr); XGetWindowAttributes(tqt_xdisplay(), wins[i], &attr);
if (attr.override_redirect ) if (attr.override_redirect )
continue; continue;
if( topmenu_space && topmenu_space->winId() == wins[ i ] ) if( topmenu_space && topmenu_space->winId() == wins[ i ] )
@ -443,10 +443,10 @@ void Workspace::init()
if ( addSystemTrayWin( wins[i] ) ) if ( addSystemTrayWin( wins[i] ) )
continue; continue;
Client* c = createClient( wins[i], true ); Client* c = createClient( wins[i], true );
if ( c != NULL && root != qt_xrootwin() ) if ( c != NULL && root != tqt_xrootwin() )
{ // TODO what is this? { // TODO what is this?
// TODO may use TQWidget:.create // TODO may use TQWidget:.create
XReparentWindow( qt_xdisplay(), c->frameId(), root, 0, 0 ); XReparentWindow( tqt_xdisplay(), c->frameId(), root, 0, 0 );
c->move(0,0); c->move(0,0);
} }
} }
@ -518,8 +518,8 @@ Workspace::~Workspace()
delete tab_box; delete tab_box;
delete popupinfo; delete popupinfo;
delete popup; delete popup;
if ( root == qt_xrootwin() ) if ( root == tqt_xrootwin() )
XDeleteProperty(qt_xdisplay(), qt_xrootwin(), atoms->twin_running); XDeleteProperty(tqt_xdisplay(), tqt_xrootwin(), atoms->twin_running);
writeWindowRules(); writeWindowRules();
KGlobal::config()->sync(); KGlobal::config()->sync();
@ -540,7 +540,7 @@ Workspace::~Workspace()
delete rules.front(); delete rules.front();
rules.pop_front(); rules.pop_front();
} }
XDestroyWindow( qt_xdisplay(), null_focus_window ); XDestroyWindow( tqt_xdisplay(), null_focus_window );
// TODO ungrabXServer(); // TODO ungrabXServer();
_self = 0; _self = 0;
} }
@ -984,7 +984,7 @@ void Workspace::updateColormap()
cmap = activeClient()->colormap(); cmap = activeClient()->colormap();
if ( cmap != installed_colormap ) if ( cmap != installed_colormap )
{ {
XInstallColormap(qt_xdisplay(), cmap ); XInstallColormap(tqt_xdisplay(), cmap );
installed_colormap = cmap; installed_colormap = cmap;
} }
} }
@ -1301,14 +1301,14 @@ void ObscuringWindows::create( Client* c )
XSetWindowAttributes a; XSetWindowAttributes a;
a.background_pixmap = None; a.background_pixmap = None;
a.override_redirect = True; a.override_redirect = True;
obs_win = XCreateWindow( qt_xdisplay(), qt_xrootwin(), c->x(), c->y(), obs_win = XCreateWindow( tqt_xdisplay(), tqt_xrootwin(), c->x(), c->y(),
c->width(), c->height(), 0, CopyFromParent, InputOutput, c->width(), c->height(), 0, CopyFromParent, InputOutput,
CopyFromParent, CWBackPixmap | CWOverrideRedirect, &a ); CopyFromParent, CWBackPixmap | CWOverrideRedirect, &a );
} }
chngs.sibling = c->frameId(); chngs.sibling = c->frameId();
chngs.stack_mode = Below; chngs.stack_mode = Below;
XConfigureWindow( qt_xdisplay(), obs_win, mask, &chngs ); XConfigureWindow( tqt_xdisplay(), obs_win, mask, &chngs );
XMapWindow( qt_xdisplay(), obs_win ); XMapWindow( tqt_xdisplay(), obs_win );
obscuring_windows.append( obs_win ); obscuring_windows.append( obs_win );
} }
@ -1319,11 +1319,11 @@ ObscuringWindows::~ObscuringWindows()
it != obscuring_windows.end(); it != obscuring_windows.end();
++it ) ++it )
{ {
XUnmapWindow( qt_xdisplay(), *it ); XUnmapWindow( tqt_xdisplay(), *it );
if( cached->count() < max_cache_size ) if( cached->count() < max_cache_size )
cached->prepend( *it ); cached->prepend( *it );
else else
XDestroyWindow( qt_xdisplay(), *it ); XDestroyWindow( tqt_xdisplay(), *it );
} }
} }
@ -1386,7 +1386,7 @@ bool Workspace::setCurrentDesktop( int new_desktop )
if (desktopHasCompositing) { if (desktopHasCompositing) {
// If composition is in use then we cannot hide the old windows before showing the new ones, // If composition is in use then we cannot hide the old windows before showing the new ones,
// unless you happen to like the "flicker annoyingly to desktop" effect... :-P // unless you happen to like the "flicker annoyingly to desktop" effect... :-P
XSync( qt_xdisplay(), false); // Make absolutely certain all new windows are shown before hiding the old ones XSync( tqt_xdisplay(), false); // Make absolutely certain all new windows are shown before hiding the old ones
for ( ClientList::ConstIterator it = stacking_order.begin(); it != stacking_order.end(); ++it) { for ( ClientList::ConstIterator it = stacking_order.begin(); it != stacking_order.end(); ++it) {
if ( !(*it)->isOnDesktop( new_desktop ) && (*it) != movingClient ) if ( !(*it)->isOnDesktop( new_desktop ) && (*it) != movingClient )
{ {
@ -1812,15 +1812,15 @@ bool Workspace::addSystemTrayWin( WId w )
if ( systemTrayWins.contains( w ) ) if ( systemTrayWins.contains( w ) )
return TRUE; return TRUE;
NETWinInfo ni( qt_xdisplay(), w, root, NET::WMKDESystemTrayWinFor ); NETWinInfo ni( tqt_xdisplay(), w, root, NET::WMKDESystemTrayWinFor );
WId trayWinFor = ni.kdeSystemTrayWinFor(); WId trayWinFor = ni.kdeSystemTrayWinFor();
if ( !trayWinFor ) if ( !trayWinFor )
return FALSE; return FALSE;
systemTrayWins.append( SystemTrayWindow( w, trayWinFor ) ); systemTrayWins.append( SystemTrayWindow( w, trayWinFor ) );
XSelectInput( qt_xdisplay(), w, XSelectInput( tqt_xdisplay(), w,
StructureNotifyMask StructureNotifyMask
); );
XAddToSaveSet( qt_xdisplay(), w ); XAddToSaveSet( tqt_xdisplay(), w );
propagateSystemTrayWins(); propagateSystemTrayWins();
return TRUE; return TRUE;
} }
@ -1843,7 +1843,7 @@ bool Workspace::removeSystemTrayWin( WId w, bool check )
// embedding it, allowing KWin to figure out. Kicker just mustn't // embedding it, allowing KWin to figure out. Kicker just mustn't
// crash before removing it again ... *shrug* . // crash before removing it again ... *shrug* .
int num_props; int num_props;
Atom* props = XListProperties( qt_xdisplay(), w, &num_props ); Atom* props = XListProperties( tqt_xdisplay(), w, &num_props );
if( props != NULL ) if( props != NULL )
{ {
for( int i = 0; for( int i = 0;
@ -1858,7 +1858,7 @@ bool Workspace::removeSystemTrayWin( WId w, bool check )
} }
} }
systemTrayWins.remove( w ); systemTrayWins.remove( w );
XRemoveFromSaveSet (qt_xdisplay (), w); XRemoveFromSaveSet (tqt_xdisplay (), w);
propagateSystemTrayWins(); propagateSystemTrayWins();
return TRUE; return TRUE;
} }
@ -1896,7 +1896,7 @@ void Workspace::killWindowId( Window window_to_kill )
Window parent, root; Window parent, root;
Window* children; Window* children;
unsigned int children_count; unsigned int children_count;
XQueryTree( qt_xdisplay(), window, &root, &parent, &children, &children_count ); XQueryTree( tqt_xdisplay(), window, &root, &parent, &children, &children_count );
if( children != NULL ) if( children != NULL )
XFree( children ); XFree( children );
if( window == root ) // we didn't find the client, probably an override-redirect window if( window == root ) // we didn't find the client, probably an override-redirect window
@ -1906,7 +1906,7 @@ void Workspace::killWindowId( Window window_to_kill )
if( client != NULL ) if( client != NULL )
client->killWindow(); client->killWindow();
else else
XKillClient( qt_xdisplay(), window_to_kill ); XKillClient( tqt_xdisplay(), window_to_kill );
} }
void Workspace::suspendWindowId( Window window_to_suspend ) void Workspace::suspendWindowId( Window window_to_suspend )
@ -1923,7 +1923,7 @@ void Workspace::suspendWindowId( Window window_to_suspend )
Window parent, root; Window parent, root;
Window* children; Window* children;
unsigned int children_count; unsigned int children_count;
XQueryTree( qt_xdisplay(), window, &root, &parent, &children, &children_count ); XQueryTree( tqt_xdisplay(), window, &root, &parent, &children, &children_count );
if( children != NULL ) if( children != NULL )
XFree( children ); XFree( children );
if( window == root ) // we didn't find the client, probably an override-redirect window if( window == root ) // we didn't find the client, probably an override-redirect window
@ -1950,7 +1950,7 @@ void Workspace::resumeWindowId( Window window_to_resume )
Window parent, root; Window parent, root;
Window* children; Window* children;
unsigned int children_count; unsigned int children_count;
XQueryTree( qt_xdisplay(), window, &root, &parent, &children, &children_count ); XQueryTree( tqt_xdisplay(), window, &root, &parent, &children, &children_count );
if( children != NULL ) if( children != NULL )
XFree( children ); XFree( children );
if( window == root ) // we didn't find the client, probably an override-redirect window if( window == root ) // we didn't find the client, probably an override-redirect window
@ -1990,7 +1990,7 @@ void Workspace::slotGrabWindow()
{ {
//As the first step, get the mask from XShape. //As the first step, get the mask from XShape.
int count, order; int count, order;
XRectangle* rects = XShapeGetRectangles( qt_xdisplay(), active_client->frameId(), XRectangle* rects = XShapeGetRectangles( tqt_xdisplay(), active_client->frameId(),
ShapeBounding, &count, &order); ShapeBounding, &count, &order);
//The ShapeBounding region is the outermost shape of the window; //The ShapeBounding region is the outermost shape of the window;
//ShapeBounding - ShapeClipping is defined to be the border. //ShapeBounding - ShapeClipping is defined to be the border.
@ -2035,7 +2035,7 @@ void Workspace::slotGrabWindow()
*/ */
void Workspace::slotGrabDesktop() void Workspace::slotGrabDesktop()
{ {
TQPixmap p = TQPixmap::grabWindow( qt_xrootwin() ); TQPixmap p = TQPixmap::grabWindow( tqt_xrootwin() );
TQClipboard *cb = TQApplication::clipboard(); TQClipboard *cb = TQApplication::clipboard();
cb->setPixmap( p ); cb->setPixmap( p );
} }
@ -2049,12 +2049,12 @@ void Workspace::slotMouseEmulation()
if ( mouse_emulation ) if ( mouse_emulation )
{ {
XUngrabKeyboard(qt_xdisplay(), GET_QT_X_TIME()); XUngrabKeyboard(tqt_xdisplay(), GET_QT_X_TIME());
mouse_emulation = FALSE; mouse_emulation = FALSE;
return; return;
} }
if ( XGrabKeyboard(qt_xdisplay(), if ( XGrabKeyboard(tqt_xdisplay(),
root, FALSE, root, FALSE,
GrabModeAsync, GrabModeAsync, GrabModeAsync, GrabModeAsync,
GET_QT_X_TIME()) == GrabSuccess ) GET_QT_X_TIME()) == GrabSuccess )
@ -2074,7 +2074,7 @@ void Workspace::slotMouseEmulation()
WId Workspace::getMouseEmulationWindow() WId Workspace::getMouseEmulationWindow()
{ {
Window root; Window root;
Window child = qt_xrootwin(); Window child = tqt_xrootwin();
int root_x, root_y, lx, ly; int root_x, root_y, lx, ly;
uint state; uint state;
Window w; Window w;
@ -2084,7 +2084,7 @@ WId Workspace::getMouseEmulationWindow()
w = child; w = child;
if (!c) if (!c)
c = findClient( FrameIdMatchPredicate( w )); c = findClient( FrameIdMatchPredicate( w ));
XQueryPointer( qt_xdisplay(), w, &root, &child, XQueryPointer( tqt_xdisplay(), w, &root, &child,
&root_x, &root_y, &lx, &ly, &state ); &root_x, &root_y, &lx, &ly, &state );
} while ( child != None && child != w ); } while ( child != None && child != w );
@ -2105,13 +2105,13 @@ unsigned int Workspace::sendFakedMouseEvent( TQPoint pos, WId w, MouseEmulation
{ {
int x, y; int x, y;
Window xw; Window xw;
XTranslateCoordinates( qt_xdisplay(), qt_xrootwin(), w, pos.x(), pos.y(), &x, &y, &xw ); XTranslateCoordinates( tqt_xdisplay(), tqt_xrootwin(), w, pos.x(), pos.y(), &x, &y, &xw );
if ( type == EmuMove ) if ( type == EmuMove )
{ // motion notify events { // motion notify events
XEvent e; XEvent e;
e.type = MotionNotify; e.type = MotionNotify;
e.xmotion.window = w; e.xmotion.window = w;
e.xmotion.root = qt_xrootwin(); e.xmotion.root = tqt_xrootwin();
e.xmotion.subwindow = w; e.xmotion.subwindow = w;
e.xmotion.time = GET_QT_X_TIME(); e.xmotion.time = GET_QT_X_TIME();
e.xmotion.x = x; e.xmotion.x = x;
@ -2120,14 +2120,14 @@ unsigned int Workspace::sendFakedMouseEvent( TQPoint pos, WId w, MouseEmulation
e.xmotion.y_root = pos.y(); e.xmotion.y_root = pos.y();
e.xmotion.state = state; e.xmotion.state = state;
e.xmotion.is_hint = NotifyNormal; e.xmotion.is_hint = NotifyNormal;
XSendEvent( qt_xdisplay(), w, TRUE, ButtonMotionMask, &e ); XSendEvent( tqt_xdisplay(), w, TRUE, ButtonMotionMask, &e );
} }
else else
{ {
XEvent e; XEvent e;
e.type = type == EmuRelease ? ButtonRelease : ButtonPress; e.type = type == EmuRelease ? ButtonRelease : ButtonPress;
e.xbutton.window = w; e.xbutton.window = w;
e.xbutton.root = qt_xrootwin(); e.xbutton.root = tqt_xrootwin();
e.xbutton.subwindow = w; e.xbutton.subwindow = w;
e.xbutton.time = GET_QT_X_TIME(); e.xbutton.time = GET_QT_X_TIME();
e.xbutton.x = x; e.xbutton.x = x;
@ -2136,7 +2136,7 @@ unsigned int Workspace::sendFakedMouseEvent( TQPoint pos, WId w, MouseEmulation
e.xbutton.y_root = pos.y(); e.xbutton.y_root = pos.y();
e.xbutton.state = state; e.xbutton.state = state;
e.xbutton.button = button; e.xbutton.button = button;
XSendEvent( qt_xdisplay(), w, TRUE, ButtonPressMask, &e ); XSendEvent( tqt_xdisplay(), w, TRUE, ButtonPressMask, &e );
if ( type == EmuPress ) if ( type == EmuPress )
{ {
@ -2178,9 +2178,9 @@ unsigned int Workspace::sendFakedMouseEvent( TQPoint pos, WId w, MouseEmulation
*/ */
bool Workspace::keyPressMouseEmulation( XKeyEvent& ev ) bool Workspace::keyPressMouseEmulation( XKeyEvent& ev )
{ {
if ( root != qt_xrootwin() ) if ( root != tqt_xrootwin() )
return FALSE; return FALSE;
int kc = XKeycodeToKeysym(qt_xdisplay(), ev.keycode, 0); int kc = XKeycodeToKeysym(tqt_xdisplay(), ev.keycode, 0);
int km = ev.state & (ControlMask | Mod1Mask | ShiftMask); int km = ev.state & (ControlMask | Mod1Mask | ShiftMask);
bool is_control = km & ControlMask; bool is_control = km & ControlMask;
@ -2255,7 +2255,7 @@ bool Workspace::keyPressMouseEmulation( XKeyEvent& ev )
} }
// fall through // fall through
case XK_Escape: case XK_Escape:
XUngrabKeyboard(qt_xdisplay(), GET_QT_X_TIME()); XUngrabKeyboard(tqt_xdisplay(), GET_QT_X_TIME());
mouse_emulation = FALSE; mouse_emulation = FALSE;
return TRUE; return TRUE;
default: default:
@ -2340,58 +2340,58 @@ void Workspace::createBorderWindows()
attributes.override_redirect = True; attributes.override_redirect = True;
attributes.event_mask = ( EnterWindowMask | LeaveWindowMask ); attributes.event_mask = ( EnterWindowMask | LeaveWindowMask );
valuemask= (CWOverrideRedirect | CWEventMask | CWCursor ); valuemask= (CWOverrideRedirect | CWEventMask | CWCursor );
attributes.cursor = XCreateFontCursor(qt_xdisplay(), attributes.cursor = XCreateFontCursor(tqt_xdisplay(),
XC_sb_up_arrow); XC_sb_up_arrow);
electric_top_border = XCreateWindow (qt_xdisplay(), qt_xrootwin(), electric_top_border = XCreateWindow (tqt_xdisplay(), tqt_xrootwin(),
0,0, 0,0,
r.width(),1, r.width(),1,
0, 0,
CopyFromParent, InputOnly, CopyFromParent, InputOnly,
CopyFromParent, CopyFromParent,
valuemask, &attributes); valuemask, &attributes);
XMapWindow(qt_xdisplay(), electric_top_border); XMapWindow(tqt_xdisplay(), electric_top_border);
attributes.cursor = XCreateFontCursor(qt_xdisplay(), attributes.cursor = XCreateFontCursor(tqt_xdisplay(),
XC_sb_down_arrow); XC_sb_down_arrow);
electric_bottom_border = XCreateWindow (qt_xdisplay(), qt_xrootwin(), electric_bottom_border = XCreateWindow (tqt_xdisplay(), tqt_xrootwin(),
0,r.height()-1, 0,r.height()-1,
r.width(),1, r.width(),1,
0, 0,
CopyFromParent, InputOnly, CopyFromParent, InputOnly,
CopyFromParent, CopyFromParent,
valuemask, &attributes); valuemask, &attributes);
XMapWindow(qt_xdisplay(), electric_bottom_border); XMapWindow(tqt_xdisplay(), electric_bottom_border);
attributes.cursor = XCreateFontCursor(qt_xdisplay(), attributes.cursor = XCreateFontCursor(tqt_xdisplay(),
XC_sb_left_arrow); XC_sb_left_arrow);
electric_left_border = XCreateWindow (qt_xdisplay(), qt_xrootwin(), electric_left_border = XCreateWindow (tqt_xdisplay(), tqt_xrootwin(),
0,0, 0,0,
1,r.height(), 1,r.height(),
0, 0,
CopyFromParent, InputOnly, CopyFromParent, InputOnly,
CopyFromParent, CopyFromParent,
valuemask, &attributes); valuemask, &attributes);
XMapWindow(qt_xdisplay(), electric_left_border); XMapWindow(tqt_xdisplay(), electric_left_border);
attributes.cursor = XCreateFontCursor(qt_xdisplay(), attributes.cursor = XCreateFontCursor(tqt_xdisplay(),
XC_sb_right_arrow); XC_sb_right_arrow);
electric_right_border = XCreateWindow (qt_xdisplay(), qt_xrootwin(), electric_right_border = XCreateWindow (tqt_xdisplay(), tqt_xrootwin(),
r.width()-1,0, r.width()-1,0,
1,r.height(), 1,r.height(),
0, 0,
CopyFromParent, InputOnly, CopyFromParent, InputOnly,
CopyFromParent, CopyFromParent,
valuemask, &attributes); valuemask, &attributes);
XMapWindow(qt_xdisplay(), electric_right_border); XMapWindow(tqt_xdisplay(), electric_right_border);
// Set XdndAware on the windows, so that DND enter events are received (#86998) // Set XdndAware on the windows, so that DND enter events are received (#86998)
Atom version = 4; // XDND version Atom version = 4; // XDND version
XChangeProperty( qt_xdisplay(), electric_top_border, atoms->xdnd_aware, XA_ATOM, XChangeProperty( tqt_xdisplay(), electric_top_border, atoms->xdnd_aware, XA_ATOM,
32, PropModeReplace, ( unsigned char* )&version, 1 ); 32, PropModeReplace, ( unsigned char* )&version, 1 );
XChangeProperty( qt_xdisplay(), electric_bottom_border, atoms->xdnd_aware, XA_ATOM, XChangeProperty( tqt_xdisplay(), electric_bottom_border, atoms->xdnd_aware, XA_ATOM,
32, PropModeReplace, ( unsigned char* )&version, 1 ); 32, PropModeReplace, ( unsigned char* )&version, 1 );
XChangeProperty( qt_xdisplay(), electric_left_border, atoms->xdnd_aware, XA_ATOM, XChangeProperty( tqt_xdisplay(), electric_left_border, atoms->xdnd_aware, XA_ATOM,
32, PropModeReplace, ( unsigned char* )&version, 1 ); 32, PropModeReplace, ( unsigned char* )&version, 1 );
XChangeProperty( qt_xdisplay(), electric_right_border, atoms->xdnd_aware, XA_ATOM, XChangeProperty( tqt_xdisplay(), electric_right_border, atoms->xdnd_aware, XA_ATOM,
32, PropModeReplace, ( unsigned char* )&version, 1 ); 32, PropModeReplace, ( unsigned char* )&version, 1 );
} }
@ -2409,13 +2409,13 @@ void Workspace::destroyBorderWindows()
electric_have_borders = false; electric_have_borders = false;
if(electric_top_border) if(electric_top_border)
XDestroyWindow(qt_xdisplay(),electric_top_border); XDestroyWindow(tqt_xdisplay(),electric_top_border);
if(electric_bottom_border) if(electric_bottom_border)
XDestroyWindow(qt_xdisplay(),electric_bottom_border); XDestroyWindow(tqt_xdisplay(),electric_bottom_border);
if(electric_left_border) if(electric_left_border)
XDestroyWindow(qt_xdisplay(),electric_left_border); XDestroyWindow(tqt_xdisplay(),electric_left_border);
if(electric_right_border) if(electric_right_border)
XDestroyWindow(qt_xdisplay(),electric_right_border); XDestroyWindow(tqt_xdisplay(),electric_right_border);
electric_top_border = None; electric_top_border = None;
electric_bottom_border = None; electric_bottom_border = None;
@ -2565,10 +2565,10 @@ void Workspace::raiseElectricBorders()
if(electric_have_borders) if(electric_have_borders)
{ {
XRaiseWindow(qt_xdisplay(), electric_top_border); XRaiseWindow(tqt_xdisplay(), electric_top_border);
XRaiseWindow(qt_xdisplay(), electric_left_border); XRaiseWindow(tqt_xdisplay(), electric_left_border);
XRaiseWindow(qt_xdisplay(), electric_bottom_border); XRaiseWindow(tqt_xdisplay(), electric_bottom_border);
XRaiseWindow(qt_xdisplay(), electric_right_border); XRaiseWindow(tqt_xdisplay(), electric_right_border);
} }
} }
@ -2647,7 +2647,7 @@ void Workspace::setupTopMenuHandling()
Window stack[ 2 ]; Window stack[ 2 ];
stack[ 0 ] = supportWindow->winId(); stack[ 0 ] = supportWindow->winId();
stack[ 1 ] = topmenu_space->winId(); stack[ 1 ] = topmenu_space->winId();
XRestackWindows(qt_xdisplay(), stack, 2); XRestackWindows(tqt_xdisplay(), stack, 2);
updateTopMenuGeometry(); updateTopMenuGeometry();
topmenu_space->show(); topmenu_space->show();
updateClientArea(); updateClientArea();
@ -2686,7 +2686,7 @@ bool Workspace::checkStartupNotification( Window w, KStartupInfoId& id, KStartup
*/ */
void Workspace::focusToNull() void Workspace::focusToNull()
{ {
XSetInputFocus(qt_xdisplay(), null_focus_window, RevertToPointerRoot, GET_QT_X_TIME() ); XSetInputFocus(tqt_xdisplay(), null_focus_window, RevertToPointerRoot, GET_QT_X_TIME() );
} }
void Workspace::helperDialog( const TQString& message, const Client* c ) void Workspace::helperDialog( const TQString& message, const Client* c )
@ -2746,8 +2746,8 @@ void Workspace::startKompmgr()
unsigned long length, after; unsigned long length, after;
unsigned char* data_root; unsigned char* data_root;
Atom prop_root; Atom prop_root;
prop_root = XInternAtom(qt_xdisplay(), "_XROOTPMAP_ID", False); prop_root = XInternAtom(tqt_xdisplay(), "_XROOTPMAP_ID", False);
if( XGetWindowProperty( qt_xdisplay(), qt_xrootwin(), prop_root, 0L, 1L, False, AnyPropertyType, &type, &format, &length, &after, &data_root) == Success && data_root != NULL ) { if( XGetWindowProperty( tqt_xdisplay(), tqt_xrootwin(), prop_root, 0L, 1L, False, AnyPropertyType, &type, &format, &length, &after, &data_root) == Success && data_root != NULL ) {
// Root pixmap is available; OK to load... // Root pixmap is available; OK to load...
} }
else { else {
@ -2770,7 +2770,7 @@ void Workspace::startKompmgr()
{ {
delete kompmgr_selection; delete kompmgr_selection;
char selection_name[ 100 ]; char selection_name[ 100 ];
sprintf( selection_name, "_NET_WM_CM_S%d", DefaultScreen( qt_xdisplay())); sprintf( selection_name, "_NET_WM_CM_S%d", DefaultScreen( tqt_xdisplay()));
kompmgr_selection = new KSelectionOwner( selection_name ); kompmgr_selection = new KSelectionOwner( selection_name );
connect( kompmgr_selection, TQT_SIGNAL( lostOwnership()), TQT_SLOT( stopKompmgr())); connect( kompmgr_selection, TQT_SIGNAL( lostOwnership()), TQT_SLOT( stopKompmgr()));
kompmgr_selection->claim( true ); kompmgr_selection->claim( true );

Loading…
Cancel
Save