Patch to pan with middle button

Frédéric <[email protected]> Sun, 15 Oct 2006 21:00:51 +0200
Newsgroups gmane.comp.gnome.apps.gqview.devel
Organization Home
Message-ID <[email protected]>
On Saturday 14 October 2006 22:18, John Ellis wrote:

> The button assigned to panning with the mouse is hard coded into
> pixbuf-renderer.c, in the function pr_mouse_press_cb(). Swap mouse
> buttons by changing the case numbers in the switch() statement.

Done.

> The button assignments for click events are one layer up in the
> respective portions of the code. For example the main window image
> display is handled in layout_image.c, in the function
> layout_image_button_cb(), simply change or swap the cases of the
> switch() statement. To find the other image button handlers search for
> calls to image_set_button_func(), the function passed to
> image_set_button_func() will be the one that handles the button clicks.

As I don't want to modify click behaviour, I didn't change anything at
this level.

> Drag and drop may be a bit harder to find for each window type, but at
> least for the main window it is set in layout_image_dnd_init() of
> layout_image.c. Change GDK_BUTTON2_MASK in the call to
> gtk_drag_source_set().

Done.

> Disclaimer: I have not actually tried to change anything, but these
> appear to me to be the correct places.

Well, it works fine, thank you very much for you help!

Here is the patch :

diff -u gqview-2.1.1/src/layout_image.c gqview-2.1.1-fma/src/layout_image.c
--- gqview-2.1.1/src/layout_image.c     2005-06-13 22:56:44.000000000 +0200
+++ gqview-2.1.1-fma/src/layout_image.c 2006-10-15 20:35:21.871901880 +0200
@@ -941,7 +941,7 @@

 static void layout_image_dnd_init(LayoutWindow *lw)
 {
-       gtk_drag_source_set(lw->image->pr, GDK_BUTTON2_MASK,
+       gtk_drag_source_set(lw->image->pr, GDK_BUTTON1_MASK,
                            dnd_file_drag_types, dnd_file_drag_types_count,
                            GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
        g_signal_connect(G_OBJECT(lw->image->pr), "drag_data_get",


diff -u gqview-2.1.1/src/pixbuf-renderer.c gqview-2.1.1-fma/src/pixbuf-renderer.c
--- gqview-2.1.1/src/pixbuf-renderer.c  2005-06-14 02:19:52.000000000 +0200
+++ gqview-2.1.1-fma/src/pixbuf-renderer.c      2006-10-15 20:39:00.152718152 +0200
@@ -2899,7 +2899,7 @@

        switch (bevent->button)
                {
-               case 1:
+               case 2:
                        pr->in_drag = TRUE;
                        pr->drag_last_x = bevent->x;
                        pr->drag_last_y = bevent->y;
@@ -2909,7 +2909,7 @@
                                         NULL, NULL, bevent->time);
                        gtk_grab_add(widget);
                        break;
-               case 2:
+               case 1:
                        pr->drag_moved = 0;
                        break;
                case 3:

-- 
   Frédéric

   http://www.gbiloba.org

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Gqview-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gqview-devel
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFMoVmYSjuFMxF2CgRAtLhAJ9ucXkc3TrFj6HDOZfC1gp1R2baegCgyMwp
2sMiOEjZ1Sbjw28HmYARBNc=
=KmHd
-----END PGP SIGNATURE-----