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. [krh: edited to use shell section and key name cursor-theme]
This commit is contained in:
committed by
Kristian Høgsberg
parent
4cb88c79e0
commit
ac3e5f2feb
+13
-1
@@ -646,9 +646,21 @@ static const char *cursors[] = {
|
|||||||
static void
|
static void
|
||||||
create_cursors(struct display *display)
|
create_cursors(struct display *display)
|
||||||
{
|
{
|
||||||
|
char *config_file;
|
||||||
|
char *theme = NULL;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
struct config_key shell_keys[] = {
|
||||||
|
{ "cursor-theme", CONFIG_KEY_STRING, &theme },
|
||||||
|
};
|
||||||
|
struct config_section cs[] = {
|
||||||
|
{ "shell", shell_keys, ARRAY_LENGTH(shell_keys), NULL },
|
||||||
|
};
|
||||||
|
|
||||||
display->cursor_theme = wl_cursor_theme_load(NULL, 32, display->shm);
|
config_file = config_file_path("weston.ini");
|
||||||
|
parse_config_file(config_file, cs, ARRAY_LENGTH(cs), NULL);
|
||||||
|
free(config_file);
|
||||||
|
|
||||||
|
display->cursor_theme = wl_cursor_theme_load(theme, 32, display->shm);
|
||||||
display->cursors =
|
display->cursors =
|
||||||
malloc(ARRAY_LENGTH(cursors) * sizeof display->cursors[0]);
|
malloc(ARRAY_LENGTH(cursors) * sizeof display->cursors[0]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user