Bug#404482: Patch to fix the "I" cursor issue
package: cdebconf-gtk-udeb
severity: normal
tags: patch
Many users complained about the cursor remaining "I" shaped after
passing on a question description (that's due to a minor gtk/dfb bug
which still has to be fixed)
As a workaround, the attached patch resets the cursor to its original
arrow shape when it moves into the main gdkwindow.
Merry XMas !
Attilio
Index: gtk.c
===================================================================
--- gtk.c (revisione 43510)
+++ gtk.c (copia locale)
@@ -92,6 +92,8 @@
static const char * get_text(struct frontend *obj, const char *template, const char *fallback );
+static int reset_cursor = FALSE;
+
void register_setter(void (*func)(void*, struct question*),
void *data, struct question *q, struct frontend *obj)
{
@@ -259,6 +261,22 @@
return FALSE;
}
+/* workaround for gtktextview cursor changing in gtk/dfb
+ */
+static gboolean reset_cursor_callback(GtkWidget *widget, GdkEventExpose *event, void *data)
+{
+ if (event->type == GDK_LEAVE_NOTIFY) {
+ if (reset_cursor == TRUE) {
+ gdk_window_set_cursor (widget->window, NULL);
+ reset_cursor = FALSE;
+ }
+ else
+ reset_cursor = TRUE;
+ }
+
+ return FALSE;
+}
+
/* Scrolling to default row in SELECT questions has to be done after the
* treeview has been realized
*/
@@ -1453,6 +1471,9 @@
gtk_init (&args, &name);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ #ifndef GDK_WINDOWING_X11
+ g_signal_connect_after (G_OBJECT (window), "event", G_CALLBACK (reset_cursor_callback), NULL);
+ #endif
gtk_widget_set_size_request (window, WINDOW_WIDTH, WINDOW_HEIGHT);
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
Reply to: