VirtualBox

Ignore:
Timestamp:
Aug 7, 2014 1:43:32 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: use the X11 EWMH protocol _NET_WM_FULLSCREEN_MONITORS to manage multi-monitor full-screen.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
3 edited

Legend:

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

    r52221 r52313  
    46624662}
    46634663
     4664bool VBoxGlobal::setFullScreenMonitorX11(QWidget *pWidget,
     4665                                         unsigned long cScreen)
     4666{
     4667    return XXSendClientMessage(pWidget->x11Info().display(),
     4668                               pWidget->window()->winId(),
     4669                               "_NET_WM_FULLSCREEN_MONITORS", cScreen, cScreen,
     4670                               cScreen, cScreen, 1
     4671                               /* Source indication (1 = normal application) */
     4672                              );
     4673}
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r52203 r52313  
    120120    bool switchToMachine(CMachine &machine);
    121121    bool launchMachine(CMachine &machine, bool fHeadless = false);
     122    bool setFullScreenMonitorX11(QWidget *pWidget, unsigned long cScreen);
     123
    122124
    123125    bool isVMConsoleProcess() const { return !vmUuid.isNull(); }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r52300 r52313  
    296296        setGeometry(geo);
    297297    }
    298 #else /* !Q_WS_MAC */
     298#elif defined(Q_WS_WIN)
    299299    /* Resize to the appropriate size: */
    300300    resize(workingArea.size());
     301#elif defined(Q_WS_X11)
     302    /* Any more-or-less modern window manager provides special mechanisms for
     303     * multi-monitor resizing.  We may fail on very old ones, but since we
     304     * do not test them I prefer not to write speculative code to make them
     305     * work. */
    301306#endif /* !Q_WS_MAC */
    302307    /* Adjust guest screen size if necessary: */
     
    327332
    328333    /* Make sure this window is maximized and placed on valid screen: */
     334    /** @todo Only needed for legacy window managers on X11 which we do not
     335     *        test; therefore this may not help there.  Better to just refuse
     336     *        to support them? */
    329337    placeOnScreen();
    330338
     
    340348
    341349#ifdef Q_WS_X11
    342     /* Make sure the window is placed on valid screen again
    343      * after window is shown & window's decorations applied.
    344      * That is required (still?) due to X11 Window Geometry Rules. */
    345     placeOnScreen();
     350    /* This tells recent window managers which screen(s) a window should be
     351     * mapped to.  Apparently some window managers will not respond to requests
     352     * for unmapped windows, so do this after the call to showFullScreen(). */
     353    vboxGlobal().setFullScreenMonitorX11(this, pFullscreenLogic
     354                                                  ->hostScreenForGuestScreen
     355                                                      (m_uScreenId));
    346356#endif /* Q_WS_X11 */
    347357}
Note: See TracChangeset for help on using the changeset viewer.

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