[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#404482: Patch to fix the "I" cursor issue



Frans Pop wrote:
On Sunday 31 December 2006 16:58, Attilio Fiandrotti wrote:

Yesterday i replied to this bug, but my reply never hit d-boot tough it
was recorded in the bts, maybe because of attached jpg size: it still
can be found in #404482 debian's bts page.


I saw your pings on IRC.

Yes, I understood that was roughly how it was supposed to work. Problem is that it just does not work for me. I see some improvement (I think), but it is still very erratic (as I described).

I am sure that I have applied the patch correctly and am testing with the correct udebs. If you want to make an image available yourself for me to test, that's fine, but if I apply your patch, it just does not work for me.

Ideally we should have an "I" cursor only when over a text entry field, but I can live with it over descriptions too.

IMO we should at least have an arrow over:
- buttons
- selection lists
- multiselect lists
- option buttons

If a patch to cdebconf can not do that, then IMO it's not really worth bothering about this.

Ok, i have a new patch here which fixes the unreliability frans reported and also makes the cursor arrow shaped even on a question description. A debug instruction is included in the patch, which prints a debug line on vt2 every time the cursor is effectively reset (this is for testing purposes only, to be removed before commit).
A miniiso [1] is available for testing.

Attilio

[1] https://debian.polito.it/downloads/mini_icursorpatch.iso
Index: src/modules/frontend/gtk/gtk.c
===================================================================
--- src/modules/frontend/gtk/gtk.c      (revisione 43749)
+++ src/modules/frontend/gtk/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_cnt = 0;
+
 void register_setter(void (*func)(void*, struct question*),
              void *data, struct question *q, struct frontend *obj)
 {
@@ -259,6 +261,21 @@
     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 || event->type == GDK_ENTER_NOTIFY) {
+        if ( (reset_cursor_cnt % 2) == 0) {
+            gdk_window_set_cursor (widget->window, NULL);
+            printf ("\nCursor reset!");
+        }
+        reset_cursor_cnt++;
+    }
+
+    return FALSE;
+}
+
 /* Scrolling to default row in SELECT questions has to be done after the
  * treeview has been realized
  */
@@ -1453,6 +1470,7 @@
     gtk_init (&args, &name);

     window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+    g_signal_connect_after (G_OBJECT (window), "event", G_CALLBACK (reset_cursor_callback), NULL);
     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: