The remaining use case was making our context current before we had any
output surfaces. We can do that now using a dummy surface, so let's stop
relying on surfaceless.
Instead of using the hacks of gbm_bos, EGLImage, FBOs and surfaceless
we switch to using the new gbm surface API. This gives us an EGL
native window type for gbm and lets us use a real EGL surface.
A couple of fixes were made: Weston tablet-shell needed to use weston_layer,
so the compositor could rebuild the surface list correctly when repainting;
homescreen and locking are using the widget + window abstration of toytoolkit;
and widget_set_redraw_handler are being set for widgets redraw.
Also, it was given some basic meaning for lockscreen_button_handler, which
was completely disabled before. As a clean up, I updated the global listener
mechanism on tablet-shell client, using the regular way of registering a
handler instead wl_display_roundtrip -> wl_display_get_global.
Switcher still without code to proper work and the same for tablet-shell
clients, which are not launched.
krh: Edited to not scale down homescreen icons, use new load_cairo_surface()
for image loading.
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Just like device_added, now the routines to close the compositor and vt switch
leave are using the same code to remove a device.
This patch also closes properly a mtdev device, bug spotted by Christopher
Michael.
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
This allows us to move the logic that calls shell->map() or
shell->configure() into shell while allowing it to be overriden for
surfaces that should not be handle by the shell, such as drag icons.
This patch adds a pointer function called configure to weston_surface,
moves the currsent surface_configure() code into shell and implements
a separate configure() for drag surfaces.
surface_attach() does two things: sets up a new buffer as the contents
of the given surface and then calls into shell so it can setup the
position of the surface and map it if necessary. However we do not want
the shell to meddle with some internal surfaces such as drag surfaces.
The intention of this refactoring is to make room for making the part
that calls into shell a virtual function that the compositor can
override for these internal surfaces.
This changes weston_buffer_attach() so it handle all the logic of tying
a buffer to a surface, including unmapping it when the buffer is NULL.
The shell map() vs. configure() logic is then split into a another
function: surface_configure(). In a later commit, this function will be
turned into a function pointer in struct weston_surface.
For shm buffers, es->pitch is set using the stride of the buffer. If
the shell happened to set the surface width to something different than
the buffer width, the contents of the surface would be cropped on the
width during redraw. However, for non-shm surfaces, es->pitch was set to
the surface width. That caused the contents of the buffer to be scaled
on the width when the buffer was wider than the surface.
This makes the behavior on both cases the same: crop on the width and
scale on the height. (which is weird but consistent)
There was a lot of code here to do a lot of work we didn't need to do.
If we damage a surface with a shm buffer attached, all we need to do
is to re-upload the damaged region to the texture. As for drm buffers,
we don't assume anything changes on attach and only update the
regions the client tells us to update in the damage request.
While activating and deactivating rotation mechanism without moving
the pointer, rotation matrix from rotate_grab object is not being
initialised and damage shell surface rotation matrix in
rotate_grab_button handler, making it invertible.
This patch initialise rotate matrix in rotate_binding
and moves surface position check to rotate_grab_motion handler.
How to reproduce: rotate the surface to something like 45 degrees,
resize it drastically, continue to rotate. The surface will jump
some space and the rotation point will not be in the center
of the surface.
Fix is to shift the surface position to match the rotation point
This reverts commit e7ad5cdcd2.
If you ask for setuid install and that fails you didn't get what you
asked for and we shouldn't just silently carry on. If installing weston
somewhere in your home directory and don't want the setuid bit set,
disable that at configure time.
When the compositor is in a repaint cycle, input is processed only once
per frame. However, a call to evdev_input_device_data() would handle at
most 8 events at time. When there was more than 8 events pending for a
given frame, input lag would occur. This was most visible with multi
touch input.
This patch changes the evdev_input_device_data() so that it will handle
all the events available in the fd. In order to do that, the fd is put
in non-blocking mode, so that it is possible to loop on read and stop
on EAGAIN instead of blocking.
Initializing pitch to 1 to avoid xxx/pitch errors
This won't influence the valid texture coordinate calculation, because
in that case buffer_attach will provide the correct value.
This makes the compositor and demo clients work on the current nouveau
nvfx driver. Obviously does not fix any clients that actually want a
depth buffer, but this does allow more people to at least try wayland.
mtdev library translates all multitouch based devices to the slotted evdev
protocol. It provides an uniform interface for Weston, which eases mt
implementation when dealing with a big variety of devices.
Weston on drm now directly depends on such library.
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Commit f992b2fc removed the saved keyboard focus logic to fix a crash
when the saved surface is destroyed. However, setting keyboard focus to
the first surface on the list ends up trying to set the focus to the
cursor surface most of the time. The end result is a NULL keyboard
focus.
This patch restores the saved keyboard focus logic and fixes the crash
mentioned above using a destroy listener.
Without this change, weston would crash whenever a nil buffer was
passed to input_device_attach() if the cursor sprite was not mapped.
While at it, change the unmapping code to use weston_surface_unmap().
Function weston_load_image() was deleted in f02a649a but the wayland
backend was not adapted to the new interface. This probably went
unoticed because the prototype for the missing function was not deleted
from compositor.h so the backend would compile without warnings.