Commit Graph

1486 Commits

Author SHA1 Message Date
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
Ustun Ergenoglu
6dc0f86dbd cairo-util: load_cairo_surface returns NULL if loading the file fails.
Otherwise a non-existent file in the configuration crashes the desktop shell.

Signed-off-by: Ustun Ergenoglu <ego@ustun.fi>
2012-03-20 22:43:55 -04:00
Tiago Vignatti
5ab91ad845 compositor: use smoother range for backlight control
now it goes from 0 to 255.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-03-20 22:43:54 -04:00
Tiago Vignatti
1b079abe0e tests: add backlight test
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-03-20 22:43:54 -04:00
Alex Wu
07b2606c7a shell: Fix 2 switcher crashes.
In case of no regular window, switcher will crash in switch_next()
due to "next == NULL" and in switcher_destroy() due to
"switcher->current == NULL".
2012-03-20 22:43:54 -04:00
Eric Anholt
e7ad5cdcd2 automake: Don't fail the build if we can't setuid.
The configure default is to setuid root the weston compositor.
However, if installing as non-root (say, to your prefix in homedir),
the install fails anyway, even if you didn't need setuid to run weston
in your configuration.
2012-03-13 12:39:00 -07:00
Eric Anholt
0e8d48b920 configure: Fix build on debian by avoiding bashisms in the test command. 2012-03-13 12:39:00 -07:00
Kristian Høgsberg
f02a649a3c Consolidate image loading code and move to shared/ 2012-03-12 01:40:59 -04:00
Kristian Høgsberg
bcacef19b0 Add an option parser
On one hand, getopt (in particular the -o suboption syntax) sucks on the
server side, and on the client side we would like to avoid the glib
dependency.  We can roll out own option parser and solve both problems
and save a few lines of code total.
2012-03-12 01:28:50 -04:00
Kristian Høgsberg
22ba60e514 x11: Move the xcb fd to the input loop
This way, we handle input just before repaint, similar to the drm backend.
2012-03-12 01:28:50 -04:00
Kristian Høgsberg
aa6019e125 Fix picking crashes
The surface list is only valid after repaint, so we need to do picking and
input delivery there.
2012-03-12 01:28:50 -04:00
Rob Clark
8efbc8ee62 drm: fix issue copying supported plane formats
Originally on the first 1/4th of the plane formats were copied, leading
to problems if AR24/XR24 appears later in the list.
2012-03-12 01:16:13 -04:00
Rob Clark
6396ed36f4 clients/window: fix build issues w/ gles 2012-03-12 01:16:12 -04:00
David Herrmann
6ac52db3b0 compositor-drm: use udev_device_get_property_value() helper
Udev provides a convenient helper. Use it instead of working with the
property-list directly.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-11 15:55:32 -04:00
David Herrmann
d7488c2f5b compositor-drm: ignore hotplug-events from other devices
If we have multiple video devices on the system (card0, card1), we should
ignore hotplug events for cards that we do not use. This avoids calling
update_outputs() if the event was not generated by our device so we avoid
refreshing the DRM information if it didn't change.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-11 15:54:49 -04:00
Christopher Michael
eb866cd9fe drm: Fix drmModeRes leak on error paths
When creating outputs in the drm compositor, if allocating crtcs
fails, then free the drm resources. Also, if the base output list is
empty, free drm resources
2012-03-08 13:17:11 -05:00
Benjamin Franzke
0eee939d76 compositor: Fix compilation without xserver launcher 2012-03-08 13:15:02 -05:00
Ander Conselvan de Oliveira
de56c311d9 shell: don't assign output for surface of type none
If map is called with a surface of type none it will call
weston_surface_assign_output, even though the surface will
not be mapped.

This change was lost with the changes for using wl_layers.
2012-03-08 13:10:18 -05:00
Alex Wu
9c35e6b47d shell: Fix segment fault when clicking to activate a NULL pointer_focus
This can happen for instance running a toytoolkit application, launching
the popup menu and then clicking on a surface that does not belong to
the client that create the popup surface.
2012-03-08 13:08:00 -05:00
Alex Wu
aa08e2d56d shell: Fix not destroy black surface when fullscreen surface exit abnomally.
When a client with fullscreen surface displayed was aborted by Ctrl-C, the
black surface still be there. Destroy the black surface in
destroy_shell_surface().
2012-03-08 12:57:54 -05:00
Kristian Høgsberg
60c4954b8a shell: Put popups and transients on top of their parent
In other words, don't map the panel menu under the panel.
2012-03-05 20:51:34 -05:00
Kristian Høgsberg
b435e84d5a window: Compute frame boundary for all windows except fullscreen
We were only computing it for toplevel type windows, which broke
the unlock dialog size allocation and repainting.
2012-03-05 20:38:08 -05:00
Kristian Høgsberg
41c5c4ee9a desktop-shell: Simplify unlock dialog redraw function 2012-03-05 20:37:51 -05:00
Kristian Høgsberg
65bec2452e drm: Disable sprites if they're broken
Current sprite implementation has a color format bug.  Disable sprites
if they don't work and avoid spamming stderr and syslog.
2012-03-05 19:57:35 -05:00
Kristian Høgsberg
7dbf5e2ea7 compositor: Only process input once per frame
When we're repainting, there's no point in polling for input events.
We just read input events once before each repaint and send out events
as needed.  The input events come with an accurate timestamp, so this
doesn't affect the timing information and client should always look at
the event timestamps if they're trying to determine pointer motion
speed or double click speed.  If we go idle (stop repainting) we add the
input devices back into the primary main loop and wait for the next event.

This avoids waking up the compositor separately (one or more times per
frame) to handle input events.  We also avoid updating cursor position
and other compositor state after the client has rendered its new
frame, reducing lag between what the client renders and the pointer
position.
2012-03-05 19:50:15 -05:00
Kristian Høgsberg
7ea10864c2 compositor: Move input devices to their own event loop
First step towards only handling input at repaint time.
2012-03-05 18:06:08 -05:00
Kristian Høgsberg
abcef3cf7a compositor: Swallow binding key for bindings that don't set up a grab
This prevents passing the key press and release to the keyboard focus client.
2012-03-05 17:47:15 -05:00
Kristian Høgsberg
63e5e06d82 window: Only set opaque and input regions if they change
Setting these regions damages the entire window or causes a repick, which
we don't want to trigger if we don't need to.
2012-03-05 00:04:57 -05:00
Kristian Høgsberg
d3c0275b14 Use wl_array_for_each() where possible 2012-03-04 22:35:47 -05:00
Pekka Paalanen
4ac32ab669 compositor-drm: fix libbacklight build
Bad inclusion of DRM headers, missing some system headers.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-04 22:00:02 -05:00
Kristian Høgsberg
0b5cd0cb4c Use typesafe server-side stubs 2012-03-04 21:57:37 -05:00