Commit Graph

2720 Commits

Author SHA1 Message Date
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
Pekka Paalanen 4e37374875 window: create new struct surface with wl_surface
Struct window has many fields that are directly related to the
wl_surface, more than to the window as a whole. When we start composing
a window from several wl_surfaces, these fields need to be per
wl_surface, not per window.

Start separating such fields from struct window into struct surface by
moving the wl_surface.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-14 12:30:04 -05:00
Pekka Paalanen 550d66bcb1 window: destroy the 2nd shm buffer, if both released
Handle the case when we the compositor somehow migrates from requiring
double buffering into working on single buffering, so we release the
extra shm buffer.

Currently, I do not think this can happen in practice, but in the future
it may happen with sub-surfaces.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-14 12:28:42 -05:00
Pekka Paalanen 33a68eaaf4 window: check the initial wl_display_dispatch()
Check for errors in the first wl_display_dispatch() call. Otherwise
doing something silly like
  $ WAYLAND_SOCKET=999 ./clickdot
will segfault.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-14 12:25:30 -05:00
Pekka Paalanen 4e1065491b window: improve EGL-related error messages
Make them explicitly mention EGL, otherwise one can easily think that
"failed to initialize display" refers to Wayland display.

Also explicitly mention falling back to wl_shm. I tested this with a
LD_PRELOAD trick that overrides eglBindAPI and makes it fail.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-14 12:16:20 -05:00
Kristian Høgsberg 3c087e4e29 configure.ac: Add version to bug URL as well 2013-02-14 12:10:03 -05:00
Scott Moreau bf0f4b9d21 configure.ac: Change bugs.freedesktop.org product to Wayland
Update the bug link. Thanks to Rune K. Svendsen for spotting this.

https://bugs.freedesktop.org/show_bug.cgi?id=60818
2013-02-14 12:09:53 -05:00
Ander Conselvan de Oliveira 4c65da5fc0 compositor: Init fade surface color properly
When fading in, if a repaint was triggered after a call to
weston_compositor_fade() but before the first call to fade_frame(),
the fade surface wouldn't be drawn because its alpha channel wasn't
initialized properly.
2013-02-13 13:52:25 -05:00
Kristian Høgsberg c4a42ca6b5 screenshot: Print warning if we're not launched from weston
weston-screenshooter is a helper binary that weston launches to write the
screenshot to disk.  If somebody tries to launch it by hand, print a
warning and mention the screenshot keybinding.
2013-02-13 13:41:07 -05:00
Kristian Høgsberg b810eb5750 xwm: Support _NET_WM_STATE_FULLSCREEN
We can now handle fullscreen X windows.  X clients request to go fullscreen
buy sending a _NET_WM_STATE client message to the root window.  When that
happens we call into the shell interface and asks the shell to make the
surface fullscreen.  The shell will then resize the window, which causes
the X wm to configure the X window appropriately.

Make sure we ignore configure requests from fullscreened clients and send out
the synthetic configure notify as required in that case.

Finally, inspect _NET_WM_STATE before mapping so we can handle initial
fullscreen correctly.
2013-02-12 21:55:51 -05:00
Scott Moreau 088c62e267 Use __func__ in log message instead of hard coded function name 2013-02-11 14:56:18 -05:00
Pekka Paalanen d1c426eef7 tests: add test for buffer release event
Tests especially, that attach-attach-commit does not result in a release
of the first buffer.

Also tests, that the old buffer is released when a new buffer has been
attached, committed, and displayed (frame callback).

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-08 13:38:17 -05:00
Pekka Paalanen 32ac9b9245 tests: export create_shm_buffer() helper
Lets the tests create additional buffers easily.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-08 13:38:14 -05:00
Pekka Paalanen 8aaef7d48c tests: add frame callback waiting helpers
To avoid duplicating the code for setting and waiting for a frame
callback, add helpers for it.

Convert move_client() to use the new helpers.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-08 13:38:09 -05:00
Tiago Vignatti 19dadf2617 tests: Add XWayland test
By default enabled but one can disable it by passing --disable-xwayland-test
to the configure script. Also, the weston-tests-env script is trying to load
xwayland.so in either case, but it behaves resilient in the absence of that
meaning all the other tests are still going to be kicked for running.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-02-08 12:18:05 -05:00
Konno, Joe 314d988b28 configure: prevent premature HAVE_GLU check
When cairo-gl and mesa-glu are present on the system, autoconf successfully
recognizes both. However, I was wondering why weston-screensaver was not
building since autoconf reported all dependencies were met.

Move the mesa-glu PKG_CHECK before the conditional. Additionally, remove
redundant check for enable_egl, as it is implied when GLU is 'yes.'

Signed-off-by: Joe Konno <joe.konno@intel.com>
2013-02-07 21:20:07 -05:00
U. Artie Eoff 209e8f177a tests: fix assignment typo, should be comparison
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2013-02-07 21:18:35 -05:00
Philip Withnall 4f49917ec5 fbdev: Add an fbdev compositor backend using pixman and evdev
Add a frame buffer backend using pixman to render to fbdev.
This has been tested against nouveaufb but nothing else. Much of the code
came straight from the rpi backend (and copyright has been attributed
accordingly).

The behaviour of this backend on less modern frame buffers has yet to be
tested.

The refresh rate is calculated from the frame buffer's metadata. Every frame
is finished in synchrony with the refresh rate.

Frame buffer devices are currently specified on the command line (or using
the default of /dev/fb0); udev could be used in future to enumerate them.

pixman is used for compositing, and a suitable pixman format is built from
the frame buffer's metadata. This doesn't support the full range of
frame buffer formats, but does support varying BPPs of RGBA and ARGB. That
should be enough for now.

The following are not currently supported:
 • FOURCC
 • Non-packed formats (interleaved, planes, etc.)
 • Non-true-colour formats (monochrome, greyscale, etc.)
 • Big-endian formats (with component MSBs on the right)
 • Non-RGBA and non-ARGB formats

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2013-02-07 20:49:22 -05:00
Kristian Høgsberg 4174791d9e configure.ac: Bump git master version to 1.0.90
We use 1.0.90 as the version number for the git master code.  This way it's
always newer than any stable version.
2013-02-02 10:32:25 -05:00
Scott Moreau 1224514f5b Add --version option 2013-02-02 10:28:50 -05:00