VirtualBox

Changeset 83045 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Feb 11, 2020 12:31:53 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
136075
Message:

bugref:9637. Some build fix to make our GA build box happy

Location:
trunk/src/VBox/Additions/x11/VBoxClient
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/display-svga-x11.cpp

    r83039 r83045  
    5454#define VMW_MAX_HEADS 32
    5555
    56 /* VMWare X.Org driver control parts definitions. */
    57 
    58 #include <X11/Xlibint.h>
    59 #include <X11/extensions/Xrandr.h>
     56#include "seamless-x11.h"
    6057
    6158#ifdef RT_OS_LINUX
  • trunk/src/VBox/Additions/x11/VBoxClient/seamless-x11.cpp

    r82968 r83045  
    2626#include <VBox/log.h>
    2727
     28#include <X11/Xatom.h>
     29#include <X11/Xmu/WinUtil.h>
     30
    2831#include "seamless-x11.h"
    2932#include "VBoxClient.h"
    30 
    31 #include <X11/Xatom.h>
    32 #include <X11/Xmu/WinUtil.h>
    3333
    3434#include <limits.h>
     
    9090        return VERR_ACCESS_DENIED;
    9191    }
     92
     93    mRandRMask = 0;
     94    mRandRAvailable = false;
     95    if (XRRQueryExtension(mDisplay, &mRandREventBase, &mRandRErrorBase))
     96    {
     97        int iRandRMajor = 0;
     98        int iRandRMinor = 0;
     99        if (XRRQueryVersion(mDisplay, &iRandRMajor, &iRandRMinor))
     100        {
     101            mRandRAvailable = true;
     102            mRandRMask = RRScreenChangeNotifyMask;
     103            if (iRandRMinor >= 2)
     104                mRandRMask |=  RRCrtcChangeNotifyMask |
     105                    RROutputChangeNotifyMask |
     106                    RROutputPropertyNotifyMask;
     107        }
     108    }
    92109    mHostCallback = pHostCallback;
    93110    mEnabled = false;
     
    145162    LogRelFlowFuncEnter();
    146163    XSelectInput(mDisplay, DefaultRootWindow(mDisplay), PropertyChangeMask);
     164}
     165
     166void SeamlessX11::monitorRandREvents(XEvent *pEvent)
     167{
     168    if (!pEvent)
     169        return;
     170    int eventTypeOffset = pEvent->type - mRandREventBase;
     171    switch (eventTypeOffset)
     172    {
     173        case RRScreenChangeNotify:
     174            VBClLogError("RRScreenChangeNotify\n");
     175            break;
     176        case RRNotify:
     177            VBClLogError("RRNotify\n");
     178            break;
     179        default:
     180            VBClLogError("Unknown RR event\n");
     181            break;
     182    }
    147183}
    148184
     
    305341
    306342    LogRelFlowFuncEnter();
     343
     344    /* We execute this even when seamless is disabled, as it also waits for
     345     * enable and disable notification. */
     346    XNextEvent(mDisplay, &event);
     347    monitorRandREvents(&event);
    307348    /* Start by sending information about the current window setup to the host.  We do this
    308349       here because we want to send all such information from a single thread. */
     
    313354    }
    314355    mChanged = false;
    315     /* We execute this even when seamless is disabled, as it also waits for
    316      * enable and disable notification. */
    317     XNextEvent(mDisplay, &event);
    318356    if (!mEnabled)
    319357        return;
  • trunk/src/VBox/Additions/x11/VBoxClient/seamless-x11.h

    r82968 r83045  
    3131#include <X11/Xlib.h>
    3232#include <X11/Xutil.h>
     33#include <X11/Xlibint.h>
    3334#include <X11/extensions/shape.h>
     35#include <X11/extensions/Xrandr.h>
    3436
    3537#define WM_TYPE_PROP "_NET_WM_WINDOW_TYPE"
     
    3840/* This is defined wrong in my X11 header files! */
    3941#define VBoxShapeNotify 64
     42
     43/** Following are stolen from randr.h Define XrandR stuff of they are not there (some ancient build box maybe). */
     44
     45/* Event selection bits */
     46#ifndef RRScreenChangeNotifyMask
     47#define RRScreenChangeNotifyMask  (1L << 0)
     48#endif
     49/* V1.2 additions */
     50#ifndef RRCrtcChangeNotifyMask
     51#define RRCrtcChangeNotifyMask      (1L << 1)
     52#endif
     53#ifndef RROutputChangeNotifyMask
     54#define RROutputChangeNotifyMask    (1L << 2)
     55#endif
     56
     57#ifndef RROutputPropertyNotifyMask
     58#define RROutputPropertyNotifyMask  (1L << 3)
     59#endif
     60
     61/* V1.4 additions */
     62#ifndef RRProviderChangeNotifyMask
     63#define RRProviderChangeNotifyMask   (1L << 4)
     64#endif
     65
     66#ifndef RRProviderPropertyNotifyMask
     67#define RRProviderPropertyNotifyMask (1L << 5)
     68#endif
     69
     70#ifndef RRResourceChangeNotifyMask
     71#define RRResourceChangeNotifyMask   (1L << 6)
     72#endif
     73
     74#ifndef RRScreenChangeNotify
     75/* Event codes */
     76#define RRScreenChangeNotify    0
     77#endif
     78#ifndef RRNotify
     79/* V1.2 additions */
     80#define RRNotify 1
     81#endif
    4082
    4183/**
     
    190232    /** Have there been changes since the last time we sent a notification? */
    191233    bool mChanged;
     234    /** Event mask we use to select randr related events. */
     235    int  mRandRMask;
     236    int  mRandREventBase;
     237    int  mRandRErrorBase;
     238    bool mRandRAvailable;
    192239
    193240    // Private methods
     
    204251    void monitorClientList(void);
    205252    void unmonitorClientList(void);
     253    void monitorRandREvents(XEvent *pEvent);
    206254    void rebuildWindowTree(void);
    207255    void addClients(const Window hRoot);
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