Commit 508ad84b authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Support multiple fallbacks for cursor names.

parent 16ab42f9
...@@ -819,58 +819,58 @@ cleanup: ...@@ -819,58 +819,58 @@ cleanup:
struct system_cursors struct system_cursors
{ {
WORD id; WORD id;
const char *name; const char *names[8];
}; };
static const struct system_cursors user32_cursors[] = static const struct system_cursors user32_cursors[] =
{ {
{ OCR_NORMAL, "left_ptr" }, { OCR_NORMAL, { "left_ptr" }},
{ OCR_IBEAM, "xterm" }, { OCR_IBEAM, { "xterm", "text" }},
{ OCR_WAIT, "watch" }, { OCR_WAIT, { "watch", "wait" }},
{ OCR_CROSS, "cross" }, { OCR_CROSS, { "cross" }},
{ OCR_UP, "center_ptr" }, { OCR_UP, { "center_ptr" }},
{ OCR_SIZE, "fleur" }, { OCR_SIZE, { "fleur", "size_all" }},
{ OCR_SIZEALL, "fleur" }, { OCR_SIZEALL, { "fleur", "size_all" }},
{ OCR_ICON, "icon" }, { OCR_ICON, { "icon" }},
{ OCR_SIZENWSE, "top_left_corner" }, { OCR_SIZENWSE, { "top_left_corner", "nw-resize" }},
{ OCR_SIZENESW, "top_right_corner" }, { OCR_SIZENESW, { "top_right_corner", "ne-resize" }},
{ OCR_SIZEWE, "left_side" }, { OCR_SIZEWE, { "left_side", "size_hor", "h_double_arrow", "ew-resize" }},
{ OCR_SIZENS, "top_side" }, { OCR_SIZENS, { "top_side", "size_ver", "v_double_arrow", "ns-resize" }},
{ OCR_NO, "not-allowed" }, { OCR_NO, { "not-allowed", "forbidden", "no-drop" }},
{ OCR_HAND, "hand2" }, { OCR_HAND, { "hand2", "pointer", "pointing-hand" }},
{ OCR_APPSTARTING, "left_ptr_watch" }, { OCR_APPSTARTING, { "left_ptr_watch" }},
{ OCR_HELP, "question_arrow" }, { OCR_HELP, { "question_arrow", "help" }},
{ 0 } { 0 }
}; };
static const struct system_cursors comctl32_cursors[] = static const struct system_cursors comctl32_cursors[] =
{ {
{ 102, "move" }, { 102, { "move", "dnd-move" }},
{ 104, "copy" }, { 104, { "copy", "dnd-copy" }},
{ 105, "left_ptr" }, { 105, { "left_ptr" }},
{ 106, "col-resize" }, { 106, { "col-resize", "split_v" }},
{ 107, "col-resize" }, { 107, { "col-resize", "split_v" }},
{ 108, "hand2" }, { 108, { "hand2", "pointer", "pointing-hand" }},
{ 135, "row-resize" }, { 135, { "row-resize", "split_h" }},
{ 0 } { 0 }
}; };
static const struct system_cursors ole32_cursors[] = static const struct system_cursors ole32_cursors[] =
{ {
{ 1, "no-drop" }, { 1, { "no-drop", "dnd-no-drop" }},
{ 2, "move" }, { 2, { "move", "dnd-move" }},
{ 3, "copy" }, { 3, { "copy", "dnd-copy" }},
{ 4, "alias" }, { 4, { "alias", "dnd-link" }},
{ 0 } { 0 }
}; };
static const struct system_cursors riched20_cursors[] = static const struct system_cursors riched20_cursors[] =
{ {
{ 105, "hand2" }, { 105, { "hand2", "pointer", "pointing-hand" }},
{ 107, "right_ptr" }, { 107, { "right_ptr" }},
{ 109, "copy" }, { 109, { "copy", "dnd-copy" }},
{ 110, "move" }, { 110, { "move", "dnd-move" }},
{ 111, "no-drop" }, { 111, { "no-drop", "dnd-no-drop" }},
{ 0 } { 0 }
}; };
...@@ -1004,6 +1004,7 @@ static Cursor create_xcursor_system_cursor( const ICONINFOEXW *info ) ...@@ -1004,6 +1004,7 @@ static Cursor create_xcursor_system_cursor( const ICONINFOEXW *info )
Cursor cursor = 0; Cursor cursor = 0;
HMODULE module; HMODULE module;
HKEY key; HKEY key;
const char * const *names = NULL;
WCHAR *p, name[MAX_PATH * 2], valueW[64]; WCHAR *p, name[MAX_PATH * 2], valueW[64];
char valueA[64]; char valueA[64];
DWORD ret; DWORD ret;
...@@ -1044,7 +1045,8 @@ static Cursor create_xcursor_system_cursor( const ICONINFOEXW *info ) ...@@ -1044,7 +1045,8 @@ static Cursor create_xcursor_system_cursor( const ICONINFOEXW *info )
for (i = 0; cursors[i].id; i++) for (i = 0; cursors[i].id; i++)
if (cursors[i].id == info->wResID) if (cursors[i].id == info->wResID)
{ {
strcpy( valueA, cursors[i].name ); strcpy( valueA, cursors[i].names[0] );
names = cursors[i].names;
break; break;
} }
...@@ -1052,7 +1054,13 @@ done: ...@@ -1052,7 +1054,13 @@ done:
if (valueA[0]) if (valueA[0])
{ {
#ifdef SONAME_LIBXCURSOR #ifdef SONAME_LIBXCURSOR
if (pXcursorLibraryLoadCursor) cursor = pXcursorLibraryLoadCursor( gdi_display, valueA ); if (pXcursorLibraryLoadCursor)
{
if (!names)
cursor = pXcursorLibraryLoadCursor( gdi_display, valueA );
else
while (*names && !cursor) cursor = pXcursorLibraryLoadCursor( gdi_display, *names++ );
}
#endif #endif
if (!cursor) if (!cursor)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment