jcs
/wallops
/amendments
/118
util: Add screen_saver_running, to be used later
jcs made amendment 118 2 months ago
--- util.c Wed Aug 28 14:02:32 2024
+++ util.c Tue Sep 17 22:03:26 2024
@@ -1499,6 +1499,19 @@ get_version(bool long_version)
return vers_s;
}
+bool
+screen_saver_running(void)
+{
+ short error;
+ long resp;
+
+ error = Gestalt('SAVR', &resp); /* gestaltScreenSaverAttr */
+ if (error == 0 && (resp & (1 << 1))) /* gestaltSaverAsleep */
+ return true;
+
+ return false;
+}
+
/*
* General Mac-specific GUI functions
*/
--- util.h Wed Sep 11 11:04:45 2024
+++ util.h Fri Sep 13 14:03:05 2024
@@ -195,6 +195,7 @@ void GetSystemSubfolder(OSType folder, bool create, sh
char * gestalt_machine_type(void);
char * get_version(bool long_version);
+bool screen_saver_running(void);
short FontHeight(short font_id, short size);
void DrawGrowIconOnly(WindowPtr win);