Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/02a8b5bca0cfe8307624dc7c2bf736069c0a2e0b
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/02a8b5bca0cfe8307624dc7c2bf736069c0a2e0b
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/02a8b5bca0cfe8307624dc7c2bf736069c0a2e0b

The branch, master has been updated
       via  02a8b5bca0cfe8307624dc7c2bf736069c0a2e0b (commit)
       via  d17b710fa945276b186a67abf05844095583738e (commit)
      from  1eb19587bf3d96712d8d3313ecb32e92e1fcbd30 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=02a8b5bca0cfe8307624dc7c2bf736069c0a2e0b
commit 02a8b5bca0cfe8307624dc7c2bf736069c0a2e0b
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Treeview: Split out textarea construction helper.

diff --git a/desktop/treeview.c b/desktop/treeview.c
index 259ec05..df5c5e9 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -3368,6 +3368,47 @@ static void treeview_textarea_callback(void *data, 
struct textarea_msg *msg)
 
 
 /**
+ * Helper to create a textarea.
+ *
+ * \param[in] tree         The treeview we're creating the textarea for.
+ * \param[in] width        The width of the textarea.
+ * \param[in] height       The height of the textarea.
+ * \param[in] text         The text style to use for the text area.
+ * \param[in] ta_callback  The textarea callback function to give the textarea.
+ * \return the textarea pointer on success, or NULL on failure.
+ */
+static struct textarea *treeview_create_textarea(
+               treeview *tree,
+               int width,
+               int height,
+               plot_font_style_t text,
+               textarea_client_callback ta_callback)
+{
+       /* Configure the textarea */
+       textarea_flags ta_flags = TEXTAREA_INTERNAL_CARET;
+       textarea_setup ta_setup = {
+               .text = text,
+               .width = width,
+               .height = height,
+               .pad_top = 0,
+               .pad_left = 2,
+               .pad_right = 2,
+               .pad_bottom = 0,
+               .border_width = 1,
+               .border_col = 0x000000,
+               .selected_bg = 0x000000,
+               .selected_text = 0xffffff,
+       };
+
+       ta_setup.text.foreground = 0x000000;
+       ta_setup.text.background = 0xffffff;
+
+       /* Create text area */
+       return textarea_create(ta_flags, &ta_setup, ta_callback, tree);
+}
+
+
+/**
  * Start edit of node field, at given y-coord, if editable
  *
  * \param tree Treeview object to consider editing in
@@ -3392,8 +3433,6 @@ treeview_edit_node_at_point(treeview *tree,
        int field_y = node_y;
        int field_x;
        int width, height;
-       textarea_setup ta_setup;
-       textarea_flags ta_flags;
        bool success;
 
        /* If the main field is editable, make field_data point to it */
