Commit Graph

2739 Commits

Author SHA1 Message Date
Quentin Glidic bb41005259 configure.ac: Make xwayland tests depend on xwayland
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2013-02-18 16:03:51 -05:00
Kristian Høgsberg 2f07ef6963 xkb: Don't call exit on failure in weston_compositor_xkb_init()
This will exit without cleaning vt modes and leave the system stuck.

https://bugs.freedesktop.org/show_bug.cgi?id=60817
2013-02-18 15:29:35 -05:00
Kristian Høgsberg 4fd273f400 compositor-x11: Fix pointer type warning 2013-02-18 15:29:35 -05:00
Kristian Høgsberg 506238454b compositor-drm: Remember to drop master in drm error handling
Otherwise we'll kill whatever other display sever we're switching back to.
The tricky thing here is that we never explicitly set drm master in the
startup path, we get that implicitly from being the first to open the
drm device.  Even so, we need to drop it before switching VTs.
2013-02-18 15:29:35 -05:00
Kristian Høgsberg 4905efdc99 src/Makefile.am: Use $(libdir) instead of @libdir@
This allows overriding prefix and libdir at make time.  Noticed
by David Herrmann.
2013-02-18 15:29:35 -05:00
Kristian Høgsberg af4f2aaf19 Install header files and pkg-config file for external modules
This patch installs the three header files that define the compositor
plugin interface as well as a pkg-config file.  This allows
building weston plugins outside the weston tree.  We currently don't make
any guarantees about the plugin API/ABI except that within a stable
branch we won't break it.
2013-02-18 15:29:35 -05:00
Marcin Slusarz 554a0da74a compositor: Use libunwind if available for better backtraces
libunwind has a dwarf parser and automatically queries the dlinfo
for location of dlopened modules.  The resulting backtrace is much
better and includes stack frames in dynamically loaded modules.

krh: Originally submitted for Xorg, adapted for weston:

  http://lists.x.org/archives/xorg-devel/2013-February/035493.html

Note this require libunwind at least 1.1 to get the pkg-config files.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
2013-02-18 15:29:17 -05:00
Jan Arne Petersen 1cc9e08d2f text: Split out cursor_position
Add an extra cursor_position, which also allows to change the anchor
(for slections). Change the index type to int to allow setting it before
the beginning of a commited string.

The cursor should not be moved as a direct repsonse to this event but
atomically on the next commit_string event.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:08:01 -05:00
Jan Arne Petersen 964b517c9b text: Rename set_micro_focus request
Rename set_micro_focus to set_cursor_rectangle to make more clear, what
it refers to.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:07:42 -05:00
Jan Arne Petersen 6138197337 text: Add show/hide_input_panel requests
Allows to show/hide the input panel (virtual keyboard) more independent
of focus (some applications might to require additionaly click on a
focused entry to show the input panel).

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:07:35 -05:00
Jan Arne Petersen 0eabcaafae text: Add commit request
Allows for atomic state changes. Updated surrounding text, content type
and micro focus is taken into account all at once at commit.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:07:03 -05:00
Jan Arne Petersen f255165bd4 text: Remove unused requests/events
Put them back in, when we know what arguments they will have.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:06:48 -05:00
Jan Arne Petersen ffbb20f730 text: Move input_panel interface to input-method
Move the input_panel interface from desktop-shell to input-method (since
it is not really tied to desktop-shell).

