Warning, file /frameworks/kwindowsystem/src/platforms/osx/kwindowsystem.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2007 Laurent Montel <montel@kde.org>
0004     SPDX-FileCopyrightText: 2008 Marijn Kruisselbrink <m.kruisselbrink@student.tue.nl>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-or-later
0007 */
0008 
0009 #include "kwindowsystem.h"
0010 #include "kwindowinfo_mac_p.h"
0011 
0012 #include <KXErrorHandler>
0013 #include <QBitmap>
0014 #include <QDebug>
0015 #include <QDesktopWidget>
0016 #include <QDialog>
0017 
0018 #include <Carbon/Carbon.h>
0019 
0020 // Uncomment the following line to enable the experimental (and not fully functional) window tracking code. Without this
0021 // only the processes/applications are tracked, not the individual windows. This currently is quite broken as I can't
0022 // seem to be able to convince the build system to generate a mov file from both the public header file, and also for this
0023 // private class
0024 // #define EXPERIMENTAL_WINDOW_TRACKING
0025 
0026 static bool operator<(const ProcessSerialNumber &a, const ProcessSerialNumber &b)
0027 {
0028     if (a.lowLongOfPSN != b.lowLongOfPSN) {
0029         return a.lowLongOfPSN < b.lowLongOfPSN;
0030     }
0031     return a.highLongOfPSN < b.highLongOfPSN;
0032 }
0033 
0034 class KWindowSystemPrivate : QObject
0035 {
0036 #ifdef EXPERIMENTAL_WINDOW_TRACKING
0037     Q_OBJECT
0038 #endif
0039 public:
0040     KWindowSystemPrivate();
0041 
0042     QMap<WId, KWindowInfo> windows;
0043     QList<WId> winids; // bah, because KWindowSystem::windows() returns a const reference, we need to keep this separate...
0044     QMap<pid_t, AXObserverRef> newWindowObservers;
0045     QMap<pid_t, AXObserverRef> windowClosedObservers;
0046     QMap<ProcessSerialNumber, WId> processes;
0047 #ifdef EXPERIMENTAL_WINDOW_TRACKING
0048     QList<KWindowInfo> nonProcessedWindows;
0049 #endif
0050 
0051     EventTargetRef m_eventTarget;
0052     EventHandlerUPP m_eventHandler;
0053     EventTypeSpec m_eventType[2];
0054     EventHandlerRef m_curHandler;
0055 
0056     void applicationLaunched(const ProcessSerialNumber &psn);
0057     void applicationTerminated(const ProcessSerialNumber &psn);
0058 
0059     bool m_noEmit;
0060     bool waitingForTimer;
0061 
0062 #ifdef EXPERIMENTAL_WINDOW_TRACKING
0063     void newWindow(AXUIElementRef element, void *windowInfoPrivate);
0064     void windowClosed(AXUIElementRef element, void *windowInfoPrivate);
0065 #endif
0066 
0067     static KWindowSystemPrivate *self()
0068     {
0069         return KWindowSystem::s_d_func();
0070     }
0071 #ifdef EXPERIMENTAL_WINDOW_TRACKING
0072 public Q_SLOTS:
0073     void tryRegisterProcess();
0074 #endif
0075 };
0076 
0077 class KWindowSystemStaticContainer
0078 {
0079 public:
0080     KWindowSystemStaticContainer()
0081         : d(new KWindowSystemPrivate)
0082     {
0083     }
0084     KWindowSystem kwm;
0085     KWindowSystemPrivate *d;
0086 };
0087 
0088 KWINDOWSYSTEM_GLOBAL_STATIC(KWindowSystemStaticContainer, g_kwmInstanceContainer)
0089 
0090 static OSStatus applicationEventHandler(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData)
0091 {
0092     KWindowSystemPrivate *d = (KWindowSystemPrivate *)inUserData;
0093 
0094     UInt32 kind;
0095 
0096     kind = GetEventKind(inEvent);
0097     ProcessSerialNumber psn;
0098     if (GetEventParameter(inEvent, kEventParamProcessID, typeProcessSerialNumber, nullptr, sizeof psn, nullptr, &psn) != noErr) {
0099         kWarning() << "Error getting event parameter in application event";
0100         return eventNotHandledErr;
0101     }
0102 
0103     if (kind == kEventAppLaunched) {
0104         d->applicationLaunched(psn);
0105     } else if (kind == kEventAppTerminated) {
0106         d->applicationTerminated(psn);
0107     }
0108 
0109     return noErr;
0110 }
0111 
0112 #ifdef EXPERIMENTAL_WINDOW_TRACKING
0113 static void windowClosedObserver(AXObserverRef observer, AXUIElementRef element, CFStringRef notification, void *refcon)
0114 {
0115     KWindowSystemPrivate::self()->windowClosed(element, refcon);
0116 }
0117 
0118 static void newWindowObserver(AXObserverRef observer, AXUIElementRef element, CFStringRef notification, void *refcon)
0119 {
0120     KWindowSystemPrivate::self()->newWindow(element, refcon);
0121 }
0122 #endif
0123 
0124 KWindowSystemPrivate::KWindowSystemPrivate()
0125     : QObject(0)
0126     , m_noEmit(true)
0127     , waitingForTimer(false)
0128 {
0129     // find all existing windows
0130     ProcessSerialNumber psn = {0, kNoProcess};
0131     while (GetNextProcess(&psn) == noErr) {
0132         qDebug() << "calling appLaunched for " << psn.lowLongOfPSN << ":" << psn.highLongOfPSN;
0133         applicationLaunched(psn);
0134     }
0135 
0136     m_noEmit = false;
0137 
0138 #ifdef Q_OS_MAC32
0139     // register callbacks for application launches/quits
0140     m_eventTarget = GetApplicationEventTarget();
0141     m_eventHandler = NewEventHandlerUPP(applicationEventHandler);
0142     m_eventType[0].eventClass = kEventClassApplication;
0143     m_eventType[0].eventKind = kEventAppLaunched;
0144     m_eventType[1].eventClass = kEventClassApplication;
0145     m_eventType[1].eventKind = kEventAppTerminated;
0146     if (InstallEventHandler(m_eventTarget, m_eventHandler, 2, m_eventType, this, &m_curHandler) != noErr) {
0147         qDebug() << "Installing event handler failed!\n";
0148     }
0149 #else
0150 #warning port me to Mac64
0151 #endif
0152 }
0153 
0154 void KWindowSystemPrivate::applicationLaunched(const ProcessSerialNumber &psn)
0155 {
0156 #ifdef Q_OS_MAC32
0157     qDebug() << "new app: " << psn.lowLongOfPSN << ":" << psn.highLongOfPSN;
0158     ProcessInfoRec pinfo;
0159     FSSpec appSpec;
0160     pinfo.processInfoLength = sizeof pinfo;
0161     pinfo.processName = 0;
0162     pinfo.processAppSpec = &appSpec;
0163     GetProcessInformation(&psn, &pinfo);
0164     if ((pinfo.processMode & modeOnlyBackground) != 0) {
0165         return;
0166     }
0167     // found a process, create a pseudo-window for it
0168 
0169     KWindowInfo winfo(0, 0);
0170     windows[winfo.win()] = winfo;
0171     winids.append(winfo.win());
0172     winfo.d->setProcessSerialNumber(psn);
0173     pid_t pid = winfo.d->pid();
0174     processes[psn] = winfo.win();
0175     qDebug() << "  pid:" << pid;
0176     AXUIElementRef app = AXUIElementCreateApplication(pid);
0177     winfo.d->setAxElement(app);
0178     if (!m_noEmit) {
0179         Q_EMIT KWindowSystem::self()->windowAdded(winfo.win());
0180     }
0181 
0182 #ifdef EXPERIMENTAL_WINDOW_TRACKING
0183     // create an observer and listen for new window events
0184     AXObserverRef observer, newObserver;
0185     OSStatus err;
0186     if (AXObserverCreate(pid, windowClosedObserver, &observer) == noErr) {
0187         CFRunLoopAddSource(CFRunLoopGetCurrent(), AXObserverGetRunLoopSource(observer), kCFRunLoopCommonModes);
0188         windowClosedObservers[pid] = observer;
0189     }
0190     if ((err = AXObserverCreate(pid, newWindowObserver, &newObserver)) == noErr) {
0191         CFRunLoopAddSource(CFRunLoopGetCurrent(), AXObserverGetRunLoopSource(newObserver), kCFRunLoopCommonModes);
0192         newWindowObservers[pid] = newObserver;
0193         if ((err = AXObserverAddNotification(newObserver, app, kAXWindowCreatedNotification, winfo.d)) != noErr) {
0194             qDebug() << "Error " << err << " adding notification to observer";
0195             // adding notifier failed, apparently app isn't responding to accesability messages yet
0196             // try it one more time later, and for now just return
0197             QTimer::singleShot(500, this, SLOT(tryRegisterProcess()));
0198             nonProcessedWindows.append(winfo);
0199             return;
0200         } else {
0201             qDebug() << "Added notification and observer";
0202         }
0203     } else {
0204         qDebug() << "Error creating observer";
0205     }
0206 
0207     CFIndex windowsInApp;
0208     AXUIElementGetAttributeValueCount(app, kAXWindowsAttribute, &windowsInApp);
0209     CFArrayRef array;
0210     AXUIElementCopyAttributeValue(app, kAXWindowsAttribute, (CFTypeRef *)&array);
0211     for (CFIndex j = 0; j < windowsInApp; j++) {
0212         AXUIElementRef win = (AXUIElementRef)CFArrayGetValueAtIndex(array, j);
0213         newWindow(win, winfo.d);
0214     }
0215 #endif
0216 #else
0217 #warning Port me to Mac64
0218 #endif
0219 }
0220 
0221 #ifdef EXPERIMENTAL_WINDOW_TRACKING
0222 void KWindowSystemPrivate::tryRegisterProcess()
0223 {
0224     qDebug() << "Single-shot timer, trying to register processes";
0225     while (!nonProcessedWindows.empty()) {
0226         KWindowInfo winfo = nonProcessedWindows.takeLast();
0227         pid_t pid = winfo.d->pid();
0228         AXUIElementRef app = winfo.d->axElement();
0229         ProcessSerialNumber psn = winfo.d->psn();
0230 
0231         // create an observer and listen for new window events
0232         AXObserverRef observer;
0233         OSStatus err;
0234         observer = newWindowObservers[pid];
0235         if ((err = AXObserverAddNotification(observer, app, kAXWindowCreatedNotification, winfo.d)) != noErr) {
0236             qDebug() << "Error " << err << " adding notification to observer";
0237         } else {
0238             qDebug() << "Added notification and observer";
0239         }
0240 
0241         observer = windowClosedObservers[pid];
0242 
0243         CFIndex windowsInApp;
0244         AXUIElementGetAttributeValueCount(app, kAXWindowsAttribute, &windowsInApp);
0245         CFArrayRef array;
0246         AXUIElementCopyAttributeValue(app, kAXWindowsAttribute, (CFTypeRef *)&array);
0247         for (CFIndex j = 0; j < windowsInApp; j++) {
0248             AXUIElementRef win = (AXUIElementRef)CFArrayGetValueAtIndex(array, j);
0249             newWindow(win, winfo.d);
0250         }
0251     }
0252 }
0253 #endif
0254 
0255 void KWindowSystemPrivate::applicationTerminated(const ProcessSerialNumber &psn)
0256 {
0257     qDebug() << "Terminated PSN: " << psn.lowLongOfPSN << ":" << psn.highLongOfPSN;
0258     WId id = processes[psn];
0259     if (windows.contains(id)) {
0260         KWindowInfo winfo = windows[id];
0261         foreach (KWindowInfo::Private *wi, winfo.d->children) {
0262             winids.removeAll(wi->win);
0263             Q_EMIT KWindowSystem::self()->windowRemoved(wi->win);
0264         }
0265         winids.removeAll(id);
0266         Q_EMIT KWindowSystem::self()->windowRemoved(winfo.win());
0267     }
0268 }
0269 
0270 #ifdef EXPERIMENTAL_WINDOW_TRACKING
0271 void KWindowSystemPrivate::windowClosed(AXUIElementRef element, void *refcon)
0272 {
0273     qDebug() << "Received window closed notification";
0274 
0275     KWindowInfo::Private *wind = (KWindowInfo::Private *)refcon; // window being closed
0276     KWindowInfo::Private *parent = wind->parent;
0277     parent->children.removeAll(wind);
0278     winids.removeAll(wind->win);
0279     if (!m_noEmit) {
0280         Q_EMIT KWindowSystem::self()->windowRemoved(wind->win);
0281     }
0282 }
0283 
0284 void KWindowSystemPrivate::newWindow(AXUIElementRef win, void *refcon)
0285 {
0286     qDebug() << "Received new window notification";
0287 
0288     KWindowInfo::Private *winfod = (KWindowInfo::Private *)refcon;
0289     pid_t pid = winfod->pid();
0290     ProcessSerialNumber psn = winfod->psn();
0291     AXObserverRef observer = windowClosedObservers[pid];
0292 
0293     KWindowInfo win2(0, 0);
0294     // listen for closed events for this window
0295     if (AXObserverAddNotification(observer, win, kAXUIElementDestroyedNotification, win2.d) != noErr) {
0296         // when we can't receive close events, the window should not be added
0297         qDebug() "error adding closed observer to window.";
0298         return;
0299     }
0300 
0301     windows[win2.win()] = win2;
0302     winids.append(win2.win());
0303     win2.d->setProcessSerialNumber(psn);
0304     win2.d->setAxElement(win);
0305     winfod->children.append(win2.d);
0306     win2.d->parent = winfod;
0307     if (!m_noEmit) {
0308         Q_EMIT KWindowSystem::self()->windowAdded(win2.win());
0309     }
0310 }
0311 #endif
0312 
0313 KWindowSystem *KWindowSystem::self()
0314 {
0315     return &(g_kwmInstanceContainer->kwm);
0316 }
0317 
0318 KWindowSystemPrivate *KWindowSystem::s_d_func()
0319 {
0320     return g_kwmInstanceContainer->d;
0321 }
0322 
0323 const QList<WId> &KWindowSystem::windows()
0324 {
0325     KWindowSystemPrivate *d = KWindowSystem::s_d_func();
0326     return d->winids;
0327 }
0328 
0329 bool KWindowSystem::hasWId(WId id)
0330 {
0331     KWindowSystemPrivate *d = KWindowSystem::s_d_func();
0332     return d->windows.contains(id);
0333 }
0334 
0335 #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 0)
0336 KWindowInfo KWindowSystem::windowInfo(WId win, unsigned long properties, unsigned long properties2)
0337 {
0338     KWindowSystemPrivate *d = KWindowSystem::s_d_func();
0339     if (d->windows.contains(win)) {
0340         return d->windows[win];
0341     } else {
0342         return KWindowInfo(win, properties, properties2);
0343     }
0344 }
0345 #endif
0346 
0347 QList<WId> KWindowSystem::stackingOrder()
0348 {
0349     // TODO
0350     QList<WId> lst;
0351     qDebug() << "QList<WId> KWindowSystem::stackingOrder() isn't yet implemented!";
0352     return lst;
0353 }
0354 
0355 WId KWindowSystem::activeWindow()
0356 {
0357     // return something
0358     qDebug() << "WId KWindowSystem::activeWindow()   isn't yet implemented!";
0359     return 0;
0360 }
0361 
0362 void KWindowSystem::activateWindow(WId win, long time)
0363 {
0364     // TODO
0365     qDebug() << "KWindowSystem::activateWindow( WId win, long time )isn't yet implemented!";
0366     KWindowSystemPrivate *d = KWindowSystem::s_d_func();
0367     if (d->windows.contains(win)) {
0368         ProcessSerialNumber psn = d->windows[win].d->psn();
0369         SetFrontProcess(&psn);
0370     }
0371 }
0372 
0373 void KWindowSystem::forceActiveWindow(WId win, long time)
0374 {
0375     // TODO
0376     qDebug() << "KWindowSystem::forceActiveWindow( WId win, long time ) isn't yet implemented!";
0377     activateWindow(win, time);
0378 }
0379 
0380 #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 101)
0381 void KWindowSystem::demandAttention(WId win, bool set)
0382 {
0383     // TODO
0384     qDebug() << "KWindowSystem::demandAttention( WId win, bool set ) isn't yet implemented!";
0385 }
0386 #endif
0387 
0388 bool KWindowSystem::compositingActive()
0389 {
0390     return true;
0391 }
0392 
0393 int KWindowSystem::currentDesktop()
0394 {
0395     return 1;
0396 }
0397 
0398 int KWindowSystem::numberOfDesktops()
0399 {
0400     return 1;
0401 }
0402 
0403 void KWindowSystem::setCurrentDesktop(int desktop)
0404 {
0405     qDebug() << "KWindowSystem::setCurrentDesktop( int desktop ) isn't yet implemented!";
0406     // TODO
0407 }
0408 
0409 void KWindowSystem::setOnAllDesktops(WId win, bool b)
0410 {
0411     qDebug() << "KWindowSystem::setOnAllDesktops( WId win, bool b ) isn't yet implemented!";
0412     // TODO
0413 }
0414 
0415 void KWindowSystem::setOnDesktop(WId win, int desktop)
0416 {
0417     // TODO
0418     qDebug() << "KWindowSystem::setOnDesktop( WId win, int desktop ) isn't yet implemented!";
0419 }
0420 
0421 void KWindowSystem::setMainWindow(QWidget *subwindow, WId id)
0422 {
0423     qDebug() << "KWindowSystem::setMainWindow( QWidget*, WId ) isn't yet implemented!";
0424     // TODO
0425 }
0426 
0427 QPixmap KWindowSystem::icon(WId win, int width, int height, bool scale)
0428 {
0429     if (hasWId(win)) {
0430         KWindowInfo info = windowInfo(win, 0);
0431         if (!info.d->loadedData) {
0432             info.d->updateData();
0433         }
0434         IconRef icon;
0435         SInt16 label;
0436 #ifdef Q_OS_MAC32
0437         OSErr err = GetIconRefFromFile(&info.d->iconSpec, &icon, &label);
0438 #else
0439         OSStatus err = GetIconRefFromFileInfo(&info.d->iconSpec, 0, 0, kIconServicesCatalogInfoMask, 0, kIconServicesNormalUsageFlag, &icon, &label);
0440 #endif
0441         if (err != noErr) {
0442             qDebug() << "Error getting icon from application";
0443             return QPixmap();
0444         } else {
0445             QPixmap ret(width, height);
0446             ret.fill(QColor(0, 0, 0, 0));
0447 
0448             CGRect rect = CGRectMake(0, 0, width, height);
0449 
0450             CGContextRef ctx = qt_mac_cg_context(&ret);
0451             CGAffineTransform old_xform = CGContextGetCTM(ctx);
0452             CGContextConcatCTM(ctx, CGAffineTransformInvert(old_xform));
0453             CGContextConcatCTM(ctx, CGAffineTransformIdentity);
0454 
0455             ::RGBColor b;
0456             b.blue = b.green = b.red = 255 * 255;
0457             PlotIconRefInContext(ctx, &rect, kAlignNone, kTransformNone, &b, kPlotIconRefNormalFlags, icon);
0458             CGContextRelease(ctx);
0459 
0460             ReleaseIconRef(icon);
0461             return ret;
0462         }
0463     } else {
0464         qDebug() << "QPixmap KWindowSystem::icon( WId win, int width, int height, bool scale ) isn't yet implemented for local windows!";
0465         return QPixmap();
0466     }
0467 }
0468 
0469 QPixmap KWindowSystem::icon(WId win, int width, int height, bool scale, int flags)
0470 {
0471     return icon(win, width, height, scale);
0472     //    qDebug() << "QPixmap KWindowSystem::icon( WId win, int width, int height, bool scale, int flags ) isn't yet implemented!";
0473 }
0474 
0475 #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 101)
0476 void KWindowSystem::setIcons(WId win, const QPixmap &icon, const QPixmap &miniIcon)
0477 {
0478     // TODO
0479     qDebug() << "KWindowSystem::setIcons( WId win, const QPixmap& icon, const QPixmap& miniIcon ) isn't yet implemented!";
0480 }
0481 #endif
0482 
0483 void KWindowSystem::setType(WId winid, NET::WindowType windowType)
0484 {
0485 #ifdef Q_OS_MAC32
0486     // not supported for 'global' windows; only for windows in the current process
0487     if (hasWId(winid)) {
0488         return;
0489     }
0490 
0491     static WindowGroupRef desktopGroup = 0;
0492     static WindowGroupRef dockGroup = 0;
0493 
0494     WindowRef win = HIViewGetWindow((HIViewRef)winid);
0495     // TODO: implement other types than Desktop and Dock
0496     if (windowType != NET::Desktop && windowType != NET::Dock) {
0497         qDebug() << "setType( WId win, NET::WindowType windowType ) isn't yet implemented for the type you requested!";
0498     }
0499     if (windowType == NET::Desktop) {
0500         if (!desktopGroup) {
0501             CreateWindowGroup(0, &desktopGroup);
0502             SetWindowGroupLevel(desktopGroup, kCGDesktopIconWindowLevel);
0503         }
0504         SetWindowGroup(win, desktopGroup);
0505     } else if (windowType == NET::Dock) {
0506         if (!dockGroup) {
0507             CreateWindowGroup(0, &dockGroup);
0508             SetWindowGroupLevel(dockGroup, kCGDockWindowLevel);
0509         }
0510         SetWindowGroup(win, dockGroup);
0511         ChangeWindowAttributes(win, kWindowNoTitleBarAttribute, kWindowNoAttributes);
0512     }
0513 #else
0514 #warning port me to Mac64
0515 #endif
0516 }
0517 
0518 void KWindowSystem::setState(WId win, NET::States state)
0519 {
0520     // TODO
0521     qDebug() << "KWindowSystem::setState( WId win, unsigned long state ) isn't yet implemented!";
0522 }
0523 
0524 void KWindowSystem::clearState(WId win, NET::States state)
0525 {
0526     // TODO
0527     qDebug() << "KWindowSystem::clearState( WId win, unsigned long state ) isn't yet implemented!";
0528 }
0529 
0530 void KWindowSystem::minimizeWindow(WId win, bool animation)
0531 {
0532     // TODO
0533     qDebug() << "KWindowSystem::minimizeWindow( WId win, bool animation) isn't yet implemented!";
0534 }
0535 
0536 void KWindowSystem::unminimizeWindow(WId win, bool animation)
0537 {
0538     // TODO
0539     qDebug() << "KWindowSystem::unminimizeWindow( WId win, bool animation ) isn't yet implemented!";
0540 }
0541 
0542 void KWindowSystem::raiseWindow(WId win)
0543 {
0544     // TODO
0545     qDebug() << "KWindowSystem::raiseWindow( WId win ) isn't yet implemented!";
0546 }
0547 
0548 void KWindowSystem::lowerWindow(WId win)
0549 {
0550     // TODO
0551     qDebug() << "KWindowSystem::lowerWindow( WId win ) isn't yet implemented!";
0552 }
0553 
0554 bool KWindowSystem::icccmCompliantMappingState()
0555 {
0556     return false;
0557 }
0558 
0559 QRect KWindowSystem::workArea(int desktop)
0560 {
0561     // TODO
0562     qDebug() << "QRect KWindowSystem::workArea( int desktop ) isn't yet implemented!";
0563     return QRect();
0564 }
0565 
0566 QRect KWindowSystem::workArea(const QList<WId> &exclude, int desktop)
0567 {
0568     // TODO
0569     qDebug() << "QRect KWindowSystem::workArea( const QList<WId>& exclude, int desktop ) isn't yet implemented!";
0570     return QRect();
0571 }
0572 
0573 QString KWindowSystem::desktopName(int desktop)
0574 {
0575     return tr("Desktop %1").arg(desktop);
0576 }
0577 
0578 void KWindowSystem::setDesktopName(int desktop, const QString &name)
0579 {
0580     qDebug() << "KWindowSystem::setDesktopName( int desktop, const QString& name ) isn't yet implemented!";
0581     // TODO
0582 }
0583 
0584 bool KWindowSystem::showingDesktop()
0585 {
0586     return false;
0587 }
0588 
0589 void KWindowSystem::setUserTime(WId win, long time)
0590 {
0591     qDebug() << "KWindowSystem::setUserTime( WId win, long time ) isn't yet implemented!";
0592     // TODO
0593 }
0594 
0595 void KWindowSystem::setExtendedStrut(WId win,
0596                                      int left_width,
0597                                      int left_start,
0598                                      int left_end,
0599                                      int right_width,
0600                                      int right_start,
0601                                      int right_end,
0602                                      int top_width,
0603                                      int top_start,
0604                                      int top_end,
0605                                      int bottom_width,
0606                                      int bottom_start,
0607                                      int bottom_end)
0608 {
0609     qDebug() << "KWindowSystem::setExtendedStrut isn't yet implemented!";
0610     // TODO
0611 }
0612 
0613 void KWindowSystem::setStrut(WId win, int left, int right, int top, int bottom)
0614 {
0615     qDebug() << "KWindowSystem::setStrut isn't yet implemented!";
0616     // TODO
0617 }
0618 
0619 bool KWindowSystem::allowedActionsSupported()
0620 {
0621     return false;
0622 }
0623 
0624 QString KWindowSystem::readNameProperty(WId window, unsigned long atom)
0625 {
0626     // TODO
0627     qDebug() << "QString KWindowSystem::readNameProperty( WId window, unsigned long atom ) isn't yet implemented!";
0628     return QString();
0629 }
0630 
0631 void KWindowSystem::connectNotify(const char *signal)
0632 {
0633     qDebug() << "connectNotify( const char* signal )  isn't yet implemented!";
0634     // TODO
0635 }
0636 
0637 void KWindowSystem::allowExternalProcessWindowActivation(int pid)
0638 {
0639     // Needed on mac ?
0640 }
0641 
0642 void KWindowSystem::setBlockingCompositing(WId window, bool active)
0643 {
0644     // TODO
0645     qDebug() << "setBlockingCompositing( WId window, bool active ) isn't yet implemented!";
0646 }
0647 
0648 #include "moc_kwindowsystem.cpp"