From 3d42cefac4646b7e921a6cfc031944c0f521f0f1 Mon Sep 17 00:00:00 2001 From: matthieu Date: Tue, 9 Jan 2007 21:49:12 +0000 Subject: [PATCH] updated patch from reyk@: no need to check for invalid screen dimensions this is a bug^Wfeature of the radeon driver. --- app/ssh-askpass/Imakefile | 6 +++--- app/ssh-askpass/x11-ssh-askpass.c | 14 +++++--------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/app/ssh-askpass/Imakefile b/app/ssh-askpass/Imakefile index 577e7ccce..aa3a481f0 100644 --- a/app/ssh-askpass/Imakefile +++ b/app/ssh-askpass/Imakefile @@ -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 diff --git a/app/ssh-askpass/x11-ssh-askpass.c b/app/ssh-askpass/x11-ssh-askpass.c index 6c7bc8939..6f5ef70d9 100644 --- a/app/ssh-askpass/x11-ssh-askpass.c +++ b/app/ssh-askpass/x11-ssh-askpass.c @@ -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); }