Add an input_panel_surface interface like wl_shell_surface to make it
easier to extend it. Also add a parameter to the set_toplevel request to
be able to specify where to show an input panel surface on the screen.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:05:04 -05:00
Jan Arne Petersen 23ccfb3ef9 shell: Do not hang after setting input_panel twice
Ignore multiple calls with the same surface in input_panel_set_surface.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:03:18 -05:00
Jan Arne Petersen af7b6c9c6d shell: Do not crash when hiding input_panel
Allow an input panel to attach a NULL-buffer for hiding.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:03:08 -05:00
Jan Arne Petersen 3fb6e71814 editor: Add support for backspace keysym events
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:02:48 -05:00
Jan Arne Petersen 8746ba0d29 doc: add some more text protocol documentation
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:02:42 -05:00
Jan Arne Petersen a75a789fc1 text: fix weston key bindings with input methods
Add a struct weston_keyboard, to handle the input method grab.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:02:26 -05:00
Jan Arne Petersen ab2b01429e simple-im: fix for protocol changes
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:01:20 -05:00
Jan Arne Petersen 2dc3b3fc9f keyboard: add support for invoke_action
Set the pre-edit cursor on the clicked index on invoke_action.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:01:12 -05:00
Jan Arne Petersen 3489ba9c21 editor: add support for invoke_action
Call invoke_action request when a currently composed word is clicked.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:00:54 -05:00
Jan Arne Petersen adfedc1965 text: add support for invoke_action request
Add a request to be called by the client when the word currently being
composed is tapped by the user. Input methods often use this information
to offer more word suggestions to the user.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:00:46 -05:00
Jan Arne Petersen 0558a93eee editor: Add content type example
Set the content type purpose to numeric of the second entry.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:00:29 -05:00
Jan Arne Petersen e475f29330 keyboard: Add support for a numeric layout
Add support for a numeric key layout, which is used for some numeric
content purpose types.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:00:20 -05:00
Jan Arne Petersen 26ffa814d9 text: Add content type support to text protocol
Support content types in text protocol. Content is defined by a hint
bitmask and a purpose field.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:00:15 -05:00
Jan Arne Petersen 0a1cf393c6 editor: add support for pre-edit styling
Add pango dependency to the example and use pango for text handling.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 16:57:37 -05:00
Jan Arne Petersen 49a3fb3d1d keyboard: Add support for pre-edit styling
Adds a button to the keyboard to support different styles of pre-edit
styling.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 16:55:58 -05:00
Jan Arne Petersen 4a17fae8e7 editor: support commit on reset
Commit pending pre-edit text when focus-out or changing the cursor
location.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 16:55:47 -05:00
Jan Arne Petersen c7d2a9839b text: add serial argument to text protocol
The serial argument will allow to ignore outdated events from before a
reset request.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 16:55:37 -05:00
Jan Arne Petersen 4653531e7a text: add pre-edit styling support to protocol
Also add a separate preedit-cursor event and add a commit argument to
preedit-string to allow to support commit on reset. Fix editor and
keyboard example to adapt to the protocol changes.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 16:55:27 -05:00
Ander Conselvan de Oliveira 18639f8d4a shell: Set the DPMS state if the screensaver fails to launch or dies
The lock hook in desktop-shell only changes the DPMS state the second
time it is called, because during the first time it launches the
screensaver and wakes the compositor again when the screensaver surface
is configured. However, if the screensaver fails to launch, the output
is left in an enabled state, even thought there's no content being
displayed on the screen.

Fix this by disabling the outputs when the screensaver dies if the
shell is still locked.

https://bugs.freedesktop.org/show_bug.cgi?id=60084
2013-02-15 14:06:15 -05:00
Kristian Høgsberg 8e7adbff68 compositor-x11: Wait for configure_notify for fullscreen
Some window managers (kwin at least) don't give us our final fullscreen
size before map_notify.  Currently we stop waiting for configire_notify
once we get mapped and in case of kwin that means we don't receive our
fullscreen size configure_notify.  With this patch, if we don't get a
configure_notify before map_notify, we just wait for the first one after
map_notify and hope that's our size.

https://bugs.freedesktop.org/show_bug.cgi?id=60608
2013-02-14 22:03:03 -05:00
Kristian Høgsberg 81585e9d2a xwm: Don't leak pending.input region
It's not really a leak, since the region is always a rectangle, but let's
play by the rules.
2013-02-14 22:03:02 -05:00
Kristian Høgsberg 25bb696fc8 xwm: Fix silly region math
We were setting up the opaque region to be the window size and then
intersecting with the opaque rectange that's always contained in the window
rectangle.  Just initialize to the opaque rectangle.
2013-02-14 22:03:02 -05:00
Kristian Høgsberg d8b617deea xwm: Fix input region regression from commit changes
This must be the last regression from the surface commit changes.  We
need to set the pending.input region, otherwise the region will be
overwritten on commit.

https://bugs.freedesktop.org/show_bug.cgi?id=60610
2013-02-14 21:56:48 -05:00
Jan Arne Petersen 451a97136f shell: Fix bug when input panel is shown twice
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-14 21:56:48 -05:00
Kristian Høgsberg 0c36903fb3 shell: Add back ability to rotate unresponsive surfaces
When a surface in deemed unresponsive and we trigger the busy cursor, it's
no longer possible to rotate the surface.  This is clearly unacceptable.
This patch adds handling of right clicks to the busy grab so that we can
continue to rotate a surface even if the client is sleeping.

