VirtualBox

Ignore:
Timestamp:
Sep 18, 2014 1:30:26 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
96168
Message:

FE/Qt: X11: Removed old work-around code which preventing window translucency from working.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/main.cpp

    r52733 r52784  
    359359        qInstallMsgHandler(QtMessageOutput);
    360360
    361 #ifdef Q_WS_X11
    362         /* Qt has a complex algorithm for selecting the right visual which
    363          * doesn't always seem to work. So we naively choose a visual - the
    364          * default one - ourselves and pass that to Qt. This means that we
    365          * also have to open the display ourselves.
    366          * We check the Qt parameter list and handle Qt's -display argument
    367          * ourselves, since we open the display connection. We also check the
    368          * to see if the user has passed Qt's -visual parameter, and if so we
    369          * assume that the user wants Qt to handle visual selection after all,
    370          * and don't supply a visual. */
    371         char *pszDisplay = NULL;
    372         bool useDefaultVisual = true;
    373         for (int i = 0; i < argc; ++i)
    374         {
    375             if (!::strcmp(argv[i], "-display") && (i + 1 < argc))
    376             /* What if it isn't? Rely on QApplication to complain? */
    377             {
    378                 pszDisplay = argv[i + 1];
    379                 ++i;
    380             }
    381             else if (!::strcmp(argv[i], "-visual"))
    382                 useDefaultVisual = false;
    383         }
    384         Display *pDisplay = XOpenDisplay(pszDisplay);
    385         if (!pDisplay)
    386         {
    387             RTPrintf(pszDisplay ? "Failed to open the X11 display \"%s\"!\n"
    388                                 : "Failed to open the X11 display!\n",
    389                      pszDisplay);
    390             break;
    391         }
    392         Visual *pVisual =   useDefaultVisual
    393                           ? DefaultVisual(pDisplay, DefaultScreen(pDisplay))
    394                           : NULL;
    395         /* Now create the application object: */
    396         QApplication a(pDisplay, argc, argv, (Qt::HANDLE)pVisual);
    397 #else /* Q_WS_X11 */
     361        /* Create application: */
    398362        QApplication a(argc, argv);
    399 #endif /* Q_WS_X11 */
    400363
    401364#ifdef Q_WS_MAC
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette