Commit Graph

124 Commits

Author SHA1 Message Date
Pekka Paalanen
53e58485a5 window: remove dead EGL code
- remove unimplemented function from header
- remove the egl function pointers that were not used

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-16 10:46:15 -04:00
Kristian Høgsberg
fa80e11c84 Update to new fd and wl_registry APIs
This commit updates the clients and the wayland compositor backend to
use the new wl_registry mechanism and the thread safe fd API.
2012-10-10 21:34:38 -04:00
Kristian Høgsberg
1671e1129d window: Add getters for fullscreen and maximized state
This lets us eliminate a bit of redundancy in the clienst where they track
fullscreen state themselves.
2012-10-10 11:36:24 -04:00
Philipp Brüschweiler
7e0cc54fca toytoolkit: add axis handler 2012-08-14 15:51:13 -04:00
Kristian Høgsberg
86adef9d54 window.c: Handle multiple keyboard foci
Keep a count of number of wl_keyboard focus we have instead of
tracking the more recent wl_keyboard.
2012-08-13 22:28:10 -04:00
Kristian Høgsberg
67ace20f8e window.c: Add fullscreen handler to keep fullscreen state consistent 2012-07-23 21:56:31 -04:00
Scott Moreau
fe89f07e33 toytoolkit: Remove obsolete function window_set_custom(). 2012-07-12 09:18:49 -04:00
Kristian Høgsberg
962342cb8e 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.
2012-06-26 16:29:53 -04:00
Kristian Høgsberg
f337052a5c window: Add support for the blank cursor 2012-06-20 23:04:41 -04:00
Kristian Høgsberg
a1627927c7 window: Compute initial window size correctly
We didn't take decoration size into account before.
2012-06-20 17:30:03 -04:00
Ander Conselvan de Oliveira
80620076fc window: Implement animated cursors (using pointer surfaces)
Since the introduction of pointer.set_cursor(), it is possible for a
client to set the surface containing the pointer image and get frame
callbacks on it thus allowing a clear implementation of animated
cursors.

This also makes the busy cursor hack of using frame callbacks on the
busy surface unnecessary.
2012-06-15 11:03:12 -04:00
Kristian Høgsberg
d56bd908bf shell: Use a busy cursor animation for unresponsive surfaces 2012-06-05 09:58:51 -04:00
Kristian Høgsberg
7cee19778a window.c: Add primitive support for animated cursors
This just adds an entry point to set a specific frame of an animated cursor.
2012-06-04 23:39:04 -04:00
Kristian Høgsberg
8591dbf8b5 window.c: Add watch cursor 2012-06-04 16:10:40 -04:00
Kristian Høgsberg
5a4e9ff51b window.c: Drop timestamp argument to input_set_pointer_image()
We need the serial to set a pointer image and we track that internally.
2012-06-04 16:04:07 -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
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
Ander Conselvan de Oliveira
210eb9d2ba dnd: work around cairo-gl brokenness
If cairo-gl is used, display_create_surface() will create an
wl_egl_window for each surface and this will result in errors if this
surface is used as a source. Also, one can't get a wl_buffer for such
a surface wich led to crashes when trying to do so for the drag icon.

This patch works around both problems by forcing the item and drag icon
surfaces to use shm.
2012-05-25 23:28:59 -04:00
Ander Conselvan de Oliveira
dc8c8fce72 window: rename enum pointer_type to cursor_type
This avoids confusion with the pointer devices (struct wl_pointer).
2012-05-25 23:28:54 -04:00
Tiago Vignatti
82db9d80e6 window: add simple text tooltip handlers
Using set_transient.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-05-25 22:53:59 -04:00
Ander Conselvan de Oliveira
1042dc15e0 window: use libwayland-cursor instead of libXcursor 2012-05-22 10:17:34 -04:00
Tiago Vignatti
dec76580c4 window: send transient flags over the wire
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-05-21 12:30:50 -04:00
Daniel Stone
37816df646 Convert wl_input_device to wl_seat (and friends)
wl_input_device has been both renamed and split.  wl_seat is now a
virtual object representing a group of logically related input devices
with related focus.

It now only generates one event: to let clients know that it has new
capabilities.  It takes requests which hand back objects for the
wl_pointer, wl_keyboard and wl_touch interfaces it exposes which all
provide the old input interface, just under different names.

This commit tracks these changes in weston and the clients, as well as
similar renames (e.g. weston_input_device -> weston_seat).  Some other
changes were necessary, e.g. renaming the name for the visible mouse
sprite from 'pointer' to 'cursor' so as to not conflict.

For simplicity, every seat is always exposed with all three interfaces,
although this will change as time goes on.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-16 15:29:06 -04:00
Kristian Høgsberg
80680c7b75 window.c: Just use float instead of GLfloat, remove GLES2.h include 2012-05-10 14:11:44 -04:00
Kristian Høgsberg
7016313778 Port Wayland clients to new xkbcommon API
A little different from Daniels initial patch.  We look up the common
modifiers at xkb init time and convert the xkb serialized modifier mask
to our own modifier bitmask.
2012-05-08 15:55:39 -04:00
Daniel Stone
b230a7ee58 Convert internal input co-ordinates to GLfloat
Change all client motion handlers to take GLfloat for co-ordinates,
rather than int32_t.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-08 14:40:57 -04:00
Daniel Stone
5d66371743 Change button from int to uint32_t
Since you can't really have a negative button number.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-07 12:57:11 -04:00
Daniel Stone
da5b93c8d7 Change key/button grab bindings to take unsigned state
'state' here meaning 'is it up or down?', obviously.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-07 12:54:14 -04:00
Kristian Høgsberg
eae5de7609 Follow wayland change to serial numbers 2012-04-11 22:42:15 -04:00
Kristian Høgsberg
bad4297380 window: Drop EGLImage surface type 2012-04-10 11:49:45 -04:00
Kristian Høgsberg
bcacef19b0 Add an option parser
On one hand, getopt (in particular the -o suboption syntax) sucks on the
server side, and on the client side we would like to avoid the glib
dependency.  We can roll out own option parser and solve both problems
and save a few lines of code total.
2012-03-12 01:28:50 -04:00
Kristian Høgsberg
067fd60534 window.c: Drop support for rgb contexts 2012-02-29 16:15:53 -05:00
Kristian Høgsberg
010f98b083 window: Track and report input and opaque regions
We just set the input region to the bounding box of the window frame
and set the opaque region to be the opaque rectangle inside the window
if the child widget is opaque.
2012-02-23 17:30:54 -05:00
Daniel Stone
9d4f030c0b window: Use new xkbcommon include path
xkbcommon in current git has moved its include files.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-16 23:19:40 -05:00
Kristian Høgsberg
d6bcd7daa7 window: Toggle maximized with super-f5 2012-02-16 23:19:38 -05:00
Kristian Høgsberg
009ac0a965 window: Dont take width and height in window constructor
Always set this by scheduling an initial resize.
2012-01-31 15:24:48 -05:00
Kristian Høgsberg
d31fcab989 window: Make window frame menu available to client 2012-01-31 09:53:44 -05:00
Pekka Paalanen
6d174cff7a window: menu leak fixes
When a menu self-destructs, free also the widget and struct menu.

As menus are self-destructing, it does not make sense to store the
window pointer, since we cannot clear it automatically. Therefore,
rename window_create_menu() to window_show_menu() that does not return
the window pointer. It also calls window_schedule_redraw() internally.

Fixes Valgrind reported memory leaks.

The alternative would be to explicitly destroy the menu in application's
menu callback.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-19 16:42:05 +02:00
Pekka Paalanen
0bd892750d window: remove duplicate widget_resize_handler_t
Fixes the following build failure:

In file included from window.c:58:0:
window.h:194:16: error: redefinition of typedef 'widget_resize_handler_t'
window.h:178:16: note: previous declaration of 'widget_resize_handler_t' was here

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-16 21:02:43 -05:00
Kristian Høgsberg
b63235142d window: Move focus widget to struct input 2012-01-11 00:04:42 -05:00
Kristian Høgsberg
831dd52aa0 window: Implement input device grabbing
With all input events going to widgets now, we can grab an input device
to a widget, so that all events are delivered to that widgets handlers.
This lets us implement the last bit of the menu behaviour, that is
the client side grabbing of events.  The result is that we can now pop down
the menu when we receive clicks in the clients own windows and we
don't send motion and button events to other widgets.
2012-01-10 23:46:33 -05:00
Kristian Høgsberg
29af3ebce6 window: Make decorations just a widget
Woohoo, only took 25 commits of refactoring to get to this point.
2012-01-10 22:41:55 -05:00
Kristian Høgsberg
bb97700474 window: Get rid of the window child allocation concept 2012-01-10 19:11:42 -05:00
Kristian Høgsberg
441338cb75 window: Keep widgets in a tree instead of a list 2012-01-10 14:22:14 -05:00
Kristian Høgsberg
b67e94b170 window: Make resize and redraw handlers widget vfuncs 2012-01-10 14:22:10 -05:00
Kristian Høgsberg
bb901fac90 window: Return pointer type from widget enter handler 2012-01-09 11:22:32 -05:00
Kristian Høgsberg
a8a0db3497 window: Move button handler to widget 2012-01-09 11:12:05 -05:00
Kristian Høgsberg
87a57bbd73 window: Create a widget for the window, drop window motion handler 2012-01-09 10:34:35 -05:00
Kristian Høgsberg
04e98344cf window: Add a widget motion handler 2012-01-09 09:36:16 -05:00