summaryrefslogtreecommitdiff
path: root/clients/clickdot.c
Commit message (Collapse)AuthorAgeFilesLines
* log: remove "%m" from format strings by using strerror(errno)Antonio Borneo2019-05-021-1/+3
| | | | | | | | | | | | | | | | | | The printf() format specifier "%m" is a glibc extension to print the string returned by strerror(errno). While supported by other libraries (e.g. uClibc and musl), it is not widely portable. In Weston code the format string is often passed to a logging function that calls other syscalls before the conversion of "%m" takes place. If one of such syscall modifies the value in errno, the conversion of "%m" will incorrectly report the error string corresponding to the new value of errno. Remove all the occurrences of the specifier "%m" in Weston code by using directly the string returned by strerror(errno). While there, fix some minor indentation issue. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* clients: consolidate timer code part 1Pekka Paalanen2018-03-121-28/+8
| | | | | | | | | | | | | | There are multiple copies for the timerfd handling code, and I need a timer in one more app. Consolidate all the timerfd code into window.c to reduce the duplication. Many of the copies were also flawed against the race mentioned in toytimer_fire(). This patch handles clickdot and window.c's tooltip timer and cursor timer. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Derek Foreman <derekf@osg.samsung.com> Acked-by: Daniel Stone <daniels@collabora.com>
* clients & tests: Unify multiple definitions of x*alloc and related functionsBryce Harrington2016-03-171-0/+1
| | | | | | | | | | | | | Direct fail_on_null calls now produce output like: [weston-info] clients/weston-info.c:714: out of memory xmalloc, et al produce output on failure like: [weston-info] out of memory (-1) Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* Unified multiple definitions of container_of() macro.Jon Cruz2015-06-151-0/+1
| | | | | | | | | Removed duplicate definitions of the container_of() macro and refactored sources to use the single implementation. Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* clients: Update boilerplate from MIT X11 license to MIT Expat licensesBryce Harrington2015-06-151-16/+17
|
* input: Schedule pointer sprite repaint when cursor is setJonas Ådahl2014-09-101-1/+49
| | | | | | | | | | | | | | If a cursor was set with wl_pointer.set_cursor but not in combination with an action that has the side effect of damaging the region where the cursor is positioned, it would not be drawn. This patch explicitly schedules a repaint of the pointer sprite when it is set. clickdot is updated to illustrate the bug; when moving the pointer over clickdot, the pointer is hidden. When not having moved the pointer for 500 ms it is made visible using wl_pointer.set_pointer. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* Make sure config.h is included before any system headersAndrew Wedgbury2014-04-071-0/+2
| | | | | | | | | | | | | | | There was an issue recently in screen-share.c where config.h was not being included, resulting in the wrong definition for off_t being used on 32 bit systems. I checked and I don't think this problem is happening elsewhere, but to help avoid this sort of problem in the future, I went through and made sure that config.h is included first whenever system headers are included. The config.h header should be included before any system headers, failing to do this can result in the wrong type sizes being defined on certain systems, e.g. off_t from sys/types.h Signed-off-by: Andrew Wedgbury <andrew.wedgbury@realvnc.com>
* Rename frame_create and frame_set_child_size with a window_ prefixJason Ekstrand2013-10-131-1/+1
| | | | | | This is to avoid a collision with an actual frame structure. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* malloc + memset -> zallocPeter Hutterer2013-08-081-3/+1
| | | | | | And for clients using the xmalloc helper, use xzalloc. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* clients: Introduce xmalloc() and use it a few placesKristian Høgsberg2013-07-251-3/+1
| | | | | | For the sample clients we introduce xmalloc() to simplify OOM-handling. This patch only converts a few callsites, but this will be our strategy going forward.
* Pass argc pointer to parse_options()Kristian Høgsberg2013-02-201-1/+1
| | | | | This lets us keep argc up to date as the backend picks out arguments from the argv array.
* Use enum wl_keyboard_key_state instead of integerDaniel Stone2012-05-311-2/+3
| | | | | | | | 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>
* Use enum wl_pointer_button_state instead of integerDaniel Stone2012-05-311-2/+3
| | | | | | | | 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>
* window: rename enum pointer_type to cursor_typeAnder Conselvan de Oliveira2012-05-251-1/+1
| | | | This avoids confusion with the pointer devices (struct wl_pointer).
* window: track changes in libwayland-cursor apiAnder Conselvan de Oliveira2012-05-251-2/+1
| | | | | | | libwayland-cursor does not provide enum wl_cursor_type anymore so this brings back enum pointer_type. This partially revers commit 1042dc15e0ca69a4d8d4d23b862f1e3d3c8e054f.
* window: use libwayland-cursor instead of libXcursorAnder Conselvan de Oliveira2012-05-221-1/+2
|
* Update to new libxkbcommon APIKristian Høgsberg2012-05-111-3/+1
| | | | We no longer depend on xproto, we use xkbcommon keycodes now. Yay!
* clients: Add motion event trails to clickdotJonas Ådahl2012-05-101-5/+138
| | | | | | Useful for testing pointer device. Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
* Change button from int to uint32_tDaniel Stone2012-05-071-1/+1
| | | | | | Since you can't really have a negative button number. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
* Change key/button grab bindings to take unsigned stateDaniel Stone2012-05-071-1/+1
| | | | | | 'state' here meaning 'is it up or down?', obviously. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
* Add an option parserKristian Høgsberg2012-03-121-1/+1
| | | | | | | 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.
* window: Dont take width and height in window constructorKristian Høgsberg2012-01-311-1/+1
| | | | Always set this by scheduling an initial resize.
* clickdot: implement the purposePekka Paalanen2012-01-271-101/+23
| | | | | | | | | | Remove all unneeded resizor features, and add the feature why clickdot exists: put a visible marker to exactly where mouse was clicked. This app can be used to check input coordinate transformations in a compositor. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
* clickdot: a copy of resizorPekka Paalanen2012-01-271-0/+259
Start a new application clickdot as a copy of resizor, with the name changed. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>