31 lines
568 B
C++
31 lines
568 B
C++
|
|
/* Author: Josh Holtrop
|
|
* DornerWorks screensaver
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include "displayinfo.h"
|
|
#include <X11/Xlib.h>
|
|
|
|
void getDisplaySize(int * width, int * height)
|
|
{
|
|
Display * display;
|
|
if ((display = XOpenDisplay(NULL)) == NULL)
|
|
{
|
|
/* fall back on hard-coded defaults */
|
|
*width = 1600;
|
|
*height = 1200;
|
|
}
|
|
else
|
|
{
|
|
int screen_num = DefaultScreen(display);
|
|
*width = DisplayWidth(display, screen_num);
|
|
*height = DisplayHeight(display, screen_num);
|
|
}
|
|
}
|
|
|
|
int getNumMonitors()
|
|
{
|
|
return 1;
|
|
}
|