On Sun, Jun 09, 2019 at 04:47:53PM +0200, Matthieu Herrb wrote:
> Hi,
>
> ssh-askpass(1) is trying to be clever and computes the size of its
> indicator relatively to the screen resolution.
>
> Unfortunatly, when multiple screens are present, this gets ugly. The
> support for Xinerama correctly computes the dimensions of the window
> to be created, relatively to the screen on which it will appear, but
> the computation of the indicator size is based on the size of the
> whole display, resulting in too small indicators (and too many of them
> if the screens hare layed out horizontally).
>
> The patch below fixes that by computing the resolution of the whole
> display before taking xinerama into account.
>
> A better fix would be to make this application really aware of XRandR
> and use the actual screen resolution from XRandR; this is an
> interesting project, if anyone wants to give it a try.
>
> ok?
ping
>
> Index: x11-ssh-askpass.c
> ===================================================================
> RCS file: /cvs/OpenBSD/xenocara/app/ssh-askpass/x11-ssh-askpass.c,v
> retrieving revision 1.6
> diff -u -p -u -r1.6 x11-ssh-askpass.c
> --- x11-ssh-askpass.c 24 Apr 2015 02:19:41 -0000 1.6
> +++ x11-ssh-askpass.c 9 Jun 2019 14:32:59 -0000
> @@ -1507,6 +1507,12 @@ int main(int argc, char **argv)
> app.screen_height = HeightOfScreen(app.screen);
> app.screen_xoffset = 0;
> app.screen_yoffset = 0;
> +
> + app.xResolution =
> + app.screen_width * 1000 / WidthMMOfScreen(app.screen);
> + app.yResolution =
> + app.screen_height * 1000 / HeightMMOfScreen(app.screen);
> +
> if (XineramaIsActive(app.dpy) &&
> (screens = XineramaQueryScreens(app.dpy, &nscreens)) != NULL &&
> nscreens) {
> @@ -1516,11 +1522,6 @@ int main(int argc, char **argv)
> app.screen_yoffset = screens[0].y_org;
> XFree(screens);
> }
> -
> - app.xResolution =
> - app.screen_width * 1000 / WidthMMOfScreen(app.screen);
> - app.yResolution =
> - app.screen_height * 1000 / HeightMMOfScreen(app.screen);
>
> createDialog(&app);
> createGCs(&app);
>
> --
> Matthieu Herrb
--
Matthieu Herrb