profile/ivi/weston-ivi-shell.git
12 years agoxwm: set the root window pointer to left_ptr
Tiago Vignatti [Mon, 16 Jul 2012 16:15:37 +0000 (12:15 -0400)]
xwm: set the root window pointer to left_ptr

More pretty and also consistent with toytoolkit.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
12 years agoxwm: set appropriate cursors for the frame window
Tiago Vignatti [Mon, 16 Jul 2012 16:09:19 +0000 (12:09 -0400)]
xwm: set appropriate cursors for the frame window

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
12 years agoxwayland: add simple xcb-cursor hook based on libXcursor
Tiago Vignatti [Mon, 16 Jul 2012 16:02:08 +0000 (12:02 -0400)]
xwayland: add simple xcb-cursor hook based on libXcursor

It's in fact based on the core of libXcursor, which doesn't bring any Xlib
dependency.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
12 years agoxwayland: Look up 32 depth rgba render format as well
Kristian Høgsberg [Mon, 16 Jul 2012 15:57:08 +0000 (11:57 -0400)]
xwayland: Look up 32 depth rgba render format as well

12 years agoxwayland: Use the right length for iterating through the formats array
Kristian Høgsberg [Mon, 16 Jul 2012 15:52:40 +0000 (11:52 -0400)]
xwayland: Use the right length for iterating through the formats array

Spotted by Tiago Vignatti, minimal fix to just use the right length.

12 years agodesktop-shell: Don't get a shell surface for the grab surface
Ander Conselvan de Oliveira [Mon, 16 Jul 2012 11:15:50 +0000 (14:15 +0300)]
desktop-shell: Don't get a shell surface for the grab surface

The grab surface does not depend on any of the shell surface
functionality, so don't allocated one.

12 years agowindow: Workaround a stuck frame callback on the cursor surface
Ander Conselvan de Oliveira [Mon, 16 Jul 2012 11:15:49 +0000 (14:15 +0300)]
window: Workaround a stuck frame callback on the cursor surface

It is possible that a client loses the focus between receiving a
pointer.enter event and sending a pointer.set_cursor request. In that
case, the cursor surface might not be mapped and the frame callback
requested on it will never trigger.

Work around this by trying to remap the cursor surface whenever there
is a frame callback and the serial for the enter event is higher than
the cursor serial.

12 years agoshell: Don't ping the grab surface
Ander Conselvan de Oliveira [Mon, 16 Jul 2012 11:15:48 +0000 (14:15 +0300)]
shell: Don't ping the grab surface

If the grab surface happens to be unresponsive, the busy cursor grab
will be started and that will cause the grab surface to receive focus,
which in turn leads to it being pingged again. Break the cycle by not
sending pings to it. If the shell is unresponsive it won't be able to
set the busy cursor anyway.

12 years agocompositor: Don't send wl_surface.enter/leave if we didn't find a resource
Kristian Høgsberg [Thu, 12 Jul 2012 16:34:43 +0000 (12:34 -0400)]
compositor: Don't send wl_surface.enter/leave if we didn't find a resource

12 years agoshell: Scale fullscreen surface without cropping them, center on output
Kristian Høgsberg [Thu, 12 Jul 2012 16:32:31 +0000 (12:32 -0400)]
shell: Scale fullscreen surface without cropping them, center on output

12 years agotoytoolkit: Remove obsolete function window_set_custom().
Scott Moreau [Thu, 12 Jul 2012 02:57:15 +0000 (20:57 -0600)]
toytoolkit: Remove obsolete function window_set_custom().

12 years agowscreensaver: Fix --demo mode.
Scott Moreau [Thu, 12 Jul 2012 02:57:14 +0000 (20:57 -0600)]
wscreensaver: Fix --demo mode.

12 years agocompositor: remove useless weston_compositor_repick call
Tiago Vignatti [Wed, 11 Jul 2012 21:46:10 +0000 (00:46 +0300)]
compositor: remove useless weston_compositor_repick call

