Commit Graph

3455 Commits

Author SHA1 Message Date
Kristian Høgsberg d4c1cd77c3 logind: Remove missing 'else'
Only fall through to cleaning up weston-launch or standalone state
if we didn't use logind.
2013-10-22 13:19:23 -07:00
Kristian Høgsberg 10ddd97ecf compositor: Remove redundant and not well-defined focus field
It was never clear what this field really did.
2013-10-22 12:40:54 -07:00
Kristian Høgsberg 2e611264a3 compositor-drm: Don't call drop/set master anymore
This is done by either laucnher-util.c directly, weston-launch or
logind, depending on how we're launched.
2013-10-22 12:27:46 -07:00
David Herrmann 1edf44ce26 compositor: finish frame if redraw fails
If we are about to finish a frame, but a redraw is pending and we let the
compositor redraw, we need to check for errors. If the redraw fails and
the backend cannot schedule a page-flip, we need to finish the frame,
anyway.

All backends except DRM use a timer to schedule frames. Hence, they cannot
fail. But for DRM, we need to be able to handle drmModePageFlip() failures
in case access got revoked.

This fixes a bug where logind+drm caused keyboard input to be missed as we
didn't reenable it after a failed page-flip during deactivation.
2013-10-22 12:24:56 -07:00
David Herrmann 3c688c5e33 compositor-drm: finish frame if initial page-flip fails
If the initial page-flip fails, immediately finish the frame to avoid
being stuck in the given frame. We already do this if we have no fbo
available. Now we do the same if the page-flip fails.
2013-10-22 12:24:53 -07:00
Cameron Stewart 4c4bb953fc Rename invocations of frame_create that were missed by ee7fefcf
For some reason it not only compiled with different parameters but the
method succeeded and just failed later.
2013-10-21 21:04:08 -07:00
David Herrmann cc5b2ed2b8 launcher: add logind backend
Instead of connecting to weston-launch from launcher-util, we now try to
connect to logind first. If logind provides session-devices, we use them.
If not, we fall back to the old weston-launch facility.
2013-10-21 16:23:58 -07:00
David Herrmann e461f85385 launcher: add weston_launcher_close() dummy
If you request a device via weston_launcher_open(), you should now release
it via weston_launcher_close() instead of close(). This is currently not
needed but will be required for logind devices.
2013-10-21 16:07:45 -07:00
David Herrmann 814d49f0b4 dbus: add dbus-match helpers
These helpers simplify adding dbus-matches by allowing var-arg arguments
to assemble the matching rules.
2013-10-21 16:07:10 -07:00
David Herrmann 59ab90049f Add optional dbus helpers
This adds optional libdbus integration for weston. If libdbus is available
and not disabled via --disable-dbus during weston build, we now provide
basic DBusConnection main-loop integration for weston.

The dbus.c file provides a new helper to integrate any DBusConnection
object into a wl_event_loop object. This avoids any glib/qt/..
dependencies but instead only uses the low-level libdbus library.

Note that we do not provide dummy fallbacks for dbus helpers in case
dbus-support is disabled. The reason for that is that you need dbus/dbus.h
for nearly any operation you want to do via dbus. Therefore, only the most
basic helpers which can be used independently provide a "static inline"
dummy fallback to avoid #ifdef all over the code.
2013-10-21 16:06:22 -07:00
Kristian Høgsberg afb9828d57 window: Only clamp min size for windows with frame
Also fix width/height typo.
2013-10-21 15:23:23 -07:00
Kristian Høgsberg fb08e4bdaa weston-launch: Use /bin/sh for launching weston
https://bugs.freedesktop.org/show_bug.cgi?id=68739
2013-10-21 15:14:44 -07:00
Kristian Høgsberg 53ec560423 window: Set a minimum size for toytoolkit windows
The decorations tiles start to overlap and look weird if we go below
200x200 size windows.  Just set that as a minimum size if the app
doesn't provide a bigger minimum size.