@@ -3435,31 +3474,14 @@ treeview_edit_node_at_point(treeview *tree,
        /* Get window width/height */
        treeview__cw_get_window_dimensions(tree, &width, &height);
 
-       /* Anow textarea width/height */
+       /* Calculate textarea width/height */
        field_x = n->inset + tree_g.step_width + tree_g.icon_step - 3;
        width -= field_x;
        height = tree_g.line_height;
 
-       /* Configure the textarea */
-       ta_flags = TEXTAREA_INTERNAL_CARET;
-
-       ta_setup.width = width;
-       ta_setup.height = height;
-       ta_setup.pad_top = 0;
-       ta_setup.pad_right = 2;
-       ta_setup.pad_bottom = 0;
-       ta_setup.pad_left = 2;
-       ta_setup.border_width = 1;
-       ta_setup.border_col = 0x000000;
-       ta_setup.selected_text = 0xffffff;
-       ta_setup.selected_bg = 0x000000;
-       ta_setup.text = plot_style_odd.text;
-       ta_setup.text.foreground = 0x000000;
-       ta_setup.text.background = 0xffffff;
-
        /* Create text area */
-       tree->edit.textarea = textarea_create(ta_flags, &ta_setup,
-                                             treeview_textarea_callback, tree);
+       tree->edit.textarea = treeview_create_textarea(tree, width, height,
+                       plot_style_odd.text, treeview_textarea_callback);
        if (tree->edit.textarea == NULL) {
                return false;
        }


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=d17b710fa945276b186a67abf05844095583738e
commit d17b710fa945276b186a67abf05844095583738e
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    GTK: Corewindow: Fix modifier keys on mouse click.
    
    Modifiers were getting unset for the click (release) events.

diff --git a/frontends/gtk/corewindow.c b/frontends/gtk/corewindow.c
index 53ee173..6ca5d22 100644
--- a/frontends/gtk/corewindow.c
+++ b/frontends/gtk/corewindow.c
@@ -145,6 +145,7 @@ nsgtk_cw_button_release_event(GtkWidget *widget,
 {
        struct nsgtk_corewindow *nsgtk_cw = (struct nsgtk_corewindow *)g;
        struct nsgtk_corewindow_mouse *mouse = &nsgtk_cw->mouse_state;
+       bool was_drag = false;
 
        /* only button 1 clicks are considered double clicks. If the
         * mouse state is PRESS then we are waiting for a release to
@@ -168,9 +169,11 @@ nsgtk_cw_button_release_event(GtkWidget *widget,
        } else if (mouse->state & BROWSER_MOUSE_HOLDING_1) {
                mouse->state ^= (BROWSER_MOUSE_HOLDING_1 |
                                 BROWSER_MOUSE_DRAG_ON);
+               was_drag = true;
        } else if (mouse->state & BROWSER_MOUSE_HOLDING_2) {
                mouse->state ^= (BROWSER_MOUSE_HOLDING_2 |
                                 BROWSER_MOUSE_DRAG_ON);
+               was_drag = true;
        }
 
        /* Handle modifiers being removed */
@@ -188,9 +191,10 @@ nsgtk_cw_button_release_event(GtkWidget *widget,
        }
 
        /* end drag with modifiers */
-       if (mouse->state & (BROWSER_MOUSE_MOD_1 |
-                           BROWSER_MOUSE_MOD_2 |
-                           BROWSER_MOUSE_MOD_3)) {
+       if (was_drag && (mouse->state & (
+                       BROWSER_MOUSE_MOD_1 |
+                       BROWSER_MOUSE_MOD_2 |
+                       BROWSER_MOUSE_MOD_3))) {
                mouse->state = BROWSER_MOUSE_HOVER;
        }
 


-----------------------------------------------------------------------

Summary of changes:
 desktop/treeview.c         |   66 +++++++++++++++++++++++++++++---------------
 frontends/gtk/corewindow.c |   10 +++++--
 2 files changed, 51 insertions(+), 25 deletions(-)

diff --git a/desktop/treeview.c b/desktop/treeview.c
index 259ec05..df5c5e9 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -3368,6 +3368,47 @@ static void treeview_textarea_callback(void *data, 
struct textarea_msg *msg)
 
 
 /**
+ * Helper to create a textarea.
+ *
+ * \param[in] tree         The treeview we're creating the textarea for.
+ * \param[in] width        The width of the textarea.
+ * \param[in] height       The height of the textarea.
+ * \param[in] text         The text style to use for the text area.
+ * \param[in] ta_callback  The textarea callback function to give the textarea.
+ * \return the textarea pointer on success, or NULL on failure.
+ */
+static struct textarea *treeview_create_textarea(
+               treeview *tree,
+               int width,
+               int height,
+               plot_font_style_t text,
+               textarea_client_callback ta_callback)
+{
+       /* Configure the textarea */
+       textarea_flags ta_flags = TEXTAREA_INTERNAL_CARET;
+       textarea_setup ta_setup = {
+               .text = text,
+               .width = width,
+               .height = height,
+               .pad_top = 0,
+               .pad_left = 2,
+               .pad_right = 2,
+               .pad_bottom = 0,
+               .border_width = 1,
+               .border_col = 0x000000,
+               .selected_bg = 0x000000,
+               .selected_text = 0xffffff,
+       };
+
+       ta_setup.text.foreground = 0x000000;
+       ta_setup.text.background = 0xffffff;
+
+       /* Create text area */
+       return textarea_create(ta_flags, &ta_setup, ta_callback, tree);
+}
+
+
+/**
  * Start edit of node field, at given y-coord, if editable
  *
  * \param tree Treeview object to consider editing in
@@ -3392,8 +3433,6 @@ treeview_edit_node_at_point(treeview *tree,
        int field_y = node_y;
        int field_x;
        int width, height;
-       textarea_setup ta_setup;
-       textarea_flags ta_flags;
        bool success;
 
        /* If the main field is editable, make field_data point to it */
@@ -3435,31 +3474,14 @@ treeview_edit_node_at_point(treeview *tree,
        /* Get window width/height */
        treeview__cw_get_window_dimensions(tree, &width, &height);
 
-       /* Anow textarea width/height */
+       /* Calculate textarea width/height */
        field_x = n->inset + tree_g.step_width + tree_g.icon_step - 3;
        width -= field_x;
        height = tree_g.line_height;
 
-       /* Configure the textarea */
-       ta_flags = TEXTAREA_INTERNAL_CARET;
-
-       ta_setup.width = width;
-       ta_setup.height = height;
-       ta_setup.pad_top = 0;
-       ta_setup.pad_right = 2;
-       ta_setup.pad_bottom = 0;
-       ta_setup.pad_left = 2;
-       ta_setup.border_width = 1;
-       ta_setup.border_col = 0x000000;
-       ta_setup.selected_text = 0xffffff;
-       ta_setup.selected_bg = 0x000000;
-       ta_setup.text = plot_style_odd.text;
-       ta_setup.text.foreground = 0x000000;
-       ta_setup.text.background = 0xffffff;
-
        /* Create text area */
-       tree->edit.textarea = textarea_create(ta_flags, &ta_setup,
-                                             treeview_textarea_callback, tree);
+       tree->edit.textarea = treeview_create_textarea(tree, width, height,
+                       plot_style_odd.text, treeview_textarea_callback);
        if (tree->edit.textarea == NULL) {
                return false;
        }
diff --git a/frontends/gtk/corewindow.c b/frontends/gtk/corewindow.c
index 53ee173..6ca5d22 100644
--- a/frontends/gtk/corewindow.c
+++ b/frontends/gtk/corewindow.c
@@ -145,6 +145,7 @@ nsgtk_cw_button_release_event(GtkWidget *widget,
 {
        struct nsgtk_corewindow *nsgtk_cw = (struct nsgtk_corewindow *)g;
        struct nsgtk_corewindow_mouse *mouse = &nsgtk_cw->mouse_state;
+       bool was_drag = false;
 
        /* only button 1 clicks are considered double clicks. If the
         * mouse state is PRESS then we are waiting for a release to
@@ -168,9 +169,11 @@ nsgtk_cw_button_release_event(GtkWidget *widget,
        } else if (mouse->state & BROWSER_MOUSE_HOLDING_1) {
                mouse->state ^= (BROWSER_MOUSE_HOLDING_1 |
                                 BROWSER_MOUSE_DRAG_ON);
+               was_drag = true;
        } else if (mouse->state & BROWSER_MOUSE_HOLDING_2) {
                mouse->state ^= (BROWSER_MOUSE_HOLDING_2 |
                                 BROWSER_MOUSE_DRAG_ON);
+               was_drag = true;
        }
 
        /* Handle modifiers being removed */
@@ -188,9 +191,10 @@ nsgtk_cw_button_release_event(GtkWidget *widget,
        }
 
        /* end drag with modifiers */
-       if (mouse->state & (BROWSER_MOUSE_MOD_1 |
-                           BROWSER_MOUSE_MOD_2 |
-                           BROWSER_MOUSE_MOD_3)) {
+       if (was_drag && (mouse->state & (
+                       BROWSER_MOUSE_MOD_1 |
+                       BROWSER_MOUSE_MOD_2 |
+                       BROWSER_MOUSE_MOD_3))) {
                mouse->state = BROWSER_MOUSE_HOVER;
        }
 


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to