compositor->focus was just unset, and weston_compositor_repick() has no
effect.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
12 years agoRemove dead code
Philipp Brüschweiler [Wed, 11 Jul 2012 13:19:23 +0000 (15:19 +0200)]
Remove dead code

window->title is always NULL inside window_create_internal

12 years agoimage-loader: Use pixman_image_t, not struct pixman_image_t
Kristian Høgsberg [Wed, 11 Jul 2012 19:45:59 +0000 (15:45 -0400)]
image-loader: Use pixman_image_t, not struct pixman_image_t

12 years agoimage-loader: don't leak pixman_image bits data
Rafal Mielniczuk [Wed, 11 Jul 2012 16:48:25 +0000 (18:48 +0200)]
image-loader: don't leak pixman_image bits data

Set the pixman_image destroy function to free bits data

12 years agoclipboard: add seat destroy signal handler
Rafal Mielniczuk [Wed, 11 Jul 2012 16:48:12 +0000 (18:48 +0200)]
clipboard: add seat destroy signal handler

12 years agocompositor: handle YUV buffers.
Gwenole Beauchesne [Fri, 20 Apr 2012 09:44:06 +0000 (11:44 +0200)]
compositor: handle YUV buffers.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
12 years agoUpdate weston-egl-ext.h with EGL_WL_bind_wayland_display changes
Kristian Høgsberg [Tue, 10 Jul 2012 19:51:13 +0000 (15:51 -0400)]
Update weston-egl-ext.h with EGL_WL_bind_wayland_display changes

12 years agocompositor: add YUV shaders.
Gwenole Beauchesne [Fri, 20 Apr 2012 09:22:16 +0000 (11:22 +0200)]
compositor: add YUV shaders.

Add shaders for NV12 (2 planes), YUV (3 planes) and YUYV (sampled as 2 planes)

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
12 years agocompositor: factor out RGB shader.
Gwenole Beauchesne [Fri, 20 Apr 2012 09:15:51 +0000 (11:15 +0200)]
compositor: factor out RGB shader.

Simplify RGB shader code and split off common code that could be reused.
This is preparatory work for YUV shaders.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
12 years agocompositor: prepare for multi-planar surfaces.
Gwenole Beauchesne [Fri, 20 Apr 2012 09:07:06 +0000 (11:07 +0200)]
compositor: prepare for multi-planar surfaces.

Make weston_surface::texture and ::surface an array, while keeping
[0] for RGB surfaces.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
12 years agoshell: Use the correct the member name when iterating panel_list
Juan Zhao [Tue, 10 Jul 2012 05:24:09 +0000 (22:24 -0700)]
shell: Use the correct the member name when iterating panel_list

It does not get the correct panel height for now.  The memeber of list
to read should be layer_link not link now.

Signed-off-by: Juan Zhao <juan.j.zhao@linux.intel.com>
12 years agowindow.c: Only set input region when we have a decoration
Kristian Høgsberg [Tue, 10 Jul 2012 02:22:37 +0000 (22:22 -0400)]
window.c: Only set input region when we have a decoration

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

12 years agotests: Handle modifier event in test-client.c
Kristian Høgsberg [Tue, 10 Jul 2012 02:17:03 +0000 (22:17 -0400)]
tests: Handle modifier event in test-client.c

We need the handle the newly added modifiers event.

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

12 years agoOnly position fullscreen surface in surface->configure callback
Kristian Høgsberg [Tue, 10 Jul 2012 01:43:22 +0000 (21:43 -0400)]
Only position fullscreen surface in surface->configure callback

We end up calling shell_configure_fullscreen() from activate(), where
surface->buffer may be NULL.  Instead, call it on initial map and
first buffer attach after surface type change.  Both code path
come from the surface->configure callback where surface->buffer is know
to be non-NULL.

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

