Commit Graph

3073 Commits

Author SHA1 Message Date
Kristian Høgsberg
f00460771e compositor: Fix remaining double free()s
Previous commit didn't catch all double free()s, hopefully this one does.
2013-06-25 11:19:31 -04:00
Kristian Høgsberg
6c8d778646 compositor: Remove double free()s in resource destructors
With the change to move free()ing of the wl_resource into wayland-server, we now have
a few cases where we double free the resource in the destructor.  This patch
removes those.
2013-06-25 10:29:30 -04:00
Kristian Høgsberg
88dab17b0e nested: Port away from old wl_resource API 2013-06-24 22:53:38 -04:00
Jason Ekstrand
6bd6294f4a Add a weston_buffer structure to replace wl_buffer
This commit adds a weston_buffer structure to replace wl_buffer.  This way
we can hold onto buffers by just their resource.  In order to do this, the
every renderer.attach function has to fill in the weston_buffer.width and
weston_buffer.height fields.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-06-21 23:22:30 -04:00
Jason Ekstrand
8a4a9eb2e4 data-device: Change resources in wl_data_offer and wl_data_source to pointers.
Because of its links to selection.c and xwayland, a destroy_signal field
was also added to wl_data_source.  Before selection.c and xwayland were
manually initializing the resource.destroy_signal field so that it could be
used without a valid resource.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-06-20 23:54:29 -04:00
Giulio Camuffo
1fd4b01d10 input: check if the focus surface has a valid resource
the resource can be NULL in some cases, like when the focus is
taken by the black_surface used in shell.c as fullscreen background.
2013-06-20 15:22:35 -04:00
Giulio Camuffo
c0b9487937 compositor-drm: select the highest possible mode frequency
the mode list is ordered so that the lower frequencies come
before the higher ones, so traverse the list from the end
to the beginning
2013-06-20 15:22:35 -04:00
Quentin Glidic
8418c298af shell: Free temporary strings
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2013-06-20 15:22:35 -04:00
Kristian Høgsberg
9ae2f111d4 log: Only use one string buffer
This also fixes a mismatch between date_string and sizeof string in
the strftime call.
2013-06-19 09:08:07 -04:00
Kristian Høgsberg
a58290b38b xwayland: Use _exit() when exec() fails
Similar to 3b64d6 but for when we fork the X server.
2013-06-18 01:03:17 -04:00
Kristian Høgsberg
082d58c88d xwayland: Silence X wm debug logging
Much to verbose for default logging.  Use a wm_log() wrapper that we can
toggle on/off as needed.  Maybe we're ready for log domains now.
2013-06-18 01:00:27 -04:00
Kristian Høgsberg
1a81abb1dd weston-launch: Don't exit on SIGTERM
Instead, forward signal to weston and wait for weston to clean up nicely.
Weston relies on weston-launch being around to shut down correctly,
so don't exit until we get the SIGCHLD from weston.  This make
killall weston-launch work properly.

https://bugs.freedesktop.org/show_bug.cgi?id=62910
2013-06-17 15:46:07 -04:00
Kristian Høgsberg
1cfd406f9d shell: Tweak spring animation for zoom animation type 2013-06-17 11:08:11 -04:00
Kristian Høgsberg
8eb0f4f830 shell: Fix warning and indentation in shell_surface_configure() 2013-06-17 10:33:22 -04:00
Kristian Høgsberg
dd2df78b9c input-panel: Bounce the input panel slide
A little bit over the top, but fun.  We may want to make a weston.ini key
for this eventually.
2013-06-17 10:32:09 -04:00
Kristian Høgsberg
5281fb1500 spring: Tweak the window fade-in spring to not overshoot
The fade animation overshoots and rings for a bit dipping back into
slightly transparent.  Bug 61675 was right.

