Commit Graph

91 Commits

Author SHA1 Message Date
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
Kristian Høgsberg
ab9e79ffc2 window: Remove window enter/leave handlers 2012-01-09 09:32:07 -05:00
Kristian Høgsberg
ee143236d7 window: Replace widget focus handler with a enter/leave handler pair 2012-01-09 08:42:24 -05:00
Kristian Høgsberg
9a13dab8a9 window: Move widget focus handler to the widget 2012-01-08 15:18:19 -05:00
Kristian Høgsberg
c51f79954b window: Rename item to widget
It's a widget.
2012-01-08 15:09:53 -05:00
Kristian Høgsberg
4f7dcd6eb1 window: Add a window menu
At least this gives us a way to close the toy toolkit clients.
2012-01-06 22:03:44 -05:00
Kristian Høgsberg
b3cca0a411 shell: Start implementing the popup surface type
This lands the basic behavior of the popup surface type, but there are still
a number of details to be worked out.  Mainly there's a hardcoded timeout
to handle the case of releasing the popup button outside any of the
client windows, which triggers popup_end if it happens after the timeout.
Maybe we just need to add that as an argument, or we could add a new event
that fires in this case to let the client decide whether it ends the popup
or not.
2012-01-06 11:41:55 -05:00
Kristian Høgsberg
e7aaec301a x11: Bridge X11 CLIPBOARD selection to Wayland clients 2011-12-27 13:50:04 -05:00
Pekka Paalanen
fe6079ac09 window: add display_destroy()
Add a function to destroy the 'struct display', supposedly with all
contained resources, that are not explicitly created by the application.

The implementation at this time is incomplete. It does clean up the
following:
- xkb structure is freed (needs new libxkbcommon from git)
- EGL resources are freed
- wl_display is flushed and destroyed

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-22 11:27:50 +02:00
Pekka Paalanen
826d795448 window: add display_exit()
Add a function, that schedules the display_run() event loop to break
out.

When display_exit() is called, processing continues as usual, until
currently waiting events and deferred tasks have been processed, and
sent requests are flushed. Then, display_run() will return.

This enables toytoolkit apps to handle their exit instead of just being
killed or call exit().

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-22 11:27:50 +02:00
Kristian Høgsberg
bbedd7e9d2 clients: Implement a toy-menu for testing the menu surface type 2011-12-19 15:40:10 -05:00
Pekka Paalanen
999c5b5dcb window: expose outputs to applications
Add output_configure_handler as a display property. This exposes only
configured outputs, that is the current mode info is already received,
to applications.

The handler is also called for mode changes on an existing output. This
simplifies the implementation in toytoolkit as we can defer the handler
calls from wl_output binding time to when we receive the current mode.
We do not need separate handlers for "new output" and "mode changed". A
plain "new output" handler would be problematic as the current mode is
not known yet.

Also add delete_handler hook for outputs, but that will never be called
for now, as the protocol lacks a way to signal output disconnections.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-14 11:17:46 +02:00
Pekka Paalanen
c1765c67b3 move config parser to a convenience library
Create a new directory for convenience librariers that can be shared
between compositor components and clients.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-08 10:25:12 +02:00
Pekka Paalanen
9d1613eb4a wl_shell_surface adaptation
Protocol changes in Wayland core introduced a new interface
wl_shell_surface, and moved all wl_shell surface methods into it. Adapt
the compositor and its Wayland backend, shell plugin, and all clients to
the new interface.

Depends on the Wayland core commit "protocol: introduce wl_shell_surface"

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-04 14:54:26 -05:00
Kristian Høgsberg
53ff2f6672 window.c: Cache outputs 2011-11-26 17:27:37 -05:00
Kristian Høgsberg
47fe08aad5 Implement the new dnd/selection protocol
The new protocol splits dnd/selection from wl_shell and allows us to move
the implementation out of shell.c.
2011-11-23 16:20:28 -05:00
Pekka Paalanen
668dd56918 window: add a helper for config file paths
Add a helper function, that constructs a path to a config file from
XDG_CONFIG_HOME environment variable, by the rules of
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

Make desktop-shell find its config file from XDG_CONFIG_HOME. This
allows to have a personal config file without continuously fighting with
git about wayland-desktop-shell.ini.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-11-15 08:57:01 -05:00
Kristian Høgsberg
ac3a59a0d1 window: Add a cheesy parser for ini-files, use it in desktop-shell 2011-11-14 22:51:02 -05:00
Kristian Høgsberg
bcee9a4b25 desktop-shell: Add beginning of pop-up menu to panel 2011-10-12 00:36:16 -04:00
Benjamin Franzke
1a89f28c7d gears: Fail if compiled without cairo-egl 2011-10-07 10:06:01 +02:00
Benjamin Franzke
0c99163d9b window: Create a cairo device for each egl config 2011-10-07 10:06:01 +02:00
Benjamin Franzke
47eb8f4e91 window: Remove display_flush_cairo_device
Rather add a flush_surface utility that
flushed the cairo_device thats associated to a surface.
2011-10-07 10:05:57 +02:00
Kristian Høgsberg
e28d05b0ad window.c: Move window items to window.c 2011-09-20 21:43:54 -04:00
Kristian Høgsberg
3a69627f43 window: Stop using glib mainloop in toy toolkit 2011-09-19 17:28:55 -04:00
Kristian Høgsberg
0c29eb292e clients: Add a simple desktop-shell app
This just provides the background surface and the top panel.
2011-09-06 18:02:34 -04:00
Kristian Høgsberg
900b226ac1 window: Add enter/leave handlers 2011-09-06 14:33:52 -04:00
Kristian Høgsberg
9de79a92a6 window.c: Drop global handler argument
We can just register a global handler directly on the wl_display now.
2011-08-29 17:12:36 -04:00
Kristian Høgsberg
3be87d1931 window: Add support for opaque windows 2011-05-16 14:46:41 -04:00
Benjamin Franzke
bde55ec8e4 Implement buffer.damage in shm, use it in window.c 2011-04-22 11:53:45 -04:00
Kristian Høgsberg
01aed1c665 Remove double definition of window_get_wl_surface() 2011-04-11 16:59:05 -04:00
Kristian Høgsberg
11e2828bdc Merge remote-tracking branch 'bnf/surface-frame-event'
Conflicts:
	compositor/compositor.c
2011-04-11 16:47:50 -04:00
Kristian Høgsberg
386857ba6a Add struct window accessor for the wl_surface 2011-04-11 13:17:44 -04:00
Tim Wiederhake
b4b67344f0 Define global handler on display creation
Otherwise the initial announcement of interfaces gets lost.
2011-04-11 13:16:33 -04:00
Benjamin Franzke
cff904e69d gears: Use wayland egl surface instead of images 2011-03-17 15:55:25 +01:00