diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-07-07 18:16:05 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-07-07 18:16:05 +0000 |
commit | a7f577ba24f314d3916cbff9a83fb33ee2d3b202 (patch) | |
tree | 3dcd5b1e16e110e271eafdbb81454c7c5d8e8c2a | |
parent | 9ff53f61bb9bdb6a5edae118ed067e3c636ecaac (diff) | |
download | monitor-edid-a7f577ba24f314d3916cbff9a83fb33ee2d3b202.tar monitor-edid-a7f577ba24f314d3916cbff9a83fb33ee2d3b202.tar.gz monitor-edid-a7f577ba24f314d3916cbff9a83fb33ee2d3b202.tar.bz2 monitor-edid-a7f577ba24f314d3916cbff9a83fb33ee2d3b202.tar.xz monitor-edid-a7f577ba24f314d3916cbff9a83fb33ee2d3b202.zip |
- monitor-get-edid-using-vbe:
o instead of checking vt >= 7 to know if X is running,
check wether $DISPLAY is set
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | monitor-get-edid-using-vbe.c | 6 |
2 files changed, 5 insertions, 3 deletions
@@ -3,6 +3,8 @@ o handle parsing of EDIDs found in "xrandr --prop" or Xorg.log - monitor-get-edid-using-vbe: o fix checking the current vt + o instead of checking vt >= 7 to know if X is running, + check wether $DISPLAY is set Version 2.0 - 8 April 2008 diff --git a/monitor-get-edid-using-vbe.c b/monitor-get-edid-using-vbe.c index 79fb0c3..753b46e 100644 --- a/monitor-get-edid-using-vbe.c +++ b/monitor-get-edid-using-vbe.c @@ -49,12 +49,12 @@ int main(int argc, char **argv) if (!size && try_in_console) { int non_X_console = 1; - int first_X_console = 7; struct vt_stat current; int fd = open("/dev/console", O_RDWR); - if (ioctl(fd, VT_GETSTATE, ¤t) == 0 && - current.v_active >= first_X_console && + if (getenv("DISPLAY") != NULL && + ioctl(fd, VT_GETSTATE, ¤t) == 0 && + current.v_active != non_X_console && ioctl(fd, VT_ACTIVATE, non_X_console) == 0 && ioctl(fd, VT_WAITACTIVE, non_X_console) == 0) { /* retrying */ |