Rename additional global functions and variables for tqt3

pull/16/head
Timothy Pearson 12 years ago
parent 4fb897b216
commit 90a4df9081

@ -65,7 +65,7 @@ bool KFullscreenVideoWidget::x11Event( XEvent *event )
#if defined Q_WS_X11 && ! defined K_WS_QTONLY #if defined Q_WS_X11 && ! defined K_WS_QTONLY
if (event->type == ClientMessage && if (event->type == ClientMessage &&
event->xclient.message_type == event->xclient.message_type ==
XInternAtom( qt_xdisplay(), "VPO_RESIZE_NOTIFY", False )) XInternAtom( tqt_xdisplay(), "VPO_RESIZE_NOTIFY", False ))
{ {
videoWidget->resizeNotify( event->xclient.data.l[0], event->xclient.data.l[1] ); videoWidget->resizeNotify( event->xclient.data.l[0], event->xclient.data.l[1] );
} }
@ -202,13 +202,13 @@ TQImage KVideoWidget::snapshot( Arts::VideoPlayObject vpo )
return TQImage(); return TQImage();
// Get 32bit RGBA image data (stored in 1bpp pixmap) // Get 32bit RGBA image data (stored in 1bpp pixmap)
XGetGeometry( qt_xdisplay(), pixmap, &root, &x, &y, &width, &height, &border, &depth ); XGetGeometry( tqt_xdisplay(), pixmap, &root, &x, &y, &width, &height, &border, &depth );
xImage = XGetImage( qt_xdisplay(), pixmap, 0, 0, width, height, 1, XYPixmap ); xImage = XGetImage( tqt_xdisplay(), pixmap, 0, 0, width, height, 1, XYPixmap );
if (xImage == 0) if (xImage == 0)
{ {
XFreePixmap( qt_xdisplay(), pixmap ); XFreePixmap( tqt_xdisplay(), pixmap );
return TQImage(); return TQImage();
} }
@ -217,7 +217,7 @@ TQImage KVideoWidget::snapshot( Arts::VideoPlayObject vpo )
// Free X11 resources and return Qt image // Free X11 resources and return Qt image
XDestroyImage( xImage ); XDestroyImage( xImage );
XFreePixmap( qt_xdisplay(), pixmap ); XFreePixmap( tqt_xdisplay(), pixmap );
return qImage; return qImage;
#else #else
@ -361,7 +361,7 @@ bool KVideoWidget::x11Event( XEvent *event )
#if defined Q_WS_X11 && ! defined K_WS_QTONLY #if defined Q_WS_X11 && ! defined K_WS_QTONLY
if (event->type == ClientMessage && if (event->type == ClientMessage &&
event->xclient.message_type == event->xclient.message_type ==
XInternAtom( qt_xdisplay(), "VPO_RESIZE_NOTIFY", False )) XInternAtom( tqt_xdisplay(), "VPO_RESIZE_NOTIFY", False ))
{ {
resizeNotify( event->xclient.data.l[0], event->xclient.data.l[1] ); resizeNotify( event->xclient.data.l[0], event->xclient.data.l[1] );
} }

@ -966,12 +966,12 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
#ifdef Q_WS_X11 #ifdef Q_WS_X11
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, "kded" ); strcpy( e.xclient.data.b, "kded" );
XSendEvent( qt_xdisplay(), qt_xrootwin(), False, SubstructureNotifyMask, &e ); XSendEvent( tqt_xdisplay(), tqt_xrootwin(), False, SubstructureNotifyMask, &e );
#endif #endif
int result = k.exec(); // keep running int result = k.exec(); // keep running

@ -1283,7 +1283,7 @@ void KHTMLView::viewportMouseMoveEvent( TQMouseEvent * _mouse )
d->cursor_icon_widget = new TQWidget( NULL, NULL, WX11BypassWM ); d->cursor_icon_widget = new TQWidget( NULL, NULL, WX11BypassWM );
XSetWindowAttributes attr; XSetWindowAttributes attr;
attr.save_under = True; attr.save_under = True;
XChangeWindowAttributes( qt_xdisplay(), d->cursor_icon_widget->winId(), CWSaveUnder, &attr ); XChangeWindowAttributes( tqt_xdisplay(), d->cursor_icon_widget->winId(), CWSaveUnder, &attr );
d->cursor_icon_widget->resize( icon_pixmap.width(), icon_pixmap.height()); d->cursor_icon_widget->resize( icon_pixmap.width(), icon_pixmap.height());
if( icon_pixmap.mask() ) if( icon_pixmap.mask() )
d->cursor_icon_widget->setMask( *icon_pixmap.mask()); d->cursor_icon_widget->setMask( *icon_pixmap.mask());
@ -1294,7 +1294,7 @@ void KHTMLView::viewportMouseMoveEvent( TQMouseEvent * _mouse )
} }
TQPoint c_pos = TQCursor::pos(); TQPoint c_pos = TQCursor::pos();
d->cursor_icon_widget->move( c_pos.x() + 15, c_pos.y() + 15 ); d->cursor_icon_widget->move( c_pos.x() + 15, c_pos.y() + 15 );
XRaiseWindow( qt_xdisplay(), d->cursor_icon_widget->winId()); XRaiseWindow( tqt_xdisplay(), d->cursor_icon_widget->winId());
TQApplication::flushX(); TQApplication::flushX();
d->cursor_icon_widget->show(); d->cursor_icon_widget->show();
#endif #endif

