Older games (mostly those based on SDL 1.x) rely on the XVidMode
extension and would refuse to run without.
Add a simple, limited and read-only xvidmode support that reports the
current mode used so that games that rely on xvidmode extension can run
on XWayland.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87806
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
216bdbc735 removed the SetRootClip call in the XWayland output-hotplug
handler when running rootless (e.g. as a part of Weston/Mutter), since
the root window has no storage, so generating exposures will result in
writes to invalid memory.
Unfortunately, preventing the segfault also breaks sprite confinement.
SetRootClip updates winSize and borderSize for the root window, which
when combined with RRScreenSizeChanged calling ScreenRestructured,
generates a new sprite-confinment area to update it to the whole screen.
Removing this call results in the window geometry being reported
correctly, but winSize/borderSize never changing from their values at
startup, i.e. out of sync with the root window geometry / screen
information in the connection info / XRandR.
This patch introduces a hybrid mode, where we update winSize and
borderSize for the root window, enabling sprite confinement to work
correctly, but keep the clip emptied so exposures are never generated.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.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>
A DeviceIntPtr with touch valuators is also created in order to deliver
the translated touch events. The lifetime of xwl_touch structs is tied
to the wayland ones, finishing in either wl_touch.up() or wl_touch.cancel()
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
This struct holds information about each individual, ongoing touchpoint.
A list of these is held by the xwl_seat.
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
This was built as a hack for simple Wayland compositors like Weston
which were lazy and didn't want to configure windows server-side when
moved.
Since comboboxes and menus are separate toplevel O-R windows, this hack
breaks input as it needs to be traced normally, not simply sent to the
focused window.
X11 toolkits really do need their windows to be configured correctly
for their O-R windows comboboxes or menus other things, so let's fix
the lazy compositors and remove this.
I have tested this patch with both Weston and Mutter and neither of
them require any changes, and it fixes comboboxes and menus.
If somebody then wants to revert 73698d4, that's fine by me, so we
reduce the amount of API that DDXen have.
Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
In some extreme cases with animated cursors at a high frame rate we
could end up filling the wl_display outgoing buffer and end up with
wl_display_flush() failing.
In any case, using the frame callback to throttle ourselves is the
right thing to do.
Signed-off-by: Rui Matos <tiagomatos@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
We don't even need to simulate button clicks; it's done automatically.
This also fixes scrolling in Qt5 apps.
Signed-off-by: Dima Ryazanov <dima@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
This implements simple throttling that keeps us to one attach per
frame. There isn't really an active performance benefit, since the
buffers will be redrawn only once per frame anyway, but it does cut down
on the chatty network traffic. Since the Wayland sockets might fill
up as well, the cut down on the volume of data we send out also provides
us with a big stability benefit.
Namely, mutter is a lot more stable running gtkperf, a fairly intensive
X11 application, after this change.
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
A few files in the server are including xorg-server.h, which is only
for use by Xorg server drivers. This fixes those errors and then adds
a check to make sure it doesn't happen again.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.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>