bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22549: 25.0.50; Tooltips placed outside of screen limits


From: Óscar Fuentes
Subject: bug#22549: 25.0.50; Tooltips placed outside of screen limits
Date: Sat, 06 Feb 2016 18:06:49 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

martin rudalics <address@hidden> writes:

>> We can use the coordinates to determine the monitor. The patch below
>> works.
>
> Good idea.  But do that only if ‘x-display-monitor-attributes-list’
> returns more than one monitor so we do not needlessly loop in (and
> possibly compromise) the one monitor case.

I don't think that performance considerations are applicable here. About
compromising the one monitor case: in theory, the monitor's geometry is
always the right thing to use for calculating the tooltip position, not
x_display_pixel_width/height. For instance: it is possible to configure
X for having a desktop area larger than the monitor's resolution, IIRC.

> Or (tediously) assign
>
> +              min_x = XINT (Fnth (make_number (1), geometry));
> +              min_y = XINT (Fnth (make_number (2), geometry));
> +              max_x = min_x + XINT (Fnth (make_number (3), geometry));
> +              max_y = min_y + XINT (Fnth (make_number (4), geometry));
>
> only if the subsequent test
>
> +              if (min_x <= *root_x && *root_x < max_x
> +                  && min_y <= *root_y && *root_y < max_y)
>
> would succeed.

> There's no guarantee that ‘x-display-monitor-attributes-list’ works on
> all systems, especially on those where neither Xinerama nor XRandr are
> installed.  IIRC older versions of the latter might also have problems
> when a monitor is added/removed during a session.  The fallback should
> always give the same results as the present code, but who knows ...

See the attached patch. If we can't use the monitor's geometry, we
default to the old code.

> And just to make sure: Can we rely on the fact that XQueryPointer always
> gives reliable results with multiple monitors and its present arguments?

Dunno. I know nothing about X Windows.

Attachment: tooltip_pos2.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]