Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2005:
[Freeciv-Dev] Re: (PR#13419) mouse wheel can break GTK client
Home

[Freeciv-Dev] Re: (PR#13419) mouse wheel can break GTK client

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx, jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#13419) mouse wheel can break GTK client
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Sun, 9 Oct 2005 05:01:56 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13419 >

On Sun, 9 Oct 2005, Mateusz Stefek wrote:

> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=13419 >
>
> > [mstefek - Wed Sep 07 11:49:32 2005]:
> >
> > > Have you reported this bug to the GTK+ bug tracker yet?
> > > http://bugzilla.gnome.org/
> > http://bugzilla.gnome.org/show_bug.cgi?id=315440
>
> No reply there.
> I guess we need to remove/block a signal, but I don't know how and which
> one.
> Vasco?

After some investigation it seems any mouse scrollwheel movement emits a
"scroll-event" signal to the GtkWidget in question.

I tried disabling the signal by adding a callback to it which stops the
propagation of the signal and it fixed the bug here. Patch attached.

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa

Index: client/gui-gtk-2.0/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/gui_main.c,v
retrieving revision 1.138
diff -u -r1.138 gui_main.c
--- client/gui-gtk-2.0/gui_main.c       3 Oct 2005 02:50:43 -0000       1.138
+++ client/gui-gtk-2.0/gui_main.c       9 Oct 2005 11:55:35 -0000
@@ -705,6 +705,11 @@
 
 
   notebook = gtk_notebook_new();
+
+  /* stop mouse wheel notebook page switching. */
+  g_signal_connect(notebook, "scroll_event",
+                  G_CALLBACK(gtk_true), NULL);
+
   toplevel_tabs = notebook;
   gtk_notebook_set_show_tabs(GTK_NOTEBOOK(notebook), FALSE);
   gtk_notebook_set_show_border(GTK_NOTEBOOK(notebook), FALSE);

[Prev in Thread] Current Thread [Next in Thread]