diff --git a/src/main.c b/src/main.c index 1fed936..0c03e4d 100644 --- a/src/main.c +++ b/src/main.c @@ -826,6 +826,13 @@ main (gint argc, gchar ** argv) #endif } + if(options.data.cursor_name) + gdk_window_set_cursor( + gdk_screen_get_root_window( + gdk_display_get_default_screen(gdk_display_get_default()) + ), + gdk_cursor_new_from_name(gdk_display_get_default(),options.data.cursor_name) + ); /* set default icons and icon theme */ if (options.data.icon_theme) { diff --git a/src/option.c b/src/option.c index add7738..51c89c2 100644 --- a/src/option.c +++ b/src/option.c @@ -139,6 +139,8 @@ static GOptionEntry general_options[] = { { "selectable-labels", 0, 0, G_OPTION_ARG_NONE, &options.data.selectable_labels, N_("Dialog text can be selected"), NULL }, /* window settings */ + { "cursor", 0, G_OPTION_FLAG_NOALIAS, G_OPTION_ARG_STRING, &options.data.cursor_name, + N_("Use specified cursor name on start"), N_("CURSORNAME") }, { "sticky", 0, 0, G_OPTION_ARG_NONE, &options.data.sticky, N_("Set window sticky"), NULL }, { "fixed", 0, 0, G_OPTION_ARG_NONE, &options.data.fixed, @@ -1419,6 +1421,7 @@ yad_options_init (void) options.data.def_resp = YAD_RESPONSE_OK; /* Initialize window options */ + options.data.cursor_name = NULL; options.data.sticky = FALSE; options.data.fixed = FALSE; options.data.ontop = FALSE; diff --git a/src/yad.h b/src/yad.h index 8f8e40b..8b7cb1a 100644 --- a/src/yad.h +++ b/src/yad.h @@ -221,6 +221,7 @@ typedef struct { GtkButtonBoxStyle buttons_layout; gint def_resp; /* window settings */ + gchar *cursor_name; gboolean sticky; gboolean fixed; gboolean ontop; diff --git a/data/yad.1 b/data/yad.1 index 3be7573..8aa60d9 100644 --- a/data/yad.1 +++ b/data/yad.1 @@ -169,6 +169,9 @@ Show separator between dialog and buttons. Works only with gtk+-2.0. .B \-\-borders=\fINUM\fP Set dialog window borders. .TP +.B \-\-cursor=\fINAME\fP +Use specified cursor on start. +.TP .B \-\-sticky Make window visible on all desktops. .TP