12 years agowcap-snapshot: add return value
Jan Engelhardt [Mon, 9 Jul 2012 15:18:10 +0000 (17:18 +0200)]
wcap-snapshot: add return value

Distro build with rpmlint aborts due to missing exit status.

12 years agotoytoolkit: Remove redundant XKB free
Daniel Stone [Mon, 9 Jul 2012 11:27:28 +0000 (12:27 +0100)]
toytoolkit: Remove redundant XKB free

We already unref these in fini_xkb().

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agoAdd cscope.out to .gitignore
Martin Olsson [Mon, 9 Jul 2012 09:35:53 +0000 (11:35 +0200)]
Add cscope.out to .gitignore

12 years agoclients: Free resources on exit in eventdemo
Martin Olsson [Sun, 8 Jul 2012 09:11:18 +0000 (11:11 +0200)]
clients: Free resources on exit in eventdemo

12 years agoclients: Silence 2x gcc 4.6.3 "warn_unused_result" compiler warnings
Martin Olsson [Sun, 8 Jul 2012 01:03:47 +0000 (03:03 +0200)]
clients: Silence 2x gcc 4.6.3 "warn_unused_result" compiler warnings

window.c:1173:6: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
desktop-shell.c:305:6: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]

12 years agowcap: Plug memory leak in wcap_decoder_create()
Martin Olsson [Sun, 8 Jul 2012 01:03:46 +0000 (03:03 +0200)]
wcap: Plug memory leak in wcap_decoder_create()

12 years agoxwayland: Don't leak fd while reading lock file in src/xwayland/launcher.c
Martin Olsson [Sun, 8 Jul 2012 01:03:45 +0000 (03:03 +0200)]
xwayland: Don't leak fd while reading lock file in src/xwayland/launcher.c

12 years agocompositor-x11: Add error handling in x11_compositor_create()
Martin Olsson [Sun, 8 Jul 2012 01:03:44 +0000 (03:03 +0200)]
compositor-x11: Add error handling in x11_compositor_create()

12 years agocompositor-wayland: Add error handling in wayland_compositor_create()
Martin Olsson [Sun, 8 Jul 2012 01:03:43 +0000 (03:03 +0200)]
compositor-wayland: Add error handling in wayland_compositor_create()

12 years agocompositor-android: Add proper error handling in android_compositor_create()
Martin Olsson [Sun, 8 Jul 2012 01:03:42 +0000 (03:03 +0200)]
compositor-android: Add proper error handling in android_compositor_create()

12 years agoshared: Don't leak file descriptor in shared/image-loader.c
Martin Olsson [Sun, 8 Jul 2012 01:03:41 +0000 (03:03 +0200)]
shared: Don't leak file descriptor in shared/image-loader.c

12 years agoclients: Don't leak "menu" on error path in clients/window.c
Martin Olsson [Sun, 8 Jul 2012 01:03:40 +0000 (03:03 +0200)]
clients: Don't leak "menu" on error path in clients/window.c

12 years agoclients: Add clients/weston-screensaver to clients/.gitignore
Martin Olsson [Sun, 8 Jul 2012 01:03:38 +0000 (03:03 +0200)]
clients: Add clients/weston-screensaver to clients/.gitignore

12 years agocompositor: Always empty the input region of the pointer surface
Ander Conselvan de Oliveira [Wed, 4 Jul 2012 12:48:29 +0000 (15:48 +0300)]
compositor: Always empty the input region of the pointer surface

Otherwise a surface.attach request might cause the input region to be
reset to the default value (the entire surface) causing it to receive
focus.

Tiago ran into this problem with xwayland.

12 years agoweston: Clip window title text to the frame
Martin Minarik [Mon, 2 Jul 2012 21:05:50 +0000 (23:05 +0200)]
weston: Clip window title text to the frame

Fixes an issue with text overflowing the available frame space.

