When we have a single output, just set it to the physical size of that
output. Otherwise try to approximate it calculating a mean m.m. per
dot. Last fallback is to default to 96 DPI.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
When a new output is hot-plugged we need to not only update our internal
screen dimensions, but also the dix screen dimensions, screenInfo
dimensions and the root window dimensions.
https://bugs.freedesktop.org/show_bug.cgi?id=92273
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
output.done event can be sent even on some property change, not only
when announcing the output. Therefore we must check if we already have it
otherwise we may corrupt the list by adding it multiple times.
This fixes bug when xwayland looped indefinitely in output.done handler
and that can be reproduced following these steps (under X without
multi-monitor setup):
1) run weston --output-count=2
2) run xterm, move it so that half is on one output
and half on the other
3) close second output, try run weston-terminal
weston sends updated outputs which trigger this bug.
v2. factor out common code into function
move expecting_events into right branch
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
This makes Xwayland correctly handle a monitor getting unplugged.
[Marek]: use xorg_list_for_each_entry_safe
Signed-off-by: Dima Ryazanov <dima@gmail.com>
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
snprintf does not allocate memory, so we can never get an out-of-memory
error.
(Also, the error handler would free xwl_output after it was already
registered as an event listener.)
Signed-off-by: Dima Ryazanov <dima@gmail.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
By the time we get here we've already been through FreeAllResources,
which has already torn down the RANDR objects, so on the second
regeneration you get:
Invalid read of size 4
at 0x51C6F0: RRCrtcDestroy (rrcrtc.c:659)
by 0x4285F5: xwl_output_destroy (xwayland-output.c:191)
by 0x426464: xwl_close_screen (xwayland.c:112)
by 0x4B7F77: CursorCloseScreen (cursor.c:187)
by 0x536013: AnimCurCloseScreen (animcur.c:106)
by 0x539841: present_close_screen (present_screen.c:64)
by 0x43E496: dix_main (main.c:351)
by 0x30D70206FF: (below main) (libc-start.c:289)
Address 0x4cc6640 is 0 bytes inside a block of size 728 free'd
at 0x4A07D6A: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x51BCCF: RRCrtcDestroyResource (rrcrtc.c:689)
by 0x45CD91: doFreeResource (resource.c:872)
by 0x45DE56: FreeClientResources (resource.c:1138)
by 0x45DF06: FreeAllResources (resource.c:1153)
by 0x43E3BD: dix_main (main.c:321)
by 0x30D70206FF: (below main) (libc-start.c:289)
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Fix missing newlines from error string and fix grammar.
Signed-off-by: Robert Ancell <robert.ancell@canonical.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Started out as an Xorg module to be used from Xorg drivers to let
Xorg run under a wayland server. The idea was to be able to reuse the
2D acceleration from the Xorg driver. Now with glamor being credible,
a better plan is to just make Xwayland its own DDX, similar to Xwin
and Xquartz. This is a much better fit, as much of the code in the
original approach had to hack around Xorg doing Xorg things like take
over the VT, probe input devices and read config files. Another big win
is that Xwayland dosn't need to be setuid root.
The Xwayland support for DRI3, Glamor and render nodes was done by
Axel Davy <axel.davy@ens.fr>, who also did a lot of work on the rebase
to the Xwayland DDX.
Contributions from:
Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Corentin Chary <corentin.chary@gmail.com>
Daniel Stone <daniel@fooishbar.org>
Kristian Høgsberg <krh@bitplanet.net>
Robert Bragg <robert@linux.intel.com>
Scott Moreau <oreaus@gmail.com>
Tiago Vignatti <tiago.vignatti@intel.com>
Giovanni Campagna <gcampagn@redhat.com>
Jonas Ådahl <jadahl@gmail.com>
Ray Strode <rstrode@redhat.com>
Trevor McCort <tjmccort@gmail.com>
Rui Matos <tiagomatos@gmail.com>
Axel Davy <axel.davy@ens.fr>
Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Axel Davy <axel.davy@ens.fr>