VirtualBox

Changeset 97867 in vbox for trunk


Ignore:
Timestamp:
Dec 26, 2022 12:49:40 PM (2 years ago)
Author:
vboxsync
Message:

FE/Qt: X11: A bit of cleanup for bugref:3355 defect.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/platform/x11
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.cpp

    r97849 r97867  
    5151#include <X11/Xutil.h>
    5252#include <X11/extensions/dpms.h>
    53 
    54 /// @todo is it required still?
    55 // WORKAROUND:
    56 // rhel3 build hack
    57 //RT_C_DECLS_BEGIN
    58 //#include <X11/Xlib.h>
    59 //#undef BOOL /* VBox/com/defs.h conflict */
    60 //RT_C_DECLS_END
    6153
    6254
     
    126118}
    127119
    128 #if 0 // unused for now?
    129 static int  gX11ScreenSaverTimeout;
    130 static BOOL gX11ScreenSaverDpmsAvailable;
    131 static BOOL gX11DpmsState;
    132 
    133 void NativeWindowSubsystem::X11ScreenSaverSettingsInit()
    134 {
    135     /* Init screen-save availability: */
    136     Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
    137     int dummy;
    138     gX11ScreenSaverDpmsAvailable = DPMSQueryExtension(pDisplay, &dummy, &dummy);
    139 }
    140 
    141 void NativeWindowSubsystem::X11ScreenSaverSettingsSave()
    142 {
    143     /* Actually this is a big mess. By default the libSDL disables the screen saver
    144      * during the SDL_InitSubSystem() call and restores the saved settings during
    145      * the SDL_QuitSubSystem() call. This mechanism can be disabled by setting the
    146      * environment variable SDL_VIDEO_ALLOW_SCREENSAVER to 1. However, there is a
    147      * known bug in the Debian libSDL: If this environment variable is set, the
    148      * screen saver is still disabled but the old state is not restored during
    149      * SDL_QuitSubSystem()! So the only solution to overcome this problem is to
    150      * save and restore the state prior and after each of these function calls. */
    151 
    152     Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
    153     int dummy;
    154     CARD16 dummy2;
    155     XGetScreenSaver(pDisplay, &gX11ScreenSaverTimeout, &dummy, &dummy, &dummy);
    156     if (gX11ScreenSaverDpmsAvailable)
    157         DPMSInfo(pDisplay, &dummy2, &gX11DpmsState);
    158 }
    159 
    160 void NativeWindowSubsystem::X11ScreenSaverSettingsRestore()
    161 {
    162     /* Restore screen-saver settings: */
    163     Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
    164     int iTimeout, iInterval, iPreferBlank, iAllowExp;
    165     XGetScreenSaver(pDisplay, &iTimeout, &iInterval, &iPreferBlank, &iAllowExp);
    166     iTimeout = gX11ScreenSaverTimeout;
    167     XSetScreenSaver(pDisplay, iTimeout, iInterval, iPreferBlank, iAllowExp);
    168     if (gX11DpmsState && gX11ScreenSaverDpmsAvailable)
    169         DPMSEnable(pDisplay);
    170 }
    171 #endif // unused for now?
    172 
    173120bool NativeWindowSubsystem::X11CheckExtension(const char *pExtensionName)
    174121{
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.h

    r96407 r97867  
    9898    X11WMType X11WindowManagerType();
    9999
    100 #if 0 // unused for now?
    101     /** X11: Inits the screen saver save/restore mechanism. */
    102     SHARED_LIBRARY_STUFF void X11ScreenSaverSettingsInit();
    103     /** X11: Saves screen saver settings. */
    104     SHARED_LIBRARY_STUFF void X11ScreenSaverSettingsSave();
    105     /** X11: Restores previously saved screen saver settings. */
    106     SHARED_LIBRARY_STUFF void X11ScreenSaverSettingsRestore();
    107 #endif // unused for now?
    108 
    109100    /** X11: Returns true if XLib extension with name @p extensionName is avaible, false otherwise. */
    110101    bool X11CheckExtension(const char *extensionName);
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