12 years agocompositor-x11: Set make and model so we don't send NULL strings
Kristian Høgsberg [Tue, 3 Jul 2012 01:24:57 +0000 (21:24 -0400)]
compositor-x11: Set make and model so we don't send NULL strings

12 years agoshell: Use desired output when sending configure events when maximised
Rob Bradford [Mon, 2 Jul 2012 18:00:19 +0000 (19:00 +0100)]
shell: Use desired output when sending configure events when maximised

With shell_surface.set_maximised the caller can provide an output to maximise
to or the default output will be used. With the corresponding configure we
should use the dimensions from the chosen output not the output the surface
was currently on.

Similarly when calculating the position for the window in the map() function
we should use the desired output again.

There is no need to assign shsurf->output to es->output since that happens in
the map() function later.

12 years agocompositor: Correctly calculate changed sub image rectangle
Rob Bradford [Mon, 2 Jul 2012 16:33:40 +0000 (17:33 +0100)]
compositor: Correctly calculate changed sub image rectangle

When calling glTexSubImage2D for sub image updates for SHM surfaces the
changed rectangle was being wrongly calculated. This resulted in interesting
redraw artefacts for clients using SHM.

12 years agoterminal: Extend selection to end of line when selecting past last char
Kristian Høgsberg [Mon, 2 Jul 2012 01:31:46 +0000 (21:31 -0400)]
terminal: Extend selection to end of line when selecting past last char

12 years agoterminal: Insert newlines when copying multiple lines
Kristian Høgsberg [Mon, 2 Jul 2012 01:25:41 +0000 (21:25 -0400)]
terminal: Insert newlines when copying multiple lines

12 years agoclipboard: initialise clipboard memory after creation
Rafal Mielniczuk [Sat, 30 Jun 2012 16:33:34 +0000 (18:33 +0200)]
clipboard: initialise clipboard memory after creation

In case we don't, weston segfault in clipboard_set_selection
on:
if (clipboard->source)
clipboard_source_unref(clipboard->source);

12 years agoterminal: Handle selection for pointer positions outside widget correctly
Kristian Høgsberg [Fri, 29 Jun 2012 15:35:24 +0000 (11:35 -0400)]
terminal: Handle selection for pointer positions outside widget correctly

That is, don't crash and select entire first/last line when the pointer
is above or below widget.

12 years agowindow.c: Don't allocate proxy manually
Kristian Høgsberg [Fri, 29 Jun 2012 02:04:06 +0000 (22:04 -0400)]
window.c: Don't allocate proxy manually

With the wayland change to automatically allocate the client side proxy
manually, we can now drop the code (and the FIXME) that did that and just
receive the proxy from the callback arguments.

12 years agoterminal: Add a terminal enter handler for setting I-beam cursor
Kristian Høgsberg [Thu, 28 Jun 2012 18:27:02 +0000 (14:27 -0400)]
terminal: Add a terminal enter handler for setting I-beam cursor

Now that the mod+click shortcuts change the cursor, this was suddenly obvious.

12 years agoshell: Don't move fullscreen surfaces
Ander Conselvan de Oliveira [Thu, 28 Jun 2012 15:08:06 +0000 (18:08 +0300)]
shell: Don't move fullscreen surfaces

12 years agoshell: Show approprite cursors during move and resize grabs
Ander Conselvan de Oliveira [Thu, 28 Jun 2012 15:08:05 +0000 (18:08 +0300)]
shell: Show approprite cursors during move and resize grabs

This patch expands the busy cursor mechanism so that it is possible for
the desktop-shell client to show the appropriate cursor during grabs.

12 years agocompositor: Always allow owner of pointer surface to change the hotspot
Ander Conselvan de Oliveira [Thu, 28 Jun 2012 15:08:04 +0000 (18:08 +0300)]
compositor: Always allow owner of pointer surface to change the hotspot

Make pointer_set_cursor() succeed if a client that doesn't have pointer
focus but is the owner of the current pointer surface calls it.

