- Timestamp:
- Dec 26, 2022 12:49:40 PM (2 years ago)
- 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 51 51 #include <X11/Xutil.h> 52 52 #include <X11/extensions/dpms.h> 53 54 /// @todo is it required still?55 // WORKAROUND:56 // rhel3 build hack57 //RT_C_DECLS_BEGIN58 //#include <X11/Xlib.h>59 //#undef BOOL /* VBox/com/defs.h conflict */60 //RT_C_DECLS_END61 53 62 54 … … 126 118 } 127 119 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 saver144 * during the SDL_InitSubSystem() call and restores the saved settings during145 * the SDL_QuitSubSystem() call. This mechanism can be disabled by setting the146 * environment variable SDL_VIDEO_ALLOW_SCREENSAVER to 1. However, there is a147 * known bug in the Debian libSDL: If this environment variable is set, the148 * screen saver is still disabled but the old state is not restored during149 * SDL_QuitSubSystem()! So the only solution to overcome this problem is to150 * 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 173 120 bool NativeWindowSubsystem::X11CheckExtension(const char *pExtensionName) 174 121 { -
trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.h
r96407 r97867 98 98 X11WMType X11WindowManagerType(); 99 99 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 109 100 /** X11: Returns true if XLib extension with name @p extensionName is avaible, false otherwise. */ 110 101 bool X11CheckExtension(const char *extensionName);
Note:
See TracChangeset
for help on using the changeset viewer.