@ -1339,7 +1339,7 @@ TQString KFileDialog::getOpenFileNameWId(const TQString& startDir,
KFileDialog dlg(startDir, filter, parent, "filedialog", true); KFileDialog dlg(startDir, filter, parent, "filedialog", true);
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if( parent == NULL && parent_id != 0 ) if( parent == NULL && parent_id != 0 )
XSetTransientForHint( qt_xdisplay(), dlg.winId(), parent_id ); XSetTransientForHint( tqt_xdisplay(), dlg.winId(), parent_id );
#else #else
// TODO // TODO
#endif #endif
@ -1621,7 +1621,7 @@ TQString KFileDialog::getSaveFileNameWId(const TQString& dir, const TQString& fi
KFileDialog dlg( specialDir ? dir : TQString::null, filter, parent, "filedialog", true); KFileDialog dlg( specialDir ? dir : TQString::null, filter, parent, "filedialog", true);
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if( parent == NULL && parent_id != 0 ) if( parent == NULL && parent_id != 0 )
XSetTransientForHint(qt_xdisplay(), dlg.winId(), parent_id); XSetTransientForHint(tqt_xdisplay(), dlg.winId(), parent_id);
#else #else
// TODO // TODO
#endif #endif

@ -387,7 +387,7 @@ KPasswdServer::processRequest()
dlg.setKeepPassword( true ); dlg.setKeepPassword( true );
#ifdef Q_WS_X11 #ifdef Q_WS_X11
XSetTransientForHint( qt_xdisplay(), dlg.winId(), request->windowId); XSetTransientForHint( tqt_xdisplay(), dlg.winId(), request->windowId);
#endif #endif
dlgResult = dlg.exec(); dlgResult = dlg.exec();

@ -83,7 +83,7 @@ KCookieWin::KCookieWin( TQWidget *parent, KHttpCookieList cookieList,
# ifdef Q_WS_X11 # ifdef Q_WS_X11
if( cookieList.first()->windowIds().count() > 0 ) if( cookieList.first()->windowIds().count() > 0 )
{ {
XSetTransientForHint( qt_xdisplay(), winId(), cookieList.first()->windowIds().first()); XSetTransientForHint( tqt_xdisplay(), winId(), cookieList.first()->windowIds().first());
} }
else else
{ {

@ -701,7 +701,7 @@ void KMdiMainFrm::detachWindow( KMdiChildView *pWnd, bool bShow )
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if ( mdiMode() == KMdi::ToplevelMode ) if ( mdiMode() == KMdi::ToplevelMode )
{ {
XSetTransientForHint( qt_xdisplay(), pWnd->winId(), topLevelWidget() ->winId() ); XSetTransientForHint( tqt_xdisplay(), pWnd->winId(), topLevelWidget() ->winId() );
} }
#endif #endif
@ -711,7 +711,7 @@ void KMdiMainFrm::detachWindow( KMdiChildView *pWnd, bool bShow )
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if ( mdiMode() == KMdi::ToplevelMode ) if ( mdiMode() == KMdi::ToplevelMode )
{ {
XSetTransientForHint( qt_xdisplay(), pWnd->winId(), topLevelWidget() ->winId() ); XSetTransientForHint( tqt_xdisplay(), pWnd->winId(), topLevelWidget() ->winId() );
} }
#endif #endif
@ -1422,7 +1422,7 @@ void KMdiMainFrm::switchToToplevelMode()
for ( kmdicvit.toFirst(); ( *kmdicvit ); ++kmdicvit ) for ( kmdicvit.toFirst(); ( *kmdicvit ); ++kmdicvit )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
XSetTransientForHint( qt_xdisplay(), ( *kmdicvit )->winId(), winId() ); XSetTransientForHint( tqt_xdisplay(), ( *kmdicvit )->winId(), winId() );
#endif #endif
( *kmdicvit )->show(); ( *kmdicvit )->show();
} }

@ -138,7 +138,7 @@ TQString KRandrSimpleAPI::applyIccFile(TQString screenName, TQString fileName) {
if (isValid() == true) { if (isValid() == true) {
screenNumber = -1; screenNumber = -1;
randr_display = qt_xdisplay(); randr_display = tqt_xdisplay();
randr_screen_info = read_screen_info(randr_display); randr_screen_info = read_screen_info(randr_display);
if (randr_screen_info == NULL) { if (randr_screen_info == NULL) {
return ""; return "";
@ -203,7 +203,7 @@ TQString KRandrSimpleAPI::applyIccFile(TQString screenName, TQString fileName) {
if (isValid() == true) { if (isValid() == true) {
screenNumber = -1; screenNumber = -1;
randr_display = qt_xdisplay(); randr_display = tqt_xdisplay();
randr_screen_info = read_screen_info(randr_display); randr_screen_info = read_screen_info(randr_display);
if (randr_screen_info == NULL) { if (randr_screen_info == NULL) {
return ""; return "";
@ -272,7 +272,7 @@ TQString KRandrSimpleAPI::applyIccConfiguration(TQString profileName, TQString k
// Find all screens // Find all screens
if (isValid() == true) { if (isValid() == true) {
randr_display = qt_xdisplay(); randr_display = tqt_xdisplay();
randr_screen_info = read_screen_info(randr_display); randr_screen_info = read_screen_info(randr_display);
if (randr_screen_info == NULL) { if (randr_screen_info == NULL) {
return ""; return "";
@ -597,7 +597,7 @@ bool KRandrSimpleAPI::applySystemwideDisplayConfiguration(TQPtrList<SingleScreen
TQString command; TQString command;
command = "xrandr"; command = "xrandr";
randr_display = qt_xdisplay(); randr_display = tqt_xdisplay();
randr_screen_info = read_screen_info(randr_display); randr_screen_info = read_screen_info(randr_display);
for (i = 0; i < screenInfoArray.count(); i++) { for (i = 0; i < screenInfoArray.count(); i++) {
screendata = screenInfoArray.at(i); screendata = screenInfoArray.at(i);
@ -658,7 +658,7 @@ bool KRandrSimpleAPI::applySystemwideDisplayConfiguration(TQPtrList<SingleScreen
} }
} }
#else #else
randr_display = qt_xdisplay(); randr_display = tqt_xdisplay();
randr_screen_info = read_screen_info(randr_display); randr_screen_info = read_screen_info(randr_display);
// Turn off all displays // Turn off all displays
for (i = 0; i < screenInfoArray.count(); i++) { for (i = 0; i < screenInfoArray.count(); i++) {
@ -899,7 +899,7 @@ void KRandrSimpleAPI::applySystemwideDisplayGamma(TQPtrList<SingleScreenData> sc
SingleScreenData *screendata; SingleScreenData *screendata;
if (isValid() == true) { if (isValid() == true) {
randr_display = qt_xdisplay(); randr_display = tqt_xdisplay();
randr_screen_info = read_screen_info(randr_display); randr_screen_info = read_screen_info(randr_display);
for (i = 0; i < screenInfoArray.count(); i++) { for (i = 0; i < screenInfoArray.count(); i++) {
screendata = screenInfoArray.at(i); screendata = screenInfoArray.at(i);
@ -951,7 +951,7 @@ void KRandrSimpleAPI::applySystemwideDisplayDPMS(TQPtrList<SingleScreenData> scr
SingleScreenData *screendata; SingleScreenData *screendata;
if (isValid() == true) { if (isValid() == true) {
randr_display = qt_xdisplay(); randr_display = tqt_xdisplay();
randr_screen_info = read_screen_info(randr_display); randr_screen_info = read_screen_info(randr_display);
for (i = 0; i < screenInfoArray.count(); i++) { for (i = 0; i < screenInfoArray.count(); i++) {
screendata = screenInfoArray.at(i); screendata = screenInfoArray.at(i);
@ -1006,7 +1006,7 @@ TQPtrList<SingleScreenData> KRandrSimpleAPI::readCurrentDisplayConfiguration() {
int numberOfScreens = 0; int numberOfScreens = 0;
if (isValid() == true) { if (isValid() == true) {
randr_display = qt_xdisplay(); randr_display = tqt_xdisplay();
randr_screen_info = read_screen_info(randr_display); randr_screen_info = read_screen_info(randr_display);
for (i = 0; i < randr_screen_info->n_output; i++) { for (i = 0; i < randr_screen_info->n_output; i++) {
output_info = randr_screen_info->outputs[i]->info; output_info = randr_screen_info->outputs[i]->info;
@ -1129,7 +1129,7 @@ TQPtrList<SingleScreenData> KRandrSimpleAPI::readCurrentDisplayConfiguration() {
screendata->supports_transformations = (cur_screen->rotations() != RandRScreen::Rotate0); screendata->supports_transformations = (cur_screen->rotations() != RandRScreen::Rotate0);
// Determine if this display is primary and/or extended // Determine if this display is primary and/or extended
RROutput primaryoutput = XRRGetOutputPrimary(qt_xdisplay(), DefaultRootWindow(qt_xdisplay())); RROutput primaryoutput = XRRGetOutputPrimary(tqt_xdisplay(), DefaultRootWindow(tqt_xdisplay()));
if (primaryoutput == randr_screen_info->outputs[i]->id) if (primaryoutput == randr_screen_info->outputs[i]->id)
screendata->is_primary = false; screendata->is_primary = false;
else else

@ -72,7 +72,7 @@ KDE_EXPORT void RandRScreen::loadSettings()
if (d->config) if (d->config)
XRRFreeScreenConfigInfo(d->config); XRRFreeScreenConfigInfo(d->config);
d->config = XRRGetScreenInfo(qt_xdisplay(), RootWindow(qt_xdisplay(), m_screen)); d->config = XRRGetScreenInfo(tqt_xdisplay(), RootWindow(tqt_xdisplay(), m_screen));
Rotation rotation; Rotation rotation;
if (d->config) { if (d->config) {
@ -89,17 +89,17 @@ KDE_EXPORT void RandRScreen::loadSettings()
if (d->config) { if (d->config) {
int numSizes; int numSizes;
XRRScreenSize* sizes = XRRSizes(qt_xdisplay(), m_screen, &numSizes); XRRScreenSize* sizes = XRRSizes(tqt_xdisplay(), m_screen, &numSizes);
for (int i = 0; i < numSizes; i++) { for (int i = 0; i < numSizes; i++) {
m_pixelSizes.append(TQSize(sizes[i].width, sizes[i].height)); m_pixelSizes.append(TQSize(sizes[i].width, sizes[i].height));
m_mmSizes.append(TQSize(sizes[i].mwidth, sizes[i].mheight)); m_mmSizes.append(TQSize(sizes[i].mwidth, sizes[i].mheight));
} }
m_rotations = XRRRotations(qt_xdisplay(), m_screen, &rotation); m_rotations = XRRRotations(tqt_xdisplay(), m_screen, &rotation);
} }
else { else {
// Great, now we have to go after the information manually. Ughh. // Great, now we have to go after the information manually. Ughh.
ScreenInfo *screeninfo = internal_read_screen_info(qt_xdisplay()); ScreenInfo *screeninfo = internal_read_screen_info(tqt_xdisplay());
XRROutputInfo *output_info = screeninfo->outputs[m_screen]->info; XRROutputInfo *output_info = screeninfo->outputs[m_screen]->info;
CrtcInfo *current_crtc = screeninfo->outputs[m_screen]->cur_crtc; CrtcInfo *current_crtc = screeninfo->outputs[m_screen]->cur_crtc;
int numSizes = screeninfo->res->nmode; int numSizes = screeninfo->res->nmode;
@ -138,24 +138,24 @@ KDE_EXPORT bool RandRScreen::applyProposed()
Status status; Status status;
if (!d->config) { if (!d->config) {
d->config = XRRGetScreenInfo(qt_xdisplay(), RootWindow(qt_xdisplay(), m_screen)); d->config = XRRGetScreenInfo(tqt_xdisplay(), RootWindow(tqt_xdisplay(), m_screen));
Q_ASSERT(d->config); Q_ASSERT(d->config);
} }
if (d->config) { if (d->config) {
if (proposedRefreshRate() < 0) if (proposedRefreshRate() < 0)
status = XRRSetScreenConfig(qt_xdisplay(), d->config, DefaultRootWindow(qt_xdisplay()), (SizeID)proposedSize(), (Rotation)proposedRotation(), CurrentTime); status = XRRSetScreenConfig(tqt_xdisplay(), d->config, DefaultRootWindow(tqt_xdisplay()), (SizeID)proposedSize(), (Rotation)proposedRotation(), CurrentTime);
else { else {
if( refreshRateIndexToHz(proposedSize(), proposedRefreshRate()) <= 0 ) { if( refreshRateIndexToHz(proposedSize(), proposedRefreshRate()) <= 0 ) {
m_proposedRefreshRate = 0; m_proposedRefreshRate = 0;
} }
status = XRRSetScreenConfigAndRate(qt_xdisplay(), d->config, DefaultRootWindow(qt_xdisplay()), (SizeID)proposedSize(), (Rotation)proposedRotation(), refreshRateIndexToHz(proposedSize(), proposedRefreshRate()), CurrentTime); status = XRRSetScreenConfigAndRate(tqt_xdisplay(), d->config, DefaultRootWindow(tqt_xdisplay()), (SizeID)proposedSize(), (Rotation)proposedRotation(), refreshRateIndexToHz(proposedSize(), proposedRefreshRate()), CurrentTime);
} }
} }
else { else {
// Great, now we have to set the information manually. Ughh. // Great, now we have to set the information manually. Ughh.
// FIXME--this does not work! // FIXME--this does not work!
ScreenInfo *screeninfo = internal_read_screen_info(qt_xdisplay()); ScreenInfo *screeninfo = internal_read_screen_info(tqt_xdisplay());
screeninfo->cur_width = (*m_pixelSizes.at(proposedSize())).width(); screeninfo->cur_width = (*m_pixelSizes.at(proposedSize())).width();
screeninfo->cur_height = (*m_pixelSizes.at(proposedSize())).height(); screeninfo->cur_height = (*m_pixelSizes.at(proposedSize())).height();
internal_main_low_apply(screeninfo); internal_main_low_apply(screeninfo);
@ -441,14 +441,14 @@ KDE_EXPORT TQStringList RandRScreen::refreshRates(int size) const
TQStringList ret; TQStringList ret;
if (d->config) { if (d->config) {
short* rates = XRRRates(qt_xdisplay(), m_screen, (SizeID)size, &nrates); short* rates = XRRRates(tqt_xdisplay(), m_screen, (SizeID)size, &nrates);
for (int i = 0; i < nrates; i++) for (int i = 0; i < nrates; i++)
ret << refreshRateDirectDescription(rates[i]); ret << refreshRateDirectDescription(rates[i]);
} }
else { else {
// Great, now we have to go after the information manually. Ughh. // Great, now we have to go after the information manually. Ughh.
ScreenInfo *screeninfo = internal_read_screen_info(qt_xdisplay()); ScreenInfo *screeninfo = internal_read_screen_info(tqt_xdisplay());
int numSizes = screeninfo->res->nmode; int numSizes = screeninfo->res->nmode;
for (int i = 0; i < numSizes; i++) { for (int i = 0; i < numSizes; i++) {
int refresh_rate = ((screeninfo->res->modes[i].dotClock*1.0)/((screeninfo->res->modes[i].hTotal)*(screeninfo->res->modes[i].vTotal)*1.0)); int refresh_rate = ((screeninfo->res->modes[i].dotClock*1.0)/((screeninfo->res->modes[i].hTotal)*(screeninfo->res->modes[i].vTotal)*1.0));
@ -505,7 +505,7 @@ KDE_EXPORT int RandRScreen::proposedRefreshRate() const
KDE_EXPORT int RandRScreen::refreshRateHzToIndex(int size, int hz) const KDE_EXPORT int RandRScreen::refreshRateHzToIndex(int size, int hz) const
{ {
int nrates; int nrates;
short* rates = XRRRates(qt_xdisplay(), m_screen, (SizeID)size, &nrates); short* rates = XRRRates(tqt_xdisplay(), m_screen, (SizeID)size, &nrates);
for (int i = 0; i < nrates; i++) for (int i = 0; i < nrates; i++)
if (hz == rates[i]) if (hz == rates[i])
@ -521,7 +521,7 @@ KDE_EXPORT int RandRScreen::refreshRateHzToIndex(int size, int hz) const
KDE_EXPORT int RandRScreen::refreshRateIndexToHz(int size, int index) const KDE_EXPORT int RandRScreen::refreshRateIndexToHz(int size, int index) const
{ {
int nrates; int nrates;
short* rates = XRRRates(qt_xdisplay(), m_screen, (SizeID)size, &nrates); short* rates = XRRRates(tqt_xdisplay(), m_screen, (SizeID)size, &nrates);
if (nrates == 0 || index < 0) if (nrates == 0 || index < 0)
return 0; return 0;
@ -622,7 +622,7 @@ KDE_EXPORT RandRDisplay::RandRDisplay()
: m_valid(true) : m_valid(true)
{ {
// Check extension // Check extension
Status s = XRRQueryExtension(qt_xdisplay(), &m_eventBase, &m_errorBase); Status s = XRRQueryExtension(tqt_xdisplay(), &m_eventBase, &m_errorBase);
if (!s) { if (!s) {
m_errorCode = TQString("%1, base %1").arg(s).arg(m_errorBase); m_errorCode = TQString("%1, base %1").arg(s).arg(m_errorBase);
m_valid = false; m_valid = false;
@ -644,14 +644,14 @@ KDE_EXPORT RandRDisplay::RandRDisplay()
} }
int major_version, minor_version; int major_version, minor_version;
XRRQueryVersion(qt_xdisplay(), &major_version, &minor_version); XRRQueryVersion(tqt_xdisplay(), &major_version, &minor_version);
m_version = TQString("X Resize and Rotate extension version %1.%1").arg(major_version).arg(minor_version); m_version = TQString("X Resize and Rotate extension version %1.%1").arg(major_version).arg(minor_version);
m_numScreens = ScreenCount(qt_xdisplay()); m_numScreens = ScreenCount(tqt_xdisplay());
// This assumption is WRONG with Xinerama // This assumption is WRONG with Xinerama
// Q_ASSERT(TQApplication::desktop()->numScreens() == ScreenCount(qt_xdisplay())); // Q_ASSERT(TQApplication::desktop()->numScreens() == ScreenCount(tqt_xdisplay()));
m_screens.setAutoDelete(true); m_screens.setAutoDelete(true);
for (int i = 0; i < m_numScreens; i++) { for (int i = 0; i < m_numScreens; i++) {

@ -2806,7 +2806,7 @@ bool KeramikStyle::eventFilter( TQObject* object, TQEvent* event )
{3, resize->size().height()-3, resize->size().width()-7, 1} {3, resize->size().height()-3, resize->size().width()-7, 1}
}; };
XShapeCombineRectangles(qt_xdisplay(), listbox->handle(), ShapeBounding, 0, 0, XShapeCombineRectangles(tqt_xdisplay(), listbox->handle(), ShapeBounding, 0, 0,
rects, 5, ShapeSet, YXSorted); rects, 5, ShapeSet, YXSorted);
} }
break; break;

@ -399,7 +399,7 @@ void KCModuleProxy::rootExited()
kdDebug(711) << k_funcinfo << endl; kdDebug(711) << k_funcinfo << endl;
if ( d->embedWidget->embeddedWinId() ) if ( d->embedWidget->embeddedWinId() )
XDestroyWindow(qt_xdisplay(), d->embedWidget->embeddedWinId()); XDestroyWindow(tqt_xdisplay(), d->embedWidget->embeddedWinId());
delete d->embedWidget; delete d->embedWidget;
d->embedWidget = 0; d->embedWidget = 0;
@ -436,7 +436,7 @@ KCModuleProxy::~KCModuleProxy()
void KCModuleProxy::deleteClient() void KCModuleProxy::deleteClient()
{ {
if( d->embedWidget ) if( d->embedWidget )
XKillClient(qt_xdisplay(), d->embedWidget->embeddedWinId()); XKillClient(tqt_xdisplay(), d->embedWidget->embeddedWinId());
delete d->kcm; delete d->kcm;

@ -55,7 +55,7 @@ KScreenSaver::KScreenSaver( WId id ) : TQWidget()
if ( id ) if ( id )
{ {
#ifdef Q_WS_X11 //FIXME #ifdef Q_WS_X11 //FIXME
XGetGeometry(qt_xdisplay(), (Drawable)id, &root, &ai, &ai, XGetGeometry(tqt_xdisplay(), (Drawable)id, &root, &ai, &ai,
&w, &h, &au, &au); &w, &h, &au, &au);
#endif #endif
@ -79,7 +79,7 @@ void KScreenSaver::embed( TQWidget *w )
{ {
KApplication::sendPostedEvents(); KApplication::sendPostedEvents();
#ifdef Q_WS_X11 //FIXME #ifdef Q_WS_X11 //FIXME
XReparentWindow(qt_xdisplay(), w->winId(), winId(), 0, 0); XReparentWindow(tqt_xdisplay(), w->winId(), winId(), 0, 0);
#endif #endif
w->setGeometry( 0, 0, width(), height() ); w->setGeometry( 0, 0, width(), height() );
KApplication::sendPostedEvents(); KApplication::sendPostedEvents();

@ -127,7 +127,7 @@ KDE_EXPORT int main(int argc, char *argv[])
#ifdef Q_WS_X11 //FIXME #ifdef Q_WS_X11 //FIXME
if (args->isSet("root")) if (args->isSet("root"))
{ {
saveWin = RootWindow(qt_xdisplay(), qt_xscreen()); saveWin = RootWindow(tqt_xdisplay(), tqt_xscreen());
} }
#endif #endif

@ -201,7 +201,7 @@ static int x11_error(Display *dpy, XErrorEvent *ev) {
// duplicated from patched Qt, so that there won't be unresolved symbols if Qt gets // duplicated from patched Qt, so that there won't be unresolved symbols if Qt gets
// replaced by unpatched one // replaced by unpatched one
TDECORE_EXPORT bool qt_qclipboard_bailout_hack = false; TDECORE_EXPORT bool tqt_qclipboard_bailout_hack = false;
template class TQPtrList<KSessionManaged>; template class TQPtrList<KSessionManaged>;
@ -891,7 +891,7 @@ void KApplication::init(bool GUIenabled)
atoms[n] = &kde_xdnd_drop; atoms[n] = &kde_xdnd_drop;
names[n++] = (char *) "XdndDrop"; names[n++] = (char *) "XdndDrop";
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];
@ -932,7 +932,7 @@ void KApplication::init(bool GUIenabled)
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
// this is important since we fork() to launch the help (Matthias) // this is important since we fork() to launch the help (Matthias)
fcntl(ConnectionNumber(qt_xdisplay()), F_SETFD, FD_CLOEXEC); fcntl(ConnectionNumber(tqt_xdisplay()), F_SETFD, FD_CLOEXEC);
// set up the fancy (=robust and error ignoring ) KDE xio error handlers (Matthias) // set up the fancy (=robust and error ignoring ) KDE xio error handlers (Matthias)
d->oldXErrorHandler = XSetErrorHandler( kde_x_errhandler ); d->oldXErrorHandler = XSetErrorHandler( kde_x_errhandler );
d->oldXIOErrorHandler = XSetIOErrorHandler( kde_xio_errhandler ); d->oldXIOErrorHandler = XSetIOErrorHandler( kde_xio_errhandler );
@ -1024,7 +1024,7 @@ void KApplication::init(bool GUIenabled)
{ {
smw = new TQWidget(0,0); smw = new TQWidget(0,0);
long data = 1; long data = 1;
XChangeProperty(qt_xdisplay(), smw->winId(), XChangeProperty(tqt_xdisplay(), smw->winId(),
atom_DesktopWindow, atom_DesktopWindow, atom_DesktopWindow, atom_DesktopWindow,
32, PropModeReplace, (unsigned char *)&data, 1); 32, PropModeReplace, (unsigned char *)&data, 1);
} }
@ -1325,7 +1325,7 @@ void KApplication::commitData( TQSessionManager& sm )
static void checkRestartVersion( TQSessionManager& sm ) static void checkRestartVersion( TQSessionManager& sm )
{ {
Display* dpy = qt_xdisplay(); Display* dpy = tqt_xdisplay();
Atom type; Atom type;
int format; int format;
unsigned long nitems, after; unsigned long nitems, after;
@ -1659,13 +1659,13 @@ void KApplication::parseCommandLine( )
int format; int format;
unsigned long length, after; unsigned long length, after;
unsigned char *data; unsigned char *data;
while ( XGetWindowProperty( qt_xdisplay(), qt_xrootwin(), atom_NetSupported, while ( XGetWindowProperty( tqt_xdisplay(), tqt_xrootwin(), atom_NetSupported,
0, 1, false, AnyPropertyType, &type, &format, 0, 1, false, AnyPropertyType, &type, &format,
&length, &after, &data ) != Success || !length ) { &length, &after, &data ) != Success || !length ) {
if ( data ) if ( data )
XFree( data ); XFree( data );
XEvent event; XEvent event;
XWindowEvent( qt_xdisplay(), qt_xrootwin(), PropertyChangeMask, &event ); XWindowEvent( tqt_xdisplay(), tqt_xrootwin(), PropertyChangeMask, &event );
} }
if ( data ) if ( data )
XFree( data ); XFree( data );
@ -2045,8 +2045,8 @@ bool KApplication::x11EventFilter( XEvent *_event )
#endif #endif
// Workaround for focus stealing prevention not working when dragging e.g. text from KWrite // Workaround for focus stealing prevention not working when dragging e.g. text from KWrite
// to KDesktop -> the dialog asking for filename doesn't get activated. This is because // to KDesktop -> the dialog asking for filename doesn't get activated. This is because
// Qt-3.2.x doesn't have concept of qt_x_user_time at all, and Qt-3.3.0b1 passes the timestamp // Qt-3.2.x doesn't have concept of tqt_x_user_time at all, and Qt-3.3.0b1 passes the timestamp
// in the XdndDrop message in incorrect field (and doesn't update qt_x_user_time either). // in the XdndDrop message in incorrect field (and doesn't update tqt_x_user_time either).
// Patch already sent, future Qt version should have this fixed. // Patch already sent, future Qt version should have this fixed.
if( _event->xclient.message_type == kde_xdnd_drop ) if( _event->xclient.message_type == kde_xdnd_drop )
{ // if the message is XdndDrop { // if the message is XdndDrop
@ -2058,15 +2058,15 @@ bool KApplication::x11EventFilter( XEvent *_event )
if( GET_QT_X_USER_TIME() == 0 if( GET_QT_X_USER_TIME() == 0
|| NET::timestampCompare( _event->xclient.data.l[ 3 ], GET_QT_X_USER_TIME() ) > 0 ) || NET::timestampCompare( _event->xclient.data.l[ 3 ], GET_QT_X_USER_TIME() ) > 0 )
{ // and the timestamp looks reasonable { // and the timestamp looks reasonable
SET_QT_X_USER_TIME(_event->xclient.data.l[ 3 ]); // update our qt_x_user_time from it SET_QT_X_USER_TIME(_event->xclient.data.l[ 3 ]); // update our tqt_x_user_time from it
} }
} }
else // normal DND, only needed until Qt updates qt_x_user_time from XdndDrop else // normal DND, only needed until Qt updates tqt_x_user_time from XdndDrop
{ {
if( GET_QT_X_USER_TIME() == 0 if( GET_QT_X_USER_TIME() == 0
|| NET::timestampCompare( _event->xclient.data.l[ 2 ], GET_QT_X_USER_TIME() ) > 0 ) || NET::timestampCompare( _event->xclient.data.l[ 2 ], GET_QT_X_USER_TIME() ) > 0 )
{ // the timestamp looks reasonable { // the timestamp looks reasonable
SET_QT_X_USER_TIME(_event->xclient.data.l[ 2 ]); // update our qt_x_user_time from it SET_QT_X_USER_TIME(_event->xclient.data.l[ 2 ]); // update our tqt_x_user_time from it
} }
} }
} }
@ -2175,17 +2175,17 @@ void KApplication::updateUserTimestamp( unsigned long time )
#if defined Q_WS_X11 #if defined Q_WS_X11
if( time == 0 ) if( time == 0 )
{ // get current X timestamp { // get current X timestamp
Window w = XCreateSimpleWindow( qt_xdisplay(), qt_xrootwin(), 0, 0, 1, 1, 0, 0, 0 ); Window w = XCreateSimpleWindow( tqt_xdisplay(), tqt_xrootwin(), 0, 0, 1, 1, 0, 0, 0 );
XSelectInput( qt_xdisplay(), w, PropertyChangeMask ); XSelectInput( tqt_xdisplay(), w, PropertyChangeMask );
unsigned char data[ 1 ]; unsigned char data[ 1 ];
XChangeProperty( qt_xdisplay(), w, XA_ATOM, XA_ATOM, 8, PropModeAppend, data, 1 ); XChangeProperty( tqt_xdisplay(), w, XA_ATOM, XA_ATOM, 8, PropModeAppend, data, 1 );
XEvent ev; XEvent ev;
XWindowEvent( qt_xdisplay(), w, PropertyChangeMask, &ev ); XWindowEvent( tqt_xdisplay(), w, PropertyChangeMask, &ev );
time = ev.xproperty.time; time = ev.xproperty.time;
XDestroyWindow( qt_xdisplay(), w ); XDestroyWindow( tqt_xdisplay(), w );
} }
if( GET_QT_X_USER_TIME() == 0 if( GET_QT_X_USER_TIME() == 0
|| NET::timestampCompare( time, GET_QT_X_USER_TIME() ) > 0 ) // check time > qt_x_user_time || NET::timestampCompare( time, GET_QT_X_USER_TIME() ) > 0 ) // check time > tqt_x_user_time
SET_QT_X_USER_TIME(time); SET_QT_X_USER_TIME(time);
#endif #endif
} }
@ -2995,8 +2995,8 @@ startServiceInternal( const TQCString &function,
TQCString _launcher = KApplication::launcher(); TQCString _launcher = KApplication::launcher();
TQValueList<TQCString> envs; TQValueList<TQCString> envs;
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if (qt_xdisplay()) { if (tqt_xdisplay()) {
TQCString dpystring(XDisplayString(qt_xdisplay())); TQCString dpystring(XDisplayString(tqt_xdisplay()));
envs.append( TQCString("DISPLAY=") + dpystring ); envs.append( TQCString("DISPLAY=") + dpystring );
} else if( getenv( "DISPLAY" )) { } else if( getenv( "DISPLAY" )) {
TQCString dpystring( getenv( "DISPLAY" )); TQCString dpystring( getenv( "DISPLAY" ));
@ -3496,7 +3496,7 @@ uint KApplication::keyboardModifiers()
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 );
return keybstate & 0x00ff; return keybstate & 0x00ff;
#elif defined W_WS_MACX #elif defined W_WS_MACX
@ -3514,7 +3514,7 @@ uint KApplication::mouseState()
Window root; Window root;
Window child; Window child;
int root_x, root_y, win_x, win_y; int root_x, root_y, win_x, win_y;
XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child, XQueryPointer( tqt_xdisplay(), tqt_xrootwin(), &root, &child,
&root_x, &root_y, &win_x, &win_y, &mousestate ); &root_x, &root_y, &win_x, &win_y, &mousestate );
#elif defined(Q_WS_WIN) #elif defined(Q_WS_WIN)
const bool mousebtn_swapped = GetSystemMetrics(SM_SWAPBUTTON); const bool mousebtn_swapped = GetSystemMetrics(SM_SWAPBUTTON);
@ -3540,7 +3540,7 @@ TQ_ButtonState KApplication::keyboardMouseState()
Window child; Window child;
int root_x, root_y, win_x, win_y; int root_x, root_y, win_x, win_y;
uint state; uint state;
XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child, XQueryPointer( tqt_xdisplay(), tqt_xrootwin(), &root, &child,
&root_x, &root_y, &win_x, &win_y, &state ); &root_x, &root_y, &win_x, &win_y, &state );
// transform the same way like Qt's qt_x11_translateButtonState() // transform the same way like Qt's qt_x11_translateButtonState()
if( state & Button1Mask ) if( state & Button1Mask )

@ -163,8 +163,8 @@ KCrash::defaultCrashHandler (int sig)
#if defined Q_WS_X11 #if defined Q_WS_X11
// start up on the correct display // start up on the correct display
argv[i++] = "-display"; argv[i++] = "-display";
if ( qt_xdisplay() ) if ( tqt_xdisplay() )
argv[i++] = XDisplayString(qt_xdisplay()); argv[i++] = XDisplayString(tqt_xdisplay());
else else
argv[i++] = getenv("DISPLAY"); argv[i++] = getenv("DISPLAY");
#elif defined(Q_WS_QWS) #elif defined(Q_WS_QWS)

@ -136,7 +136,7 @@ bool KGlobalAccelPrivate::grabKey( const KKeyServer::Key& key, bool bGrab, KAcce
// We'll have to grab 8 key modifier combinations in order to cover all // We'll have to grab 8 key modifier combinations in order to cover all
// combinations of CapsLock, NumLock, ScrollLock. // combinations of CapsLock, NumLock, ScrollLock.
// Does anyone with more X-savvy know how to set a mask on qt_xrootwin so that // Does anyone with more X-savvy know how to set a mask on tqt_xrootwin so that
// the irrelevant bits are always ignored and we can just make one XGrabKey // the irrelevant bits are always ignored and we can just make one XGrabKey
// call per accelerator? -- ellis // call per accelerator? -- ellis
#ifndef NDEBUG #ifndef NDEBUG
@ -149,10 +149,10 @@ bool KGlobalAccelPrivate::grabKey( const KKeyServer::Key& key, bool bGrab, KAcce
sDebug += TQString("0x%3, ").arg(irrelevantBitsMask, 0, 16); sDebug += TQString("0x%3, ").arg(irrelevantBitsMask, 0, 16);
#endif #endif
if( bGrab ) if( bGrab )
XGrabKey( qt_xdisplay(), keyCodeX, keyModX | irrelevantBitsMask, XGrabKey( tqt_xdisplay(), keyCodeX, keyModX | irrelevantBitsMask,
qt_xrootwin(), True, GrabModeAsync, GrabModeSync ); tqt_xrootwin(), True, GrabModeAsync, GrabModeSync );
else else
XUngrabKey( qt_xdisplay(), keyCodeX, keyModX | irrelevantBitsMask, qt_xrootwin() ); XUngrabKey( tqt_xdisplay(), keyCodeX, keyModX | irrelevantBitsMask, tqt_xrootwin() );
} }
} }
#ifndef NDEBUG #ifndef NDEBUG
@ -169,7 +169,7 @@ bool KGlobalAccelPrivate::grabKey( const KKeyServer::Key& key, bool bGrab, KAcce
kdDebug(125) << "grab failed!\n"; kdDebug(125) << "grab failed!\n";
for( uint m = 0; m <= 0xff; m++ ) { for( uint m = 0; m <= 0xff; m++ ) {
if( m & keyModMaskX == 0 ) if( m & keyModMaskX == 0 )
XUngrabKey( qt_xdisplay(), keyCodeX, keyModX | m, qt_xrootwin() ); XUngrabKey( tqt_xdisplay(), keyCodeX, keyModX | m, tqt_xrootwin() );
} }
} }
} }
@ -222,8 +222,8 @@ bool KGlobalAccelPrivate::x11KeyPress( const XEvent *pEvent )
{ {
// do not change this line unless you really really know what you are doing (Matthias) // do not change this line unless you really really know what you are doing (Matthias)
if ( !TQWidget::keyboardGrabber() && !TQApplication::activePopupWidget() ) { if ( !TQWidget::keyboardGrabber() && !TQApplication::activePopupWidget() ) {
XUngrabKeyboard( qt_xdisplay(), pEvent->xkey.time ); XUngrabKeyboard( tqt_xdisplay(), pEvent->xkey.time );
XFlush( qt_xdisplay()); // avoid X(?) bug XFlush( tqt_xdisplay()); // avoid X(?) bug
} }
if( !m_bEnabled ) if( !m_bEnabled )
@ -237,7 +237,7 @@ bool KGlobalAccelPrivate::x11KeyPress( const XEvent *pEvent )
// e.g., KP_4 => Shift+KP_Left, and Shift+KP_4 => KP_Left. // e.g., KP_4 => Shift+KP_Left, and Shift+KP_4 => KP_Left.
if( pEvent->xkey.state & KKeyServer::modXNumLock() ) { if( pEvent->xkey.state & KKeyServer::modXNumLock() ) {
// TODO: what's the xor operator in c++? // TODO: what's the xor operator in c++?
uint sym = XKeycodeToKeysym( qt_xdisplay(), codemod.code, 0 ); uint sym = XKeycodeToKeysym( tqt_xdisplay(), codemod.code, 0 );
// If this is a keypad key, // If this is a keypad key,
if( sym >= XK_KP_Space && sym <= XK_KP_9 ) { if( sym >= XK_KP_Space && sym <= XK_KP_9 ) {
switch( sym ) { switch( sym ) {

@ -172,7 +172,7 @@ bool KGlobalAccelPrivate::grabKey( const KKeyServer::Key& key, bool bGrab, KAcce
// HACK: make Alt+Print work // HACK: make Alt+Print work
// only do this for the Xorg default keyboard keycodes, // only do this for the Xorg default keyboard keycodes,
// other mappings (e.g. evdev) don't need or want it // other mappings (e.g. evdev) don't need or want it
if( key.sym() == XK_Sys_Req && XKeycodeToKeysym( qt_xdisplay(), 111, 0 ) == XK_Print ) { if( key.sym() == XK_Sys_Req && XKeycodeToKeysym( tqt_xdisplay(), 111, 0 ) == XK_Print ) {
keyModX |= KKeyServer::modXAlt(); keyModX |= KKeyServer::modXAlt();
keyCodeX = 111; keyCodeX = 111;
} }
@ -191,7 +191,7 @@ bool KGlobalAccelPrivate::grabKey( const KKeyServer::Key& key, bool bGrab, KAcce
#endif #endif
// We'll have to grab 8 key modifier combinations in order to cover all // We'll have to grab 8 key modifier combinations in order to cover all
// combinations of CapsLock, NumLock, ScrollLock. // combinations of CapsLock, NumLock, ScrollLock.
// Does anyone with more X-savvy know how to set a mask on qt_xrootwin so that // Does anyone with more X-savvy know how to set a mask on tqt_xrootwin so that
// the irrelevant bits are always ignored and we can just make one XGrabKey // the irrelevant bits are always ignored and we can just make one XGrabKey
// call per accelerator? -- ellis // call per accelerator? -- ellis
#ifndef NDEBUG #ifndef NDEBUG
@ -204,10 +204,10 @@ bool KGlobalAccelPrivate::grabKey( const KKeyServer::Key& key, bool bGrab, KAcce
sDebug += TQString("0x%3, ").arg(irrelevantBitsMask, 0, 16); sDebug += TQString("0x%3, ").arg(irrelevantBitsMask, 0, 16);
#endif #endif
if( bGrab ) if( bGrab )
XGrabKey( qt_xdisplay(), keyCodeX, keyModX | irrelevantBitsMask, XGrabKey( tqt_xdisplay(), keyCodeX, keyModX | irrelevantBitsMask,
qt_xrootwin(), True, GrabModeAsync, GrabModeSync ); tqt_xrootwin(), True, GrabModeAsync, GrabModeSync );
else else
XUngrabKey( qt_xdisplay(), keyCodeX, keyModX | irrelevantBitsMask, qt_xrootwin() ); XUngrabKey( tqt_xdisplay(), keyCodeX, keyModX | irrelevantBitsMask, tqt_xrootwin() );
} }
} }
#ifndef NDEBUG #ifndef NDEBUG
@ -224,7 +224,7 @@ bool KGlobalAccelPrivate::grabKey( const KKeyServer::Key& key, bool bGrab, KAcce
kdDebug(125) << "grab failed!\n"; kdDebug(125) << "grab failed!\n";
for( uint m = 0; m <= 0xff; m++ ) { for( uint m = 0; m <= 0xff; m++ ) {
if(( m & keyModMaskX ) == 0 ) if(( m & keyModMaskX ) == 0 )
XUngrabKey( qt_xdisplay(), keyCodeX, keyModX | m, qt_xrootwin() ); XUngrabKey( tqt_xdisplay(), keyCodeX, keyModX | m, tqt_xrootwin() );
} }
} }
} }
@ -317,8 +317,8 @@ bool KGlobalAccelPrivate::x11KeyPress( const XEvent *pEvent )
{ {
// do not change this line unless you really really know what you are doing (Matthias) // do not change this line unless you really really know what you are doing (Matthias)
if ( !TQWidget::keyboardGrabber() && !TQApplication::activePopupWidget() ) { if ( !TQWidget::keyboardGrabber() && !TQApplication::activePopupWidget() ) {
XUngrabKeyboard( qt_xdisplay(), pEvent->xkey.time ); XUngrabKeyboard( tqt_xdisplay(), pEvent->xkey.time );
XFlush( qt_xdisplay()); // avoid X(?) bug XFlush( tqt_xdisplay()); // avoid X(?) bug
} }
if( !isEnabledInternal() || m_suspended ) if( !isEnabledInternal() || m_suspended )
@ -332,7 +332,7 @@ bool KGlobalAccelPrivate::x11KeyPress( const XEvent *pEvent )
// e.g., KP_4 => Shift+KP_Left, and Shift+KP_4 => KP_Left. // e.g., KP_4 => Shift+KP_Left, and Shift+KP_4 => KP_Left.
if( pEvent->xkey.state & KKeyServer::modXNumLock() ) { if( pEvent->xkey.state & KKeyServer::modXNumLock() ) {
// TODO: what's the xor operator in c++? // TODO: what's the xor operator in c++?
uint sym = XKeycodeToKeysym( qt_xdisplay(), codemod.code, 0 ); uint sym = XKeycodeToKeysym( tqt_xdisplay(), codemod.code, 0 );
// If this is a keypad key, // If this is a keypad key,
if( sym >= XK_KP_Space && sym <= XK_KP_9 ) { if( sym >= XK_KP_Space && sym <= XK_KP_9 ) {
switch( sym ) { switch( sym ) {

@ -36,11 +36,11 @@
#include "kiconeffect.h" #include "kiconeffect.h"
#if defined(Q_WS_WIN) || defined(Q_WS_MACX) #if defined(Q_WS_WIN) || defined(Q_WS_MACX)
static bool qt_use_xrender=true; static bool tqt_use_xrender=true;
static bool qt_has_xft=true; static bool tqt_has_xft=true;
#else #else
extern bool qt_use_xrender; extern bool tqt_use_xrender;
extern bool qt_has_xft; extern bool tqt_has_xft;
#endif #endif
class KIconEffectPrivate class KIconEffectPrivate
{ {
@ -445,7 +445,7 @@ void KIconEffect::semiTransparent(TQImage &img)
int width = img.width(); int width = img.width();
int height = img.height(); int height = img.height();
if (qt_use_xrender && qt_has_xft ) if (tqt_use_xrender && tqt_has_xft )
for (y=0; y<height; y++) for (y=0; y<height; y++)
{ {
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
@ -511,7 +511,7 @@ void KIconEffect::semiTransparent(TQImage &img)
void KIconEffect::semiTransparent(TQPixmap &pix) void KIconEffect::semiTransparent(TQPixmap &pix)
{ {
if ( qt_use_xrender && qt_has_xft ) if ( tqt_use_xrender && tqt_has_xft )
{ {
TQImage img=pix.convertToImage(); TQImage img=pix.convertToImage();
semiTransparent(img); semiTransparent(img);
@ -885,7 +885,7 @@ KIconEffect::visualActivate(TQWidget * widget, TQRect rect, TQPixmap *pixmap)
// Fade out Icon a bit more // Fade out Icon a bit more
int x, y; int x, y;
if ((img.depth() == 32) && qt_use_xrender && qt_has_xft) if ((img.depth() == 32) && tqt_use_xrender && tqt_has_xft)
{ {
int width = img.width(); int width = img.width();
int height = img.height(); int height = img.height();

@ -48,7 +48,7 @@ static long getSimpleProperty(Window w, Atom a)
int status; int status;
unsigned char *p = 0; unsigned char *p = 0;
status = XGetWindowProperty(qt_xdisplay(), w, a, 0L, 1L, False, a, status = XGetWindowProperty(tqt_xdisplay(), w, a, 0L, 1L, False, a,
&real_type, &format, &n, &extra, &p); &real_type, &format, &n, &extra, &p);
if ((status == Success) && (n == 1) && (format == 32)) if ((status == Success) && (n == 1) && (format == 32))
res = *(unsigned long*)p; res = *(unsigned long*)p;
@ -62,24 +62,24 @@ void KIPC::sendMessage(Message msg, WId w, int data)
#if defined Q_WS_X11 #if defined Q_WS_X11
static Atom a = 0; static Atom a = 0;
if (a == 0) if (a == 0)
a = XInternAtom(qt_xdisplay(), "KIPC_COMM_ATOM", False); a = XInternAtom(tqt_xdisplay(), "KIPC_COMM_ATOM", False);
XEvent ev; XEvent ev;
ev.xclient.type = ClientMessage; ev.xclient.type = ClientMessage;
ev.xclient.display = qt_xdisplay(); ev.xclient.display = tqt_xdisplay();
ev.xclient.window = (Window) w; ev.xclient.window = (Window) w;
ev.xclient.message_type = a; ev.xclient.message_type = a;
ev.xclient.format = 32; ev.xclient.format = 32;
ev.xclient.data.l[0] = msg; ev.xclient.data.l[0] = msg;
ev.xclient.data.l[1] = data; ev.xclient.data.l[1] = data;
XSendEvent(qt_xdisplay(), (Window) w, False, 0L, &ev); XSendEvent(tqt_xdisplay(), (Window) w, False, 0L, &ev);
// KDE 1 support // KDE 1 support
static Atom kde1 = 0; static Atom kde1 = 0;
if ( msg == PaletteChanged || msg == FontChanged ) { if ( msg == PaletteChanged || msg == FontChanged ) {
if ( kde1 == 0 ) if ( kde1 == 0 )
kde1 = XInternAtom(qt_xdisplay(), "KDEChangeGeneral", False ); kde1 = XInternAtom(tqt_xdisplay(), "KDEChangeGeneral", False );
ev.xclient.message_type = kde1; ev.xclient.message_type = kde1;
XSendEvent(qt_xdisplay(), (Window) w, False, 0L, &ev); XSendEvent(tqt_xdisplay(), (Window) w, False, 0L, &ev);
} }
#endif #endif
@ -91,7 +91,7 @@ void KIPC::sendMessageAll(Message msg, int data)
#if defined Q_WS_X11 #if defined Q_WS_X11
unsigned int i, nrootwins; unsigned int i, nrootwins;
Window dw1, dw2, *rootwins = 0; Window dw1, dw2, *rootwins = 0;
Display *dpy = qt_xdisplay(); Display *dpy = tqt_xdisplay();
int screen_count = ScreenCount(dpy); int screen_count = ScreenCount(dpy);
KXErrorHandler handler; KXErrorHandler handler;
@ -99,7 +99,7 @@ void KIPC::sendMessageAll(Message msg, int data)
Window root = RootWindow(dpy, s); Window root = RootWindow(dpy, s);
XQueryTree(dpy, root, &dw1, &dw2, &rootwins, &nrootwins); XQueryTree(dpy, root, &dw1, &dw2, &rootwins, &nrootwins);
Atom a = XInternAtom(qt_xdisplay(), "KDE_DESKTOP_WINDOW", False); Atom a = XInternAtom(tqt_xdisplay(), "KDE_DESKTOP_WINDOW", False);
for (i = 0; i < nrootwins; i++) for (i = 0; i < nrootwins; i++)
{ {
if (getSimpleProperty(rootwins[i], a) != 0L) if (getSimpleProperty(rootwins[i], a) != 0L)

@ -111,13 +111,13 @@ bool KKeyNative::init( const KKey& key )
// Only do this for the default Xorg layout, other keycode mappings // Only do this for the default Xorg layout, other keycode mappings
// (e.g. evdev) don't need or want it. // (e.g. evdev) don't need or want it.
if( m_sym == XK_Print && !(m_mod & Mod1Mask) && if( m_sym == XK_Print && !(m_mod & Mod1Mask) &&
XKeycodeToKeysym( qt_xdisplay(), 111, 0 ) == XK_Print ) XKeycodeToKeysym( tqt_xdisplay(), 111, 0 ) == XK_Print )
m_code = 111; // code for Print m_code = 111; // code for Print
else if( m_sym == XK_Break || (m_sym == XK_Pause && (m_mod & ControlMask)) && else if( m_sym == XK_Break || (m_sym == XK_Pause && (m_mod & ControlMask)) &&
XKeycodeToKeysym( qt_xdisplay(), 114, 0 ) == XK_Pause ) XKeycodeToKeysym( tqt_xdisplay(), 114, 0 ) == XK_Pause )
m_code = 114; m_code = 114;
else else
m_code = XKeysymToKeycode( qt_xdisplay(), m_sym ); m_code = XKeysymToKeycode( tqt_xdisplay(), m_sym );
if( !m_code && m_sym ) if( !m_code && m_sym )
kdDebug(125) << "Couldn't get code for sym" << endl; kdDebug(125) << "Couldn't get code for sym" << endl;

@ -328,14 +328,14 @@ static uint g_modXNumLock, g_modXScrollLock, g_modXModeSwitch;
bool initializeMods() bool initializeMods()
{ {
XModifierKeymap* xmk = XGetModifierMapping( qt_xdisplay() ); XModifierKeymap* xmk = XGetModifierMapping( tqt_xdisplay() );
g_rgModInfo[3].modX = g_modXNumLock = g_modXScrollLock = g_modXModeSwitch = 0; g_rgModInfo[3].modX = g_modXNumLock = g_modXScrollLock = g_modXModeSwitch = 0;
int min_keycode, max_keycode; int min_keycode, max_keycode;
int keysyms_per_keycode = 0; int keysyms_per_keycode = 0;
XDisplayKeycodes( qt_xdisplay(), &min_keycode, &max_keycode ); XDisplayKeycodes( tqt_xdisplay(), &min_keycode, &max_keycode );
XFree( XGetKeyboardMapping( qt_xdisplay(), min_keycode, 1, &keysyms_per_keycode )); XFree( XGetKeyboardMapping( tqt_xdisplay(), min_keycode, 1, &keysyms_per_keycode ));
// Qt assumes that Alt is always Mod1Mask, so start at Mod2Mask. // Qt assumes that Alt is always Mod1Mask, so start at Mod2Mask.
for( int i = Mod2MapIndex; i < 8; i++ ) { for( int i = Mod2MapIndex; i < 8; i++ ) {
uint mask = (1 << i); uint mask = (1 << i);
@ -346,7 +346,7 @@ bool initializeMods()
// found fixes the problem. // found fixes the problem.
for( int j = 0; j < xmk->max_keypermod && keySymX == NoSymbol; ++j ) for( int j = 0; j < xmk->max_keypermod && keySymX == NoSymbol; ++j )
for( int k = 0; k < keysyms_per_keycode && keySymX == NoSymbol; ++k ) for( int k = 0; k < keysyms_per_keycode && keySymX == NoSymbol; ++k )
keySymX = XKeycodeToKeysym( qt_xdisplay(), xmk->modifiermap[xmk->max_keypermod * i + j], k ); keySymX = XKeycodeToKeysym( tqt_xdisplay(), xmk->modifiermap[xmk->max_keypermod * i + j], k );
switch( keySymX ) { switch( keySymX ) {
case XK_Num_Lock: g_modXNumLock = mask; break; // Normally Mod2Mask case XK_Num_Lock: g_modXNumLock = mask; break; // Normally Mod2Mask
case XK_Super_L: case XK_Super_L:
@ -372,7 +372,7 @@ bool initializeMods()
static void initializeVariations() static void initializeVariations()
{ {
for( int i = 0; g_rgSymVariation[i].sym != 0; i++ ) for( int i = 0; g_rgSymVariation[i].sym != 0; i++ )
g_rgSymVariation[i].bActive = (XKeysymToKeycode( qt_xdisplay(), g_rgSymVariation[i].symVariation ) != 0); g_rgSymVariation[i].bActive = (XKeysymToKeycode( tqt_xdisplay(), g_rgSymVariation[i].symVariation ) != 0);
g_bInitializedVariations = true; g_bInitializedVariations = true;
} }
#endif //Q_WS_X11 #endif //Q_WS_X11
@ -546,18 +546,18 @@ uint Sym::getModsRequired() const
return KKey::SHIFT; return KKey::SHIFT;
} }
uchar code = XKeysymToKeycode( qt_xdisplay(), m_sym ); uchar code = XKeysymToKeycode( tqt_xdisplay(), m_sym );
if( code ) { if( code ) {
// need to check index 0 before the others, so that a null-mod // need to check index 0 before the others, so that a null-mod
// can take precedence over the others, in case the modified // can take precedence over the others, in case the modified
// key produces the same symbol. // key produces the same symbol.
if( m_sym == XKeycodeToKeysym( qt_xdisplay(), code, 0 ) ) if( m_sym == XKeycodeToKeysym( tqt_xdisplay(), code, 0 ) )
; ;
else if( m_sym == XKeycodeToKeysym( qt_xdisplay(), code, 1 ) ) else if( m_sym == XKeycodeToKeysym( tqt_xdisplay(), code, 1 ) )
mod = KKey::SHIFT; mod = KKey::SHIFT;
else if( m_sym == XKeycodeToKeysym( qt_xdisplay(), code, 2 ) ) else if( m_sym == XKeycodeToKeysym( tqt_xdisplay(), code, 2 ) )
mod = KKeyServer::MODE_SWITCH; mod = KKeyServer::MODE_SWITCH;
else if( m_sym == XKeycodeToKeysym( qt_xdisplay(), code, 3 ) ) else if( m_sym == XKeycodeToKeysym( tqt_xdisplay(), code, 3 ) )
mod = KKey::SHIFT | KKeyServer::MODE_SWITCH; mod = KKey::SHIFT | KKeyServer::MODE_SWITCH;
} }
#endif #endif
@ -762,7 +762,7 @@ bool codeXToSym( uchar codeX, uint modX, uint& sym )
XKeyPressedEvent event; XKeyPressedEvent event;
event.type = KeyPress; event.type = KeyPress;
event.display = qt_xdisplay(); event.display = tqt_xdisplay();
event.state = modX; event.state = modX;
event.keycode = codeX; event.keycode = codeX;
@ -858,7 +858,7 @@ uint stringUserToMod( const TQString& mod )
if( keySymX != 0 ) { if( keySymX != 0 ) {
// Get X keyboard code // Get X keyboard code
keyCodeX = XKeysymToKeycode( qt_xdisplay(), keySymX ); keyCodeX = XKeysymToKeycode( tqt_xdisplay(), keySymX );
// Add ModeSwitch modifier bit, if necessary // Add ModeSwitch modifier bit, if necessary
keySymXMods( keySymX, 0, &keyModX ); keySymXMods( keySymX, 0, &keyModX );
@ -887,8 +887,8 @@ uint stringUserToMod( const TQString& mod )
// keycode 111 & 92: Print Sys_Req -> Sys_Req = Alt+Print // keycode 111 & 92: Print Sys_Req -> Sys_Req = Alt+Print
// keycode 110 & 114: Pause Break -> Break = Ctrl+Pause // keycode 110 & 114: Pause Break -> Break = Ctrl+Pause
if( (keyCodeX == 92 || keyCodeX == 111) && if( (keyCodeX == 92 || keyCodeX == 111) &&
XKeycodeToKeysym( qt_xdisplay(), 92, 0 ) == XK_Print && XKeycodeToKeysym( tqt_xdisplay(), 92, 0 ) == XK_Print &&
XKeycodeToKeysym( qt_xdisplay(), 111, 0 ) == XK_Print ) XKeycodeToKeysym( tqt_xdisplay(), 111, 0 ) == XK_Print )
{ {
// If Alt is pressed, then we need keycode 92, keysym XK_Sys_Req // If Alt is pressed, then we need keycode 92, keysym XK_Sys_Req
if( keyModX & keyModXAlt() ) { if( keyModX & keyModXAlt() ) {
@ -902,8 +902,8 @@ uint stringUserToMod( const TQString& mod )
} }
} }
else if( (keyCodeX == 110 || keyCodeX == 114) && else if( (keyCodeX == 110 || keyCodeX == 114) &&
XKeycodeToKeysym( qt_xdisplay(), 110, 0 ) == XK_Pause && XKeycodeToKeysym( tqt_xdisplay(), 110, 0 ) == XK_Pause &&
XKeycodeToKeysym( qt_xdisplay(), 114, 0 ) == XK_Pause ) XKeycodeToKeysym( tqt_xdisplay(), 114, 0 ) == XK_Pause )
{ {
if( keyModX & keyModXCtrl() ) { if( keyModX & keyModXCtrl() ) {
keyCodeX = 114; keyCodeX = 114;

@ -76,7 +76,7 @@ bool KSelectionOwnerPrivate::x11Event( XEvent* ev_P )
KSelectionOwner::KSelectionOwner( Atom selection_P, int screen_P, TQObject* parent_P ) KSelectionOwner::KSelectionOwner( Atom selection_P, int screen_P, TQObject* parent_P )
: TQObject( parent_P ), : TQObject( parent_P ),
selection( selection_P ), selection( selection_P ),
screen( screen_P >= 0 ? screen_P : DefaultScreen( qt_xdisplay())), screen( screen_P >= 0 ? screen_P : DefaultScreen( tqt_xdisplay())),
window( None ), window( None ),
timestamp( CurrentTime ), timestamp( CurrentTime ),
extra1( 0 ), extra2( 0 ), extra1( 0 ), extra2( 0 ),
@ -86,8 +86,8 @@ KSelectionOwner::KSelectionOwner( Atom selection_P, int screen_P, TQObject* pare
KSelectionOwner::KSelectionOwner( const char* selection_P, int screen_P, TQObject* parent_P ) KSelectionOwner::KSelectionOwner( const char* selection_P, int screen_P, TQObject* parent_P )
: TQObject( parent_P ), : TQObject( parent_P ),
selection( XInternAtom( qt_xdisplay(), selection_P, False )), selection( XInternAtom( tqt_xdisplay(), selection_P, False )),
screen( screen_P >= 0 ? screen_P : DefaultScreen( qt_xdisplay())), screen( screen_P >= 0 ? screen_P : DefaultScreen( tqt_xdisplay())),
window( None ), window( None ),
timestamp( CurrentTime ), timestamp( CurrentTime ),
extra1( 0 ), extra2( 0 ), extra1( 0 ), extra2( 0 ),
@ -107,7 +107,7 @@ bool KSelectionOwner::claim( bool force_P, bool force_kill_P )
getAtoms(); getAtoms();
if( timestamp != CurrentTime ) if( timestamp != CurrentTime )
release(); release();
Display* const dpy = qt_xdisplay(); Display* const dpy = tqt_xdisplay();
Window prev_owner = XGetSelectionOwner( dpy, selection ); Window prev_owner = XGetSelectionOwner( dpy, selection );
if( prev_owner != None ) if( prev_owner != None )
{ {
@ -183,7 +183,7 @@ void KSelectionOwner::release()
{ {
if( timestamp == CurrentTime ) if( timestamp == CurrentTime )
return; return;
XDestroyWindow( qt_xdisplay(), window ); // also makes the selection not owned XDestroyWindow( tqt_xdisplay(), window ); // also makes the selection not owned
// kdDebug() << "Releasing selection" << endl; // kdDebug() << "Releasing selection" << endl;
timestamp = CurrentTime; timestamp = CurrentTime;
} }
@ -217,8 +217,8 @@ bool KSelectionOwner::filterEvent( XEvent* ev_P )
timestamp = CurrentTime; timestamp = CurrentTime;
// kdDebug() << "Lost selection" << endl; // kdDebug() << "Lost selection" << endl;
emit lostOwnership(); emit lostOwnership();
XSelectInput( qt_xdisplay(), window, 0 ); XSelectInput( tqt_xdisplay(), window, 0 );
XDestroyWindow( qt_xdisplay(), window ); XDestroyWindow( tqt_xdisplay(), window );
return false; return false;
} }
case DestroyNotify: case DestroyNotify:
@ -268,7 +268,7 @@ void KSelectionOwner::filter_selection_request( XSelectionRequestEvent& ev_P )
unsigned long items; unsigned long items;
unsigned long after; unsigned long after;
unsigned char* data; unsigned char* data;
if( XGetWindowProperty( qt_xdisplay(), ev_P.requestor, ev_P.property, 0, if( XGetWindowProperty( tqt_xdisplay(), ev_P.requestor, ev_P.property, 0,
MAX_ATOMS, False, AnyPropertyType, &type, &format, &items, &after, MAX_ATOMS, False, AnyPropertyType, &type, &format, &items, &after,
&data ) == Success && format == 32 && items % 2 == 0 ) &data ) == Success && format == 32 && items % 2 == 0 )
{ {
@ -289,7 +289,7 @@ void KSelectionOwner::filter_selection_request( XSelectionRequestEvent& ev_P )
atoms[ i * 2 + 1 ] = None; atoms[ i * 2 + 1 ] = None;
} }
if( !all_handled ) if( !all_handled )
XChangeProperty( qt_xdisplay(), ev_P.requestor, ev_P.property, XA_ATOM, XChangeProperty( tqt_xdisplay(), ev_P.requestor, ev_P.property, XA_ATOM,
32, PropModeReplace, reinterpret_cast< unsigned char* >( atoms ), items ); 32, PropModeReplace, reinterpret_cast< unsigned char* >( atoms ), items );
handled = true; handled = true;
XFree( data ); XFree( data );
@ -304,11 +304,11 @@ void KSelectionOwner::filter_selection_request( XSelectionRequestEvent& ev_P )
} }
XEvent ev; XEvent ev;
ev.xselection.type = SelectionNotify; ev.xselection.type = SelectionNotify;
ev.xselection.display = qt_xdisplay(); ev.xselection.display = tqt_xdisplay();
ev.xselection.requestor = ev_P.requestor; ev.xselection.requestor = ev_P.requestor;
ev.xselection.target = ev_P.target; ev.xselection.target = ev_P.target;
ev.xselection.property = handled ? ev_P.property : None; ev.xselection.property = handled ? ev_P.property : None;
XSendEvent( qt_xdisplay(), ev_P.requestor, False, 0, &ev ); XSendEvent( tqt_xdisplay(), ev_P.requestor, False, 0, &ev );
} }
bool KSelectionOwner::handle_selection( Atom target_P, Atom property_P, Window requestor_P ) bool KSelectionOwner::handle_selection( Atom target_P, Atom property_P, Window requestor_P )
@ -316,7 +316,7 @@ bool KSelectionOwner::handle_selection( Atom target_P, Atom property_P, Window r
if( target_P == xa_timestamp ) if( target_P == xa_timestamp )
{ {
// kdDebug() << "Handling timestamp request" << endl; // kdDebug() << "Handling timestamp request" << endl;
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* >( &timestamp ), 1 ); PropModeReplace, reinterpret_cast< unsigned char* >( &timestamp ), 1 );
} }
else if( target_P == xa_targets ) else if( target_P == xa_targets )
@ -332,7 +332,7 @@ void KSelectionOwner::replyTargets( Atom property_P, Window requestor_P )
{ {
Atom atoms[ 3 ] = { xa_multiple, xa_timestamp, xa_targets }; Atom atoms[ 3 ] = { xa_multiple, xa_timestamp, xa_targets };
// kdDebug() << "Handling targets request" << endl; // kdDebug() << "Handling targets request" << endl;
XChangeProperty( qt_xdisplay(), requestor_P, property_P, XA_ATOM, 32, PropModeReplace, XChangeProperty( tqt_xdisplay(), requestor_P, property_P, XA_ATOM, 32, PropModeReplace,
reinterpret_cast< unsigned char* >( atoms ), 3 ); reinterpret_cast< unsigned char* >( atoms ), 3 );
} }
@ -348,7 +348,7 @@ void KSelectionOwner::getAtoms()
Atom atoms[ 4 ]; Atom atoms[ 4 ];
const char* const names[] = const char* const names[] =
{ "MANAGER", "MULTIPLE", "TARGETS", "TIMESTAMP" }; { "MANAGER", "MULTIPLE", "TARGETS", "TIMESTAMP" };
XInternAtoms( qt_xdisplay(), const_cast< char** >( names ), 4, False, atoms ); XInternAtoms( tqt_xdisplay(), const_cast< char** >( names ), 4, False, atoms );
manager_atom = atoms[ 0 ]; manager_atom = atoms[ 0 ];
xa_multiple = atoms[ 1]; xa_multiple = atoms[ 1];
xa_targets = atoms[ 2 ]; xa_targets = atoms[ 2 ];
@ -393,7 +393,7 @@ bool KSelectionWatcherPrivate::x11Event( XEvent* ev_P )
KSelectionWatcher::KSelectionWatcher( Atom selection_P, int screen_P, TQObject* parent_P ) KSelectionWatcher::KSelectionWatcher( Atom selection_P, int screen_P, TQObject* parent_P )
: TQObject( parent_P ), : TQObject( parent_P ),
selection( selection_P ), selection( selection_P ),
screen( screen_P >= 0 ? screen_P : DefaultScreen( qt_xdisplay())), screen( screen_P >= 0 ? screen_P : DefaultScreen( tqt_xdisplay())),
selection_owner( None ), selection_owner( None ),
d( new KSelectionWatcherPrivate( this )) d( new KSelectionWatcherPrivate( this ))
{ {
@ -402,8 +402,8 @@ KSelectionWatcher::KSelectionWatcher( Atom selection_P, int screen_P, TQObject*
KSelectionWatcher::KSelectionWatcher( const char* selection_P, int screen_P, TQObject* parent_P ) KSelectionWatcher::KSelectionWatcher( const char* selection_P, int screen_P, TQObject* parent_P )
: TQObject( parent_P ), : TQObject( parent_P ),
selection( XInternAtom( qt_xdisplay(), selection_P, False )), selection( XInternAtom( tqt_xdisplay(), selection_P, False )),
screen( screen_P >= 0 ? screen_P : DefaultScreen( qt_xdisplay())), screen( screen_P >= 0 ? screen_P : DefaultScreen( tqt_xdisplay())),
selection_owner( None ), selection_owner( None ),
d( new KSelectionWatcherPrivate( this )) d( new KSelectionWatcherPrivate( this ))
{ {
@ -419,7 +419,7 @@ void KSelectionWatcher::init()
{ {
if( manager_atom == None ) if( manager_atom == None )
{ {
Display* const dpy = qt_xdisplay(); Display* const dpy = tqt_xdisplay();
manager_atom = XInternAtom( dpy, "MANAGER", False ); manager_atom = XInternAtom( dpy, "MANAGER", False );
XWindowAttributes attrs; XWindowAttributes attrs;
XGetWindowAttributes( dpy, RootWindow( dpy, screen ), &attrs ); XGetWindowAttributes( dpy, RootWindow( dpy, screen ), &attrs );
@ -431,7 +431,7 @@ void KSelectionWatcher::init()
Window KSelectionWatcher::owner() Window KSelectionWatcher::owner()
{ {
Display* const dpy = qt_xdisplay(); Display* const dpy = tqt_xdisplay();
KXErrorHandler handler; KXErrorHandler handler;
Window current_owner = XGetSelectionOwner( dpy, selection ); Window current_owner = XGetSelectionOwner( dpy, selection );
if( current_owner == None ) if( current_owner == None )

@ -64,11 +64,11 @@ void KRootProp::sync()
} }
} }
XChangeProperty( qt_xdisplay(), qt_xrootwin(), atom, XChangeProperty( tqt_xdisplay(), tqt_xrootwin(), atom,
XA_STRING, 8, PropModeReplace, XA_STRING, 8, PropModeReplace,
(const unsigned char *)propString.utf8().data(), (const unsigned char *)propString.utf8().data(),
propString.length()); propString.length());
XFlush( qt_xdisplay() ); XFlush( tqt_xdisplay() );
} }
void KRootProp::setProp( const TQString& rProp ) void KRootProp::setProp( const TQString& rProp )
@ -89,14 +89,14 @@ void KRootProp::setProp( const TQString& rProp )
if( rProp.isEmpty() ) if( rProp.isEmpty() )
return; return;
atom = XInternAtom( qt_xdisplay(), rProp.utf8(), False); atom = XInternAtom( tqt_xdisplay(), rProp.utf8(), False);
TQString s; TQString s;
offset = 0; bytes_after = 1; offset = 0; bytes_after = 1;
while (bytes_after != 0) while (bytes_after != 0)
{ {
unsigned char *buf = 0; unsigned char *buf = 0;
if (XGetWindowProperty( qt_xdisplay(), qt_xrootwin(), atom, offset, 256, if (XGetWindowProperty( tqt_xdisplay(), tqt_xrootwin(), atom, offset, 256,
False, XA_STRING, &type, &format, &nitems, &bytes_after, False, XA_STRING, &type, &format, &nitems, &bytes_after,
&buf) == Success && buf) &buf) == Success && buf)
{ {
@ -152,7 +152,7 @@ void KRootProp::destroy()
dirty = false; dirty = false;
propDict.clear(); propDict.clear();
if( atom ) { if( atom ) {
XDeleteProperty( qt_xdisplay(), qt_xrootwin(), atom ); XDeleteProperty( tqt_xdisplay(), tqt_xrootwin(), atom );
atom = 0; atom = 0;
} }
} }

@ -383,7 +383,7 @@ bool KStartupInfo::sendStartup( const KStartupInfoId& id_P, const KStartupInfoDa
KXMessages msgs; KXMessages msgs;
TQString msg = TQString::fromLatin1( "new: %1 %2" ) TQString msg = TQString::fromLatin1( "new: %1 %2" )
.arg( id_P.to_text()).arg( data_P.to_text()); .arg( id_P.to_text()).arg( data_P.to_text());
msg = check_required_startup_fields( msg, data_P, qt_xscreen()); msg = check_required_startup_fields( msg, data_P, tqt_xscreen());
kdDebug( 172 ) << "sending " << msg << endl; kdDebug( 172 ) << "sending " << msg << endl;
msgs.broadcastMessage( NET_STARTUP_MSG, msg, -1, false ); msgs.broadcastMessage( NET_STARTUP_MSG, msg, -1, false );
return true; return true;
@ -508,7 +508,7 @@ void KStartupInfo::appStarted( const TQCString& startup_id )
return; return;
if( kapp != NULL ) if( kapp != NULL )
KStartupInfo::sendFinish( id ); KStartupInfo::sendFinish( id );
else if( getenv( "DISPLAY" ) != NULL ) // don't rely on qt_xdisplay() else if( getenv( "DISPLAY" ) != NULL ) // don't rely on tqt_xdisplay()
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
Display* disp = XOpenDisplay( NULL ); Display* disp = XOpenDisplay( NULL );
@ -551,7 +551,7 @@ void KStartupInfo::setNewStartupId( TQWidget* window, const TQCString& startup_i
{ {
if( !startup_id.isEmpty() && startup_id != "0" ) if( !startup_id.isEmpty() && startup_id != "0" )
{ {
NETRootInfo i( qt_xdisplay(), NET::Supported ); NETRootInfo i( tqt_xdisplay(), NET::Supported );
if( i.isSupported( NET::WM2StartupId )) if( i.isSupported( NET::WM2StartupId ))
{ {
KStartupInfo::setWindowStartupId( window->winId(), startup_id ); KStartupInfo::setWindowStartupId( window->winId(), startup_id );
@ -618,7 +618,7 @@ KStartupInfo::startup_t KStartupInfo::check_startup_internal( WId w_P, KStartupI
return find_id( id, id_O, data_O ) ? Match : NoMatch; return find_id( id, id_O, data_O ) ? Match : NoMatch;
} }
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETWinInfo info( qt_xdisplay(), w_P, qt_xrootwin(), NETWinInfo info( tqt_xdisplay(), w_P, tqt_xrootwin(),
NET::WMWindowType | NET::WMPid | NET::WMState ); NET::WMWindowType | NET::WMPid | NET::WMState );
pid_t pid = info.pid(); pid_t pid = info.pid();
if( pid > 0 ) if( pid > 0 )
@ -630,7 +630,7 @@ KStartupInfo::startup_t KStartupInfo::check_startup_internal( WId w_P, KStartupI
// try XClass matching , this PID stuff sucks :( // try XClass matching , this PID stuff sucks :(
} }
XClassHint hint; XClassHint hint;
if( XGetClassHint( qt_xdisplay(), w_P, &hint ) != 0 ) if( XGetClassHint( tqt_xdisplay(), w_P, &hint ) != 0 )
{ // We managed to read the class hint { // We managed to read the class hint
TQCString res_name = hint.res_name; TQCString res_name = hint.res_name;
TQCString res_class = hint.res_class; TQCString res_class = hint.res_class;
@ -652,8 +652,8 @@ KStartupInfo::startup_t KStartupInfo::check_startup_internal( WId w_P, KStartupI
return NoMatch; return NoMatch;
// lets see if this is a transient // lets see if this is a transient
Window transient_for; Window transient_for;
if( XGetTransientForHint( qt_xdisplay(), static_cast< Window >( w_P ), &transient_for ) if( XGetTransientForHint( tqt_xdisplay(), static_cast< Window >( w_P ), &transient_for )
&& static_cast< WId >( transient_for ) != qt_xrootwin() && static_cast< WId >( transient_for ) != tqt_xrootwin()
&& transient_for != None ) && transient_for != None )
return NoMatch; return NoMatch;
#endif #endif
@ -744,7 +744,7 @@ static TQCString read_startup_id_property( WId w_P )
Atom type_ret; Atom type_ret;
int format_ret; int format_ret;
unsigned long nitems_ret = 0, after_ret = 0; unsigned long nitems_ret = 0, after_ret = 0;
if( XGetWindowProperty( qt_xdisplay(), w_P, net_startup_atom, 0l, 4096, if( XGetWindowProperty( tqt_xdisplay(), w_P, net_startup_atom, 0l, 4096,
False, utf8_string_atom, &type_ret, &format_ret, &nitems_ret, &after_ret, &name_ret ) False, utf8_string_atom, &type_ret, &format_ret, &nitems_ret, &after_ret, &name_ret )
== Success ) == Success )
{ {
@ -762,13 +762,13 @@ TQCString KStartupInfo::windowStartupId( WId w_P )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if( net_startup_atom == None ) if( net_startup_atom == None )
net_startup_atom = XInternAtom( qt_xdisplay(), NET_STARTUP_WINDOW, False ); net_startup_atom = XInternAtom( tqt_xdisplay(), NET_STARTUP_WINDOW, False );
if( utf8_string_atom == None ) if( utf8_string_atom == None )
utf8_string_atom = XInternAtom( qt_xdisplay(), "UTF8_STRING", False ); utf8_string_atom = XInternAtom( tqt_xdisplay(), "UTF8_STRING", False );
TQCString ret = read_startup_id_property( w_P ); TQCString ret = read_startup_id_property( w_P );
if( ret.isEmpty()) if( ret.isEmpty())
{ // retry with window group leader, as the spec says { // retry with window group leader, as the spec says
XWMHints* hints = XGetWMHints( qt_xdisplay(), w_P ); XWMHints* hints = XGetWMHints( tqt_xdisplay(), w_P );
if( hints && ( hints->flags & WindowGroupHint ) != 0 ) if( hints && ( hints->flags & WindowGroupHint ) != 0 )
ret = read_startup_id_property( hints->window_group ); ret = read_startup_id_property( hints->window_group );
if( hints ) if( hints )
@ -786,10 +786,10 @@ void KStartupInfo::setWindowStartupId( WId w_P, const TQCString& id_P )
if( id_P.isNull()) if( id_P.isNull())
return; return;
if( net_startup_atom == None ) if( net_startup_atom == None )
net_startup_atom = XInternAtom( qt_xdisplay(), NET_STARTUP_WINDOW, False ); net_startup_atom = XInternAtom( tqt_xdisplay(), NET_STARTUP_WINDOW, False );
if( utf8_string_atom == None ) if( utf8_string_atom == None )
utf8_string_atom = XInternAtom( qt_xdisplay(), "UTF8_STRING", False ); utf8_string_atom = XInternAtom( tqt_xdisplay(), "UTF8_STRING", False );
XChangeProperty( qt_xdisplay(), w_P, net_startup_atom, utf8_string_atom, 8, XChangeProperty( tqt_xdisplay(), w_P, net_startup_atom, utf8_string_atom, 8,
PropModeReplace, reinterpret_cast< unsigned char* >( const_cast<TQCString&>(id_P).data()), id_P.length()); PropModeReplace, reinterpret_cast< unsigned char* >( const_cast<TQCString&>(id_P).data()), id_P.length());
#endif #endif
} }
@ -800,7 +800,7 @@ TQCString KStartupInfo::get_window_hostname( WId w_P )
XTextProperty tp; XTextProperty tp;
char** hh; char** hh;
int cnt; int cnt;
if( XGetWMClientMachine( qt_xdisplay(), w_P, &tp ) != 0 if( XGetWMClientMachine( tqt_xdisplay(), w_P, &tp ) != 0
&& XTextPropertyToStringList( &tp, &hh, &cnt ) != 0 ) && XTextPropertyToStringList( &tp, &hh, &cnt ) != 0 )
{ {
if( cnt == 1 ) if( cnt == 1 )

@ -180,7 +180,7 @@ class TDECORE_EXPORT KStartupInfo
static bool sendStartup( const KStartupInfoId& id, const KStartupInfoData& data ); static bool sendStartup( const KStartupInfoId& id, const KStartupInfoData& data );
/** /**
* Like sendStartup , uses dpy instead of qt_xdisplay() for sending the info. * Like sendStartup , uses dpy instead of tqt_xdisplay() for sending the info.
* @param dpy the display of the application. Note that the name field * @param dpy the display of the application. Note that the name field
* in data is required. * in data is required.
* @param id the id of the application * @param id the id of the application
@ -203,7 +203,7 @@ class TDECORE_EXPORT KStartupInfo
static bool sendChange( const KStartupInfoId& id, const KStartupInfoData& data ); static bool sendChange( const KStartupInfoId& id, const KStartupInfoData& data );
/** /**
* Like sendChange , uses dpy instead of qt_xdisplay() for sending the info. * Like sendChange , uses dpy instead of tqt_xdisplay() for sending the info.
* @param dpy the display of the application. * @param dpy the display of the application.
* @param id the id of the application * @param id the id of the application
* @param data the application's data * @param data the application's data
@ -220,7 +220,7 @@ class TDECORE_EXPORT KStartupInfo
static bool sendFinish( const KStartupInfoId& id ); static bool sendFinish( const KStartupInfoId& id );
/** /**
* Like sendFinish , uses dpy instead of qt_xdisplay() for sending the info. * Like sendFinish , uses dpy instead of tqt_xdisplay() for sending the info.
* @param dpy the display of the application. * @param dpy the display of the application.
* @param id the id of the application * @param id the id of the application
* @return true if successful, false otherwise * @return true if successful, false otherwise
@ -237,7 +237,7 @@ class TDECORE_EXPORT KStartupInfo
static bool sendFinish( const KStartupInfoId& id, const KStartupInfoData& data ); static bool sendFinish( const KStartupInfoId& id, const KStartupInfoData& data );
/** /**
* Like sendFinish , uses dpy instead of qt_xdisplay() for sending the info. * Like sendFinish , uses dpy instead of tqt_xdisplay() for sending the info.
* @param dpy the display of the application. * @param dpy the display of the application.
* @param id the id of the application * @param id the id of the application
* @param data the application's data * @param data the application's data
@ -637,7 +637,7 @@ class TDECORE_EXPORT KStartupInfoData
/** /**
* Sets the X11 screen on which the startup notification should happen. * Sets the X11 screen on which the startup notification should happen.
* This is usually not necessary to set, as it's set by default to qt_xscreen(). * This is usually not necessary to set, as it's set by default to tqt_xscreen().
*/ */
void setScreen( int screen ); void setScreen( int screen );

@ -61,20 +61,20 @@ class TDECORE_EXPORT KXErrorHandler
* Creates error handler that will set error flag after encountering * Creates error handler that will set error flag after encountering
* any X error. * any X error.
*/ */
KXErrorHandler( Display* dpy = qt_xdisplay()); KXErrorHandler( Display* dpy = tqt_xdisplay());
/** /**
* This constructor takes pointer to a function that will get request number, * This constructor takes pointer to a function that will get request number,
* error code number and resource id of the failed request, as provided * error code number and resource id of the failed request, as provided
* by XErrorEvent. If the function returns true, the error flag will be set. * by XErrorEvent. If the function returns true, the error flag will be set.
*/ */
KXErrorHandler( bool (*handler)( int request, int error_code, unsigned long resource_id ), Display* dpy = qt_xdisplay()); KXErrorHandler( bool (*handler)( int request, int error_code, unsigned long resource_id ), Display* dpy = tqt_xdisplay());
/** /**
* This constructor takes pointer to a function whose prototype matches * This constructor takes pointer to a function whose prototype matches
* the one that's used with the XSetErrorHandler() Xlib function. * the one that's used with the XSetErrorHandler() Xlib function.
* NOTE: For the error flag to be set, the function must return non-zero * NOTE: For the error flag to be set, the function must return non-zero
* value. * value.
*/ */
KXErrorHandler( int (*handler)( Display*, XErrorEvent* ), Display* dpy = qt_xdisplay()); KXErrorHandler( int (*handler)( Display*, XErrorEvent* ), Display* dpy = tqt_xdisplay());
/** /**
* This function returns true if the error flag is set (i.e. no custom handler * This function returns true if the error flag is set (i.e. no custom handler
* function was used and there was any error, or the custom handler indicated * function was used and there was any error, or the custom handler indicated

@ -44,7 +44,7 @@ KXMessages::KXMessages( const char* accept_broadcast_P, TQWidget* parent_P )
{ {
( void ) kapp->desktop(); //trigger desktop widget creation to select root window events ( void ) kapp->desktop(); //trigger desktop widget creation to select root window events
kapp->installX11EventFilter( this ); // i.e. PropertyChangeMask kapp->installX11EventFilter( this ); // i.e. PropertyChangeMask
accept_atom1 = XInternAtom( qt_xdisplay(), accept_broadcast_P, false ); accept_atom1 = XInternAtom( tqt_xdisplay(), accept_broadcast_P, false );
accept_atom2 = accept_atom1; accept_atom2 = accept_atom1;
} }
else else
@ -61,9 +61,9 @@ KXMessages::KXMessages( const char* accept_broadcast_P, TQWidget* parent_P, bool
{ {
( void ) kapp->desktop(); //trigger desktop widget creation to select root window events ( void ) kapp->desktop(); //trigger desktop widget creation to select root window events
kapp->installX11EventFilter( this ); // i.e. PropertyChangeMask kapp->installX11EventFilter( this ); // i.e. PropertyChangeMask
accept_atom2 = XInternAtom( qt_xdisplay(), accept_broadcast_P, false ); accept_atom2 = XInternAtom( tqt_xdisplay(), accept_broadcast_P, false );
accept_atom1 = obsolete_P ? accept_atom2 accept_atom1 = obsolete_P ? accept_atom2
: XInternAtom( qt_xdisplay(), TQCString( accept_broadcast_P ) + "_BEGIN", false ); : XInternAtom( tqt_xdisplay(), TQCString( accept_broadcast_P ) + "_BEGIN", false );
} }
else else
{ {
@ -86,10 +86,10 @@ void KXMessages::broadcastMessage( const char* msg_type_P, const TQString& messa
void KXMessages::broadcastMessage( const char* msg_type_P, const TQString& message_P, void KXMessages::broadcastMessage( const char* msg_type_P, const TQString& message_P,
int screen_P, bool obsolete_P ) int screen_P, bool obsolete_P )
{ {
Atom a2 = XInternAtom( qt_xdisplay(), msg_type_P, false ); Atom a2 = XInternAtom( tqt_xdisplay(), msg_type_P, false );
Atom a1 = obsolete_P ? a2 : XInternAtom( qt_xdisplay(), TQCString( msg_type_P ) + "_BEGIN", false ); Atom a1 = obsolete_P ? a2 : XInternAtom( tqt_xdisplay(), TQCString( msg_type_P ) + "_BEGIN", false );
Window root = screen_P == -1 ? qt_xrootwin() : qt_xrootwin( screen_P ); Window root = screen_P == -1 ? tqt_xrootwin() : tqt_xrootwin( screen_P );
send_message_internal( root, message_P, BROADCAST_MASK, qt_xdisplay(), send_message_internal( root, message_P, BROADCAST_MASK, tqt_xdisplay(),
a1, a2, handle->winId()); a1, a2, handle->winId());
} }
@ -101,9 +101,9 @@ void KXMessages::sendMessage( WId w_P, const char* msg_type_P, const TQString& m
void KXMessages::sendMessage( WId w_P, const char* msg_type_P, const TQString& message_P, void KXMessages::sendMessage( WId w_P, const char* msg_type_P, const TQString& message_P,
bool obsolete_P ) bool obsolete_P )
{ {
Atom a2 = XInternAtom( qt_xdisplay(), msg_type_P, false ); Atom a2 = XInternAtom( tqt_xdisplay(), msg_type_P, false );
Atom a1 = obsolete_P ? a2 : XInternAtom( qt_xdisplay(), TQCString( msg_type_P ) + "_BEGIN", false ); Atom a1 = obsolete_P ? a2 : XInternAtom( tqt_xdisplay(), TQCString( msg_type_P ) + "_BEGIN", false );
send_message_internal( w_P, message_P, 0, qt_xdisplay(), a1, a2, handle->winId()); send_message_internal( w_P, message_P, 0, tqt_xdisplay(), a1, a2, handle->winId());
} }
bool KXMessages::broadcastMessageX( Display* disp, const char* msg_type_P, bool KXMessages::broadcastMessageX( Display* disp, const char* msg_type_P,

@ -56,7 +56,7 @@
#include "netwm.h" #include "netwm.h"
static bool atoms_created = false; static bool atoms_created = false;
extern Atom qt_wm_protocols; extern Atom tqt_wm_protocols;
static Atom net_wm_context_help; static Atom net_wm_context_help;
static Atom kde_wm_change_state; static Atom kde_wm_change_state;
@ -86,12 +86,12 @@ static void twin_net_create_atoms() {
names[n++] = (char*) "_KDE_WM_WINDOW_SHADOW"; names[n++] = (char*) "_KDE_WM_WINDOW_SHADOW";
char net_wm_cm_name[ 100 ]; char net_wm_cm_name[ 100 ];
sprintf( net_wm_cm_name, "_NET_WM_CM_S%d", DefaultScreen( qt_xdisplay())); sprintf( net_wm_cm_name, "_NET_WM_CM_S%d", DefaultScreen( tqt_xdisplay()));
atoms[n] = &net_wm_cm; atoms[n] = &net_wm_cm;
names[n++] = net_wm_cm_name; names[n++] = net_wm_cm_name;
// we need a const_cast for the shitty X API // we need a const_cast for the shitty X API
XInternAtoms( qt_xdisplay(), const_cast<char**>(names), n, false, atoms_return ); XInternAtoms( tqt_xdisplay(), const_cast<char**>(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];
@ -117,7 +117,7 @@ static void sendClientMessageToRoot(Window w, Atom a, long x, long y = 0, long z
ev.xclient.data.l[1] = y; ev.xclient.data.l[1] = y;
ev.xclient.data.l[2] = z; ev.xclient.data.l[2] = z;
mask = SubstructureRedirectMask; mask = SubstructureRedirectMask;
XSendEvent(qt_xdisplay(), qt_xrootwin(), False, mask, &ev); XSendEvent(tqt_xdisplay(), tqt_xrootwin(), False, mask, &ev);
} }
#endif #endif
@ -137,9 +137,9 @@ static void sendClientMessage(Window w, Atom a, long x){
ev.xclient.data.l[0] = x; ev.xclient.data.l[0] = x;
ev.xclient.data.l[1] = CurrentTime; ev.xclient.data.l[1] = CurrentTime;
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);
} }
#endif #endif
@ -147,7 +147,7 @@ bool KWin::compositingActive()
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
twin_net_create_atoms(); twin_net_create_atoms();
return XGetSelectionOwner( qt_xdisplay(), net_wm_cm ) != None; return XGetSelectionOwner( tqt_xdisplay(), net_wm_cm ) != None;
#else #else
return false; return false;
#endif #endif
@ -171,7 +171,7 @@ ContextWidget::ContextWidget()
TQWhatsThis::enterWhatsThisMode(); TQWhatsThis::enterWhatsThisMode();
TQCursor c = *TQApplication::overrideCursor(); TQCursor c = *TQApplication::overrideCursor();
TQWhatsThis::leaveWhatsThisMode(); TQWhatsThis::leaveWhatsThisMode();
XGrabPointer( qt_xdisplay(), qt_xrootwin(), true, XGrabPointer( tqt_xdisplay(), tqt_xrootwin(), true,
(uint)( ButtonPressMask | ButtonReleaseMask | (uint)( ButtonPressMask | ButtonReleaseMask |
PointerMotionMask | EnterWindowMask | PointerMotionMask | EnterWindowMask |
LeaveWindowMask ), LeaveWindowMask ),
@ -184,25 +184,25 @@ ContextWidget::ContextWidget()
bool ContextWidget::x11Event( XEvent * ev) bool ContextWidget::x11Event( XEvent * ev)
{ {
if ( ev->type == ButtonPress && ev->xbutton.button == Button1 ) { if ( ev->type == ButtonPress && ev->xbutton.button == Button1 ) {
XUngrabPointer( qt_xdisplay(), ev->xbutton.time ); XUngrabPointer( tqt_xdisplay(), ev->xbutton.time );
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;
do { do {
w = child; w = child;
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 );
::sendClientMessage(w, qt_wm_protocols, net_wm_context_help); ::sendClientMessage(w, tqt_wm_protocols, net_wm_context_help);
XEvent e = *ev; XEvent e = *ev;
e.xbutton.window = w; e.xbutton.window = w;
e.xbutton.subwindow = w; e.xbutton.subwindow = w;
e.xbutton.x = lx; e.xbutton.x = lx;
e.xbutton.y = ly; e.xbutton.y = ly;
XSendEvent( qt_xdisplay(), w, true, ButtonPressMask, &e ); XSendEvent( tqt_xdisplay(), w, true, ButtonPressMask, &e );
tqApp->exit_loop(); tqApp->exit_loop();
return true; return true;
} }
@ -221,11 +221,11 @@ void KWin::invokeContextHelp()
void KWin::setSystemTrayWindowFor( WId trayWin, WId forWin ) void KWin::setSystemTrayWindowFor( WId trayWin, WId forWin )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETWinInfo info( qt_xdisplay(), trayWin, qt_xrootwin(), 0 ); NETWinInfo info( tqt_xdisplay(), trayWin, tqt_xrootwin(), 0 );
if ( !forWin ) if ( !forWin )
forWin = qt_xrootwin(); forWin = tqt_xrootwin();
info.setKDESystemTrayWinFor( forWin ); info.setKDESystemTrayWinFor( forWin );
NETRootInfo rootinfo( qt_xdisplay(), NET::Supported ); NETRootInfo rootinfo( tqt_xdisplay(), NET::Supported );
if( !rootinfo.isSupported( NET::WMKDESystemTrayWinFor )) { if( !rootinfo.isSupported( NET::WMKDESystemTrayWinFor )) {
DCOPRef ref( "kded", "kded" ); DCOPRef ref( "kded", "kded" );
if( !ref.send( "loadModule", TQCString( "kdetrayproxy" ))) if( !ref.send( "loadModule", TQCString( "kdetrayproxy" )))
@ -237,7 +237,7 @@ void KWin::setSystemTrayWindowFor( WId trayWin, WId forWin )
void KWin::activateWindow( WId win, long time ) void KWin::activateWindow( WId win, long time )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETRootInfo info( qt_xdisplay(), 0 ); NETRootInfo info( tqt_xdisplay(), 0 );
if( time == 0 ) if( time == 0 )
time = GET_QT_X_USER_TIME(); time = GET_QT_X_USER_TIME();
info.setActiveWindow( win, NET::FromApplication, time, info.setActiveWindow( win, NET::FromApplication, time,
@ -249,7 +249,7 @@ void KWin::activateWindow( WId win, long time )
void KWin::forceActiveWindow( WId win, long time ) void KWin::forceActiveWindow( WId win, long time )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETRootInfo info( qt_xdisplay(), 0 ); NETRootInfo info( tqt_xdisplay(), 0 );
if( time == 0 ) if( time == 0 )
time = GET_QT_X_TIME(); time = GET_QT_X_TIME();
info.setActiveWindow( win, NET::FromTool, time, 0 ); info.setActiveWindow( win, NET::FromTool, time, 0 );
@ -260,7 +260,7 @@ void KWin::forceActiveWindow( WId win, long time )
void KWin::setActiveWindow( WId win ) void KWin::setActiveWindow( WId win )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETRootInfo info( qt_xdisplay(), 0 ); NETRootInfo info( tqt_xdisplay(), 0 );
info.setActiveWindow( win, NET::FromUnknown, 0, 0 ); info.setActiveWindow( win, NET::FromUnknown, 0, 0 );
#endif #endif
KUniqueApplication::setHandleAutoStarted(); KUniqueApplication::setHandleAutoStarted();
@ -269,7 +269,7 @@ void KWin::setActiveWindow( WId win )
void KWin::demandAttention( WId win, bool set ) void KWin::demandAttention( WId win, bool set )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), 0 ); NETWinInfo info( tqt_xdisplay(), win, tqt_xrootwin(), 0 );
info.setState( set ? NET::DemandsAttention : 0, NET::DemandsAttention ); info.setState( set ? NET::DemandsAttention : 0, NET::DemandsAttention );
#endif #endif
} }
@ -277,7 +277,7 @@ void KWin::demandAttention( WId win, bool set )
void KWin::setUserTime( WId win, long time ) void KWin::setUserTime( WId win, long time )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), 0 ); NETWinInfo info( tqt_xdisplay(), win, tqt_xrootwin(), 0 );
info.setUserTime( time ); info.setUserTime( time );
#endif #endif
} }
@ -293,7 +293,7 @@ WId KWin::transientFor( WId win )
#ifdef Q_WS_X11 #ifdef Q_WS_X11
KXErrorHandler handler; // ignore badwindow KXErrorHandler handler; // ignore badwindow
Window transient_for = None; Window transient_for = None;
if( XGetTransientForHint( qt_xdisplay(), win, &transient_for )) if( XGetTransientForHint( tqt_xdisplay(), win, &transient_for ))
return transient_for; return transient_for;
// XGetTransientForHint() did sync // XGetTransientForHint() did sync
return None; return None;
@ -317,10 +317,10 @@ void KWin::setMainWindow( TQWidget* subwindow, WId mainwindow )
kdWarning() << "KWin::setMainWindow(): There either mustn't be kapp->mainWidget()," kdWarning() << "KWin::setMainWindow(): There either mustn't be kapp->mainWidget(),"
" or the dialog must have a non-NULL parent, otherwise Qt will reset the change. Bummer." << endl; " or the dialog must have a non-NULL parent, otherwise Qt will reset the change. Bummer." << endl;
} }
XSetTransientForHint( qt_xdisplay(), subwindow->winId(), mainwindow ); XSetTransientForHint( tqt_xdisplay(), subwindow->winId(), mainwindow );
} }
else else
XDeleteProperty( qt_xdisplay(), subwindow->winId(), XA_WM_TRANSIENT_FOR ); XDeleteProperty( tqt_xdisplay(), subwindow->winId(), XA_WM_TRANSIENT_FOR );
#endif #endif
} }
@ -328,7 +328,7 @@ WId KWin::groupLeader( WId win )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
KXErrorHandler handler; // ignore badwindow KXErrorHandler handler; // ignore badwindow
XWMHints *hints = XGetWMHints( qt_xdisplay(), win ); XWMHints *hints = XGetWMHints( tqt_xdisplay(), win );
Window window_group = None; Window window_group = None;
if ( hints ) if ( hints )
{ {
@ -348,7 +348,7 @@ KWin::Info KWin::info( WId win )
{ {
Info w; Info w;
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETWinInfo inf( qt_xdisplay(), win, qt_xrootwin(), NETWinInfo inf( tqt_xdisplay(), win, tqt_xrootwin(),
NET::WMState | NET::WMState |
NET::WMStrut | NET::WMStrut |
NET::WMWindowType | NET::WMWindowType |
@ -369,7 +369,7 @@ KWin::Info KWin::info( WId win )
w.name = TQString::fromUtf8( inf.name() ); w.name = TQString::fromUtf8( inf.name() );
} else { } else {
char* c = 0; char* c = 0;
if ( XFetchName( qt_xdisplay(), win, &c ) != 0 ) { if ( XFetchName( tqt_xdisplay(), win, &c ) != 0 ) {
w.name = TQString::fromLocal8Bit( c ); w.name = TQString::fromLocal8Bit( c );
XFree( c ); XFree( c );
} }
@ -404,7 +404,7 @@ TQPixmap KWin::icon( WId win, int width, int height, bool scale, int flags )
TQPixmap result; TQPixmap result;
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if( flags & NETWM ) { if( flags & NETWM ) {
NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), NET::WMIcon ); NETWinInfo info( tqt_xdisplay(), win, tqt_xrootwin(), NET::WMIcon );
NETIcon ni = info.icon( width, height ); NETIcon ni = info.icon( width, height );
if ( ni.data && ni.size.width > 0 && ni.size.height > 0 ) { if ( ni.data && ni.size.width > 0 && ni.size.height > 0 ) {
TQImage img( (uchar*) ni.data, (int) ni.size.width, (int) ni.size.height, 32, 0, 0, TQImage::IgnoreEndian ); TQImage img( (uchar*) ni.data, (int) ni.size.width, (int) ni.size.height, 32, 0, 0, TQImage::IgnoreEndian );
@ -421,7 +421,7 @@ TQPixmap KWin::icon( WId win, int width, int height, bool scale, int flags )
Pixmap p = None; Pixmap p = None;
Pixmap p_mask = None; Pixmap p_mask = None;
XWMHints *hints = XGetWMHints(qt_xdisplay(), win ); XWMHints *hints = XGetWMHints(tqt_xdisplay(), win );
if (hints && (hints->flags & IconPixmapHint)){ if (hints && (hints->flags & IconPixmapHint)){
p = hints->icon_pixmap; p = hints->icon_pixmap;
} }
@ -437,19 +437,19 @@ TQPixmap KWin::icon( WId win, int width, int height, bool scale, int flags )
unsigned int w = 0; unsigned int w = 0;
unsigned int h = 0; unsigned int h = 0;
unsigned int border_w, depth; unsigned int border_w, depth;
XGetGeometry(qt_xdisplay(), p, &root, XGetGeometry(tqt_xdisplay(), p, &root,
&x, &y, &w, &h, &border_w, &depth); &x, &y, &w, &h, &border_w, &depth);
if (w > 0 && h > 0){ if (w > 0 && h > 0){
TQPixmap pm(w, h, depth); TQPixmap pm(w, h, depth);
// Always detach before doing something behind QPixmap's back. // Always detach before doing something behind QPixmap's back.
pm.detach(); pm.detach();
XCopyArea(qt_xdisplay(), p, pm.handle(), XCopyArea(tqt_xdisplay(), p, pm.handle(),
qt_xget_temp_gc(qt_xscreen(), depth==1), tqt_xget_temp_gc(tqt_xscreen(), depth==1),
0, 0, w, h, 0, 0); 0, 0, w, h, 0, 0);
if (p_mask != None){ if (p_mask != None){
TQBitmap bm(w, h); TQBitmap bm(w, h);
XCopyArea(qt_xdisplay(), p_mask, bm.handle(), XCopyArea(tqt_xdisplay(), p_mask, bm.handle(),
qt_xget_temp_gc(qt_xscreen(), true), tqt_xget_temp_gc(tqt_xscreen(), true),
0, 0, w, h, 0, 0); 0, 0, w, h, 0, 0);
pm.setMask(bm); pm.setMask(bm);
} }
@ -480,7 +480,7 @@ TQPixmap KWin::icon( WId win, int width, int height, bool scale, int flags )
if( result.isNull() ) { if( result.isNull() ) {
XClassHint hint; XClassHint hint;
if( XGetClassHint( qt_xdisplay(), win, &hint ) ) { if( XGetClassHint( tqt_xdisplay(), win, &hint ) ) {
TQString className = hint.res_class; TQString className = hint.res_class;
TQPixmap pm = KGlobal::instance()->iconLoader()->loadIcon( className.lower(), KIcon::Small, iconWidth, TQPixmap pm = KGlobal::instance()->iconLoader()->loadIcon( className.lower(), KIcon::Small, iconWidth,
@ -517,7 +517,7 @@ void KWin::setIcons( WId win, const TQPixmap& icon, const TQPixmap& miniIcon )
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if ( icon.isNull() ) if ( icon.isNull() )
return; return;
NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), 0 ); NETWinInfo info( tqt_xdisplay(), win, tqt_xrootwin(), 0 );
TQImage img = TQImage(icon.convertToImage()).convertDepth( 32 ); TQImage img = TQImage(icon.convertToImage()).convertDepth( 32 );
NETIcon ni; NETIcon ni;
ni.size.width = img.size().width(); ni.size.width = img.size().width();
@ -537,7 +537,7 @@ void KWin::setIcons( WId win, const TQPixmap& icon, const TQPixmap& miniIcon )
void KWin::setType( WId win, NET::WindowType windowType ) void KWin::setType( WId win, NET::WindowType windowType )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), 0 ); NETWinInfo info( tqt_xdisplay(), win, tqt_xrootwin(), 0 );
info.setWindowType( windowType ); info.setWindowType( windowType );
#endif #endif
} }
@ -545,7 +545,7 @@ void KWin::setType( WId win, NET::WindowType windowType )
void KWin::setState( WId win, unsigned long state ) void KWin::setState( WId win, unsigned long state )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), NET::WMState ); NETWinInfo info( tqt_xdisplay(), win, tqt_xrootwin(), NET::WMState );
info.setState( state, state ); info.setState( state, state );
#endif #endif
} }
@ -553,7 +553,7 @@ void KWin::setState( WId win, unsigned long state )
void KWin::clearState( WId win, unsigned long state ) void KWin::clearState( WId win, unsigned long state )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), NET::WMState ); NETWinInfo info( tqt_xdisplay(), win, tqt_xrootwin(), NET::WMState );
info.setState( 0, state ); info.setState( 0, state );
#endif #endif
} }
@ -563,11 +563,11 @@ void KWin::setOpacity( WId win, uint percent )
#ifdef Q_WS_X11 #ifdef Q_WS_X11
twin_net_create_atoms(); twin_net_create_atoms();
if (percent > 99) if (percent > 99)
XDeleteProperty (qt_xdisplay(), win, kde_wm_window_opacity); XDeleteProperty (tqt_xdisplay(), win, kde_wm_window_opacity);
else else
{ {
long opacity = long(0xFFFFFFFF/100.0*percent); long opacity = long(0xFFFFFFFF/100.0*percent);
XChangeProperty(qt_xdisplay(), win, kde_wm_window_opacity, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &opacity, 1L); XChangeProperty(tqt_xdisplay(), win, kde_wm_window_opacity, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &opacity, 1L);
} }
#endif #endif
} }
@ -577,18 +577,18 @@ void KWin::setShadowSize( WId win, uint percent )
#ifdef Q_WS_X11 #ifdef Q_WS_X11
twin_net_create_atoms(); twin_net_create_atoms();
long shadowSize = long(0xFFFFFFFF/100.0*percent); long shadowSize = long(0xFFFFFFFF/100.0*percent);
XChangeProperty(qt_xdisplay(), win, kde_wm_window_shadow, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &shadowSize, 1L); XChangeProperty(tqt_xdisplay(), win, kde_wm_window_shadow, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &shadowSize, 1L);
#endif #endif
} }
void KWin::setOnAllDesktops( WId win, bool b ) void KWin::setOnAllDesktops( WId win, bool b )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), NET::WMDesktop ); NETWinInfo info( tqt_xdisplay(), win, tqt_xrootwin(), NET::WMDesktop );
if ( b ) if ( b )
info.setDesktop( NETWinInfo::OnAllDesktops ); info.setDesktop( NETWinInfo::OnAllDesktops );
else if ( info.desktop() == NETWinInfo::OnAllDesktops ) { else if ( info.desktop() == NETWinInfo::OnAllDesktops ) {
NETRootInfo rinfo( qt_xdisplay(), NET::CurrentDesktop ); NETRootInfo rinfo( tqt_xdisplay(), NET::CurrentDesktop );
info.setDesktop( rinfo.currentDesktop() ); info.setDesktop( rinfo.currentDesktop() );
} }
#endif #endif
@ -597,7 +597,7 @@ void KWin::setOnAllDesktops( WId win, bool b )
void KWin::setOnDesktop( WId win, int desktop ) void KWin::setOnDesktop( WId win, int desktop )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), NET::WMDesktop ); NETWinInfo info( tqt_xdisplay(), win, tqt_xrootwin(), NET::WMDesktop );
info.setDesktop( desktop ); info.setDesktop( desktop );
#endif #endif
} }
@ -607,7 +607,7 @@ void KWin::setExtendedStrut( WId win, int left_width, int left_start, int left_e
int bottom_width, int bottom_start, int bottom_end ) int bottom_width, int bottom_start, int bottom_end )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), 0 ); NETWinInfo info( tqt_xdisplay(), win, tqt_xrootwin(), 0 );
NETExtendedStrut strut; NETExtendedStrut strut;
strut.left_width = left_width; strut.left_width = left_width;
strut.right_width = right_width; strut.right_width = right_width;
@ -628,7 +628,7 @@ void KWin::setExtendedStrut( WId win, int left_width, int left_start, int left_e
void KWin::setStrut( WId win, int left, int right, int top, int bottom ) void KWin::setStrut( WId win, int left, int right, int top, int bottom )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), 0 ); NETWinInfo info( tqt_xdisplay(), win, tqt_xrootwin(), 0 );
NETStrut strut; NETStrut strut;
strut.left = left; strut.left = left;
strut.right = right; strut.right = right;
@ -641,11 +641,11 @@ void KWin::setStrut( WId win, int left, int right, int top, int bottom )
int KWin::currentDesktop() int KWin::currentDesktop()
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if (!qt_xdisplay()) if (!tqt_xdisplay())
#endif #endif
return 1; return 1;
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETRootInfo info( qt_xdisplay(), NET::CurrentDesktop ); NETRootInfo info( tqt_xdisplay(), NET::CurrentDesktop );
return info.currentDesktop(); return info.currentDesktop();
#endif #endif
} }
@ -653,11 +653,11 @@ int KWin::currentDesktop()
int KWin::numberOfDesktops() int KWin::numberOfDesktops()
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if (!qt_xdisplay()) if (!tqt_xdisplay())
#endif #endif
return 0; return 0;
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETRootInfo info( qt_xdisplay(), NET::NumberOfDesktops ); NETRootInfo info( tqt_xdisplay(), NET::NumberOfDesktops );
return info.numberOfDesktops(); return info.numberOfDesktops();
#endif #endif
} }
@ -665,7 +665,7 @@ int KWin::numberOfDesktops()
void KWin::setCurrentDesktop( int desktop ) void KWin::setCurrentDesktop( int desktop )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETRootInfo info( qt_xdisplay(), NET::CurrentDesktop ); NETRootInfo info( tqt_xdisplay(), NET::CurrentDesktop );
info.setCurrentDesktop( desktop ); info.setCurrentDesktop( desktop );
#endif #endif
} }
@ -673,7 +673,7 @@ void KWin::setCurrentDesktop( int desktop )
void KWin::setCurrentDesktopViewport( int desktop, TQPoint viewport ) void KWin::setCurrentDesktopViewport( int desktop, TQPoint viewport )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETRootInfo info( qt_xdisplay(), NET::CurrentDesktop ); NETRootInfo info( tqt_xdisplay(), NET::CurrentDesktop );
NETPoint netview; NETPoint netview;
netview.x = viewport.x(); netview.x = viewport.x();
netview.y = viewport.y(); netview.y = viewport.y();
@ -689,7 +689,7 @@ void KWin::iconifyWindow( WId win, bool animation)
twin_net_create_atoms(); twin_net_create_atoms();
sendClientMessageToRoot( win, kde_wm_change_state, IconicState, 1 ); sendClientMessageToRoot( win, kde_wm_change_state, IconicState, 1 );
} }
XIconifyWindow( qt_xdisplay(), win, qt_xscreen() ); XIconifyWindow( tqt_xdisplay(), win, tqt_xscreen() );
#endif #endif
} }
@ -702,29 +702,29 @@ void KWin::deIconifyWindow( WId win, bool animation )
twin_net_create_atoms(); twin_net_create_atoms();
sendClientMessageToRoot( win, kde_wm_change_state, NormalState, 1 ); sendClientMessageToRoot( win, kde_wm_change_state, NormalState, 1 );
} }
XMapWindow( qt_xdisplay(), win ); XMapWindow( tqt_xdisplay(), win );
#endif #endif
} }
void KWin::raiseWindow( WId win ) void KWin::raiseWindow( WId win )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETRootInfo info( qt_xdisplay(), NET::Supported ); NETRootInfo info( tqt_xdisplay(), NET::Supported );
if( info.isSupported( NET::WM2RestackWindow )) if( info.isSupported( NET::WM2RestackWindow ))
info.restackRequest( win, None, Above ); info.restackRequest( win, None, Above );
else else
XRaiseWindow( qt_xdisplay(), win ); XRaiseWindow( tqt_xdisplay(), win );
#endif #endif
} }
void KWin::lowerWindow( WId win ) void KWin::lowerWindow( WId win )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETRootInfo info( qt_xdisplay(), NET::Supported ); NETRootInfo info( tqt_xdisplay(), NET::Supported );
if( info.isSupported( NET::WM2RestackWindow )) if( info.isSupported( NET::WM2RestackWindow ))
info.restackRequest( win, None, Below ); info.restackRequest( win, None, Below );
else else
XLowerWindow( qt_xdisplay(), win ); XLowerWindow( tqt_xdisplay(), win );
#endif #endif
} }
@ -787,7 +787,7 @@ KWin::WindowInfo::WindowInfo( WId win, unsigned long properties, unsigned long p
properties |= NET::WMStrut; // will be used as fallback properties |= NET::WMStrut; // will be used as fallback
properties |= NET::XAWMState; // force to get error detection for valid() properties |= NET::XAWMState; // force to get error detection for valid()
unsigned long props[ 2 ] = { properties, properties2 }; unsigned long props[ 2 ] = { properties, properties2 };
d->info = new NETWinInfo( qt_xdisplay(), win, qt_xrootwin(), props, 2 ); d->info = new NETWinInfo( tqt_xdisplay(), win, tqt_xrootwin(), props, 2 );
d->win_ = win; d->win_ = win;
if( properties & NET::WMName ) { if( properties & NET::WMName ) {
if( d->info->name() && d->info->name()[ 0 ] != '\0' ) if( d->info->name() && d->info->name()[ 0 ] != '\0' )
@ -895,22 +895,22 @@ NETExtendedStrut KWin::WindowInfo::extendedStrut() const
if( str.left != 0 ) { if( str.left != 0 ) {
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;
@ -1211,7 +1211,7 @@ bool KWin::icccmCompliantMappingState()
#ifdef Q_WS_X11 #ifdef Q_WS_X11
static enum { noidea, yes, no } wm_is_1_2_compliant = noidea; static enum { noidea, yes, no } wm_is_1_2_compliant = noidea;
if( wm_is_1_2_compliant == noidea ) { if( wm_is_1_2_compliant == noidea ) {
NETRootInfo info( qt_xdisplay(), NET::Supported ); NETRootInfo info( tqt_xdisplay(), NET::Supported );
wm_is_1_2_compliant = info.isSupported( NET::Hidden ) ? yes : no; wm_is_1_2_compliant = info.isSupported( NET::Hidden ) ? yes : no;
} }
return wm_is_1_2_compliant == yes; return wm_is_1_2_compliant == yes;
@ -1225,7 +1225,7 @@ bool KWin::allowedActionsSupported()
#ifdef Q_WS_X11 #ifdef Q_WS_X11
static enum { noidea, yes, no } wm_supports_allowed_actions = noidea; static enum { noidea, yes, no } wm_supports_allowed_actions = noidea;
if( wm_supports_allowed_actions == noidea ) { if( wm_supports_allowed_actions == noidea ) {
NETRootInfo info( qt_xdisplay(), NET::Supported ); NETRootInfo info( tqt_xdisplay(), NET::Supported );
wm_supports_allowed_actions = info.isSupported( NET::WM2AllowedActions ) ? yes : no; wm_supports_allowed_actions = info.isSupported( NET::WM2AllowedActions ) ? yes : no;
} }
return wm_supports_allowed_actions == yes; return wm_supports_allowed_actions == yes;
@ -1243,15 +1243,15 @@ TQString KWin::readNameProperty( WId win, unsigned long atom )
#endif #endif
TQString result; TQString result;
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if ( XGetTextProperty( qt_xdisplay(), win, &tp, atom ) != 0 && tp.value != NULL ) if ( XGetTextProperty( tqt_xdisplay(), win, &tp, atom ) != 0 && tp.value != NULL )
{ {
if (!twin_UTF8_STRING) if (!twin_UTF8_STRING)
twin_UTF8_STRING = XInternAtom( qt_xdisplay(), "UTF8_STRING", False); twin_UTF8_STRING = XInternAtom( tqt_xdisplay(), "UTF8_STRING", False);
if ( tp.encoding == twin_UTF8_STRING ) { if ( tp.encoding == twin_UTF8_STRING ) {
result = TQString::fromUtf8 ( (const char*) tp.value ); result = TQString::fromUtf8 ( (const char*) tp.value );
} }
else if ( XmbTextPropertyToTextList( qt_xdisplay(), &tp, &text, &count) == Success && else if ( XmbTextPropertyToTextList( tqt_xdisplay(), &tp, &text, &count) == Success &&
text != NULL && count > 0 ) { text != NULL && count > 0 ) {
result = TQString::fromLocal8Bit( text[0] ); result = TQString::fromLocal8Bit( text[0] );
} else if ( tp.encoding == XA_STRING ) } else if ( tp.encoding == XA_STRING )

@ -62,7 +62,7 @@ class KWinModulePrivate : public TQWidget, public NETRootInfo4
{ {
public: public:
KWinModulePrivate(int _what) KWinModulePrivate(int _what)
: TQWidget(0,0), NETRootInfo4( qt_xdisplay(), : TQWidget(0,0), NETRootInfo4( tqt_xdisplay(),
_what >= KWinModule::INFO_WINDOWS ? _what >= KWinModule::INFO_WINDOWS ?
windows_properties : desktop_properties, windows_properties : desktop_properties,
2, 2,
@ -202,7 +202,7 @@ TQPoint KWinModulePrivate::currentViewport(int desktop) const
bool KWinModulePrivate::x11Event( XEvent * ev ) bool KWinModulePrivate::x11Event( XEvent * ev )
{ {
if ( ev->xany.window == qt_xrootwin() ) { if ( ev->xany.window == tqt_xrootwin() ) {
int old_current_desktop = currentDesktop(); int old_current_desktop = currentDesktop();
WId old_active_window = activeWindow(); WId old_active_window = activeWindow();
int old_number_of_desktops = numberOfDesktops(); int old_number_of_desktops = numberOfDesktops();
@ -244,7 +244,7 @@ bool KWinModulePrivate::x11Event( XEvent * ev )
emit (*mit)->showingDesktopChanged( showingDesktop()); emit (*mit)->showingDesktopChanged( showingDesktop());
} }
} else if ( windows.findIndex( ev->xany.window ) != -1 ){ } else if ( windows.findIndex( ev->xany.window ) != -1 ){
NETWinInfo ni( qt_xdisplay(), ev->xany.window, qt_xrootwin(), 0 ); NETWinInfo ni( tqt_xdisplay(), ev->xany.window, tqt_xrootwin(), 0 );
unsigned long dirty[ 2 ]; unsigned long dirty[ 2 ];
ni.event( ev, dirty, 2 ); ni.event( ev, dirty, 2 );
if ( ev->type ==PropertyNotify ) { if ( ev->type ==PropertyNotify ) {
@ -296,10 +296,10 @@ void KWinModulePrivate::updateStackingOrder()
void KWinModulePrivate::addClient(Window w) void KWinModulePrivate::addClient(Window w)
{ {
if ( (what >= KWinModule::INFO_WINDOWS) && !TQWidget::find( w ) ) if ( (what >= KWinModule::INFO_WINDOWS) && !TQWidget::find( w ) )
XSelectInput( qt_xdisplay(), w, PropertyChangeMask | StructureNotifyMask ); XSelectInput( tqt_xdisplay(), w, PropertyChangeMask | StructureNotifyMask );
bool emit_strutChanged = false; bool emit_strutChanged = false;
if( strutSignalConnected && modules.count() > 0 ) { if( strutSignalConnected && modules.count() > 0 ) {
NETWinInfo info( qt_xdisplay(), w, qt_xrootwin(), NET::WMStrut | NET::WMDesktop ); NETWinInfo info( tqt_xdisplay(), w, tqt_xrootwin(), NET::WMStrut | NET::WMDesktop );
NETStrut strut = info.strut(); NETStrut strut = info.strut();
if ( strut.left || strut.top || strut.right || strut.bottom ) { if ( strut.left || strut.top || strut.right || strut.bottom ) {
strutWindows.append( StrutData( w, strut, info.desktop())); strutWindows.append( StrutData( w, strut, info.desktop()));
@ -319,7 +319,7 @@ void KWinModulePrivate::removeClient(Window w)
{ {
bool emit_strutChanged = removeStrutWindow( w ); bool emit_strutChanged = removeStrutWindow( w );
if( strutSignalConnected && possibleStrutWindows.findIndex( w ) != -1 && modules.count() > 0 ) { if( strutSignalConnected && possibleStrutWindows.findIndex( w ) != -1 && modules.count() > 0 ) {
NETWinInfo info( qt_xdisplay(), w, qt_xrootwin(), NET::WMStrut ); NETWinInfo info( tqt_xdisplay(), w, tqt_xrootwin(), NET::WMStrut );
NETStrut strut = info.strut(); NETStrut strut = info.strut();
if ( strut.left || strut.top || strut.right || strut.bottom ) { if ( strut.left || strut.top || strut.right || strut.bottom ) {
emit_strutChanged = true; emit_strutChanged = true;
@ -417,7 +417,7 @@ TQRect KWinModule::workArea( const TQValueList<WId>& exclude, int desktop ) cons
continue; continue;
strut = (*it2).strut; strut = (*it2).strut;
} else if( d->possibleStrutWindows.findIndex( *it1 ) != -1 ) { } else if( d->possibleStrutWindows.findIndex( *it1 ) != -1 ) {
NETWinInfo info( qt_xdisplay(), (*it1), qt_xrootwin(), NET::WMStrut | NET::WMDesktop); NETWinInfo info( tqt_xdisplay(), (*it1), tqt_xrootwin(), NET::WMStrut | NET::WMDesktop);
strut = info.strut(); strut = info.strut();
d->possibleStrutWindows.remove( *it1 ); d->possibleStrutWindows.remove( *it1 );
d->strutWindows.append( KWinModulePrivate::StrutData( *it1, info.strut(), info.desktop())); d->strutWindows.append( KWinModulePrivate::StrutData( *it1, info.strut(), info.desktop()));

@ -57,7 +57,7 @@
# include <X11/Xlib.h> # include <X11/Xlib.h>
# ifdef HAVE_XRENDER # ifdef HAVE_XRENDER
# include <X11/extensions/Xrender.h> // schroder # include <X11/extensions/Xrender.h> // schroder
extern bool qt_use_xrender; extern bool tqt_use_xrender;
# endif # endif
#else #else
#undef HAVE_XRENDER #undef HAVE_XRENDER
@ -2130,8 +2130,8 @@ void TransparencyHandler::createShadowWindows(const TQWidget* p)
se.w2 = new TQWidget(0, 0, (WFlags)(WStyle_Customize | WType_Popup | WX11BypassWM) ); se.w2 = new TQWidget(0, 0, (WFlags)(WStyle_Customize | WType_Popup | WX11BypassWM) );
se.w1->setGeometry(shadow1); se.w1->setGeometry(shadow1);
se.w2->setGeometry(shadow2); se.w2->setGeometry(shadow2);
XSelectInput(qt_xdisplay(), se.w1->winId(), StructureNotifyMask ); XSelectInput(tqt_xdisplay(), se.w1->winId(), StructureNotifyMask );
XSelectInput(qt_xdisplay(), se.w2->winId(), StructureNotifyMask ); XSelectInput(tqt_xdisplay(), se.w2->winId(), StructureNotifyMask );
// Insert a new ShadowMap entry // Insert a new ShadowMap entry
shadowMap()[p] = se; shadowMap()[p] = se;
@ -2144,9 +2144,9 @@ void TransparencyHandler::createShadowWindows(const TQWidget* p)
pix_shadow2 = TQPixmap(shadow2.width(), shadow2.height()); pix_shadow2 = TQPixmap(shadow2.width(), shadow2.height());
} }
else { else {
pix_shadow1 = TQPixmap::grabWindow(qt_xrootwin(), pix_shadow1 = TQPixmap::grabWindow(tqt_xrootwin(),
shadow1.x(), shadow1.y(), shadow1.width(), shadow1.height()); shadow1.x(), shadow1.y(), shadow1.width(), shadow1.height());
pix_shadow2 = TQPixmap::grabWindow(qt_xrootwin(), pix_shadow2 = TQPixmap::grabWindow(tqt_xrootwin(),
shadow2.x(), shadow2.y(), shadow2.width(), shadow2.height()); shadow2.x(), shadow2.y(), shadow2.width(), shadow2.height());
} }
@ -2166,8 +2166,8 @@ void TransparencyHandler::createShadowWindows(const TQWidget* p)
// Show the 'shadow' just before showing the popup menu window // Show the 'shadow' just before showing the popup menu window
// Don't use TQWidget::show() so we don't confuse QEffects, thus causing broken focus. // Don't use TQWidget::show() so we don't confuse QEffects, thus causing broken focus.
XMapWindow(qt_xdisplay(), se.w1->winId()); XMapWindow(tqt_xdisplay(), se.w1->winId());
XMapWindow(qt_xdisplay(), se.w2->winId()); XMapWindow(tqt_xdisplay(), se.w2->winId());
#else #else
Q_UNUSED( p ) Q_UNUSED( p )
#endif #endif
@ -2180,9 +2180,9 @@ void TransparencyHandler::removeShadowWindows(const TQWidget* p)
if (it != shadowMap().end()) if (it != shadowMap().end())
{ {
ShadowElements se = it.data(); ShadowElements se = it.data();
XUnmapWindow(qt_xdisplay(), se.w1->winId()); // hide XUnmapWindow(tqt_xdisplay(), se.w1->winId()); // hide
XUnmapWindow(qt_xdisplay(), se.w2->winId()); XUnmapWindow(tqt_xdisplay(), se.w2->winId());
XFlush(qt_xdisplay()); // try to hide faster XFlush(tqt_xdisplay()); // try to hide faster
delete se.w1; delete se.w1;
delete se.w2; delete se.w2;
shadowMap().erase(it); shadowMap().erase(it);
@ -2207,13 +2207,13 @@ bool TransparencyHandler::eventFilter( TQObject* object, TQEvent* event )
// Handle translucency // Handle translucency
if (te != Disabled) if (te != Disabled)
{ {
pix = TQPixmap::grabWindow(qt_xrootwin(), pix = TQPixmap::grabWindow(tqt_xrootwin(),
p->x(), p->y(), p->width(), p->height()); p->x(), p->y(), p->width(), p->height());
switch (te) { switch (te) {
#ifdef HAVE_XRENDER #ifdef HAVE_XRENDER
case XRender: case XRender:
if (qt_use_xrender) { if (tqt_use_xrender) {
XRenderBlendToPixmap(p); XRenderBlendToPixmap(p);
break; break;
} }
@ -2320,7 +2320,7 @@ void TransparencyHandler::XRenderBlendToPixmap(const TQWidget* p)
else else
renderPix.fill(p->colorGroup().button()); // Just tint as the default behavior renderPix.fill(p->colorGroup().button()); // Just tint as the default behavior
Display* dpy = qt_xdisplay(); Display* dpy = tqt_xdisplay();
Pixmap alphaPixmap; Pixmap alphaPixmap;
Picture alphaPicture; Picture alphaPicture;
XRenderPictFormat Rpf; XRenderPictFormat Rpf;

@ -50,7 +50,7 @@
#define UNLOAD_OBJECT(x) if (x != 0) { delete x; x = 0; } #define UNLOAD_OBJECT(x) if (x != 0) { delete x; x = 0; }
#ifdef Q_WS_X11 #ifdef Q_WS_X11
extern void qt_generate_epsf( bool b ); extern void tqt_generate_epsf( bool b );
#endif #endif
KMFactory* KMFactory::m_self = 0; KMFactory* KMFactory::m_self = 0;
@ -102,7 +102,7 @@ KMFactory::KMFactory()
// If this is a problem for anyone, we can add a public method to set this flag. // If this is a problem for anyone, we can add a public method to set this flag.
// (David Faure, doing as advised by Lars Knoll) // (David Faure, doing as advised by Lars Knoll)
#ifdef Q_WS_X11 #ifdef Q_WS_X11
qt_generate_epsf( false ); tqt_generate_epsf( false );
#endif #endif
#endif #endif

@ -70,7 +70,7 @@
// 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);
#endif #endif
struct ColorPaletteNameType struct ColorPaletteNameType
@ -1179,7 +1179,7 @@ KColorDialog::~KColorDialog()
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if (d->bColorPicking) if (d->bColorPicking)
qt_set_x11_event_filter(d->oldfilter); tqt_set_x11_event_filter(d->oldfilter);
#endif #endif
delete d; delete d;
} }
@ -1504,7 +1504,7 @@ KColorDialog::slotColorPicker()
{ {
d->bColorPicking = true; d->bColorPicking = true;
#ifdef Q_WS_X11 #ifdef Q_WS_X11
d->oldfilter = qt_set_x11_event_filter(kde_color_dlg_handler); d->oldfilter = tqt_set_x11_event_filter(kde_color_dlg_handler);
#endif #endif
kde_color_dlg_widget = this; kde_color_dlg_widget = this;
grabMouse( tqcrossCursor ); grabMouse( tqcrossCursor );
@ -1518,7 +1518,7 @@ KColorDialog::mouseReleaseEvent( TQMouseEvent *e )
{ {
d->bColorPicking = false; d->bColorPicking = false;
#ifdef Q_WS_X11 #ifdef Q_WS_X11
qt_set_x11_event_filter(d->oldfilter); tqt_set_x11_event_filter(d->oldfilter);
d->oldfilter = 0; d->oldfilter = 0;
#endif #endif
releaseMouse(); releaseMouse();
@ -1547,7 +1547,7 @@ KColorDialog::keyPressEvent( TQKeyEvent *e )
{ {
d->bColorPicking = false; d->bColorPicking = false;
#ifdef Q_WS_X11 #ifdef Q_WS_X11
qt_set_x11_event_filter(d->oldfilter); tqt_set_x11_event_filter(d->oldfilter);
d->oldfilter = 0; d->oldfilter = 0;
#endif #endif
releaseMouse(); releaseMouse();

@ -45,12 +45,12 @@ KDETrayProxy::KDETrayProxy()
Atom KDETrayProxy::makeSelectionAtom() Atom KDETrayProxy::makeSelectionAtom()
{ {
return XInternAtom( qt_xdisplay(), "_NET_SYSTEM_TRAY_S" + TQCString().setNum( qt_xscreen()), False ); return XInternAtom( tqt_xdisplay(), "_NET_SYSTEM_TRAY_S" + TQCString().setNum( tqt_xscreen()), False );
} }
void KDETrayProxy::windowAdded( WId w ) void KDETrayProxy::windowAdded( WId w )
{ {
NETWinInfo ni( qt_xdisplay(), w, qt_xrootwin(), NET::WMKDESystemTrayWinFor ); NETWinInfo ni( tqt_xdisplay(), w, tqt_xrootwin(), NET::WMKDESystemTrayWinFor );
WId trayWinFor = ni.kdeSystemTrayWinFor(); WId trayWinFor = ni.kdeSystemTrayWinFor();
if ( !trayWinFor ) // not a KDE tray window if ( !trayWinFor ) // not a KDE tray window
return; return;
@ -93,7 +93,7 @@ bool KDETrayProxy::x11Event( XEvent* e )
} }
if( e->type == ReparentNotify && tray_windows.contains( e->xreparent.window )) if( e->type == ReparentNotify && tray_windows.contains( e->xreparent.window ))
{ {
if( e->xreparent.parent == qt_xrootwin()) if( e->xreparent.parent == tqt_xrootwin())
{ {
if( !docked_windows.contains( e->xreparent.window ) || e->xreparent.serial >= docked_windows[ e->xreparent.window ] ) if( !docked_windows.contains( e->xreparent.window ) || e->xreparent.serial >= docked_windows[ e->xreparent.window ] )
{ {
@ -114,7 +114,7 @@ bool KDETrayProxy::x11Event( XEvent* e )
if( docked_windows.contains( e->xunmap.window ) && e->xunmap.serial >= docked_windows[ e->xunmap.window ] ) if( docked_windows.contains( e->xunmap.window ) && e->xunmap.serial >= docked_windows[ e->xunmap.window ] )
{ {
// kdDebug() << "Window unmapped:" << e->xunmap.window << endl; // kdDebug() << "Window unmapped:" << e->xunmap.window << endl;
XReparentWindow( qt_xdisplay(), e->xunmap.window, qt_xrootwin(), 0, 0 ); XReparentWindow( tqt_xdisplay(), e->xunmap.window, tqt_xrootwin(), 0, 0 );
// ReparentNotify will take care of the rest // ReparentNotify will take care of the rest
} }
} }
@ -124,21 +124,21 @@ bool KDETrayProxy::x11Event( XEvent* e )
void KDETrayProxy::dockWindow( Window w, Window owner ) void KDETrayProxy::dockWindow( Window w, Window owner )
{ {
// kdDebug() << "Docking " << w << " into " << owner << endl; // kdDebug() << "Docking " << w << " into " << owner << endl;
docked_windows[ w ] = XNextRequest( qt_xdisplay()); docked_windows[ w ] = XNextRequest( tqt_xdisplay());
static Atom prop = XInternAtom( qt_xdisplay(), "_XEMBED_INFO", False ); static Atom prop = XInternAtom( tqt_xdisplay(), "_XEMBED_INFO", False );
long data[ 2 ] = { 0, 1 }; long data[ 2 ] = { 0, 1 };
XChangeProperty( qt_xdisplay(), w, prop, prop, 32, PropModeReplace, (unsigned char*)data, 2 ); XChangeProperty( tqt_xdisplay(), w, prop, prop, 32, PropModeReplace, (unsigned char*)data, 2 );
XSizeHints hints; XSizeHints hints;
hints.flags = PMinSize | PMaxSize; hints.flags = PMinSize | PMaxSize;
hints.min_width = 24; hints.min_width = 24;
hints.max_width = 24; hints.max_width = 24;
hints.min_height = 24; hints.min_height = 24;
hints.max_height = 24; hints.max_height = 24;
XSetWMNormalHints( qt_xdisplay(), w, &hints ); XSetWMNormalHints( tqt_xdisplay(), w, &hints );
// kxerrorhandler ? // kxerrorhandler ?
XEvent ev; XEvent ev;
memset(&ev, 0, sizeof( ev )); memset(&ev, 0, sizeof( ev ));
static Atom atom = XInternAtom( qt_xdisplay(), "_NET_SYSTEM_TRAY_OPCODE", False ); static Atom atom = XInternAtom( tqt_xdisplay(), "_NET_SYSTEM_TRAY_OPCODE", False );
ev.xclient.type = ClientMessage; ev.xclient.type = ClientMessage;
ev.xclient.window = owner; ev.xclient.window = owner;
ev.xclient.message_type = atom; ev.xclient.message_type = atom;
@ -148,20 +148,20 @@ void KDETrayProxy::dockWindow( Window w, Window owner )
ev.xclient.data.l[ 2 ] = w; ev.xclient.data.l[ 2 ] = w;
ev.xclient.data.l[ 3 ] = 0; // unused ev.xclient.data.l[ 3 ] = 0; // unused
ev.xclient.data.l[ 4 ] = 0; // unused ev.xclient.data.l[ 4 ] = 0; // unused
XSendEvent( qt_xdisplay(), owner, False, NoEventMask, &ev ); XSendEvent( tqt_xdisplay(), owner, False, NoEventMask, &ev );
} }
void KDETrayProxy::withdrawWindow( Window w ) void KDETrayProxy::withdrawWindow( Window w )
{ {
XWithdrawWindow( qt_xdisplay(), w, qt_xscreen()); XWithdrawWindow( tqt_xdisplay(), w, tqt_xscreen());
static Atom wm_state = XInternAtom( qt_xdisplay(), "WM_STATE", False ); static Atom wm_state = XInternAtom( tqt_xdisplay(), "WM_STATE", False );
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, wm_state, 0, 2, int r = XGetWindowProperty( tqt_xdisplay(), w, wm_state, 0, 2,
False, AnyPropertyType, &type, &format, False, AnyPropertyType, &type, &format,
&length, &after, &data ); &length, &after, &data );
bool withdrawn = true; bool withdrawn = true;

@ -130,7 +130,7 @@ void KDialog::setPlainCaption( const TQString &caption )
TQDialog::setCaption( caption ); TQDialog::setCaption( caption );
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETWinInfo info( qt_xdisplay(), winId(), qt_xrootwin(), 0 ); NETWinInfo info( tqt_xdisplay(), winId(), tqt_xrootwin(), 0 );
info.setName( caption.utf8().data() ); info.setName( caption.utf8().data() );
#endif #endif
} }
@ -398,8 +398,8 @@ KSMModalDialog::KSMModalDialog(TQWidget* parent)
{ {
// 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);
TQVBoxLayout* vbox = new TQVBoxLayout( this ); TQVBoxLayout* vbox = new TQVBoxLayout( this );

@ -820,7 +820,7 @@ void KDockWidget::applyToWidget( TQWidget* s, const TQPoint& p )
#ifndef NO_KDE2 #ifndef NO_KDE2
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if (d->transient && d->_parent) if (d->transient && d->_parent)
XSetTransientForHint( qt_xdisplay(), winId(), d->_parent->winId() ); XSetTransientForHint( tqt_xdisplay(), winId(), d->_parent->winId() );
#ifdef BORDERLESS_WINDOWS #ifdef BORDERLESS_WINDOWS
KWin::setType( winId(), NET::Override); //d->windowType ); KWin::setType( winId(), NET::Override); //d->windowType );

@ -592,7 +592,7 @@ void KMainWindow::setPlainCaption( const TQString &caption )
{ {
TQMainWindow::setCaption( caption ); TQMainWindow::setCaption( caption );
#if defined Q_WS_X11 #if defined Q_WS_X11
NETWinInfo info( qt_xdisplay(), winId(), qt_xrootwin(), 0 ); NETWinInfo info( tqt_xdisplay(), winId(), tqt_xrootwin(), 0 );
info.setName( caption.utf8().data() ); info.setName( caption.utf8().data() );
#endif #endif
} }

@ -109,11 +109,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 ];
} }
@ -178,7 +178,7 @@ void KMenuBar::setTopLevelMenuInternal(bool top_level)
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
d->selection = new KSelectionWatcher( KMenuBarPrivate::makeSelectionAtom(), d->selection = new KSelectionWatcher( KMenuBarPrivate::makeSelectionAtom(),
DefaultScreen( qt_xdisplay())); DefaultScreen( tqt_xdisplay()));
connect( d->selection, TQT_SIGNAL( newOwner( Window )), connect( d->selection, TQT_SIGNAL( newOwner( Window )),
this, TQT_SLOT( updateFallbackSize())); this, TQT_SLOT( updateFallbackSize()));
connect( d->selection, TQT_SIGNAL( lostOwner()), connect( d->selection, TQT_SIGNAL( lostOwner()),
@ -193,7 +193,7 @@ void KMenuBar::setTopLevelMenuInternal(bool top_level)
#ifdef Q_WS_X11 #ifdef Q_WS_X11
KWin::setType( winId(), NET::TopMenu ); KWin::setType( winId(), NET::TopMenu );
if( parentWidget()) if( parentWidget())
XSetTransientForHint( qt_xdisplay(), winId(), parentWidget()->topLevelWidget()->winId()); XSetTransientForHint( tqt_xdisplay(), winId(), parentWidget()->topLevelWidget()->winId());
#endif #endif
TQMenuBar::setFrameStyle( NoFrame ); TQMenuBar::setFrameStyle( NoFrame );
TQMenuBar::setLineWidth( 0 ); TQMenuBar::setLineWidth( 0 );
@ -260,7 +260,7 @@ bool KMenuBar::eventFilter(TQObject *obj, TQEvent *ev)
if( parentWidget() && TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(parentWidget()) && ev->type() == TQEvent::Reparent ) if( parentWidget() && TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(parentWidget()) && ev->type() == TQEvent::Reparent )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
XSetTransientForHint( qt_xdisplay(), winId(), parentWidget()->topLevelWidget()->winId()); XSetTransientForHint( tqt_xdisplay(), winId(), parentWidget()->topLevelWidget()->winId());
#else #else
//TODO: WIN32? //TODO: WIN32?
#endif #endif
@ -271,7 +271,7 @@ bool KMenuBar::eventFilter(TQObject *obj, TQEvent *ev)
if( ev->type() == TQEvent::Show ) if( ev->type() == TQEvent::Show )
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
XSetTransientForHint( qt_xdisplay(), winId(), parentWidget()->topLevelWidget()->winId()); XSetTransientForHint( tqt_xdisplay(), winId(), parentWidget()->topLevelWidget()->winId());
#else #else
//TODO: WIN32? //TODO: WIN32?
#endif #endif

@ -434,7 +434,7 @@ KMessageBox::questionYesNoListWId(WId parent_id, const TQString &text,
dialog->setPlainCaption( caption ); dialog->setPlainCaption( caption );
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if( parent == NULL && parent_id ) if( parent == NULL && parent_id )
XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id ); XSetTransientForHint( tqt_xdisplay(), dialog->winId(), parent_id );
#endif #endif
bool checkboxResult = false; bool checkboxResult = false;
@ -485,7 +485,7 @@ KMessageBox::questionYesNoCancelWId(WId parent_id,
dialog->setPlainCaption( caption ); dialog->setPlainCaption( caption );
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if( parent == NULL && parent_id ) if( parent == NULL && parent_id )
XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id ); XSetTransientForHint( tqt_xdisplay(), dialog->winId(), parent_id );
#endif #endif
bool checkboxResult = false; bool checkboxResult = false;
@ -567,7 +567,7 @@ KMessageBox::warningYesNoListWId(WId parent_id, const TQString &text,
dialog->setPlainCaption( caption ); dialog->setPlainCaption( caption );
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if( parent == NULL && parent_id ) if( parent == NULL && parent_id )
XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id ); XSetTransientForHint( tqt_xdisplay(), dialog->winId(), parent_id );
#endif #endif
bool checkboxResult = false; bool checkboxResult = false;
@ -639,7 +639,7 @@ KMessageBox::warningContinueCancelListWId(WId parent_id, const TQString &text,
dialog->setPlainCaption( caption ); dialog->setPlainCaption( caption );
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if( parent == NULL && parent_id ) if( parent == NULL && parent_id )
XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id ); XSetTransientForHint( tqt_xdisplay(), dialog->winId(), parent_id );
#endif #endif
bool checkboxResult = false; bool checkboxResult = false;
@ -715,7 +715,7 @@ KMessageBox::warningYesNoCancelListWId(WId parent_id, const TQString &text,
dialog->setPlainCaption( caption ); dialog->setPlainCaption( caption );
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if( parent == NULL && parent_id ) if( parent == NULL && parent_id )
XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id ); XSetTransientForHint( tqt_xdisplay(), dialog->winId(), parent_id );
#endif #endif
bool checkboxResult = false; bool checkboxResult = false;
@ -766,7 +766,7 @@ KMessageBox::errorListWId(WId parent_id, const TQString &text, const TQStringLi
dialog->setPlainCaption( caption ); dialog->setPlainCaption( caption );
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if( parent == NULL && parent_id ) if( parent == NULL && parent_id )
XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id ); XSetTransientForHint( tqt_xdisplay(), dialog->winId(), parent_id );
#endif #endif
createKMessageBox(dialog, TQMessageBox::Critical, text, strlist, TQString::null, 0, options); createKMessageBox(dialog, TQMessageBox::Critical, text, strlist, TQString::null, 0, options);
@ -796,7 +796,7 @@ KMessageBox::detailedErrorWId(WId parent_id, const TQString &text,
dialog->setPlainCaption( caption ); dialog->setPlainCaption( caption );
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if( parent == NULL && parent_id ) if( parent == NULL && parent_id )
XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id ); XSetTransientForHint( tqt_xdisplay(), dialog->winId(), parent_id );
#endif #endif
createKMessageBox(dialog, TQMessageBox::Critical, text, TQStringList(), TQString::null, 0, options, details); createKMessageBox(dialog, TQMessageBox::Critical, text, TQStringList(), TQString::null, 0, options, details);
@ -843,7 +843,7 @@ KMessageBox::sorryWId(WId parent_id, const TQString &text,
dialog->setPlainCaption( caption ); dialog->setPlainCaption( caption );
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if( parent == NULL && parent_id ) if( parent == NULL && parent_id )
XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id ); XSetTransientForHint( tqt_xdisplay(), dialog->winId(), parent_id );
#endif #endif
createKMessageBox(dialog, TQMessageBox::Warning, text, TQStringList(), TQString::null, 0, options); createKMessageBox(dialog, TQMessageBox::Warning, text, TQStringList(), TQString::null, 0, options);
@ -873,7 +873,7 @@ KMessageBox::detailedSorryWId(WId parent_id, const TQString &text,
dialog->setPlainCaption( caption ); dialog->setPlainCaption( caption );
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if( parent == NULL && parent_id ) if( parent == NULL && parent_id )
XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id ); XSetTransientForHint( tqt_xdisplay(), dialog->winId(), parent_id );
#endif #endif
createKMessageBox(dialog, TQMessageBox::Warning, text, TQStringList(), TQString::null, 0, options, details); createKMessageBox(dialog, TQMessageBox::Warning, text, TQStringList(), TQString::null, 0, options, details);
@ -919,7 +919,7 @@ KMessageBox::informationListWId(WId parent_id,const TQString &text, const TQStri
dialog->setPlainCaption( caption ); dialog->setPlainCaption( caption );
#ifdef Q_WS_X11 #ifdef Q_WS_X11
if( parent == NULL && parent_id ) if( parent == NULL && parent_id )
XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id ); XSetTransientForHint( tqt_xdisplay(), dialog->winId(), parent_id );
#endif #endif
bool checkboxResult = false; bool checkboxResult = false;

@ -234,7 +234,7 @@ void KPassivePopup::hideEvent( TQHideEvent * )
TQRect KPassivePopup::defaultArea() const TQRect KPassivePopup::defaultArea() const
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
NETRootInfo info( qt_xdisplay(), NETRootInfo info( tqt_xdisplay(),
NET::NumberOfDesktops | NET::NumberOfDesktops |
NET::CurrentDesktop | NET::CurrentDesktop |
NET::WorkArea, NET::WorkArea,
@ -261,7 +261,7 @@ void KPassivePopup::positionSelf()
} }
else { else {
NETWinInfo ni( qt_xdisplay(), window, qt_xrootwin(), NETWinInfo ni( tqt_xdisplay(), window, tqt_xrootwin(),
NET::WMIconGeometry | NET::WMKDESystemTrayWinFor ); NET::WMIconGeometry | NET::WMKDESystemTrayWinFor );
// Figure out where to put the popup. Note that we must handle // Figure out where to put the popup. Note that we must handle

@ -92,9 +92,9 @@ KPixmapIO::KPixmapIO()
return; return;
int ignore; int ignore;
if (XQueryExtension(qt_xdisplay(), "MIT-SHM", &ignore, &ignore, &ignore)) if (XQueryExtension(tqt_xdisplay(), "MIT-SHM", &ignore, &ignore, &ignore))
{ {
if (XShmQueryExtension(qt_xdisplay())) if (XShmQueryExtension(tqt_xdisplay()))
m_bShm = true; m_bShm = true;
} }
if (!m_bShm) if (!m_bShm)
@ -108,7 +108,7 @@ KPixmapIO::KPixmapIO()
// Sort out bit format. Create a temporary XImage for this. // Sort out bit format. Create a temporary XImage for this.
d->shminfo = new XShmSegmentInfo; d->shminfo = new XShmSegmentInfo;
d->ximage = XShmCreateImage(qt_xdisplay(), (Visual *) TQPaintDevice::x11AppVisual(), d->ximage = XShmCreateImage(tqt_xdisplay(), (Visual *) TQPaintDevice::x11AppVisual(),
TQPaintDevice::x11AppDepth(), ZPixmap, 0L, d->shminfo, 10, 10); TQPaintDevice::x11AppDepth(), ZPixmap, 0L, d->shminfo, 10, 10);
d->bpp = d->ximage->bits_per_pixel; d->bpp = d->ximage->bits_per_pixel;
d->first_try = true; d->first_try = true;
@ -231,10 +231,10 @@ void KPixmapIO::putImage(TQPixmap *dst, int dx, int dy, const TQImage *src)
if( initXImage(src->width(), src->height())) if( initXImage(src->width(), src->height()))
{ {
convertToXImage(*src); convertToXImage(*src);
XShmPutImage(qt_xdisplay(), dst->handle(), qt_xget_temp_gc(qt_xscreen(), false), d->ximage, XShmPutImage(tqt_xdisplay(), dst->handle(), tqt_xget_temp_gc(tqt_xscreen(), false), d->ximage,
dx, dy, 0, 0, src->width(), src->height(), false); dx, dy, 0, 0, src->width(), src->height(), false);
// coolo: do we really need this here? I see no good for it // coolo: do we really need this here? I see no good for it
XSync(qt_xdisplay(), false); XSync(tqt_xdisplay(), false);
doneXImage(); doneXImage();
fallback = false; fallback = false;
} }
@ -265,7 +265,7 @@ TQImage KPixmapIO::getImage(const TQPixmap *src, int sx, int sy, int sw, int sh)
#ifdef HAVE_MITSHM #ifdef HAVE_MITSHM
if( initXImage(sw, sh)) if( initXImage(sw, sh))
{ {
XShmGetImage(qt_xdisplay(), src->handle(), d->ximage, sx, sy, AllPlanes); XShmGetImage(tqt_xdisplay(), src->handle(), d->ximage, sx, sy, AllPlanes);
image = convertFromXImage(); image = convertFromXImage();
doneXImage(); doneXImage();
fallback = false; fallback = false;
@ -353,7 +353,7 @@ void KPixmapIO::destroyXImage()
bool KPixmapIO::createXImage(int w, int h) bool KPixmapIO::createXImage(int w, int h)
{ {
destroyXImage(); destroyXImage();
d->ximage = XShmCreateImage(qt_xdisplay(), (Visual *) TQPaintDevice::x11AppVisual(), d->ximage = XShmCreateImage(tqt_xdisplay(), (Visual *) TQPaintDevice::x11AppVisual(),
TQPaintDevice::x11AppDepth(), ZPixmap, 0L, d->shminfo, w, h); TQPaintDevice::x11AppDepth(), ZPixmap, 0L, d->shminfo, w, h);
return d->ximage != None; return d->ximage != None;
} }
@ -363,7 +363,7 @@ void KPixmapIO::destroyShmSegment()
{ {
if (d->shmsize) if (d->shmsize)
{ {
XShmDetach(qt_xdisplay(), d->shminfo); XShmDetach(tqt_xdisplay(), d->shminfo);
shmdt(d->shminfo->shmaddr); shmdt(d->shminfo->shmaddr);
shmctl(d->shminfo->shmid, IPC_RMID, 0); shmctl(d->shminfo->shmid, IPC_RMID, 0);
d->shmsize = 0; d->shmsize = 0;
@ -412,12 +412,12 @@ bool KPixmapIO::createShmSegment(int size)
if (d->first_try) { if (d->first_try) {
// make sure that we don't get errors of old stuff // make sure that we don't get errors of old stuff
XSync(qt_xdisplay(), False); XSync(tqt_xdisplay(), False);
old_errhandler = XSetErrorHandler(kpixmapio_errorhandler); old_errhandler = XSetErrorHandler(kpixmapio_errorhandler);
kpixmapio_serial = NextRequest(qt_xdisplay()); kpixmapio_serial = NextRequest(tqt_xdisplay());
} }
if ( !XShmAttach(qt_xdisplay(), d->shminfo)) if ( !XShmAttach(tqt_xdisplay(), d->shminfo))
{ {
kdWarning() << "X-Server could not attach shared memory segment.\n"; kdWarning() << "X-Server could not attach shared memory segment.\n";
m_bShm = false; m_bShm = false;
@ -426,7 +426,7 @@ bool KPixmapIO::createShmSegment(int size)
} }
if (d->first_try) { if (d->first_try) {
XSync(qt_xdisplay(), false); XSync(tqt_xdisplay(), false);
if (!use_xshm) if (!use_xshm)
m_bShm = false; m_bShm = false;
@ -464,7 +464,7 @@ TQImage KPixmapIO::convertFromXImage()
XColor *cmap = new XColor[ncells]; XColor *cmap = new XColor[ncells];
for (i=0; i<ncells; i++) for (i=0; i<ncells; i++)
cmap[i].pixel = i; cmap[i].pixel = i;
XQueryColors(qt_xdisplay(), TQPaintDevice::x11AppColormap(), XQueryColors(tqt_xdisplay(), TQPaintDevice::x11AppColormap(),
cmap, ncells); cmap, ncells);
image.setNumColors(ncells); image.setNumColors(ncells);
for (i=0; i<ncells; i++) for (i=0; i<ncells; i++)

@ -92,7 +92,7 @@ KRootPixmap::~KRootPixmap()
int KRootPixmap::currentDesktop() const int KRootPixmap::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();
#else #else
@ -263,7 +263,7 @@ bool KRootPixmap::isAvailable() const
TQString KRootPixmap::pixmapName(int desk) { TQString KRootPixmap::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";
} }
@ -284,7 +284,7 @@ void KRootPixmap::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 );

@ -77,10 +77,10 @@ KSharedPixmap::~KSharedPixmap()
void KSharedPixmap::init() void KSharedPixmap::init()
{ {
d->pixmap = XInternAtom(qt_xdisplay(), "PIXMAP", false); d->pixmap = XInternAtom(tqt_xdisplay(), "PIXMAP", false);
TQCString atom; TQCString atom;
atom.sprintf("target prop for window %lx", static_cast<unsigned long int>(winId())); atom.sprintf("target prop for window %lx", static_cast<unsigned long int>(winId()));
d->target = XInternAtom(qt_xdisplay(), atom.data(), false); d->target = XInternAtom(tqt_xdisplay(), atom.data(), false);
d->selection = None; d->selection = None;
} }
@ -88,10 +88,10 @@ void KSharedPixmap::init()
bool KSharedPixmap::isAvailable(const TQString & name) const bool KSharedPixmap::isAvailable(const TQString & name) const
{ {
TQString str = TQString("KDESHPIXMAP:%1").arg(name); TQString str = TQString("KDESHPIXMAP:%1").arg(name);
Atom sel = XInternAtom(qt_xdisplay(), str.latin1(), true); Atom sel = XInternAtom(tqt_xdisplay(), str.latin1(), true);
if (sel == None) if (sel == None)
return false; return false;
return XGetSelectionOwner(qt_xdisplay(), sel) != None; return XGetSelectionOwner(tqt_xdisplay(), sel) != None;
} }
@ -105,16 +105,16 @@ bool KSharedPixmap::loadFromShared(const TQString & name, const TQRect & rect)
TQPixmap::resize(0, 0); // invalidate TQPixmap::resize(0, 0); // invalidate
TQString str = TQString("KDESHPIXMAP:%1").arg(name); TQString str = TQString("KDESHPIXMAP:%1").arg(name);
d->selection = XInternAtom(qt_xdisplay(), str.latin1(), true); d->selection = XInternAtom(tqt_xdisplay(), str.latin1(), true);
if (d->selection == None) if (d->selection == None)
return false; return false;
if (XGetSelectionOwner(qt_xdisplay(), d->selection) == None) if (XGetSelectionOwner(tqt_xdisplay(), d->selection) == None)
{ {
d->selection = None; d->selection = None;
return false; return false;
} }
XConvertSelection(qt_xdisplay(), d->selection, d->pixmap, d->target, XConvertSelection(tqt_xdisplay(), d->selection, d->pixmap, d->target,
winId(), CurrentTime); winId(), CurrentTime);
return true; return true;
} }
@ -144,7 +144,7 @@ bool KSharedPixmap::x11Event(XEvent *event)
unsigned char *pixmap_id = 0; unsigned char *pixmap_id = 0;
Atom type; Atom type;
XGetWindowProperty(qt_xdisplay(), winId(), ev->property, 0, 1, false, XGetWindowProperty(tqt_xdisplay(), winId(), ev->property, 0, 1, false,
d->pixmap, &type, &format, &nitems, &ldummy, d->pixmap, &type, &format, &nitems, &ldummy,
&pixmap_id); &pixmap_id);
@ -160,7 +160,7 @@ bool KSharedPixmap::x11Event(XEvent *event)
void *drawable_id = (void *) pixmap_id; void *drawable_id = (void *) pixmap_id;
Drawable pixmap = *(Drawable*) drawable_id; Drawable pixmap = *(Drawable*) drawable_id;
Status status = XGetGeometry(qt_xdisplay(), pixmap, &root, &dummy, &dummy, &width, &height, &udummy, &udummy); Status status = XGetGeometry(tqt_xdisplay(), pixmap, &root, &dummy, &dummy, &width, &height, &udummy, &udummy);
if (status == BadDrawable) if (status == BadDrawable)
return false; return false;
@ -168,11 +168,11 @@ bool KSharedPixmap::x11Event(XEvent *event)
if (d->rect.isEmpty()) if (d->rect.isEmpty())
{ {
TQPixmap::resize(width, height); TQPixmap::resize(width, height);
XCopyArea(qt_xdisplay(), pixmap, ((KPixmap*)this)->handle(), qt_xget_temp_gc(qt_xscreen(), false), XCopyArea(tqt_xdisplay(), pixmap, ((KPixmap*)this)->handle(), tqt_xget_temp_gc(tqt_xscreen(), false),
0, 0, width, height, 0, 0); 0, 0, width, height, 0, 0);
XFree(pixmap_id); XFree(pixmap_id);
XDeleteProperty(qt_xdisplay(), winId(), ev->property); XDeleteProperty(tqt_xdisplay(), winId(), ev->property);
d->selection = None; d->selection = None;
emit done(true); emit done(true);
return true; return true;
@ -206,19 +206,19 @@ bool KSharedPixmap::x11Event(XEvent *event)
TQPixmap::resize( tw+origin.x(), th+origin.y() ); TQPixmap::resize( tw+origin.x(), th+origin.y() );
XCopyArea(qt_xdisplay(), pixmap, (static_cast<KPixmap*>(this))->handle(), qt_xget_temp_gc(qt_xscreen(), false), XCopyArea(tqt_xdisplay(), pixmap, (static_cast<KPixmap*>(this))->handle(), tqt_xget_temp_gc(tqt_xscreen(), false),
xa, ya, t1w+origin.x(), t1h+origin.y(), origin.x(), origin.y() ); xa, ya, t1w+origin.x(), t1h+origin.y(), origin.x(), origin.y() );
XCopyArea(qt_xdisplay(), pixmap, (static_cast<KPixmap*>(this))->handle(), qt_xget_temp_gc(qt_xscreen(), false), XCopyArea(tqt_xdisplay(), pixmap, (static_cast<KPixmap*>(this))->handle(), tqt_xget_temp_gc(tqt_xscreen(), false),
0, ya, tw-t1w, t1h, t1w, 0); 0, ya, tw-t1w, t1h, t1w, 0);
XCopyArea(qt_xdisplay(), pixmap, (static_cast<KPixmap*>(this))->handle(), qt_xget_temp_gc(qt_xscreen(), false), XCopyArea(tqt_xdisplay(), pixmap, (static_cast<KPixmap*>(this))->handle(), tqt_xget_temp_gc(tqt_xscreen(), false),
xa, 0, t1w, th-t1h, 0, t1h); xa, 0, t1w, th-t1h, 0, t1h);
XCopyArea(qt_xdisplay(), pixmap, (static_cast<KPixmap*>(this))->handle(), qt_xget_temp_gc(qt_xscreen(), false), XCopyArea(tqt_xdisplay(), pixmap, (static_cast<KPixmap*>(this))->handle(), tqt_xget_temp_gc(tqt_xscreen(), false),
0, 0, tw-t1w, th-t1h, t1w, t1h); 0, 0, tw-t1w, th-t1h, t1w, t1h);
XFree(pixmap_id); XFree(pixmap_id);
d->selection = None; d->selection = None;
XDeleteProperty(qt_xdisplay(), winId(), ev->property); XDeleteProperty(tqt_xdisplay(), winId(), ev->property);
emit done(true); emit done(true);
return true; return true;
} }

@ -69,7 +69,7 @@ KSystemTray::KSystemTray( TQWidget* parent, const char* name )
d->actionCollection = new KActionCollection(this); d->actionCollection = new KActionCollection(this);
#ifdef Q_WS_X11 #ifdef Q_WS_X11
KWin::setSystemTrayWindowFor( winId(), parent?parent->topLevelWidget()->winId(): qt_xrootwin() ); KWin::setSystemTrayWindowFor( winId(), parent?parent->topLevelWidget()->winId(): tqt_xrootwin() );
#endif #endif
setBackgroundMode(X11ParentRelative); setBackgroundMode(X11ParentRelative);
setBackgroundOrigin(WindowOrigin); setBackgroundOrigin(WindowOrigin);

@ -97,10 +97,10 @@ const int XKeyRelease = KeyRelease;
# undef FocusIn # undef FocusIn
// L0005: Variables defined in qapplication_x11.cpp // L0005: Variables defined in qapplication_x11.cpp
extern Atom qt_wm_protocols; extern Atom tqt_wm_protocols;
extern Atom qt_wm_delete_window; extern Atom tqt_wm_delete_window;
extern Atom qt_wm_take_focus; extern Atom tqt_wm_take_focus;
extern Atom qt_wm_state; extern Atom tqt_wm_state;
// L0006: X11 atoms private to QXEmbed // L0006: X11 atoms private to QXEmbed
static Atom xembed = 0; static Atom xembed = 0;
@ -184,7 +184,7 @@ public:
// L0400: This sets a very low level filter for X11 messages. // L0400: This sets a very low level filter for X11 messages.
// See qapplication_x11.cpp // See 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 oldFilter = 0; static QX11EventFilter oldFilter = 0;
@ -204,7 +204,7 @@ static void sendXEmbedMessage( WId window, long message, long detail = 0,
ev.xclient.data.l[2] = detail; ev.xclient.data.l[2] = detail;
ev.xclient.data.l[3] = data1; ev.xclient.data.l[3] = data1;
ev.xclient.data.l[4] = data2; ev.xclient.data.l[4] = data2;
XSendEvent(qt_xdisplay(), window, false, NoEventMask, &ev); XSendEvent(tqt_xdisplay(), window, false, NoEventMask, &ev);
} }
// L0501: Helper to send ICCCM Client messages. // L0501: Helper to send ICCCM Client messages.
@ -220,7 +220,7 @@ static void sendClientMessage(Window window, Atom a, long x)
ev.xclient.format = 32; ev.xclient.format = 32;
ev.xclient.data.l[0] = x; ev.xclient.data.l[0] = x;
ev.xclient.data.l[1] = GET_QT_X_TIME(); ev.xclient.data.l[1] = GET_QT_X_TIME();
XSendEvent(qt_xdisplay(), window, false, NoEventMask, &ev); XSendEvent(tqt_xdisplay(), window, false, NoEventMask, &ev);
} }
// L0502: Helper to send fake X11 focus messages. // L0502: Helper to send fake X11 focus messages.
@ -234,7 +234,7 @@ static void sendFocusMessage(Window window, int type, int mode, int detail)
ev.xfocus.window = window; ev.xfocus.window = window;
ev.xfocus.mode = mode; ev.xfocus.mode = mode;
ev.xfocus.detail = detail; ev.xfocus.detail = detail;
XSendEvent(qt_xdisplay(), window, false, FocusChangeMask, &ev); XSendEvent(tqt_xdisplay(), window, false, FocusChangeMask, &ev);
} }
@ -462,7 +462,7 @@ static int qxembed_x11_event_filter( XEvent* e)
// widget might later be set in L0680. // widget might later be set in L0680.
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 = XFocusIn; ev.xfocus.type = XFocusIn;
ev.xfocus.window = w->topLevelWidget()->winId(); ev.xfocus.window = w->topLevelWidget()->winId();
ev.xfocus.mode = NotifyNormal; ev.xfocus.mode = NotifyNormal;
@ -476,7 +476,7 @@ static int qxembed_x11_event_filter( XEvent* e)
// receive extra Qt FocusOut events but we do not care. // receive extra Qt FocusOut events but we do not care.
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 = XFocusOut; ev.xfocus.type = XFocusOut;
ev.xfocus.window = w->topLevelWidget()->winId(); ev.xfocus.window = w->topLevelWidget()->winId();
ev.xfocus.mode = NotifyNormal; ev.xfocus.mode = NotifyNormal;
@ -555,7 +555,7 @@ static int qxembed_x11_event_filter( XEvent* e)
break; break;
} }
} else if ( e->xclient.format == 32 && e->xclient.message_type ) { } else if ( e->xclient.format == 32 && e->xclient.message_type ) {
if ( e->xclient.message_type == qt_wm_protocols ) { if ( e->xclient.message_type == tqt_wm_protocols ) {
TQWidget* w = TQT_TQWIDGET(TQWidget::find( e->xclient.window )); TQWidget* w = TQT_TQWIDGET(TQWidget::find( e->xclient.window ));
if ( !w ) if ( !w )
break; break;
@ -567,7 +567,7 @@ static int qxembed_x11_event_filter( XEvent* e)
// changed the X11 focus. We want to make sure it goes // changed the X11 focus. We want to make sure it goes
// to the focus proxy window eventually. // to the focus proxy window eventually.
Atom a = e->xclient.data.l[0]; Atom a = e->xclient.data.l[0];
if ( a == qt_wm_take_focus ) { if ( a == tqt_wm_take_focus ) {
// L0695: update Qt message time variable // L0695: update Qt message time variable
if ( (ulong) e->xclient.data.l[1] > GET_QT_X_TIME() ) if ( (ulong) e->xclient.data.l[1] > GET_QT_X_TIME() )
SET_QT_X_TIME(e->xclient.data.l[1]); SET_QT_X_TIME(e->xclient.data.l[1]);
@ -607,9 +607,9 @@ void QXEmbed::initialize()
return; return;
// L0710: Atom used by the XEMBED protocol. // L0710: Atom used by the XEMBED protocol.
xembed = XInternAtom( qt_xdisplay(), "_XEMBED", false ); xembed = XInternAtom( tqt_xdisplay(), "_XEMBED", false );
// L0720: Install low level filter for X11 events (L0650) // L0720: Install low level filter for X11 events (L0650)
oldFilter = qt_set_x11_event_filter( qxembed_x11_event_filter ); oldFilter = tqt_set_x11_event_filter( qxembed_x11_event_filter );
// L0730: See L0610 for an explanation about focusMap. // L0730: See L0610 for an explanation about focusMap.
focusMap = new TQPtrDict<TQGuardedPtr<TQWidget> >; focusMap = new TQPtrDict<TQGuardedPtr<TQWidget> >;
focusMap->setAutoDelete( true ); focusMap->setAutoDelete( true );
@ -670,7 +670,7 @@ QXEmbed::QXEmbed(TQWidget *parent, const char *name, WFlags f)
// L0912: We are mostly interested in SubstructureNotify // L0912: We are mostly interested in SubstructureNotify
// This is sent when something happens to the children of // This is sent when something happens to the children of
// the X11 window associated with the QXEmbed widget. // the X11 window associated with the QXEmbed widget.
XSelectInput(qt_xdisplay(), winId(), XSelectInput(tqt_xdisplay(), winId(),
KeyPressMask | KeyReleaseMask | KeyPressMask | KeyReleaseMask |
ButtonPressMask | ButtonReleaseMask | ButtonPressMask | ButtonReleaseMask |
KeymapStateMask | KeymapStateMask |
@ -693,7 +693,7 @@ QXEmbed::QXEmbed(TQWidget *parent, const char *name, WFlags f)
// See L1581 to know why we do not use isActiveWindow(). // See L1581 to know why we do not use isActiveWindow().
if ( tqApp->activeWindow() == topLevelWidget() ) if ( tqApp->activeWindow() == topLevelWidget() )
if ( !((QPublicWidget*) topLevelWidget())->topData()->embedded ) if ( !((QPublicWidget*) topLevelWidget())->topData()->embedded )
XSetInputFocus( qt_xdisplay(), d->focusProxy->winId(), XSetInputFocus( tqt_xdisplay(), d->focusProxy->winId(),
RevertToParent, GET_QT_X_TIME() ); RevertToParent, GET_QT_X_TIME() );
// L0915: ??? [drag&drop?] // L0915: ??? [drag&drop?]
setAcceptDrops( true ); setAcceptDrops( true );
@ -704,7 +704,7 @@ QXEmbed::~QXEmbed()
{ {
// L1010: Make sure no pointer grab is left. // L1010: Make sure no pointer grab is left.
if ( d && d->xgrab) if ( d && d->xgrab)
XUngrabButton( qt_xdisplay(), AnyButton, AnyModifier, winId() ); XUngrabButton( tqt_xdisplay(), AnyButton, AnyModifier, winId() );
if ( window && ( autoDelete() || !d->xplain )) if ( window && ( autoDelete() || !d->xplain ))
{ {
// L1021: Hide the window and safely reparent it into the root, // L1021: Hide the window and safely reparent it into the root,
@ -720,17 +720,17 @@ QXEmbed::~QXEmbed()
// themselves they have been released from systray, but KWin requires them // themselves they have been released from systray, but KWin requires them
// to be visible to allow next Kicker instance to swallow them. // to be visible to allow next Kicker instance to swallow them.
// See also below the L1022 comment. // See also below the L1022 comment.
// XUnmapWindow( qt_xdisplay(), window ); // XUnmapWindow( tqt_xdisplay(), window );
#else #else
if( autoDelete()) if( autoDelete())
XUnmapWindow( qt_xdisplay(), window ); XUnmapWindow( tqt_xdisplay(), window );
#endif #endif
XReparentWindow(qt_xdisplay(), window, qt_xrootwin(), 0, 0); XReparentWindow(tqt_xdisplay(), window, tqt_xrootwin(), 0, 0);
if( !d->xplain ) if( !d->xplain )
XRemoveFromSaveSet( qt_xdisplay(), window ); XRemoveFromSaveSet( tqt_xdisplay(), window );
if( d->mapAfterRelease ) if( d->mapAfterRelease )
XMapWindow( qt_xdisplay(), window ); XMapWindow( tqt_xdisplay(), window );
XSync(qt_xdisplay(), false); XSync(tqt_xdisplay(), false);
// L1022: Send the WM_DELETE_WINDOW message // L1022: Send the WM_DELETE_WINDOW message
if( autoDelete() /*&& d->xplain*/ ) if( autoDelete() /*&& d->xplain*/ )
// This sendDelete should only apply to XPLAIN. // This sendDelete should only apply to XPLAIN.
@ -744,9 +744,9 @@ QXEmbed::~QXEmbed()
// Make sure that the X11 focus is not lost in the process. // Make sure that the X11 focus is not lost in the process.
Window focus; Window focus;
int revert; int revert;
XGetInputFocus( qt_xdisplay(), &focus, &revert ); XGetInputFocus( tqt_xdisplay(), &focus, &revert );
if( focus == d->focusProxy->winId()) if( focus == d->focusProxy->winId())
XSetInputFocus( qt_xdisplay(), topLevelWidget()->winId(), RevertToParent, GET_QT_X_TIME() ); XSetInputFocus( tqt_xdisplay(), topLevelWidget()->winId(), RevertToParent, GET_QT_X_TIME() );
// L01045: Delete our private data. // L01045: Delete our private data.
delete d; delete d;
} }
@ -759,8 +759,8 @@ void QXEmbed::sendDelete( void )
{ {
if (window) if (window)
{ {
sendClientMessage(window, qt_wm_protocols, qt_wm_delete_window); sendClientMessage(window, tqt_wm_protocols, tqt_wm_delete_window);
XFlush( qt_xdisplay() ); XFlush( tqt_xdisplay() );
} }
} }
@ -793,14 +793,14 @@ QXEmbed::Protocol QXEmbed::protocol()
void QXEmbed::resizeEvent(TQResizeEvent*) void QXEmbed::resizeEvent(TQResizeEvent*)
{ {
if (window) if (window)
XResizeWindow(qt_xdisplay(), window, width(), height()); XResizeWindow(tqt_xdisplay(), window, width(), height());
} }
// L1250: QXEmbed widget is shown: make sure embedded window is visible. // L1250: QXEmbed widget is shown: make sure embedded window is visible.
void QXEmbed::showEvent(TQShowEvent*) void QXEmbed::showEvent(TQShowEvent*)
{ {
if (window) if (window)
XMapRaised(qt_xdisplay(), window); XMapRaised(tqt_xdisplay(), window);
} }
@ -815,7 +815,7 @@ bool QXEmbed::eventFilter( TQObject *o, TQEvent * e)
// Make sure the X11 focus is on the focus proxy window. See L0686. // Make sure the X11 focus is on the focus proxy window. See L0686.
if ( !((QPublicWidget*) topLevelWidget())->topData()->embedded ) if ( !((QPublicWidget*) topLevelWidget())->topData()->embedded )
if (! hasFocus() ) if (! hasFocus() )
XSetInputFocus( qt_xdisplay(), d->focusProxy->winId(), XSetInputFocus( tqt_xdisplay(), d->focusProxy->winId(),
RevertToParent, GET_QT_X_TIME() ); RevertToParent, GET_QT_X_TIME() );
if (d->xplain) if (d->xplain)
// L1311: Activation has changed. Grab state might change. See L2800. // L1311: Activation has changed. Grab state might change. See L2800.
@ -874,7 +874,7 @@ void QXEmbed::keyPressEvent( TQKeyEvent *)
if (!window) if (!window)
return; return;
last_key_event.window = window; last_key_event.window = window;
XSendEvent(qt_xdisplay(), window, false, KeyPressMask, (XEvent*)&last_key_event); XSendEvent(tqt_xdisplay(), window, false, KeyPressMask, (XEvent*)&last_key_event);
} }
@ -885,7 +885,7 @@ void QXEmbed::keyReleaseEvent( TQKeyEvent *)
if (!window) if (!window)
return; return;
last_key_event.window = window; last_key_event.window = window;
XSendEvent(qt_xdisplay(), window, false, KeyReleaseMask, (XEvent*)&last_key_event); XSendEvent(tqt_xdisplay(), window, false, KeyReleaseMask, (XEvent*)&last_key_event);
} }
// L1500: Handle Qt focus in event. // L1500: Handle Qt focus in event.
@ -899,7 +899,7 @@ void QXEmbed::focusInEvent( TQFocusEvent * e ){
// L1511: Alter X focus only when window is active. // L1511: Alter X focus only when window is active.
// This is dual safety here because FocusIn implies this. // This is dual safety here because FocusIn implies this.
// But see L1581 for an example where this really matters. // But see L1581 for an example where this really matters.
XSetInputFocus( qt_xdisplay(), d->focusProxy->winId(), XSetInputFocus( tqt_xdisplay(), d->focusProxy->winId(),
RevertToParent, GET_QT_X_TIME() ); RevertToParent, GET_QT_X_TIME() );
if (d->xplain) { if (d->xplain) {
// L1520: Qt focus has changed. Grab state might change. See L2800. // L1520: Qt focus has changed. Grab state might change. See L2800.
@ -949,7 +949,7 @@ void QXEmbed::focusOutEvent( TQFocusEvent * ){
// The test above is not the same as isActiveWindow(). // The test above is not the same as isActiveWindow().
// Function isActiveWindow() also returns true when a modal // Function isActiveWindow() also returns true when a modal
// dialog child of this window is active. // dialog child of this window is active.
XSetInputFocus( qt_xdisplay(), d->focusProxy->winId(), XSetInputFocus( tqt_xdisplay(), d->focusProxy->winId(),
RevertToParent, GET_QT_X_TIME() ); RevertToParent, GET_QT_X_TIME() );
} }
@ -973,7 +973,7 @@ static bool wstate_withdrawn( WId winid )
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;
@ -993,7 +993,7 @@ static int get_parent(WId winid, Window *out_parent)
{ {
Window root, *children=0; Window root, *children=0;
unsigned int nchildren; unsigned int nchildren;
int st = XQueryTree(qt_xdisplay(), winid, &root, out_parent, &children, &nchildren); int st = XQueryTree(tqt_xdisplay(), winid, &root, out_parent, &children, &nchildren);
if (st && children) if (st && children)
XFree(children); XFree(children);
return st; return st;
@ -1016,14 +1016,14 @@ void QXEmbed::embed(WId w)
// This makes sure that the window manager will // This makes sure that the window manager will
// no longer try to manage this window. // no longer try to manage this window.
if ( !wstate_withdrawn(window) ) { if ( !wstate_withdrawn(window) ) {
XWithdrawWindow(qt_xdisplay(), window, qt_xscreen()); XWithdrawWindow(tqt_xdisplay(), window, tqt_xscreen());
TQApplication::flushX(); TQApplication::flushX();
// L1711: See L1610 // L1711: See L1610
for (int i=0; i < 10000; ++i) { for (int i=0; i < 10000; ++i) {
if (wstate_withdrawn(window)) { if (wstate_withdrawn(window)) {
Window parent = 0; Window parent = 0;
get_parent(w, &parent); get_parent(w, &parent);
if (parent == qt_xrootwin()) break; if (parent == tqt_xrootwin()) break;
} }
USLEEP(1000); USLEEP(1000);
} }
@ -1039,8 +1039,8 @@ void QXEmbed::embed(WId w)
// this is done once more when finishing embedding, but it's done also here // this is done once more when finishing embedding, but it's done also here
// just in case we crash before reaching that place // just in case we crash before reaching that place
if( !d->xplain ) if( !d->xplain )
XAddToSaveSet( qt_xdisplay(), w ); XAddToSaveSet( tqt_xdisplay(), w );
XReparentWindow(qt_xdisplay(), w, winId(), 0, 0); XReparentWindow(tqt_xdisplay(), w, winId(), 0, 0);
if (get_parent(w, &parent) && parent == winId()) { if (get_parent(w, &parent) && parent == winId()) {
kdDebug() << TQString(TQString("> Loop %1: ").arg(i)) kdDebug() << TQString(TQString("> Loop %1: ").arg(i))
<< TQString(TQString("> reparent of 0x%1").arg(w,0,16)) << TQString(TQString("> reparent of 0x%1").arg(w,0,16))
@ -1066,9 +1066,9 @@ void QXEmbed::handleEmbed()
// only XEMBED apps can survive crash, // only XEMBED apps can survive crash,
// see http://lists.kde.org/?l=kfm-devel&m=106752026501968&w=2 // see http://lists.kde.org/?l=kfm-devel&m=106752026501968&w=2
if( !d->xplain ) if( !d->xplain )
XAddToSaveSet( qt_xdisplay(), window ); XAddToSaveSet( tqt_xdisplay(), window );
XResizeWindow(qt_xdisplay(), window, width(), height()); XResizeWindow(tqt_xdisplay(), window, width(), height());
XMapRaised(qt_xdisplay(), window); XMapRaised(tqt_xdisplay(), window);
// L2024: see L2900. // L2024: see L2900.
sendSyntheticConfigureNotifyEvent(); sendSyntheticConfigureNotifyEvent();
// L2025: ??? [any idea about drag&drop?] // L2025: ??? [any idea about drag&drop?]
@ -1155,7 +1155,7 @@ bool QXEmbed::x11Event( XEvent* e)
// ??? [not sure it is good to touch this window since // ??? [not sure it is good to touch this window since
// someone else has taken control of it already.] // someone else has taken control of it already.]
if( !d->xplain ) if( !d->xplain )
XRemoveFromSaveSet( qt_xdisplay(), window ); XRemoveFromSaveSet( tqt_xdisplay(), window );
} else if ( e->xreparent.parent == winId()){ } else if ( e->xreparent.parent == winId()){
if( window == 0 ) // something started embedding from the outside if( window == 0 ) // something started embedding from the outside
window = e->xreparent.window; window = e->xreparent.window;
@ -1176,7 +1176,7 @@ bool QXEmbed::x11Event( XEvent* e)
TQFocusEvent::resetReason(); TQFocusEvent::resetReason();
#endif // USE_QT4 #endif // USE_QT4
// L2064: Resume X11 event processing. // L2064: Resume X11 event processing.
XAllowEvents(qt_xdisplay(), ReplayPointer, CurrentTime); XAllowEvents(tqt_xdisplay(), ReplayPointer, CurrentTime);
// L2065: Qt should not know about this. // L2065: Qt should not know about this.
return true; return true;
} }
@ -1184,14 +1184,14 @@ bool QXEmbed::x11Event( XEvent* e)
case ButtonRelease: case ButtonRelease:
if (d->xplain && d->xgrab) { if (d->xplain && d->xgrab) {
// L2064: Resume X11 event processing after passive grab (see L2060) // L2064: Resume X11 event processing after passive grab (see L2060)
XAllowEvents(qt_xdisplay(), SyncPointer, CurrentTime); XAllowEvents(tqt_xdisplay(), SyncPointer, CurrentTime);
return true; return true;
} }
break; break;
case MapRequest: case MapRequest:
// L2070: Behave like a window manager. // L2070: Behave like a window manager.
if ( window && e->xmaprequest.window == window ) if ( window && e->xmaprequest.window == window )
XMapRaised(qt_xdisplay(), window ); XMapRaised(tqt_xdisplay(), window );
break; break;
case ClientMessage: case ClientMessage:
// L2080: This is where the QXEmbed object receives XEMBED // L2080: This is where the QXEmbed object receives XEMBED
@ -1268,7 +1268,7 @@ void QXEmbed::enterWhatsThisMode()
TQWhatsThis::leaveWhatsThisMode(); TQWhatsThis::leaveWhatsThisMode();
if ( !context_help ) if ( !context_help )
context_help = XInternAtom( x11Display(), "_NET_WM_CONTEXT_HELP", false ); context_help = XInternAtom( x11Display(), "_NET_WM_CONTEXT_HELP", false );
sendClientMessage(window , qt_wm_protocols, context_help ); sendClientMessage(window , tqt_wm_protocols, context_help );
} }
@ -1315,7 +1315,7 @@ bool QXEmbed::processClientCmdline( TQWidget* client, int& argc, char ** argv )
void QXEmbed::embedClientIntoWindow(TQWidget* client, WId window) void QXEmbed::embedClientIntoWindow(TQWidget* client, WId window)
{ {
initialize(); initialize();
XReparentWindow(qt_xdisplay(), client->winId(), window, 0, 0); XReparentWindow(tqt_xdisplay(), client->winId(), window, 0, 0);
// L2451: These two lines are redundant. See L0680. // L2451: These two lines are redundant. See L0680.
((QXEmbed*)client)->topData()->embedded = true; ((QXEmbed*)client)->topData()->embedded = true;
#ifdef USE_QT4 #ifdef USE_QT4
@ -1353,7 +1353,7 @@ TQSize QXEmbed::minimumSizeHint() const
if ( window ) { if ( window ) {
XSizeHints size; XSizeHints size;
long msize; long msize;
if (XGetWMNormalHints(qt_xdisplay(), window, &size, &msize) if (XGetWMNormalHints(tqt_xdisplay(), window, &size, &msize)
&& ( size.flags & PMinSize) ) { && ( size.flags & PMinSize) ) {
minw = size.min_width; minw = size.min_width;
minh = size.min_height; minh = size.min_height;
@ -1391,13 +1391,13 @@ void QXEmbed::checkGrab()
{ {
if (d->xplain && isActiveWindow() && !hasFocus()) { if (d->xplain && isActiveWindow() && !hasFocus()) {
if (! d->xgrab) if (! d->xgrab)
XGrabButton(qt_xdisplay(), AnyButton, AnyModifier, winId(), XGrabButton(tqt_xdisplay(), AnyButton, AnyModifier, winId(),
false, ButtonPressMask, GrabModeSync, GrabModeAsync, false, ButtonPressMask, GrabModeSync, GrabModeAsync,
None, None ); None, None );
d->xgrab = true; d->xgrab = true;
} else { } else {
if (d->xgrab) if (d->xgrab)
XUngrabButton( qt_xdisplay(), AnyButton, AnyModifier, winId() ); XUngrabButton( tqt_xdisplay(), AnyButton, AnyModifier, winId() );
d->xgrab = false; d->xgrab = false;
} }
} }
@ -1415,7 +1415,7 @@ void QXEmbed::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 = window; c.event = window;
c.window = window; c.window = window;
@ -1426,11 +1426,11 @@ void QXEmbed::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 );
#endif #endif
// Yes, this doesn't make sense at all. See the commit message. // Yes, this doesn't make sense at all. See the commit message.
XSetWindowBorderWidth( qt_xdisplay(), window, 1 ); XSetWindowBorderWidth( tqt_xdisplay(), window, 1 );
XSetWindowBorderWidth( qt_xdisplay(), window, 0 ); XSetWindowBorderWidth( tqt_xdisplay(), window, 0 );
} }
} }

@ -84,5 +84,5 @@ Window Window_With_Name(Display *dpy, Window top, const char *name)
WId windowWithName(const char *name) WId windowWithName(const char *name)
{ {
return Window_With_Name(qt_xdisplay(), qt_xrootwin(), name); return Window_With_Name(tqt_xdisplay(), tqt_xrootwin(), name);
} }

@ -47,7 +47,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
static TQCString twinName() { static TQCString twinName() {
TQCString appname; TQCString appname;
int screen_number = DefaultScreen(qt_xdisplay()); int screen_number = DefaultScreen(tqt_xdisplay());
if (screen_number == 0) if (screen_number == 0)
appname = "twin"; appname = "twin";
else else
@ -100,7 +100,7 @@ static bool standaloneDialog( const KWin::WindowInfo* info, const NameSortedInfo
WId group = info->groupLeader(); WId group = info->groupLeader();
if( group == 0 ) if( group == 0 )
{ {
return info->transientFor() == qt_xrootwin(); return info->transientFor() == tqt_xrootwin();
} }
for( TQPtrListIterator< KWin::WindowInfo > it( list ); for( TQPtrListIterator< KWin::WindowInfo > it( list );
it.current() != NULL; it.current() != NULL;

Loading…
Cancel
Save