123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #include "maindialog.h"
- #include <QApplication>
- #include <QTextCodec>
- #include <QWindow>
- #include <QDebug>
- #include <QTimer>
-
-
- int main(int argc, char *argv[])
- {
- QApplication a(argc, argv);
- // QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
- // QTextCodec::setCodecForTr(QTextCodec::codecForCStrings());
- MainDialog w;
- w.show();
-
- // Display *dpy;
- // Window rootWindow;
- // Window parent;
- // Window *children;
- // Window *child;
- // unsigned long noOfChildren;
-
- // dpy = XOpenDisplay(NULL);
- // if (!dpy) {
- // return 7;
- // }
- // rootWindow = RootWindow(dpy, -1);
-
-
- // children = (Window*)get_client_list(dpy, &noOfChildren);
-
- //// XQueryTree(dpy, rootWindow, &rootWindow, &parent, &children, &noOfChildren);
- // for (int i = 0; i < noOfChildren; ++i) {
- // char* nameStr;
- // XFetchName(dpy, children[i], &nameStr);
- // QString name(nameStr);
- // XFree(nameStr);
- // if (name.startsWith("rdesktop - ")) {
- //// if (name.startsWith("robin@gigi-lt1: /tmp")) {
- // qDebug() << name;
- // QWindow *window = QWindow::fromWinId(children[i]);
- // window->setFlags(Qt::FramelessWindowHint);
-
- // QWidget *widget = QWidget::createWindowContainer(window);
- //// QEvent e(QEvent::EmbeddingControl);
- //// QApplication::sendEvent(widget, &e);
- //// widget->show();
- //// QTimer* timer = new QTimer(widget);
- //// QObject::connect(timer, SIGNAL(timeout()), widget, SLOT(update()));
- //// timer->start(100);
- // break;
- // }
- // }
-
- //// QWindow *window = QWindow::fromWinId(0x0340056f);
- //// window->setFlags(Qt::FramelessWindowHint);
-
- //// QWidget *widget = QWidget::createWindowContainer(window);
-
- //// QVBoxLayout *layout = new QVBoxLayout(this);
- //// layout->addWidget(widget);
- //// this->setLayout(layout);
-
- return a.exec();
- }
|