VirtualBox

Changeset 50662 in vbox


Ignore:
Timestamp:
Mar 3, 2014 10:14:58 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
92593
Message:

Additions/x11/vboxvideo: set a root window property when we do not own the active VT.

Location:
trunk/src/VBox/Additions/x11/vboxvideo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/vboxvideo/undefined

    r49696 r50662  
     1ChangeWindowProperty
     2DeleteProperty
    13DRI2CloseScreen
    24DRI2ScreenInit
     
    1921ShadowFBInit2
    2022VErrorF
     23WindowTable
    2124XNFcalloc
    2225XNFstrdup
     
    97100resVgaShared
    98101screenInfo
     102serverClient
    99103serverGeneration
    100104setenv
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c

    r50569 r50662  
    101101# include "xf86Crtc.h"
    102102# include "xf86Modes.h"
    103 # include <X11/Xatom.h>
    104 #endif
     103#endif
     104
     105/* For setting the root window property. */
     106#include <X11/Xatom.h>
     107#include "property.h"
    105108
    106109#ifdef VBOX_DRI
     
    666669# define SCRNINDEXAPI(pfn) pfn
    667670#endif /* XF86_SCRN_INTERFACE */
     671
     672/** Helper to work round different ways of getting the root window in different
     673 * server versions. */
     674#if defined(XORG_VERSION_CURRENT) && XORG_VERSION_CURRENT < 700000000 \
     675    && XORG_VERSION_CURRENT >= 100900000
     676# define ROOT_WINDOW(pScrn) xf86ScrnToScreen(pScrn)->root
     677#else
     678# define ROOT_WINDOW(pScrn) WindowTable[xf86ScrnToScreen(pScrn)->myNum]
     679#endif
     680
     681/** Helper to work round different prototypes for DeleteProperty in different
     682 * server versions. */
     683#if defined(XORG_VERSION_CURRENT) && XORG_VERSION_CURRENT < 700000000 \
     684    && XORG_VERSION_CURRENT >= 100500000
     685# define DELETE_PROPERTY(client, window, prop) \
     686    DeleteProperty(client, window, prop)
     687#else
     688# define DELETE_PROPERTY(client, window, prop) \
     689    DeleteProperty(window, prop)
     690#endif
    668691
    669692static void setScreenFunctions(ScrnInfoPtr pScrn, xf86ProbeProc pfnProbe)
     
    11811204}
    11821205
     1206/** FEATURE: Set a property on the root window if the server VT is currently
     1207 * switched out.  This should be called from the EnterVT/LeaveVT hooks.
     1208 * TESTING: the feature works if seamless mode and dynamic resizing are
     1209 *   disabled on the host when a VT switch to a text console is done on an old
     1210 *   X11 guest.  When the vboxvideo DDX is running the property created should
     1211 *   exist exactly when the X server is switched out. */
     1212static Bool setVTRootProperty(ScrnInfoPtr pScrn, BOOL fLeave)
     1213{
     1214    Atom propertyName = MakeAtom("XFree86_NO_VT", sizeof("XFree86_NO_VT") - 1,
     1215                                 TRUE);
     1216    int32_t cValue = 0;
     1217    int rc;
     1218
     1219    if (propertyName == BAD_RESOURCE)
     1220        return FALSE;
     1221    rc =   fLeave
     1222         ? ChangeWindowProperty(ROOT_WINDOW(pScrn), propertyName, XA_INTEGER,
     1223                                32, PropModeReplace, 1, &cValue, TRUE)
     1224         : DELETE_PROPERTY(serverClient, ROOT_WINDOW(pScrn), propertyName);
     1225    return rc == Success;
     1226}
     1227
    11831228static Bool VBOXEnterVT(ScrnInfoPtr pScrn)
    11841229{
     
    12091254        return FALSE;
    12101255#endif
     1256    setVTRootProperty(pScrn, FALSE);
    12111257    return TRUE;
    12121258}
     
    12301276#endif
    12311277        VBOXRestoreMode(pScrn);
     1278    setVTRootProperty(pScrn, TRUE);
    12321279    TRACE_EXIT();
    12331280}
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