12 years agocompositor: Move repaint debug binding to mod-shift-space
Kristian Høgsberg [Thu, 28 Jun 2012 18:13:10 +0000 (14:13 -0400)]
compositor: Move repaint debug binding to mod-shift-space

Alt-space or Super-space are too likely to conflict with application
bindings.

12 years agocompositor: Update xkb state with key releases on focus out
Kristian Høgsberg [Thu, 28 Jun 2012 17:46:09 +0000 (13:46 -0400)]
compositor: Update xkb state with key releases on focus out

This happens when vt-switching away from the compositor (drm) or
giving keyboard focus to a different X window.  Release the modifiers
so we don't get stuck modifiers.  We'll update with the new keys down
when we come back.

12 years agocompositor-drm: Improve initial mode picking
Kristian Høgsberg [Thu, 28 Jun 2012 15:28:15 +0000 (11:28 -0400)]
compositor-drm: Improve initial mode picking

We now pick the driver preferred mode for our initial mode.  If no preferred
mode is available we default to the current mode.  We also have a command
line option now to keep the current mode if it differs from the preferred.

This commit also drops the built-in mode and insteade uses the current mode
if the connector doesn't report any modes.

12 years agoterminal: Scroll selection with terminal contents
Kristian Høgsberg [Wed, 27 Jun 2012 23:29:41 +0000 (19:29 -0400)]
terminal: Scroll selection with terminal contents

12 years agoterminal: Make font size configurable
Kristian Høgsberg [Wed, 27 Jun 2012 21:52:23 +0000 (17:52 -0400)]
terminal: Make font size configurable

12 years agoterminal: Implement word and line based selection
Kristian Høgsberg [Wed, 27 Jun 2012 21:43:10 +0000 (17:43 -0400)]
terminal: Implement word and line based selection

Double-click to select by word, triple click to select by line.

12 years agoshell: Take a wl_surface as parent for transient and popup windows
Kristian Høgsberg [Wed, 27 Jun 2012 14:22:58 +0000 (10:22 -0400)]
shell: Take a wl_surface as parent for transient and popup windows

12 years agoshell: Make input_panel just a regular wl_surface
Kristian Høgsberg [Wed, 27 Jun 2012 14:22:15 +0000 (10:22 -0400)]
shell: Make input_panel just a regular wl_surface

12 years agoshell: Make screensaver just a wl_surface
Kristian Høgsberg [Wed, 27 Jun 2012 02:15:53 +0000 (22:15 -0400)]
shell: Make screensaver just a wl_surface

12 years agoshell: Make the lock surface just a plain wl_surface too
Kristian Høgsberg [Wed, 27 Jun 2012 01:44:35 +0000 (21:44 -0400)]
shell: Make the lock surface just a plain wl_surface too

12 years agoshell: Make panel just a wl_surface too
Kristian Høgsberg [Wed, 27 Jun 2012 01:19:23 +0000 (21:19 -0400)]
shell: Make panel just a wl_surface too

12 years agoshell: Don't make desktop_shell background a wl_shell_surface
Kristian Høgsberg [Tue, 26 Jun 2012 20:29:50 +0000 (16:29 -0400)]
shell: Don't make desktop_shell background a wl_shell_surface

We don't gain anything from taking a wl_shell_surface in
desktop_surface.set_background, except making wl_shell_surface
gratuitously dependent on wl_shell.  In shell.c we can also handle
backgrounds in their own background_configure function which simplifies
the mapping and placement logic.

12 years agoterminal: Tab should not output spaces, just move cursor
Kristian Høgsberg [Tue, 26 Jun 2012 15:57:40 +0000 (11:57 -0400)]
terminal: Tab should not output spaces, just move cursor