https://bugs.freedesktop.org/show_bug.cgi?id=66794
2013-10-21 15:05:52 -07:00
Jonas Ådahl 3042ffe011 udev-seat: Repick seat after a new device was added
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-10-21 13:47:05 -07:00
Jonas Ådahl a493274442 input: Unmap pointer sprite when no more pointer devices are connected
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-10-21 13:46:44 -07:00
Jonas Ådahl 630bae8672 input: Unset focus of seat device when releasing last reference
When the last input device with a certain capability is removed, unset
the focus of the seat device associated with the capability.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-10-21 13:46:33 -07:00
Jonas Ådahl d6e1c34405 evdev: Reference count input device's seat capabilities
When the only input device of a certain seat capability is unplugged,
stop advertising the capability.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-10-21 13:45:03 -07:00
Kristian Høgsberg 8e6f376ef0 compositor-drm: Support configuring the framebuffer format from weston.ini
This patch adds a new weston.ini key, gbm-format, to the [core] section.
This new key can be rgb565, xrgb8888 or xrgb2101010, and makes the
compositor use the corresponding GBM format for the framebuffer.
2013-10-16 16:31:42 -07:00
Kristian Høgsberg d8e9833017 compositor-drm: Use a param struct for initialization like other backends 2013-10-16 16:15:11 -07:00
Kristian Høgsberg 3f97b345dd compositor-drm: Make drm_output_check_scanout_format() work for all formats
This used to work only for ARGB8888 and XRGB8888 buffers, but this lets
us support pageflipping to any client buffer as long as it matches the
framebuffer format.
2013-10-16 16:09:23 -07:00
Kristian Høgsberg 598477d832 window: Set opaque region to window size if we're fullscreen 2013-10-16 16:06:18 -07:00
Kristian Høgsberg 724c8d9e7c shell: Add a new weston.ini to control the startup animation
The new key startup-animation in the [shell] section lets you
control the startup animation.  Default is fade, but with this patch
we can also do none, which just show the desktop as fast as possible.
2013-10-16 11:38:24 -07:00
Kristian Høgsberg 991810c1b3 compositor: Stop the repaint loop if the compositor went to sleep
We check the state when we schedule a repaint, but we will still repaint
in weston_output_finish_frame() if a repaint is needed.  Now we check
whether we went to sleep while waiting for the page flip and stop repainting
in that case.

https://bugs.freedesktop.org/show_bug.cgi?id=65802
2013-10-16 11:10:12 -07:00
Kristian Høgsberg 78fe75368a simple-egl: Add support for using a 16 bpp EGLConfig 2013-10-15 22:03:41 -07:00
David Herrmann 1641d14b82 fbdev: open launcher only once
We currently call launcher_connect() twice, which is redundant and
amazingly works (ugh?). Fix this and connect only once to the launcher.
2013-10-15 09:12:55 -07:00
David Herrmann e05a0cd92c evdev: release devices on read() error
If read() fails without EAGAIN/EINTR, the device is very likely dead.
However, we must not remove the device as it might be muted/revoked. So we
simply remove the event-source to avoid polling the device and simply wait
for the udev-remove signal now.

Note that we cannot call evdev_device_destroy() as the caller created the
FD and might need custom code to close it (like weston_launcher_close()).
2013-10-15 09:12:30 -07:00
Kristian Høgsberg c133fc4836 evdev: Clear touch capability if we see a mouse-type button
If an input device has BTN_LEFT (typically) it's not a touch screen but
a touch pad.
2013-10-14 15:46:13 -07:00
Kristian Høgsberg 9df41e153c evdev: Only init a pointer if the evdev device has a button
We used to test for abs | rel | button,  which inits a pointer device for
a device with just rel or abs capabilities.  We now make sure we have either
rel or abs as well as button.
2013-10-14 15:32:08 -07:00
Kristian Høgsberg 7073f6ffa1 evdev: Stop looking for pointer buttons when we get to BTN_JOYSTICK
We don't want to mark a touchscreen as a button device just because it
exposes the BTN_TOUCH and BTN_TOOL buttons.
2013-10-14 15:28:01 -07:00
Ander Conselvan de Oliveira 97f2952bca gl-renderer: Build as a loadable module
The time spent loading EGL and GLES libraries from disk can be a
considerable hit in some embedded use cases. If Weston is compiled
with EGL support, the binary will depend on those libraries, even if
a software renderer is in use.

This patch splits the GL renderer into a separate loadable module,
and moves the dependency on EGL and GLES to it. The backends still
need the EGL headers for the native types and EGLint. The function
load_module() is renamed to weston_load_module() and exported, so
that it can be used by the backends.

The gl renderer interface is changed so that there is only one symbol
that needs to be dlsym()'d. This symbol contains pointers to all the
functions and data necessary to interact with the renderer. As a side
effect, this change simplifies gl-renderer.h a great deal.
2013-10-14 15:02:20 -07:00
Ander Conselvan de Oliveira 70e2e684fa build: Add dependency between libdrm and compositor for drm backend
The compositor uses libdrm in launcher-util.c if the drm backend is
built, but there was no explicit requirement in the build. egl brings
libdrm implicity so the build doesn't fail.