https://bugs.freedesktop.org/show_bug.cgi?id=60609
2013-02-14 21:33:42 -05:00
Kristian Høgsberg e994eddafc window.c: Don't allow moving a maximized window
Ideally the shell would send an unmaximize event to the client when
we try to move a maximized window, but for now, let's just prevent
moving maximized windows.

https://bugs.freedesktop.org/show_bug.cgi?id=56296
2013-02-14 16:31:42 -05:00
Rob Bradford 9f3dd15183 shell: Bypass fullscreen scaling if surface width and height match output
If our surface has width and height set to the same dimensions as the output
then we can bypassing the scale factor calculation and addition of the
transformation.

The use case that led to this optimisation is the playback of video using
gstreamer-vaapi with the "scale" method. The video is the same dimensions as
the output (1080p.)
2013-02-14 13:40:52 -05:00
Martin Andersson 566b46467f weston-launcher: Add missing newline in error message 2013-02-14 13:38:40 -05:00
Pekka Paalanen 0c4445ba57 window: create Cairo surfaces on demand for redraw
This introduces the function widget_cairo_create().

Instead of directly referencing surface->cairo_surface, use the function
widget_cairo_create(), which will create the cairo_surface as necessary,
and just returns a Cairo drawing context. Also fix window_get_surface()
similarly.

Now we can go through idle_redraw() without always creating Cairo
surfaces and committing them. This will be useful with sub-surfaces,
where repainting one sub-surface does not need to force the repaint of
all surfaces of a window.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-14 12:35:14 -05:00
Pekka Paalanen 0a9686f51c window: let menu and tooltip redraw use widget size
Menu and tooltip redraw functions were using the surface size directly.
For consistency, make them use the widget size instead, it is the same.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-14 12:34:45 -05:00
Pekka Paalanen 61e028c953 window: remove the transparent flag as unused
This flag was always true, and never false.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-14 12:34:31 -05:00
Pekka Paalanen 89dee00e5e window: move cairo_surface into struct surface
Widgets should be rendering to a cairo_surface for a particular
wl_surface, just like buffers are per surface.

window_flush() has a change in behaviour: it will now send
wl_shell_surface.set_toplevel also without a cairo_surface to be
attached. This shouldn't change anything in practice.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-14 12:34:22 -05:00
Pekka Paalanen 2d8a32a9e4 window: add surface pointer to widget
So that given a widget, we can access the surface specific data, like
buffers, and input and opaque regions.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-14 12:34:03 -05:00
Pekka Paalanen b1cd9b17bf window: move input and opaque regions into struct surface
They are per wl_surface state.

The frame widget is always on the main surface, since it can be created
only for the window. That is why frame_resize_handler() can simply
assume that the surface is the main_surface.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-14 12:33:48 -05:00
Pekka Paalanen ac95f3ee9d window: move 'widget' member into struct surface
Repaint and resizing widget recursions must start from the root widget
of each (sub-)surface, so that buffers and regions get initialized
correctly. Make it easier by moving the widget field from struct window
to struct surface.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-14 12:33:30 -05:00
Pekka Paalanen 7bcfeade53 window: assimilate window_get_resize_dx_dy() into the call site
Not used elsewhere, just cleanup.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-14 12:33:11 -05:00
Pekka Paalanen 02bba7ceb0 window: move buffer type and transform into struct surface
These are surface specifics, since buffers are surface specific.

SURFACE_HINT_RESIZE is moved together to the other SURFACE_* flags, so
that surface_create_surface() would not need two flags arguments.
struct toysurface::prepare vfunc checks for SURFACE_HINT_RESIZE, and
egl_window_surface_create() and shm_surface_create() check for the
non-HINT flags.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-14 12:32:49 -05:00
Pekka Paalanen 811ec4ff31 window: move toysurface and allocation to struct surface
Fields 'allocation' and 'server_allocation' are surface specific. Fields
'saved_allocation', 'min_allocation', and 'pending_allocation' are
window specific, and will not be moved.

Field 'toysurface' is naturally surface specific, since it provides the
backing storage for the wl_surface.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-14 12:30:27 -05:00