Emacs uses tab and backspace to move the cursor as well as the regular
cursor movement escape codes.  When it's less bytes than the escape code,
emacs will use a tab or tab + backspace to move the cursor forward.  The
effect is that as you're  moving around in the buffer, emacs will
(seemingly) randomly insert spaces and overwrite what's in the terminal.
Making tab just move the cursor as it should fixes this.

12 years agocompositor-drm: Don't leak FBs when the buffer of a sprite is detroyed
Ander Conselvan de Oliveira [Tue, 26 Jun 2012 14:09:15 +0000 (17:09 +0300)]
compositor-drm: Don't leak FBs when the buffer of a sprite is detroyed

As a side effect, the overlay is disabled when the buffer is destroyed.

12 years agocompositor-drm: Remove destroy listeners when disabling planes
Ander Conselvan de Oliveira [Tue, 26 Jun 2012 14:09:14 +0000 (17:09 +0300)]
compositor-drm: Remove destroy listeners when disabling planes

When an unused plane is disabled, the destroy listener for a previously
used buffer needs to be removed. This fixes a crash when an overlay
would be reenabled using the same buffer as before, causing the destroy
listener to be inserted twice.

12 years agocompositor-drm: Wait for vblank events before starting next frame
Ander Conselvan de Oliveira [Tue, 26 Jun 2012 14:09:13 +0000 (17:09 +0300)]
compositor-drm: Wait for vblank events before starting next frame

Besides the fact of the frame not being done, assigning planes before
the vblank handler is called will make the state inconsistent, leading
to a crash.

12 years agocompositor-drm: Check surface's outputs when assigning overlays
Ander Conselvan de Oliveira [Tue, 26 Jun 2012 14:09:12 +0000 (17:09 +0300)]
compositor-drm: Check surface's outputs when assigning overlays

Check if the output passed to drm_output_prepare_overlay_surface() does
actually contain the surface and fail if it doesn't. Also fail if a
surface spans multiple outputs since clearing the damage will cause the
portion that is not in an overlay to not be updated at all.

12 years agosimple-egl: Make window moveable
Ander Conselvan de Oliveira [Tue, 26 Jun 2012 14:09:11 +0000 (17:09 +0300)]
simple-egl: Make window moveable

12 years agoconfigure.ac: Bump version to 0.94.90
Kristian Høgsberg [Mon, 25 Jun 2012 22:12:10 +0000 (18:12 -0400)]
configure.ac: Bump version to 0.94.90

12 years agoshell: Fix inverted test for locked in workspace bindings
Kristian Høgsberg [Tue, 26 Jun 2012 01:35:29 +0000 (21:35 -0400)]
shell: Fix inverted test for locked in workspace bindings

12 years agoMakefile.am: Don't list wcap sub directory twice in DIST_SUBDIRS
Kristian Høgsberg [Mon, 25 Jun 2012 22:05:08 +0000 (18:05 -0400)]
Makefile.am: Don't list wcap sub directory twice in DIST_SUBDIRS

12 years agotests: Add weston-test to EXTRA_DIST
Kristian Høgsberg [Mon, 25 Jun 2012 21:50:22 +0000 (17:50 -0400)]
tests: Add weston-test to EXTRA_DIST

12 years agoMove text-cursor-position.c into zoom.c
Kristian Høgsberg [Mon, 25 Jun 2012 21:13:58 +0000 (17:13 -0400)]
Move text-cursor-position.c into zoom.c

12 years agowcap: Add vpx_config.h to Makefile.am
Kristian Høgsberg [Mon, 25 Jun 2012 21:13:34 +0000 (17:13 -0400)]
wcap: Add vpx_config.h to Makefile.am

12 years agoxwm: Add xwayland.h to Makefile.am
Kristian Høgsberg [Mon, 25 Jun 2012 20:00:48 +0000 (16:00 -0400)]
xwm: Add xwayland.h to Makefile.am

12 years agoInstall screensaver by default
Kristian Høgsberg [Mon, 25 Jun 2012 18:06:45 +0000 (14:06 -0400)]
Install screensaver by default