This patch adds an explicit dependency between the compositor and
libdrm if the drm backend is built, so that changes to the compositor
modules don't cause build failures.
2013-10-14 14:56:26 -07:00
Kristian Høgsberg 891a16ddee launcher: Drop unecessary checks for drm_fd == -1
We never get into this case, and if we do, we just want to pass the invalid
fd through to the underlying ioctl and get the error that way."
2013-10-14 14:00:03 -07:00
Kristian Høgsberg 876c75f1fa launcher: Fix reverted sense of drm_check_master() wrapper
Also rename to drm_is_master() to make it clearer what we're checking.

https://bugs.freedesktop.org/show_bug.cgi?id=70459
2013-10-14 13:57:44 -07:00
Neil Roberts e14aa4f0a9 Don't remove the touch grab until the last touch point is removed
Previously if you move a window around and temporarily add a second
finger then it will cancel the grab even though the original finger is
still held on the screen. It seems more robust to avoid cancelling the
grab until all fingers have been removed.
2013-10-14 13:53:16 -07:00
Neil Roberts 306fe0838b Only update the touch grab position for the first finger
Previously if you add a second finger while moving a window with a
touch grab then the position will keep jumping between the position of
each finger as you move them around. This patch changes it so that it
keeps track of the first touch id that starts the grab and only
updates the grab position when that finger moves.
2013-10-14 13:53:14 -07:00
Neil Roberts aba0f25cb0 Add a touch move binding
When holding the compositor super key the touch events can now be used
to move a window.
2013-10-14 13:53:08 -07:00
Neil Roberts a28c69358c Add a touch binding to activate a surface
Adds a new binding type for touch events via the new function
weston_compositor_add_touch_binding. The binding can only be added for
a touch down with the first finger. The shell now uses this to install
a binding to activate the current surface.
2013-10-14 13:53:08 -07:00
Kristian Høgsberg 2cd6da1400 xwm: Fall back to xcb_kill_client() if window does support WM_DELETE_WINDOW 2013-10-14 12:27:55 -07:00
Jason Ekstrand d14c4ca603 xwayland: Use decoration frame from cairo-util
In particular, this gives us a close button on xwayland windows.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-10-14 12:27:55 -07:00
Jason Ekstrand 3f66cf92ed Use cairo-util frame in tinytoolkit
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-10-14 12:27:55 -07:00
Jason Ekstrand 01c9ec3477 Add decoration frame support to cairo-util
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-10-13 22:12:16 -07:00
Jason Ekstrand ee7fefcffc Rename frame_create and frame_set_child_size with a window_ prefix
This is to avoid a collision with an actual frame structure.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-10-13 22:12:16 -07:00
Kristian Høgsberg bcfd07b70a xwm: Redirect root window subwindows
xwayland no longer does this for us, we have to request it now
2013-10-11 16:48:19 -07:00
Kristian Høgsberg 9acd374822 fbdev: Fix compilation without EGL
We have to duplicate #defines and typedefs for the EGL types and constants
we use in gl-renderer.h so we can compile the fbdev backend without EGL.

https://bugs.freedesktop.org/show_bug.cgi?id=70392
2013-10-11 15:26:35 -07:00
Alexandru DAMIAN be0ac5b147 compositor-drm: fix EGL format type
EGLInt is not always uint32_t so we need
to make sure we use the right int size for the format.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2013-10-11 13:35:16 -07:00
Stefan Schmidt db044cb9a5 clients: Update .gitignore for weston-multi-resource
Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com>
2013-10-11 13:31:29 -07:00
Stefan Schmidt 08921b85ce xwayland: Remove unused call weston_wm_handle_configure_notify.
We get the child position but never use this information here. Just remove it.
Spotted by Christopher Michael.

Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com>
2013-10-11 13:30:15 -07:00
Xiong Zhang abd5d47b3b compositor-drm: Avoid output_destroy happened before page_flip event
Currently there is no guarentee that output remove event always happend after
page_flip event on the same output. So if the following situation occur:

  first: unplug a output
  second: output remove event arrive, output_destrory called adn free output
  third: page_flip event arrive on the destroyed output

the segment fault will happpen in page_flip_handler().

This patch add a variable drm_compositor->destroy_pending, if page flip
event is pending when output remove event arrive, output_destroy will be
delayed until page flip finished.

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
2013-10-11 12:29:22 -07:00
Kristian Høgsberg cab9aeaff5 multi-resource: Don't include non-existing xmalloc.h
It existed on my local disk, of course.  Just copy over xzmalloc().
2013-10-10 19:21:05 -07:00
Tomeu Vizoso 0b12db5f51 launcher: Wrap drmGetMagic and drmAuthMagic so we can build without libdrm 2013-10-10 16:51:37 -07:00