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>
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>
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>
Print an user friendly error mesage when
the variable is not a valid directory.
krh: Edited to make message a litle more precise and added a check to
verify XDG_RUNTIME_DIR ownership and access mode.
Since we now batch up damage and only handle it at repaint time, we need
to apply it in case a buffer is destroyed so we don't lose it.
Ander found the problem, but we need to fix it in the compositor so we
don't change the behavior of the compositor.
weston_surface_update_transform() is typically called as part of the
repaint cycle so don't schedule a repaint here. There are still a couple
of places where we call weston_surface_update_transform() manually, but
they don't rely on the repaint being scheduled.
This is the point where we have just finished rendering the new scene
but before we swap it to the front buffer. At this point, the
output->previous_damage region exactly corresponds to what was just
renders, as compared to previous frame.
We start tracking which hardware plane a surface is displayed on, which
lets us avoid generating damage when a hardware overlay/cursor is moved
around.
EGLDisplay is helpfully typedeffed as void *, which means that you won't
get conflicting-pointer-type warnings if you accidentally confuse it
with weston_compositor::wl_display. Rename it to make it more clear
which display you're dealing with, and also rename compositor-wayland's
parent.display member to parent.wl_display.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
We transform the surface damage to global damage at weston_output_repaint()
time. This way we don't touch the transform when it might not be valid
and in case of overlapping damage, we only copy pixels once for shm textures.
Expecting the link to be initialized breaks when compositor-drm.c
takes surfaces out of the list. We could fix that to also
wl_list_init() the link, but we're moving to making the surface list
local to weston_output_repaint(), rebuilt in and only valid during
weston_output_repaint() so just don't touch it instead.
If a surface is map'd and unmap'd before an output repaint occurs, it
is not added to the compositor's surface list, so the field
weston_surface::link might be invalid (the field is initialized on
weston_surface_create()), and it that case Weston will crash on the
call to wl_list_remove(&surface->link) in weston_surface_unmap().
Initialize the surface->link after the call to wl_list_remove() to make
sure a following call to wl_list_remove() won't cause a crash.
Iterate the frame_counter before calling animation->frame() because the animation might be
destroyed in this path. The first frame is now 1 (not 0) in the animation frame handlers.
A workspace is a list of top level surfaces visible at a time. New
toplevel surfaces are added to the current workspace. Default
keybindings (modifier - Up, modifier - Down, modifier - F1 up to F6) are
used for navigating between workspaces. By default a single workspace is
created.
Surfaces of inactive workspaces have their outputs NULL:ed so that frame
callbacks gets queued instead of emitted. When workspace gets visible
again surface's outputs are assigned.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
We need to update the temp grab pointer after weston_compositor_run_key_binding()
before calling the key handler because it may have installed a new grab.
It is useful to have relevant information about the host system.
Example:
[..] OS: Linux, 3.0.0-13-generic, #22-Ubuntu SMP Wed Nov 2 13:25:36 UTC 2011, i686
This is logging functionality for weston compositor.
It handles:
messages coming from libwayland-server from wl_log()
messages from weston itself, from weston_log()
Introduce --log option, to specify log file path on the command line.
When the path is incorrect, or on weston_log_file_destroy(), fall
back to stderr.
Weston has a SIGSEGV handler that attempts to shut everything down
cleanly. If it actually succeeds in that, the process exit status will
indicate success, when the process just segfaulted.
Fix that by setting the return value to failure in the SEGV handler.
v2: use a local instead of a global variable
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Without this patch, Weston would not start with the message:
creating a keymap file for 44012 bytes failed: No such file or directory
If you do not know, that we use XDG_RUNTIME_DIR for that, the message is
very confusing. Therefore implement a clear error message right at the
start if XDG_RUNTIME_DIR is not set.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>