fix mouse actions that don't depend on a position in a pane - sfeed_curses - sfeed curses UI (now part of sfeed, development is in sfeed)
 (HTM) git clone git://git.codemadness.org/sfeed_curses
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 39fe4803fb3595e9425efae568c2e9a53f143a4c
 (DIR) parent 64f10e20f6dce1cdf6ee517ab9ce12b39a192d5f
 (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
       Date:   Wed, 24 Mar 2021 18:15:14 +0100
       
       fix mouse actions that don't depend on a position in a pane
       
       - Fix forward and backward if the position is not in a pane (like the
         statusbar, linebar or scrollbar).
       - Add ctrl+scroll to change the sidebar size.
       
       Diffstat:
         M sfeed_curses.1                      |       6 ++++++
         M sfeed_curses.c                      |      38 +++++++++++++++++++------------
       
       2 files changed, 30 insertions(+), 14 deletions(-)
       ---
 (DIR) diff --git a/sfeed_curses.1 b/sfeed_curses.1
       @@ -165,6 +165,12 @@ Items pane: pipe the item.
        Scroll one page up.
        .It SCROLL DOWN
        Scroll one page down.
       +.It CTRL+SCROLL UP
       +Use a fixed sidebar size for the current layout and decrease the fixed width or
       +height by 1 column.
       +.It CTRL+SCROLL DOWN
       +Use a fixed sidebar size for the current layout and increase the fixed width or
       +height by 1 column.
        .It FORWARD
        Switch to the items pane.
        .It BACKWARD
 (DIR) diff --git a/sfeed_curses.c b/sfeed_curses.c
       @@ -1684,6 +1684,30 @@ mousereport(int button, int release, int keymask, int x, int y)
                        if (p->hidden || !p->width || !p->height)
                                continue;
        
       +                /* these button actions are done regardless of the position */
       +                switch (button) {
       +                case 3: /* ctrl+scroll up */
       +                case 4: /* ctrl+scroll down */
       +                        if ((keymask & 16))
       +                                adjustsidebarsize(button == 3 ? -1 : +1);
       +                        return;
       +                case 7: /* side-button: backward */
       +                        if (selpane == PaneFeeds)
       +                                return;
       +                        selpane = PaneFeeds;
       +                        if (layout == LayoutMonocle)
       +                                updategeom();
       +                        return;
       +                case 8: /* side-button: forward */
       +                        if (selpane == PaneItems)
       +                                return;
       +                        selpane = PaneItems;
       +                        if (layout == LayoutMonocle)
       +                                updategeom();
       +                        return;
       +                }
       +
       +                /* check if mouse position is in pane */
                        if (!(x >= p->x && x < p->x + p->width &&
                              y >= p->y && y < p->y + p->height))
                                continue;
       @@ -1739,20 +1763,6 @@ mousereport(int button, int release, int keymask, int x, int y)
                        case 4: /* scroll down */
                                pane_scrollpage(p, button == 3 ? -1 : +1);
                                break;
       -                case 7: /* side-button: backward */
       -                        if (selpane == PaneFeeds)
       -                                break;
       -                        selpane = PaneFeeds;
       -                        if (layout == LayoutMonocle)
       -                                updategeom();
       -                        break;
       -                case 8: /* side-button: forward */
       -                        if (selpane == PaneItems)
       -                                break;
       -                        selpane = PaneItems;
       -                        if (layout == LayoutMonocle)
       -                                updategeom();
       -                        break;
                        }
                        return; /* do not bubble events */
                }