Commit Graph

3152 Commits

Author SHA1 Message Date
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
Armin K
a94e285be7 clients/nested: Fix compilation 2013-06-04 23:50:41 -04:00
U. Artie Eoff
a2326ed77f add fullscreen to .gitignore
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2013-06-04 23:20:22 -04:00
Pekka Paalanen
ab5dd94c93 shared: fix build of libshared-cairo
Another case of missing wayland-util.h, as we didn't pass any libwayland
CFLAGS. This is triggerable on a system, where libwayland is installed
in a custom prefix, and pixman, cairo, libpng, and webp are either
not installed or are installed in the standard path.

COMPOSITOR_CFLAGS contains more than just the libwayland CFLAGS, though.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-06-04 23:16:49 -04:00
Rob Bradford
5a4cea9a9c build: Add declaration checks to check for required syscall flags
The required flags are relatively new and some older enterprise
distributions do not feature them.

https://bugs.freedesktop.org/show_bug.cgi?id=63360
2013-06-04 23:11:42 -04:00
Kristian Høgsberg
1cc5ac34b5 clients: Nested compositor example
A wayland compositor doesn't provide a mechanism for buffer sharing between
clients.  Under X, one client can render to a Pixmap and another can use it
as a source in a subsequent drawing operations.  Wayland doesn't have a
mechanims to share Pixmaps or textures between clients like that, but it's
possible for one client to act as a nested compositor to another client.

This less work than it sounds, since the nested compositor won't have to
provide input devices or even any kind of shell extension.  The nested
compositor and its client can be very tightly coupled and have very specific
expectations of what the other process should provide.

In this example, nested.c is a toytoolkit application that uses cairo-gl
for rendering and forks and execs nested-client.c.  As it execs the client,
it passes it one end of a socketpair that will be the clients connection
to the nested compositor.  The nested compositor doesn't even create a
listening socket.

The client is a minimal GLES2 application, which just renders a spinning
triangle in its frame callback.
2013-06-04 02:47:12 -04:00
Jan Arne Petersen
8ccb7cc258 editor: Do not commit/preedit after invalid delete
Ignore the whole commit-string or preedit_string transaction when the
delete_surrounding event was invalid.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-06-04 00:34:55 -04:00
Jan Arne Petersen
895a128ce1 editor: Improve checks on delete add asserts
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-06-04 00:34:52 -04:00
Jan Arne Petersen
9eaa8e51ca editor: Properly adjust cursor on delete
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-06-04 00:34:48 -04:00
Jan Arne Petersen
a96953dffa editor: Support deleting text in preedit_string
Delete text marked with wl_text_input::delete_surrounding_text on
preedit_string event. When text is explicitly marked with
delete_surrounding_text do not delete selected text.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-06-04 00:34:46 -04:00
Jan Arne Petersen
1c45b4a4a9 editor: Fix text selection
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-06-04 00:34:42 -04:00
Armin K
49c36c6804 Don't fail if colord or libunwind are not present
This patch adds auto detection for presence of
the colord and libunwind packages.
2013-06-04 00:31:23 -04:00
Eduardo Lima (Etrunko)
4b2c236845 weston.pc: Added libexecdir and pkglibexecdir variables
These can be used by external clients to check the installation path

Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
2013-06-04 00:14:04 -04:00
Rob Bradford
f9e9d0d434 udev-seat: Fail input setup only if no devices are found
Rather than failing if we cannot open any single device fail the input
setup if there are no input devices added.

https://bugs.freedesktop.org/show_bug.cgi?id=64506
2013-06-04 00:13:20 -04:00
Hardening
b60e46f6ba Handle mouse wheel
The RDP compositor was ignoring mouse wheel events, this patch adds
support for it.
2013-06-04 00:10:19 -04:00
U. Artie Eoff
3b64d6236c use _exit instead of exit if client fails to exec
exit() calls atexit() handlers and C++ destructors (e.g. a C++
weston module) which could destroy state that the main process
depends on (e.g. ioctl's, tmpfiles, sockets, etc...).  If an exec
fails, call _exit() instead of exit().

v2: prefer _exit over _Exit

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2013-06-04 00:07:10 -04:00
Alexander Larsson
b846a8d45e screenshooter: Scale damage by output scale in screen recorder
The damage region is in compositor coords, we need to scale it by
the output scale when using the damage to read output buffer data.
2013-05-29 10:22:15 -04:00
Alexander Larsson
97af792718 pixman-renderer: Fix read_pixels for screen recorder
The old code had an off-by-one error on the y coordinate
where it says height - (cur_y - y). And it does the vflipping of
the *destination* buffer, whereas what is really needed is to
vflip the whole source buffer. This only affects when you read
out part of the image, such as when using the screen recoder.

Also, instead of doing the flipping manually we just let pixman
handle it.
2013-05-29 10:22:01 -04:00
Alexander Larsson
5576546e3d screenshoter: Make recorder handle PIXMAN_x8r8g8b8
This is what the pixman renderer reports for the read format.
2013-05-29 10:21:58 -04:00
Alexander Larsson
690f718834 shell: Position DRIVER fullscreen surfaces at origin
When a window is fullscreened with DRIVER method and we succeeded
in changing mode we need to actually move the surface to the
origin of the output, or it won't be used for scanout.
2013-05-29 10:18:15 -04:00
Alexander Larsson
d622ed3fbf shell: Center window in fullscreen if needed
If modeset fails With DRIVER method, and always with FILL method
we want to center the window.
2013-05-28 17:22:04 -04:00
Alexander Larsson
f82b6cac5e shell: Always go to original mode when focused window not fullscreen
Right now we only switch mode on activating a fullscreened window.
This has several problems:

* Once you're in fullscreen its hard to switch to a non-fullscreened
  window with alt-tab as you stay in the small resolution.
* If you switch from a fullscreened window to a non-fullscreened
  window and the fullscreened window is destroyed we will not
  restore the original mode (since the window is not
  shell_surface_is_top_fullscreen()
* Its hard to reach a different output on the right with the mouse
  when the mode is smaller that the original, as there is a "gap"
  between the two outputs. So, if you alt-tab to another window
  you can not always reach it.

This is somewhat of a sledge hammer, as it means you can't e.g.
focus a non-fullscreen on one output and have a window fullscreened
on another output. However, trying to restore only the outputs
the new window is on is problematic:

* It may later change output
* We want to see all windows anyway during alt-tab
* Can't reach the other windows with the mouse anyway

So, this seems like an ok solution.
2013-05-28 17:22:01 -04:00