VirtualBox

Ignore:
Timestamp:
Apr 28, 2020 6:27:44 AM (5 years ago)
Author:
vboxsync
Message:

bugref:9637. Try sleeping before the first resize to avoid races with DE

File:
1 edited

Legend:

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

    r83935 r84025  
    4646#include <stdio.h>
    4747#include <dlfcn.h>
     48/** For sleep(..) */
     49#include <unistd.h>
    4850#include "VBoxClient.h"
    4951
     
    204206  * out of horizontal and vertical resolutions. Replicated here to avoid further
    205207  * dependencies. */
    206 DisplayModeR f86CVTMode(int HDisplay, int VDisplay, float VRefresh, Bool Reduced,
     208DisplayModeR f86CVTMode(int HDisplay, int VDisplay, float VRefresh /* Herz */, Bool Reduced,
    207209            Bool Interlaced)
    208210{
     
    923925    unsigned int iYRes = 0;
    924926    /* Don't care about the output positions for now. */
    925     for (int i = 0; i < VMW_MAX_HEADS; ++i)
     927    for (int i = 0; i < x11Context.hOutputCount; ++i)
    926928    {
    927929        if (!paOutputs[i].fEnabled)
     
    11731175        configureOutput(i, paOutputs);
    11741176    }
    1175 
     1177    XSync(x11Context.pDisplay, False);
     1178#ifdef WITH_DISTRO_XRAND_XINERAMA
     1179    XRRFreeScreenResources(x11Context.pScreenResources);
     1180#else
     1181    if (x11Context.pXRRFreeScreenResources)
     1182        x11Context.pXRRFreeScreenResources(x11Context.pScreenResources);
     1183#endif
    11761184    XUngrabServer(x11Context.pDisplay);
    11771185    XFlush(x11Context.pDisplay);
    1178 
    1179 #ifdef WITH_DISTRO_XRAND_XINERAMA
    1180     XRRFreeScreenResources(x11Context.pScreenResources);
    1181 #else
    1182     if (x11Context.pXRRFreeScreenResources)
    1183         x11Context.pXRRFreeScreenResources(x11Context.pScreenResources);
    1184 #endif
    1185 
    11861186}
    11871187
     
    12041204     * e.g. from before a guest reboot. */
    12051205    bool fAck = false;
    1206 
     1206    bool fFirstRun = true;
    12071207    if (!init())
    12081208        return VINF_SUCCESS;
     
    12661266            }
    12671267            setXrandrTopology(aOutputs);
     1268            /* Wait for some seconds and set toplogy again after the boot. In some desktop environments (cinnamon) where
     1269               DE get into our resizing our first resize is reverted by the DE. Sleeping for some secs. helps. Setting
     1270               topology a 2nd time resolves the black screen I get after resizing.*/
     1271            if (fFirstRun)
     1272            {
     1273                sleep(4);
     1274                setXrandrTopology(aOutputs);
     1275                fFirstRun = false;
     1276            }
    12681277        }
    12691278        do
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