You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #include "maindialog.h"
  2. #include <QApplication>
  3. #include <QTextCodec>
  4. #include <QWindow>
  5. #include <QDebug>
  6. #include <QTimer>
  7. int main(int argc, char *argv[])
  8. {
  9. QApplication a(argc, argv);
  10. // QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
  11. // QTextCodec::setCodecForTr(QTextCodec::codecForCStrings());
  12. MainDialog w;
  13. w.show();
  14. // Display *dpy;
  15. // Window rootWindow;
  16. // Window parent;
  17. // Window *children;
  18. // Window *child;
  19. // unsigned long noOfChildren;
  20. // dpy = XOpenDisplay(NULL);
  21. // if (!dpy) {
  22. // return 7;
  23. // }
  24. // rootWindow = RootWindow(dpy, -1);
  25. // children = (Window*)get_client_list(dpy, &noOfChildren);
  26. //// XQueryTree(dpy, rootWindow, &rootWindow, &parent, &children, &noOfChildren);
  27. // for (int i = 0; i < noOfChildren; ++i) {
  28. // char* nameStr;
  29. // XFetchName(dpy, children[i], &nameStr);
  30. // QString name(nameStr);
  31. // XFree(nameStr);
  32. // if (name.startsWith("rdesktop - ")) {
  33. //// if (name.startsWith("robin@gigi-lt1: /tmp")) {
  34. // qDebug() << name;
  35. // QWindow *window = QWindow::fromWinId(children[i]);
  36. // window->setFlags(Qt::FramelessWindowHint);
  37. // QWidget *widget = QWidget::createWindowContainer(window);
  38. //// QEvent e(QEvent::EmbeddingControl);
  39. //// QApplication::sendEvent(widget, &e);
  40. //// widget->show();
  41. //// QTimer* timer = new QTimer(widget);
  42. //// QObject::connect(timer, SIGNAL(timeout()), widget, SLOT(update()));
  43. //// timer->start(100);
  44. // break;
  45. // }
  46. // }
  47. //// QWindow *window = QWindow::fromWinId(0x0340056f);
  48. //// window->setFlags(Qt::FramelessWindowHint);
  49. //// QWidget *widget = QWidget::createWindowContainer(window);
  50. //// QVBoxLayout *layout = new QVBoxLayout(this);
  51. //// layout->addWidget(widget);
  52. //// this->setLayout(layout);
  53. return a.exec();
  54. }