https://bugs.freedesktop.org/show_bug.cgi?id=61675
2013-06-17 10:32:09 -04:00
Kristian Høgsberg
091b09652a spring: Make min/max part of spring parameters
Don't hard code the 0.0 - 1.0 spring envelope.
2013-06-17 09:24:14 -04:00
Kristian Høgsberg
7eec9b32f7 spring: Make clip behavior configurable
When the spring goes outside the envelope, we have a few options for
bringing it back: either just let it overshoot, bounce off the limit or
just clamp it.  Instead of controlling that with #ifdef, let's make it
a part of the spring state.
2013-06-17 09:24:14 -04:00
Kristian Høgsberg
c24744ec91 spring: End spring simulatio faster
The spring animation runs for a long time after it has visually settled
down, because we're requiring too much stability.
2013-06-17 09:24:14 -04:00
Kristian Høgsberg
08d8c68bff Add spring-tool, a small utility to plot spring behavior
The weston_spring is a very flexible and powerful mecanhism for driving
animations.  However, it can be a little difficult to tame, but this
little helper can plot the response of the spring to a set of initial
parameters and makes it easy to tune and tweak the spring behavior.
2013-06-17 09:24:14 -04:00
Jason Ekstrand
0bd587e645 subsurfaces: Use wl_resource_get accessors for subsurfaces
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-06-14 16:51:34 -04:00
Jason Ekstrand
a0d2dde6cd output: Use wl_resource_get accessors for weston_output resources
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-06-14 16:51:20 -04:00
Jason Ekstrand
44a3863a17 input: Use wl_resource_get accessor functions for resources
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-06-14 16:49:11 -04:00
Jason Ekstrand
89d319978e text-backend: Change resources to wl_resource pointers
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-06-14 16:49:11 -04:00
Jason Ekstrand
51e5b14952 input_panel_surface: Change resource to a wl_resource pointer
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-06-14 16:49:11 -04:00
Jason Ekstrand
fbbbec8ef5 callback: Change resource to a wl_resource pointer
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-06-14 16:49:10 -04:00
Jason Ekstrand
8895efcd0d region: Change resource to a wl_resource pointer
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-06-14 16:49:10 -04:00
Jason Ekstrand
651f00e94a shell: Convert resources to pointers
This commit converts shell_surface.resource to a pointers and updates
shell.c to use wl_resource_get accessors for shell_surface, desktop_shell,
screensaver, and workspace_manager related resources.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-06-14 16:49:10 -04:00
Jason Ekstrand
0f2ef7ebd3 Use wl_resource_get_user_data for weston_surface resources
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-06-14 15:58:29 -04:00
Samuel Iglesias Gonsalvez
de4667351c compositor-drm: free plane resources using drm function.
Free plane resources using drmModeFreePlaneResources()

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
2013-06-14 15:29:02 -04:00
Tiago Vignatti
fb2adba3da xwayland: Forward global position to X
xeyes works as expected now. subwindows are popped also as expected. This
patch should fix the following:

https://bugs.freedesktop.org/show_bug.cgi?id=59983

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-06-14 15:29:02 -04:00
MoD
55375b9858 xwm: Check result of xcb_get_atom_name_reply
When printing debug information about atoms, the XWM would crash if the X
server failed to respond to a request about atom names. In practice this
occurred when the server itself crashed, e.g. when starting mplayer with the
"xv" vo.
2013-06-14 14:40:43 -04:00
MoD
3170012ec5 xwm: Define SEND_EVENT_MASK and EVENT_TYPE macros to clarify xcb event type checks 2013-06-14 14:34:52 -04:00
Jason Ekstrand
26ed73cee8 Change weston_surface.resource to a wl_resource pointer.
This is the first in what will be a series of weston patches to convert
instances of wl_resource to pointers so we can make wl_resource opaque.
This patch handles weston_surface and should be the most invasive of the
entire series.  I am sending this one out ahead of the rest for review.

Specifically, my machine is not set up to build XWayland so I have no
ability to test it fully.  Could someone please test with XWayland and let
me know if this causes problems?

Because a surface may be created from XWayland, the resource may not always
exist.  Therefore, a destroy signal was added to weston_surface and
everything used to listen to surface->resource.destroy_signal now listens
to surface->destroy_signal.
2013-06-12 15:04:49 -04:00
Eduardo Lima (Etrunko)
a2ce68fd03 text: Fix misleading error message
This should be "input_method" and not "desktop_shell"

Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
2013-06-07 01:29:22 -04:00
Sinclair Yeh
2ada748289 Avoid unnecessarily re-allocating texture buffer when the size hasn't changed.
v4:
Incorporated krh and anderco's comments.  Now adding newly allocated
buffer's dimensions to texture_damage

v3:
* Removed unnecessary parentheses
* Added check for switching from EGL image to SHM buffer
* Moved shader assignment out of IF condition

v2:
Fixed the wrong comparison

