updated patch from reyk@: no need to check for invalid screen dimensions

this is a bug^Wfeature of the radeon driver.
This commit is contained in:
matthieu 2007-01-09 21:49:12 +00:00
parent 115dfa6a0e
commit 3d42cefac4
2 changed files with 8 additions and 12 deletions

View File

@ -1,9 +1,9 @@
XCOMM $OpenBSD: Imakefile,v 1.1.1.1 2006/11/26 10:56:00 matthieu Exp $
XCOMM $OpenBSD: Imakefile,v 1.2 2007/01/09 21:49:12 matthieu Exp $
SRCS = drawing.c dynlist.c resources.c x11-ssh-askpass.c
OBJS = drawing.o dynlist.o resources.o x11-ssh-askpass.o
DEPLIBS = $(DEPXTOOLLIB) $(DEPXLIB)
LOCAL_LIBRARIES = $(XTOOLLIB) $(XLIB)
DEPLIBS = $(DEPXTOOLLIB) $(DEPXLIB) $(DEPXINERAMALIB)
LOCAL_LIBRARIES = $(XTOOLLIB) $(XLIB) $(XINERAMALIB)
NAME = ssh-askpass
CLASS = SshAskpass

View File

@ -1439,7 +1439,7 @@ int main(int argc, char **argv)
AppInfo app;
XEvent event;
XineramaScreenInfo *screens;
int nscreens, i;
int nscreens;
memset(&app, 0, sizeof(app));
@ -1491,14 +1491,10 @@ int main(int argc, char **argv)
app.screen_width = WidthOfScreen(app.screen);
app.screen_height = HeightOfScreen(app.screen);
if (XineramaIsActive(app.dpy) &&
(screens = XineramaQueryScreens(app.dpy, &nscreens)) != NULL) {
for (i = 0; i < nscreens; i++) {
if (!screens[i].width || !screens[i].height)
continue;
app.screen_width = screens[i].width;
app.screen_height = screens[i].height;
break;
}
(screens = XineramaQueryScreens(app.dpy, &nscreens)) != NULL &&
nscreens) {
app.screen_width = screens[0].width;
app.screen_height = screens[0].height;
XFree(screens);
}