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 SRCS = drawing.c dynlist.c resources.c x11-ssh-askpass.c
OBJS = drawing.o dynlist.o resources.o x11-ssh-askpass.o OBJS = drawing.o dynlist.o resources.o x11-ssh-askpass.o
DEPLIBS = $(DEPXTOOLLIB) $(DEPXLIB) DEPLIBS = $(DEPXTOOLLIB) $(DEPXLIB) $(DEPXINERAMALIB)
LOCAL_LIBRARIES = $(XTOOLLIB) $(XLIB) LOCAL_LIBRARIES = $(XTOOLLIB) $(XLIB) $(XINERAMALIB)
NAME = ssh-askpass NAME = ssh-askpass
CLASS = SshAskpass CLASS = SshAskpass

View File

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