Commit Graph

1516 Commits

Author SHA1 Message Date
Alex Wu
2185843ced shell: Add fullscreen path into activate()
Use shell_stack_fullscreen() to raise fullscreen surface in activate(),
and before activate() a regular surface, move all the fullscreen
surfaces from fullscreen_layer to toplevel_layer.

Also add a void *private into struct wesont_surface since we already
have a configure() vfunc. That helps to get the associated fullscreen
surface of black surface.
2012-04-02 22:15:40 -04:00
Kristian Høgsberg
875ab9e735 Add signedness warning flag and fix fallout 2012-03-30 11:52:39 -04:00
Kristian Høgsberg
ed92f79655 Fix warnings resulting from wayland signedness fixes 2012-03-30 11:31:25 -04:00
Kristian Høgsberg
3448616bc3 Remove weston_shell map and configure function pointers 2012-03-29 13:08:32 -04:00
Kristian Høgsberg
56d23bc3ee shell: Remove obsolete workaround
Cursor surface now are properly initialized.
2012-03-29 11:35:32 -04:00
Kristian Høgsberg
dbae80e6b5 compositor: Support alpha for solid color surfaces 2012-03-29 11:34:39 -04:00
Jonas Ådahl
29a9cf0f97 tty: Improve error handling in tty_create()
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-03-28 23:03:00 -04:00
Jonas Ådahl
c97af923d9 Properly dispose event sources and event loops
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-03-28 23:00:08 -04:00
Kristian Høgsberg
b5ef591fac compositor: Stop using EGL_KHR_surfaceless_gles2
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.
2012-03-28 22:53:49 -04:00
Kristian Høgsberg
cbcd04794c compostor-drm: Use gbm surface
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.
2012-03-28 22:29:21 -04:00
Tiago Vignatti
0a38611e7d tablet-shell: come back to life
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>
2012-03-28 09:37:17 -04:00
Kristian Høgsberg
fb6de223b2 compositor: Use GL_EXT_unpack_subimage for texture updates 2012-03-27 17:10:20 -04:00
Kristian Høgsberg
8cbfb2a40a compositor: Rename weston_buffer_attach to weston_surface_attach
This was always an operation on the surface, not the buffer.
2012-03-27 17:05:06 -04:00
Kristian Høgsberg
679f716088 dnd: Damage surface after attaching new buffer 2012-03-27 16:45:13 -04:00
Kristian Høgsberg
a8ae8a9135 clients: Fix a couple of warnings 2012-03-27 16:39:17 -04:00
Tiago Vignatti
db4ecc61a7 evdev: reuse code for device removal
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>
2012-03-27 16:36:54 -04:00
Ander Conselvan de Oliveira
7fb9f95dce compositor: move force_configure field to shell_surface 2012-03-27 16:36:54 -04:00
Ander Conselvan de Oliveira
093bfa3793 compositor: make surface_configure() a vfunc
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.
2012-03-27 16:36:53 -04:00
Ander Conselvan de Oliveira
e11683aab2 compositor: refactor surface_attach()
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.
2012-03-27 16:36:53 -04:00
Ander Conselvan de Oliveira
d6ea33dfd6 compositor: use new drag icon listener for setting up drag surfaces
That way we can get rid of the call to
weston_compositor_update_drag_surfaces() on shell->map().
2012-03-27 16:36:53 -04:00
Ander Conselvan de Oliveira
9390ae3ed1 compositor: make es->pitch consistent between shm and drm surfaces
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)
2012-03-27 16:36:53 -04:00
Ander Conselvan de Oliveira
fbf2894812 compositor: add weston_surface_to_global_float helper 2012-03-27 16:36:53 -04:00
Ander Conselvan de Oliveira
b8ab14fe04 compositor: add a weston_surface_is_mapped() helper 2012-03-27 16:36:53 -04:00
Kristian Høgsberg
f9247ddc31 compositor: Use GL_BGRA_EXT for glReadPixels in screenshooter
This needs GL_EXT_read_format_bgra.
2012-03-27 15:59:46 -04:00
Kristian Høgsberg
9629fe3206 Simplify shm buffer handling
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.
2012-03-26 19:27:35 -04:00
Kristian Høgsberg
42b4f80116 window.c: Do resize work from the repaint idle callback
This way we always make sure we handle any resizing before we start drawing.
2012-03-26 13:49:29 -04:00
Kristian Høgsberg
7a011eac73 compositor-drm: Check es->image, not es->buffer when looking for overlays
es->buffer can be NULL if the client destroyed the buffer, but es->image
will be non-NULL if and only if we have a buffer we might use with KMS.
2012-03-26 11:48:55 -04:00
Tiago Vignatti
9a206c4da5 config-parser: consolidate shell files into weston.ini only
The shell choice happens in the configuration file now.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-03-25 08:49:30 -04:00
Kristian Høgsberg
6bd4d97271 window.c; Only redraw once per frame
Based on a patch from Martin Minarik <minarik11@student.fiit.stuba.sk> who
tracked down the excessive redraw problem.
2012-03-24 14:42:09 -04:00
Scott Moreau
56456d6578 Secure screenshooter protocol. 2012-03-24 14:40:21 -04:00
Rafal Mielniczuk
2d7ab82d74 shell: fix matrix invertible bug in rotation handler
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.
2012-03-22 22:34:11 -04:00
Scott Moreau
a3aa9c9dd6 Add surface opacity controls. 2012-03-22 11:03:41 -06:00
Scott Moreau
1b45a79a0a Switch zoom binding to <Super>+Scroll. 2012-03-22 11:03:41 -06:00
Scott Moreau
6a3633d2bb Modify bindings for axis event detection. 2012-03-22 11:03:41 -06:00
Scott Moreau
210d079817 Hook up axis events. 2012-03-22 11:03:41 -06:00
Rob Clark
3c97b9017d drm: plane src coords are 16.16 fixed point 2012-03-22 11:58:58 -04:00
Rafal Mielniczuk
778e629b95 shell: correct position of a surface before rotating it.
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
2012-03-22 10:44:27 -04:00
Kristian Høgsberg
126f85535f window.c: Fix the stretch scaling code 2012-03-22 10:43:05 -04:00
Kristian Høgsberg
ec323d222c window.c: Increase drop shadow fluffiness 2012-03-21 01:07:49 -04:00
Kristian Høgsberg
b8abe7e9ae window.c: Tweak window decoration appearance
The old orange decorations were starting to look like clown shoes.
2012-03-20 23:56:05 -04:00
Kristian Høgsberg
9ab37e8c36 Revert "automake: Don't fail the build if we can't setuid."
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.
2012-03-20 22:44:08 -04:00
Ander Conselvan de Oliveira
29d955685f evdev: fix input lag when processing input from output repaint
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.
2012-03-20 22:43:57 -04:00
Kristian Høgsberg
afee221ccb compositor: Fix pointer type mismatch warnings 2012-03-20 22:43:56 -04:00
Juan Zhao
46436618d8 weston_surface: initialize pitch
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.
2012-03-20 22:43:56 -04:00
Bill Spitzak
027b962d8c weston: don't hang in wait()
Pausing weston (with ^Z in the shell) and putting it in the background
made it hang.
2012-03-20 22:43:56 -04:00
Bill Spitzak
d273e28567 weston: Don't ask for EGL depth buffer if not needed
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.
2012-03-20 22:43:56 -04:00
Tiago Vignatti
23fdeedf82 evdev: use mtdev for multitouch devices
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>
2012-03-20 22:43:56 -04:00
Ander Conselvan de Oliveira
71b1d0c91d compositor: properly restore keyboard_focus in notify_keyboard_focus()
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.
2012-03-20 22:43:55 -04:00
Ander Conselvan de Oliveira
96b0abd88a compositor: allow multiple input_device_attach()'s with a nil buffer
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().
2012-03-20 22:43:55 -04:00
Ander Conselvan de Oliveira
e2d21e82fc compositor-wayland: use image loading code from shared/
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.
2012-03-20 22:43:55 -04:00