diff options
Diffstat (limited to 'xorg-server/hw/xwin/winmonitors.c')
-rw-r--r-- | xorg-server/hw/xwin/winmonitors.c | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/xorg-server/hw/xwin/winmonitors.c b/xorg-server/hw/xwin/winmonitors.c index 63af803d0..876d23437 100644 --- a/xorg-server/hw/xwin/winmonitors.c +++ b/xorg-server/hw/xwin/winmonitors.c @@ -27,8 +27,13 @@ from The Open Group. */ +#ifdef HAVE_XWIN_CONFIG_H +#include <xwin-config.h> +#endif #include "win.h" +#define COMPILE_MULTIMON_STUBS +#include <multimon.h> #include "winmonitors.h" /* @@ -53,30 +58,8 @@ wBOOL CALLBACK getMonitorInfo(HMONITOR hMonitor, HDC hdc, LPRECT rect, LPARAM _d return TRUE; } -typedef wBOOL (*ENUMDISPLAYMONITORSPROC)(HDC,LPCRECT,MONITORENUMPROC,LPARAM); -ENUMDISPLAYMONITORSPROC _EnumDisplayMonitors; - -wBOOL CALLBACK getMonitorInfo(HMONITOR hMonitor, HDC hdc, LPRECT rect, LPARAM _data); - Bool QueryMonitor(int index, struct GetMonitorInfoData *data) { - /* Load EnumDisplayMonitors from DLL */ - HMODULE user32; - FARPROC func; - user32 = LoadLibrary("user32.dll"); - if (user32 == NULL) - { - winW32Error(2, "Could not open user32.dll"); - return FALSE; - } - func = GetProcAddress(user32, "EnumDisplayMonitors"); - if (func == NULL) - { - winW32Error(2, "Could not resolve EnumDisplayMonitors: "); - return FALSE; - } - _EnumDisplayMonitors = (ENUMDISPLAYMONITORSPROC)func; - /* prepare data */ if (data == NULL) return FALSE; @@ -84,9 +67,7 @@ Bool QueryMonitor(int index, struct GetMonitorInfoData *data) data->requestedMonitor = index; /* query information */ - _EnumDisplayMonitors(NULL, NULL, getMonitorInfo, (LPARAM) data); + xEnumDisplayMonitors(NULL, NULL, getMonitorInfo, (LPARAM) data); - /* cleanup */ - FreeLibrary(user32); return TRUE; } |