Cursor themes

Kristian Høgsberg hoegsberg at gmail.com
Mon Aug 13 08:15:58 PDT 2012


On Sat, Aug 11, 2012 at 03:18:58PM +0100, Christopher Michael wrote:
> Hi All,
> 
> I have attached a couple of patches for both Wayland and Weston.
> 
> The first patche fixes Wayland to also look in the xorg cursor theme
> directories for pointer images.
> 
> The second patch adds the ability in Weston for specifying an xorg
> cursor theme to use for windows. You can specify a theme in the
> weston.ini file:
> 
> [cursors]
> theme=THEME_NAME

That's a good feature.  I changed the section/key to just be a shell
key, ie:

[shell]
cursor-theme=Oxygen_Black
...
background-image=/home/krh/Downloads/bubbles-1366.png
(etc)

thanks,
Kristian

> Cheers,
> devilhorns

> From 17d6500757be4184a0cb11c2a8d8c331ef18a1e6 Mon Sep 17 00:00:00 2001
> From: Christopher Michael <cpmichael1 at comcast.net>
> Date: Sat, 11 Aug 2012 15:09:02 +0100
> Subject: [PATCH] Add support for X cursor themes.
> 
> This patch adds a few more directories to search for xcursor themes.
> 
> Along with the weston patch, this adds the ability to configure weston
> to use an X11 cursor theme. Previously, wayland cursor would just look
> in the icons and pixmaps directories for cursor images to load. This
> adds the ability to also search in the x cursors directory.
> ---
>  cursor/xcursor.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/cursor/xcursor.c b/cursor/xcursor.c
> index f08225c..1f66bce 100644
> --- a/cursor/xcursor.c
> +++ b/cursor/xcursor.c
> @@ -606,7 +606,7 @@ XcursorFileLoadImages (FILE *file, int size)
>  #endif
>  
>  #ifndef XCURSORPATH
> -#define XCURSORPATH "~/.icons:/usr/share/icons:/usr/share/pixmaps:"ICONDIR
> +#define XCURSORPATH "~/.icons:/usr/share/icons:/usr/share/pixmaps:~/.cursors:/usr/share/cursors/xorg-x11:"ICONDIR
>  #endif
>  
>  static const char *
> -- 
> 1.7.8.6
> 

> From 2bae51c9320a9c10d1a21edcc57b9ed1716823a2 Mon Sep 17 00:00:00 2001
> From: Christopher Michael <cpmichael1 at comcast.net>
> Date: Sat, 11 Aug 2012 15:12:09 +0100
> Subject: [PATCH] Add support in Weston for X cursor themes.
> 
> This patch, along with the wayland patch, adds the ability to specify
> a cursor theme in the weston.ini file:
> 
> [cursors]
> theme=THEME_NAME
> 
> If specified, than Weston can use a specific X cursor theme for the
> pointer. This relies on the 0001-Add-support-for-X-cursor-themes.patch
> for wayland.
> ---
>  clients/window.c |   18 +++++++++++++++++-
>  1 files changed, 17 insertions(+), 1 deletions(-)
> 
> diff --git a/clients/window.c b/clients/window.c
> index d0b7a7d..b7ea94e 100644
> --- a/clients/window.c
> +++ b/clients/window.c
> @@ -646,9 +646,25 @@ static const char *cursors[] = {
>  static void
>  create_cursors(struct display *display)
>  {
> +        char *config_file;
> +        char *theme = NULL;
>  	unsigned int i;
> +        struct config_key cursor_keys[] = {
> +           { "theme", CONFIG_KEY_STRING, &theme },
> +        };
> +        struct config_section cs[] = {
> +           { "cursors", cursor_keys, ARRAY_LENGTH(cursor_keys), NULL },
> +        };
> +
> +        config_file = config_file_path("weston.ini");
> +        parse_config_file(config_file, cs, ARRAY_LENGTH(cs), NULL);
> +        free(config_file);
> +   
> +        if (theme)
> +                display->cursor_theme = wl_cursor_theme_load(theme, 32, display->shm);
> +        else
> +                display->cursor_theme = wl_cursor_theme_load(NULL, 32, display->shm);
>  
> -	display->cursor_theme = wl_cursor_theme_load(NULL, 32, display->shm);
>  	display->cursors =
>  		malloc(ARRAY_LENGTH(cursors) * sizeof display->cursors[0]);
>  
> -- 
> 1.7.8.6
> 

> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel



More information about the wayland-devel mailing list