Commit Graph

2057 Commits

Author SHA1 Message Date
Daniel Stone
9a9ee2c779 Split XKB keymap compilation out into separate function
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:48:24 -04:00
Daniel Stone
74419a2237 Split weston_seat_init up into pointer/keyboard/touch
So we don't unnecessarily advertise interfaces the seat doesn't support.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:47:41 -04:00
Daniel Stone
97f685449e clients: Move XKB info from display to input struct
As it does (will) vary per-seat.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:46:30 -04:00
Daniel Stone
2fce4028d6 Convert wl_pointer::axis to wl_fixed_t
To go with the matching protocol change.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:45:25 -04:00
Daniel Stone
0c1e46eb18 Use wl_fixed_t for axis bindings
In preparation for axis values being wl_fixed_t in the protocol as well.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:45:20 -04:00
Daniel Stone
325fc2d53a Split bindings into separate key/button/axis bindings
Rather than attempting to have the one handler prototype everywhere.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:45:16 -04:00
Daniel Stone
878f0b77a8 Convert notify_axis to wl_fixed_t
In preparation for the rest of the axis code changing.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:45:08 -04:00
Daniel Stone
b21046836f shell: Reset focus for all seats on activation
Rather than using a single hardcoded seat to activate new windows within
a compositor, reset the focus for all seats.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:45:02 -04:00
Daniel Stone
162f78af68 tablet-shell: Use seat_list rather than primary seat
Activate surfaces for all seats when showing the grid, not just the
primary seat.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:44:14 -04:00
Daniel Stone
4034c7ac21 tablet-shell: Remove 'seat' member
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:44:08 -04:00
Daniel Stone
4dab5dba3f Use compositor->seat_list instead of a singular seat
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:44:03 -04:00
Daniel Stone
c9785eacca Use enum wl_keyboard_key_state instead of integer
Instead of using a uint32_t for state everywhere (except on the wire,
where that's still the call signature), use the new
wl_keyboard_key_state enum, and explicit comparisons.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:43:03 -04:00
Daniel Stone
4dbadb1556 Use enum wl_pointer_button_state instead of integer
Instead of using a uint32_t for state everywhere (except on the wire,
where that's still the call signature), use the new
wl_pointer_button_state enum, and explicit comparisons.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:42:47 -04:00
Daniel Stone
11d7139989 test-client.c: Replace hard-coded magic value
Took me a second to work out that the 272 was actually BTN_LEFT, as keys
and buttons share a namespace in evdev.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:42:25 -04:00
Daniel Stone
7bbd5b3335 evdev: Add LED update hook
Simply pushes the updated LEDs through to all keyboard attached to the
seat.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:42:17 -04:00
Daniel Stone
33965c242d evdev: Add device capabilities
Does what it says on the box: lists whether or not the device supports
key, absolute, relative or touch classes.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:42:15 -04:00
Daniel Stone
1d637772c8 Rename evdev_input_device::type to pending_events
Since that's what it actually is, rather than a description of the
device as such.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:41:11 -04:00
Daniel Stone
a62e804c7e evdev: Convert device type to an enum
Rather than using #defines.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:40:47 -04:00
Daniel Stone
8c8164faeb Add core LED handling
Similar to how we deal with modifiers, also add LED handling to the core
input code, with a callout into the backends to update them when they
change.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:38:50 -04:00
Daniel Stone
e3f15edc2f Do binding modifier lookup on XKB state, not physical keys
When we update the modifier_state used for Weston bindings, derive this
from the XKB modifier state, rather than a hardcoded mapping of physical
keys to modifier state.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:38:10 -04:00
Daniel Stone
994679a20e Move xkb_state object to weston_seat
As we need to keep a separate state for every seat (i.e. keyboard
interface) rather than a compositor-global state.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:28:32 -04:00
Daniel Stone
496ca17a77 Convert Weston modifier #defines to an enum
To avoid any possible collision between the disparate XKB and Weston
modifier namespaces.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:28:23 -04:00
Daniel Stone
351eb61fbc Support wl_keyboard::modifiers event
This event lets the compositor inform clients of the canonical keyboard
modifier/group state.  Make sure we send it at appropriate moments from
the compositor, and listen for it in clients as well.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:27:47 -04:00
Daniel Stone
7ace3902f9 Update XKB state in update_modifier_state
As well as just updating Weston's internal modifier_state, also update
our xkb_state object, in preparation for serialising modifier values to
clients.  This also makes update_modifier_state return 1 if the
modifier/group state has changed, or 0 if not.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 13:59:28 -04:00
Daniel Stone
17b13bd89f Update pointer and keyboard focus on new listeners
If we get a new wl_pointer or wl_keyboard listener from the client
currently owning the focus resource, issue another
wl_{pointer,keyboard}_set_focus so the focus_resource can be updated and
the client can receive an enter event.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 13:58:49 -04:00
Pekka Paalanen
3ae50bb45c Add Android backend
The Android backend provides basic EGL/GLES2 graphics, where everything
is always composited. Overlays are not used. Input is stubbed, therefore
there is no input yet.

This adds the first C++ source file into Weston compositor. The Android
gralloc and fb HAL glue code to the Android EGL library is in C++, and
there is no way to access it from plain C. We have a simple wrapper to
the required C++ class API. Android forces the C++ file name extension
to .cpp.

The android backend is compiled by default. However, all Android
specific calls are protected with #ifdef ANDROID, so it will build also
without Android headers. The binary produced without the Android build
system is useless, but allows build-testing generic Weston changes.
Therefore the android backend is not installed.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-05-31 13:54:01 -04:00
Pekka Paalanen
daed3bc1aa tests, wcap: update ignores
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-05-31 13:53:57 -04:00
Pekka Paalanen
647f2bfd2a window: add wrapper for EPOLL_CLOEXEC
Android does not have EPOLL_CLOEXEC, so add a fallback.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-05-31 13:53:51 -04:00
Pekka Paalanen
200019c0c6 compositor: check for execinfo.h
Some systems may not have execinfo.h. Add a configure test for it, and
if it is not found, make the backtrace() call a no-operation.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-05-31 13:52:24 -04:00
Pekka Paalanen
51aaf646db compositor: work around missing SOCK_CLOEXEC
Android does not have SOCK_CLOEXEC, so implement a wrapper that falls
back.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-05-31 13:52:20 -04:00
Scott Moreau
7a1b32a198 Implement text cursor position protocol.
Here we create a new client/compositor interface in weston to allow
clients to report their x/y cursor position to the compositor. These
values are then used to center the zoom area on this point. This
is useful for everyone, especially people who are visually impaired.
2012-05-31 13:10:22 -04:00
Kristian Høgsberg
d64bdf4755 xwm: Just ignore the synthetic unmap_notify
As per ICCCM 4.1.4 we're supposed to withdraw the window when we see
the real unmap or the synthetic unmap, whichever comes first.  The
synthetic unmap may come after the window has been destroyed, so let's
just only handle the real unmap.
2012-05-31 10:33:43 -04:00
Kristian Høgsberg
f7a69642a9 wcap: Convert argb to yv12 using integer math instead
Drop from 8% in the profile to 1.8%.
2012-05-30 15:01:03 -04:00
Kristian Høgsberg
86aa5fbbe6 wcap: Fix README typo
Thanks to Jonas Kulla <nyocurio@googlemail.com> for spotting it.
2012-05-30 13:00:54 -04:00
Kristian Høgsberg
a6d9a5e4aa xwm: Set WM_STATE window property
xprop and gtk+ dnd is now working.
2012-05-30 12:15:44 -04:00
Kristian Høgsberg
f197e9f7a3 xwm: Bring back synthetic events and handle synthetic unmap notify as per ICCCM 2012-05-30 11:46:29 -04:00
Kristian Høgsberg
e244cb03f7 xwm: Don't try to read deleted properties 2012-05-30 11:34:35 -04:00
Kristian Høgsberg
029539bf27 xwm: Handle reparenting windows 2012-05-30 11:28:24 -04:00
Kristian Høgsberg
44c2013d43 xwm: Don't select for XCB_EXPOSE
We don't need expose events.  All windows are redirected and we know
exactly when we need to repaint them.
2012-05-30 10:09:24 -04:00
Kristian Høgsberg
8d1aa7d8ef xwm: Don't dispatch for events coming from XSendEvent
GTK+ sends an unmap_notify to the root window when a toplevel GTK+ window
gets unmapped.  That may be a GTK+ bug, but we should just ignore events
from XSendEvent.
2012-05-30 10:06:59 -04:00
Kristian Høgsberg
194ea5423e xwm: Destroy frame resources and reparent back to root in unmap_notify
The frame window and the wayland surface needs to go away when then
X window is unmapped, not when it's destroyed.
2012-05-30 10:05:41 -04:00
Kristian Høgsberg
d96fe1f7e7 xwm: Remove pointless change set request 2012-05-30 10:04:15 -04:00
Kristian Høgsberg
f94a031b84 xwm: Don't select for STRUCTURE_NOTIFY or RESIZE_REDIRECT
We get all that information through SUBSTRUCTURE_NOTIFY on the parent
windows.
2012-05-30 10:02:58 -04:00
Kristian Høgsberg
bc6e1622b0 xwm: Ignore map request for already mapped window
If a client sends another map request before the server has seen our
reply to the first map request event, we might get a map request for an
already mapped window.  Just ignore that.
2012-05-30 09:59:56 -04:00
Kristian Høgsberg
0273b5716a xwm: Reduce window property debug output
We just print properties when they change now instead of dumping all
properties whenever we re-read them.  Also, make the property output a
little more concise.
2012-05-30 09:58:02 -04:00
Kristian Høgsberg
66a099b775 compositor: Only fini region if it's not the undef region 2012-05-29 16:49:45 -04:00
Kristian Høgsberg
c9571fbd3a xwm: Reset wm->focus_window when the focused window is destroyed 2012-05-29 15:35:29 -04:00
Kristian Høgsberg
053be42a4e wcap: Compute per-component deltas 2012-05-29 12:15:47 -04:00
Kristian Høgsberg
db0623a5f0 wcap: Add wcap README, with a bit of documentation 2012-05-29 11:36:27 -04:00
Kristian Høgsberg
f40d5d893f wcap-decode: Fix setting framerate
Default to 30fps instead of crashing if we don't get a framerate on the
command line.
2012-05-29 10:51:55 -04:00