changeset 1559:3bafb7d27d78

allow pasting into form widgets when middle_click_drags_page=NO http://lists.auriga.wearlab.de/pipermail/dillo-dev/2010-February/007281.html
author corvid <corvid@lavabit.com>
date Thu, 11 Feb 2010 20:11:03 +0000
parents abc0ba143745
children c47ab3201464
files src/ui.cc
diffstat 1 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ui.cc	Thu Feb 11 11:21:50 2010 +0100
+++ b/src/ui.cc	Thu Feb 11 20:11:03 2010 +0000
@@ -850,8 +850,21 @@
       if (prefs.middle_click_drags_page == 0 &&
           event_button() == MiddleButton &&
           !a_UIcmd_pointer_on_link(a_UIcmd_get_bw_by_widget(this))) {
-         paste_url();
-         ret = 1;
+         if (Main->Rectangle::contains (event_x (), event_y ())) {
+            /* Offer the event to Main's children (form widgets) */
+            int save_x = e_x, save_y = e_y;
+
+            e_x -= Main->x();
+            e_y -= Main->y();
+            ret = ((Group *)Main)->Group::handle(event);
+            e_x = save_x;
+            e_y = save_y;
+         }
+         if (!ret) {
+            /* middle click was not on a link or a form widget */
+            paste_url();
+            ret = 1;
+         }
       }
    }