Skip to content

Commit 054312e

Browse files
committed
🪟 | Added some Windows compatibility
1 parent bba7c99 commit 054312e

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

cgo/getDisplays.c

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
#include "checkOS.c"
22
#include <stdio.h>
33

4+
struct DisplayInfo {
5+
int x;
6+
int y;
7+
int w;
8+
int h;
9+
};
10+
11+
static struct DisplayInfo displayInfos[10];
12+
413
#if defined (UNIX)
514
#include <X11/Xlib.h>
615
#include <X11/extensions/Xrandr.h>
716
#include <X11/extensions/randr.h>
817

9-
struct DisplayInfo {
10-
int x;
11-
int y;
12-
int w;
13-
int h;
14-
};
15-
1618
struct DisplayInfo * getDisplays() {
17-
static struct DisplayInfo displayInfos[10];
18-
1919
Display * dpy = XOpenDisplay(NULL);
2020
XRRScreenResources * screen = XRRGetScreenResources(dpy, DefaultRootWindow(dpy));
2121
XRRCrtcInfo * crtcInfo;
@@ -48,16 +48,7 @@
4848

4949
#if defined (WINDOWS)
5050
#include <winuser.h>
51-
#include <stdio.h>
52-
53-
struct DisplayInfo {
54-
int x;
55-
int y;
56-
int w;
57-
int h;
58-
};
5951

60-
static struct DisplayInfo displayInfos[10];
6152
int turns = 0;
6253

6354
BOOL CALLBACK MonitorEnum(HMONITOR hMon, HDC hdc, LPRECT lprc, LPARAM dwData) {

0 commit comments

Comments
 (0)