Make ssh-ask-pass Xinerama aware (also works with XRandR thanks to

its pseudo-Xinerama emulation). ok stsp@
This commit is contained in:
matthieu 2010-01-22 11:24:31 +00:00
parent 7d573b6e6c
commit f64b917b27
2 changed files with 8 additions and 2 deletions

View File

@ -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);
}

View File

@ -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;