Commit Graph

37 Commits

Author SHA1 Message Date
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
Kristian Høgsberg bef52d1423 Update to new libxkbcommon API
We no longer depend on xproto, we use xkbcommon keycodes now. Yay!
2012-05-11 11:24:35 -04:00
Kristian Høgsberg d174521b56 resizor: More resizing
Interacts better with interactive resizing, left/right keys now
changes window width.
2012-05-10 23:10:54 -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 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 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
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 84d62dc999 resizor: free the widget on destroy
Plugs a memory leak.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-19 16:41:59 +02: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 b67e94b170 window: Make resize and redraw handlers widget vfuncs 2012-01-10 14:22:10 -05:00
Kristian Høgsberg 5d12990dbe window: Allocate and flush the window surface in window.c
No need to push this to the toolkit users.
2012-01-10 12:25:32 -05:00
Kristian Høgsberg 75bc667a70 window: Drop the window widget
It was just a temporary convenience for moving things over.
2012-01-10 10:45:52 -05:00
Kristian Høgsberg a8a0db3497 window: Move button handler to widget 2012-01-09 11:12:05 -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
Pekka Paalanen e59d74a9b9 resizor: add exit key and cleanups
Make resizor quit when you press Esc key.

Call the toytoolkit cleanup functions, properly destroy window, display
and frame callback.

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
Kristian Høgsberg 8da0fbde12 resizor: Use symbolic name for BTN_RIGHT
Also, we were actually using BTN_MIDDLE before.
2011-12-19 15:36:10 -05:00
Kristian Høgsberg c5241f5b73 Never include wayland-util.h directly
And fix a missing "" to <> conversion for wayland-client.h include.
2011-11-22 09:35:14 -05:00
Pekka Paalanen 50719bce2a Fix inconsistent #include style
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-11-22 09:27:03 -05:00
Kristian Høgsberg 3a69627f43 window: Stop using glib mainloop in toy toolkit 2011-09-19 17:28:55 -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 a8d1fa762e clients: Bring clients up to date 2011-08-29 17:12:36 -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
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 ec4d342aa9 Support per surface frame events
This fixes tearing with multi head.
2011-03-17 11:54:35 +01:00
Tim Wiederhake eae5569558 remove unused variable 2011-01-23 17:58:18 -05:00
Kristian Høgsberg 248c1b61ce Add an orange pop-up menu to test the new map_transient request 2011-01-21 18:03:15 -05:00
Kristian Høgsberg 67cac8a565 Pass input device and time in key_handler callback
Move the modifiers to a input device getter function.
2011-01-19 14:25:13 -05:00
Kristian Høgsberg da846ca91d Fix terminal resizing
Get snapping to character grid working again, avoid crashes when attempting
to resize below 1x1 character cell, only redraw when size actually changes.

Also, rename window_get_child_rectangle() to window_get_child_allocation().
2011-01-11 10:00:52 -05:00
Kristian Høgsberg 82da52b15b Update surface.attach and change surface.map to surface.map_toplevel
The new map_toplevel() request no longer specifies a position and takes
the size from the attached buffer.  The attach request now takes a
position relative to the top-left corner of the old buffer to let
clients specify the relative position of the new buffer.
2010-12-17 09:53:12 -05:00
Kristian Høgsberg 53a7f2137b Fix the resizor 2010-12-16 21:11:10 -05:00
Kristian Høgsberg 5c4056e049 Schedule frame callback in the redraw handler 2010-12-16 14:56:41 -05:00
Kristian Høgsberg 7c221d278a Add window resize sample client
This is an example of how to animate window resizing.  The size is
animated by a simple physics model that allows the user to cancel the
animation halfway and still look good.
2010-12-16 13:35:23 -05:00