Skip to content

Commit 0e457ba

Browse files
jub3iillegalprime
authored andcommitted
improve variable names, move hasDisplayNameChanged reset
1 parent cdbf8df commit 0e457ba

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/xdisplay.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44

55
static Display *mainDisplay = NULL;
66
static int registered = 0;
7-
static char *display_name = ":0.0";
8-
static int display_name_changed = 0;
7+
static char *displayName = ":0.0";
8+
static int hasDisplayNameChanged = 0;
99

1010
Display *XGetMainDisplay(void)
1111
{
12-
/* Close the display if display_name has changed */
13-
if (display_name_changed) {
12+
/* Close the display if displayName has changed */
13+
if (hasDisplayNameChanged) {
1414
XCloseMainDisplay();
15+
hasDisplayNameChanged = 0;
1516
}
16-
display_name_changed = 0;
1717

1818
if (mainDisplay == NULL) {
19-
/* First try the user set display_name */
20-
mainDisplay = XOpenDisplay(display_name);
19+
/* First try the user set displayName */
20+
mainDisplay = XOpenDisplay(displayName);
2121

2222
/* Then try using environment variable DISPLAY */
2323
if (mainDisplay == NULL) {
@@ -45,10 +45,10 @@ void XCloseMainDisplay(void)
4545

4646
char *getXDisplay(void)
4747
{
48-
return display_name;
48+
return displayName;
4949
}
5050

5151
void setXDisplay(char *name) {
52-
display_name = name;
53-
display_name_changed = 1;
52+
displayName = name;
53+
hasDisplayNameChanged = 1;
5454
}

0 commit comments

Comments
 (0)