12 years agoshell: Hide workspace layer when locking screen
Kristian Høgsberg [Mon, 25 Jun 2012 18:03:13 +0000 (14:03 -0400)]
shell: Hide workspace layer when locking screen

12 years agocompositor: Send ping to keyboard focus surface for key press
Kristian Høgsberg [Fri, 22 Jun 2012 20:57:21 +0000 (16:57 -0400)]
compositor: Send ping to keyboard focus surface for key press

We were sending to the pointer focus surface.

12 years agoterminal: Ignore more modifier keys
Kristian Høgsberg [Fri, 22 Jun 2012 16:18:56 +0000 (12:18 -0400)]
terminal: Ignore more modifier keys

Don't want these to leak into the terminal.

12 years agoterminal: Only hide cursor for keypresses that generate data for the process
Kristian Høgsberg [Fri, 22 Jun 2012 16:17:17 +0000 (12:17 -0400)]
terminal: Only hide cursor for keypresses that generate data for the process

12 years agocompositor-drm: Add proper error handling to init
Daniel Stone [Fri, 22 Jun 2012 13:04:37 +0000 (14:04 +0100)]
compositor-drm: Add proper error handling to init

This way, if initialisation fails (say, udev or Mesa are broken, or we
couldn't find any devices), we'll at least take you back to where you
were, rather than leave you at a totally broken VT you can't escape
from.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agoSplit weston_compositor_init into base and _gl
Daniel Stone [Fri, 22 Jun 2012 13:04:36 +0000 (14:04 +0100)]
Split weston_compositor_init into base and _gl

weston_compositor_init is always called late because most
implementations can't initialise GL until fairly late in the game.
Split it into a base version with the same name, followed by
weston_compositor_init_gl which can be called later on.

This simplifies compositor-wayland, which no longer needs a separate
global handler just for wl_seat.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agocompositor-wayland: Synchronise keyboard state with parent
Daniel Stone [Fri, 22 Jun 2012 12:21:41 +0000 (13:21 +0100)]
compositor-wayland: Synchronise keyboard state with parent

Use the wl_keyboard::modifiers events our parent helpfully sends us to
make sure our views of the keyboard state are always identical, rather
than relying on key press events to do the right thing.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agocompositor-x11: Attempt to track state without XKB
Daniel Stone [Fri, 22 Jun 2012 12:21:40 +0000 (13:21 +0100)]
compositor-x11: Attempt to track state without XKB

This isn't very pleasant, but it's pretty much the best we can do in the
absence of either XCB XKB support, or XCB XI2 bindings (argh!).

We get a state mask with most significant X11 events (which inexplicably
includes EnterNotify but not FocusIn), but unfortunately it's only a
single flat set of effective modifiers rather than the more granular
sets we want, so we still update the state with every key, but then also
use the core X11 state as a mask to make sure we don't get any stuck
modifiers.

Ugh.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agocompositor-x11: Use XKB StateNotify to synchronise state
Daniel Stone [Fri, 22 Jun 2012 12:21:39 +0000 (13:21 +0100)]
compositor-x11: Use XKB StateNotify to synchronise state

Make sure that we always have the exact same view of the keyboard state
as the host server by using XKB StateNotify events to update our state
exactly rather than relying on key events.  In particular, this fixes
key state during grabs, where we either miss modifiers completely or get
them stuck permanently, depending on the nature of the grab and the
implementation of the X window manager/compositor.

The downside, however, is that Weston wakes up on every modifier change,
regardless of whether or not it has focus.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agoRename modifier_state_changed to notify_modifiers
Daniel Stone [Fri, 22 Jun 2012 12:21:38 +0000 (13:21 +0100)]
Rename modifier_state_changed to notify_modifiers

notify_modifiers will now synchronise Weston's internal state with the
XKB state, and send a modifier event if necessary.  This eliminates the
need for update_modifier_state to have a return value at all.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agonotify_key: Add update_state argument
Daniel Stone [Fri, 22 Jun 2012 12:21:37 +0000 (13:21 +0100)]
notify_key: Add update_state argument

If update_state is true, then notify_key will continue to call
xkb_key_update_state to update the local state mask, as before this
commit.  Otherwise, it will rely on the compositor to manually update
the state itself, for nested compositors.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agocompositor-x11: Use XKB detectable autorepeat if possible
Daniel Stone [Fri, 22 Jun 2012 12:21:36 +0000 (13:21 +0100)]
compositor-x11: Use XKB detectable autorepeat if possible

If we have XCB XKB support, use XKB's detectable autorepeat, which
generates repeat sequences as a series of
press-press-press-[...]-release events, rather than
press-release-press-release-[...].

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agocompositor-x11: Add base XCB/XKB support
Daniel Stone [Fri, 22 Jun 2012 12:21:35 +0000 (13:21 +0100)]
compositor-x11: Add base XCB/XKB support

Try to find the XKB extension, to be used in later commits.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agocompositor-x11: Move input creation before output
Daniel Stone [Fri, 22 Jun 2012 12:21:34 +0000 (13:21 +0100)]
compositor-x11: Move input creation before output

So we can set up XKB masks and be sure to get the right events before
we set up our window.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agoweston_xkb_info: Cache all modifier indices for X11
Daniel Stone [Fri, 22 Jun 2012 12:21:33 +0000 (13:21 +0100)]
weston_xkb_info: Cache all modifier indices for X11

X11 has a set of eight modifiers which we want to represent.  Cache
their indices when we create a weston_xkb_info, so we can use this from
compositor-x11 to keep the state synchronised exactly between the host X
server and a nested Weston instance.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agoRun key bindings on keyboard focus in
Daniel Stone [Fri, 22 Jun 2012 12:21:32 +0000 (13:21 +0100)]
Run key bindings on keyboard focus in

This is mainly for X11's benefit; the common case is using Logo+S to
take a screenshot, where GNOME Shell has grabbed Logo, and replays the
event down to the nested compositor after S is pressed.  This means we
get an enter event with both Logo and S down, and even if Shell delivers
the key press event for S (which isn't mandatory, and not all window
managers do), then we never run the binding since notify_key realises
that S is already down and exits early.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agoIgnore repeat keys in notify_key
Daniel Stone [Fri, 22 Jun 2012 12:21:31 +0000 (13:21 +0100)]
Ignore repeat keys in notify_key

Let compositors just blithely post through every event they get,
including repeating keys.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agoLet wayland-server send modifier events for focus
Daniel Stone [Fri, 22 Jun 2012 12:21:30 +0000 (13:21 +0100)]
Let wayland-server send modifier events for focus

When the focus changes, wl_keyboard_set_focus (and, as an added bonus,
wl_pointer_set_focus) will now send wl_keyboard::modifier events for us
if we store the modifier state in the right place, so we don't have to
worry about that anymore.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agoSplit notify_keyboard_focus into in/out variants
Daniel Stone [Fri, 22 Jun 2012 12:21:29 +0000 (13:21 +0100)]
Split notify_keyboard_focus into in/out variants

Since the two functions had nothing in common but the local variables.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years ago.gitignore: Ignore ctags and cscope output
Daniel Stone [Fri, 22 Jun 2012 12:21:28 +0000 (13:21 +0100)]
.gitignore: Ignore ctags and cscope output

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agowindow.c: Always set cursor after pointer enter
Kristian Høgsberg [Fri, 22 Jun 2012 14:52:58 +0000 (10:52 -0400)]
window.c: Always set cursor after pointer enter

If the cursor didn't change since last time we had pointer focus we just
wouldn't change it.  But whoever had pointer focus in the mean time could
have changed it, so make sure we always set the cursor after pointer enter.