v1:
Depending on specific DRI driver implementation, glTexImage2D() with data
set to NULL may or may not re-allocate the texture buffer each time it is
called.  Unintended consequences happen if later glTexSubImage2D() is called
to only update a sub-region of the texture buffer.

I've explored moving glTexImage2D() from gl_renderer_attach() and simply
mark the texture dirty, but the current implemention seems cleaner because
I won't have to worry about calling ensure_textures() and re-assigning
gs->shader unnecessarily.
2013-06-07 00:19:13 -04:00
Pekka Paalanen
d7bc6351f8 shared: build fix for config-parser test
One more wayland-util.h not found issue, triggered by having libwayland
installed to a custom prefix.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2012-02-07 17:47:01 -05:00
Daniel Stone
c228e23b05 configure.ac: Enable AC_USE_SYSTEM_EXTENSIONS
AC_USE_SYSTEM_EXTENSIONS enables _XOPEN_SOURCE, _GNU_SOURCE and similar
macros to expose the largest extent of functionality supported by the
underlying system.  This is required since these macros are often
limiting rather than merely additive, e.g. _XOPEN_SOURCE will actually
on some systems hide declarations which are not part of the X/Open spec.

Since this goes into config.h rather than the command line, ensure all
source is consistently including config.h before anything else,
including system libraries.  This doesn't need to be guarded by a
HAVE_CONFIG_H ifdef, which was only ever a hangover from the X.Org
modular transition.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>

[pq: rebased and converted more files]
2013-06-05 01:16:34 -04:00
Rob Bradford
5238b683e2 udev-seat: Use udev rules to support multiple seats
By labelling devices with ENV{WL_SEAT} in udev rules the devices will be
pulled into multiple weston seats.

As a result you can get multiple independent seats under the DRM and
fbdev backends.
2013-06-05 00:27:35 -04:00
Rob Bradford
b7682b6413 udev-seat: Separate the seat out to its own structure
Thie will allow us to instantiate multiple seats.
2013-06-05 00:27:30 -04:00
Rob Bradford
2387fde095 compositor-fbdev: Rename seat variable to seat_id to clarify purpose 2013-06-05 00:24:10 -04:00
Rob Bradford
f165f18439 compositor-fbdev: Remove unused fbdev_seat code
The fbdev compositor uses the commons seat handling code with the drm
compositor.
2013-06-05 00:23:59 -04:00
Rob Bradford
d355b80172 udev-seat: Make the udev_input structure an embedded structure
And as a result of this stop iterating through the compositor seat list
(of one item) and instead access the udev_input structure directly.

This enables a refactoring to pull out the weston_seat into a separate
structure permitting multiple seats.
2013-06-05 00:23:29 -04:00
Rob Bradford
d27b99d950 udev-seat: Rename udev_seat to udev_input
This is a pure rename of the structure, functions and local variables in
preparation of the separation of the seat from the other udev input
handling.
2013-06-05 00:20:02 -04:00
Rob Bradford
643641dfb7 compositor-drm: Rename seat variable to seat_id to clarify it's purpose
This change is a straight refactor that has no functional change.
2013-06-05 00:18:06 -04:00
Rob Bradford
14a7601340 weston-info: Report the seat name provided by the compositor 2013-06-05 00:17:48 -04:00
Rob Bradford
e445ae69f2 input: Send the seat name if the client advertises verson 2 of wl_seat 2013-06-05 00:17:43 -04:00
Rob Bradford
9af5f9e0fe input: Add a seat name parameter to weston_seat_init 2013-06-05 00:17:38 -04:00
Ander Conselvan de Oliveira
722a2d523c compositor-drm: Force DPMS state to ON after drmModeSetCrtc()
The kernel is supposed to set this when drmModeSetCrtc() is called but
at least the i915 driver wouldn't do that in all cases. A fix for this
should be released with kernel 3.10, but we work around the issue in
older kernels by always forcing DPMS to ON when doing a mode set.

https://bugs.freedesktop.org/show_bug.cgi?id=64873
2013-06-05 00:01:35 -04:00
Ander Conselvan de Oliveira
a0a433a223 compositor-drm: Cache the DPMS property on drm_output
This avoids one drmModeGetConnector() call every time the DPMS mode is
set. That call can take hundreds of milliseconds due to DDC.
2013-06-05 00:01:30 -04:00