Commit Graph

36 Commits

Author SHA1 Message Date
Peter Hutterer
f3d62276d2 malloc + memset -> zalloc
And for clients using the xmalloc helper, use xzalloc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-08-08 13:46:13 -07:00
Brian Lovin
bc91926e0c clients: use xmalloc in more places
For the clients continue to use xmalloc() to simplify OOM-handling.

Signed-off-by: Brian Lovin <brian.j.lovin@intel.com>
2013-08-07 16:27:33 -07:00
Rob Bradford
c48c34d6fa tablet-shell: Avoid leaking the path on failed icon loading 2013-07-30 11:05:23 -07:00
Ossama Othman
a50e6e4c50 config-parser: Honor XDG_CONFIG_DIRS
This set of changes adds support for searching for a given config file
in the directories listed in $XDG_CONFIG_DIRS if it wasn't found in
$XDG_CONFIG_HOME or ~/.config.  This allows packages to install custom
config files in /etc/xdg/weston, for example, thus allowing them to
avoid dealing with home directories.

To avoid a TOCTOU race the config file is actually open()ed during the
search.  Its file descriptor is returned and stored in the compositor
for later use when performing subsequent config file parses.

Signed-off-by: Ossama Othman <ossama.othman@intel.com>
2013-05-14 14:36:37 -04:00
Tiago Vignatti
b67c91d46d clients: tablet-shell: Wait for set_homescreen hits the server
This relates to:
    https://bugs.freedesktop.org/show_bug.cgi?id=57634
    https://bugs.freedesktop.org/show_bug.cgi?id=57637

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-04-09 15:05:32 -04:00
Kristian Høgsberg
4172f668e7 Pass argc pointer to parse_options()
This lets us keep argc up to date as the backend picks out arguments
from the argv array.
2013-02-20 15:27:49 -05: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
Scott Moreau
fe89f07e33 toytoolkit: Remove obsolete function window_set_custom(). 2012-07-12 09:18:49 -04:00
Juan Zhao
8634f51b63 tablet-shell client:fix one seg-fault error
When the icon provided in weston.ini is not available, it will report a segfault error.
Check the icon at first.
backtrace:
*INT_cairo_surface_status (surface=0x0) at cairo-surface.c:259
259     {
(gdb) bt
 #0  *INT_cairo_surface_status (surface=0x0) at cairo-surface.c:259
 #1  0x0804baca in tablet_shell_add_launcher (data=0xbfb800ec)
     at tablet-shell.c:404
 #2  launcher_section_done (data=0xbfb800ec) at tablet-shell.c:434
 #3  0x08051121 in parse_config_file (
     path=0x8b96c10 "/root/.config/weston.ini", sections=0x8053c80,
     num_sections=2, data=0xbfb800ec) at config-parser.c:113
 #4  0x0804c0f9 in main (argc=1, argv=0xbfb801d4) at tablet-shell.c:480

Signed-off-by: Juan Zhao <juan.j.zhao@linux.intel.com>
2012-06-21 16:11:10 -04:00
Daniel Stone
6d4a3c1a39 tablet-shell: Fix compilation warnings
Include unistd.h to get fork and execl prototypes, and remove
declarations of two unused variables.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-18 15:09:45 -04:00
Alex Wu
5b72a4d21d tablet-shell: Add actual actions for launcher.
The launcher before in tablet-shell just draw the icon and will
not activate a client. This patch makes the launcher as sub-widget
of homescreen, and implements enter/leave/button/redraw hanler to
do the actual client launching action.
2012-06-18 11:06:56 -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
5a315bc72d Move cairo-util to shared/ 2012-05-15 22:33:43 -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
Tiago Vignatti
d081020435 client: tablet-shell: fallback in the lack of lockscreen icon
lockscreen, homescreen and shell launchers are falling back okay already and
only lockscreen icon was missing some way to keep the shell client running in
the absence of images. This patch fix it.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-04-03 14:53:47 -04:00
Tiago Vignatti
0a38611e7d tablet-shell: come back to life
A couple of fixes were made: Weston tablet-shell needed to use weston_layer,
so the compositor could rebuild the surface list correctly when repainting;
homescreen and locking are using the widget + window abstration of toytoolkit;
and widget_set_redraw_handler are being set for widgets redraw.

Also, it was given some basic meaning for lockscreen_button_handler, which
was completely disabled before. As a clean up, I updated the global listener
mechanism on tablet-shell client, using the regular way of registering a
handler instead wl_display_roundtrip -> wl_display_get_global.

Switcher still without code to proper work and the same for tablet-shell
clients, which are not launched.

krh: Edited to not scale down homescreen icons, use new load_cairo_surface()
for image loading.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-03-28 09:37:17 -04:00
Kristian Høgsberg
a8ae8a9135 clients: Fix a couple of warnings 2012-03-27 16:39:17 -04:00
Tiago Vignatti
9a206c4da5 config-parser: consolidate shell files into weston.ini only
The shell choice happens in the configuration file now.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-03-25 08:49:30 -04:00
Kristian Høgsberg
f02a649a3c Consolidate image loading code and move to shared/ 2012-03-12 01:40:59 -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
Kristian Høgsberg
d654876510 cairo-util: Add png loader and image type sniffing 2012-01-25 16:30:48 -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
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
87a57bbd73 window: Create a widget for the window, drop window motion handler 2012-01-09 10:34:35 -05:00
Kristian Høgsberg
5f190ef96a window: Convert a few clients to use widget motion handler 2012-01-09 09:44:45 -05:00
Kristian Høgsberg
9724b51750 More weston rename fixes 2012-01-03 14:35:49 -05:00
Kristian Høgsberg
9b935c8239 Use '-' to separate words in file names
Eventually we will want more functionality in the shared library and we
will rename it at that point.  Perhaps we'll name it libnih, but for now
let's stick with libconfig-parser.
2011-12-08 12:44:27 -05: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
Kristian Høgsberg
f033a7b6e6 tablet-shell: Add more interesting lock and home screens 2011-11-26 23:38:46 -05:00
Kristian Høgsberg
6336e46e15 tablet-shell: Add a stub tablet-shell client
For a start, this is just to we can run and test the corresponding
compositor plugin and keep it from bit-rotting.
2011-11-26 17:37:54 -05:00