summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2010-01-22 11:24:32 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2010-01-22 11:24:32 +0000
commitb0aa806fde7a8cc83abfcf58e75ecdf7fe0bb21d (patch)
tree3ad1722a54012ea0bc1b2e7bedd8d8c779009ae4 /app
parentf20b535074e6b99c30b01bb7e0edf6bf9f1bf676 (diff)
Make ssh-ask-pass Xinerama aware (also works with XRandR thanks to
its pseudo-Xinerama emulation). ok stsp@
Diffstat (limited to 'app')
-rw-r--r--app/ssh-askpass/x11-ssh-askpass.c8
-rw-r--r--app/ssh-askpass/x11-ssh-askpass.h2
2 files changed, 8 insertions, 2 deletions
diff --git a/app/ssh-askpass/x11-ssh-askpass.c b/app/ssh-askpass/x11-ssh-askpass.c
index 0cb68f795..56ee7ffc0 100644
--- a/app/ssh-askpass/x11-ssh-askpass.c
+++ b/app/ssh-askpass/x11-ssh-askpass.c
@@ -698,8 +698,8 @@ void createDialog(AppInfo *app)
calcButtonLabelPosition(&(d->okButton));
calcButtonLabelPosition(&(d->cancelButton));
- d->w3.w.x = (app->screen_width - d->w3.w.width) / 2;
- d->w3.w.y = (app->screen_height - d->w3.w.height) / 3;
+ d->w3.w.x = app->screen_xoffset + (app->screen_width - d->w3.w.width) / 2;
+ d->w3.w.y = app->screen_yoffset + (app->screen_height - d->w3.w.height) / 3;
app->dialog = d;
}
@@ -1504,11 +1504,15 @@ int main(int argc, char **argv)
app.screen_width = WidthOfScreen(app.screen);
app.screen_height = HeightOfScreen(app.screen);
+ app.screen_xoffset = 0;
+ app.screen_yoffset = 0;
if (XineramaIsActive(app.dpy) &&
(screens = XineramaQueryScreens(app.dpy, &nscreens)) != NULL &&
nscreens) {
app.screen_width = screens[0].width;
app.screen_height = screens[0].height;
+ app.screen_xoffset = screens[0].x_org;
+ app.screen_yoffset = screens[0].y_org;
XFree(screens);
}
diff --git a/app/ssh-askpass/x11-ssh-askpass.h b/app/ssh-askpass/x11-ssh-askpass.h
index 547d2a38f..7875f4c26 100644
--- a/app/ssh-askpass/x11-ssh-askpass.h
+++ b/app/ssh-askpass/x11-ssh-askpass.h
@@ -160,6 +160,8 @@ typedef struct
Screen *screen;
long screen_width;
long screen_height;
+ long screen_xoffset;
+ long screen_yoffset;
Window rootWindow;
Pixel black;
Pixel white;