Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

too fast and buggy on_scroll_up/down #775

Open
ralencode opened this issue Nov 11, 2024 · 3 comments
Open

too fast and buggy on_scroll_up/down #775

ralencode opened this issue Nov 11, 2024 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@ralencode
Copy link

Describe the bug
when scrolling on widgets with a touchpad, scroll speed is too fast. its not a big issue with a volume widget, but that makes workspace scroll unusable. also, there is a bug: when you release touchpad, scroll makes one step down. so, when you, for example, scroll the volume to 100, it gets to 99. when from 99 to 50, it gets to 49 (if step is 1%)

To Reproduce
Steps to reproduce the behavior:
use my config, hyprland and touchpad. try to scroll on volume and workspace widgets

Expected behavior
scrolling is 2-5 times slower, but if you want to scroll faster, you.. scroll faster. maybe assume some distance to a step, like when scroll goes 10 pixels, do one step or something idk how scroll works but ig its possible to calculate scroll distance

System information:

  • Distro: Arch Linux
  • Compositor: latest Hyprland from official repository (0.45.0)
  • Ironbar version: ironbar-git from aur (0.16.1-pre)

Configuration

Share your bar configuration and stylesheet as applicable:

Config
{
  "$schema": "https://f.jstanger.dev/github/ironbar/schema.json",
  "anchor_to_edges": true,
  "position": "top",
  "height": 54,
  "popup_gap": 0,
  "icon_theme": "kora",
  "start": [
    {
      "type": "workspaces",
      "all_monitors": false,
      "name_map": {
        "special:magic": "S"
      },
      "on_scroll_up": "hyprctl dispatch workspace e+1", 
      "on_scroll_down": "hyprctl dispatch workspace e-1" 
    },
    {
      "type": "launcher",
      "favorites": [
        "nemo",
        "firefox",
        "telegram-desktop",
        "mgba",
        "PPSSPPSDL",
        "lutris",
        "steam",
        "antimicrox",
        "migu"
      ],
      "show_names": false,
      "show_icons": true
    }
  ],
  "center": [
    {
      "type": "clock"
    }
  ],
  "end": [
    {
      "type": "volume",
      "format": "{icon} {percentage}%",
      "max_volume": 100,
      "on_click_right": "amixer -D pipewire sset Master toggle",
      "on_scroll_up": "amixer -D pipewire sset Master playback 1%-",
      "on_scroll_down": "amixer -D pipewire sset Master playback 1%+",
      "icons": {
        "volume_high": "󰕾",
        "volume_medium": "󰖀",
        "volume_low": "󰕿",
        "muted": "󰝟"
      }
    },
    {
      "type": "clipboard",
      "max_items": 3,
      "on_click_right": "kitty",
      "truncate": {
        "mode": "end",
        "length": 50
      }
    },
    {
      "type": "custom",
      "class": "power-menu",
      "bar": [
        {
          "type": "button",
          "name": "power-btn",
          "label": "",
          "on_click": "popup:toggle"
        }
      ],
      "popup": [
        {
          "type": "box",
          "orientation": "vertical",
          "widgets": [
            {
              "type": "label",
              "name": "header",
              "label": "Power menu"
            },
            {
              "type": "box",
              "widgets": [
                {
                  "type": "button",
                  "class": "power-btn",
                  "label": "<span font-size='40pt'>  </span>",
                  "on_click": "!shutdown now"
                },
                {
                  "type": "button",
                  "class": "power-btn",
                  "label": "<span font-size='40pt'>  </span>",
                  "on_click": "!reboot"
                }
              ]
            },
            {
              "type": "label",
              "name": "uptime",
              "label": "Uptime: {{30000:uptime -p | cut -d ' ' -f2-}}"
            }
          ]
        }
      ],
      "tooltip": "Up: {{30000:uptime -p | cut -d ' ' -f2-}}"
    },
    {
      "type": "upower",
      "format": "{percentage}%"
    },
    {
      "type": "notifications",
      "show_count": true,
      "icons": {
        "closed_none": "󰍥",
        "closed_some": "󱥂",
        "closed_dnd": "󱅯",
        "open_none": "󰍡",
        "open_some": "󱥁",
        "open_dnd": "󱅮"
      }
    }
  ]
}
Styles
@define-color color_bg rgba(0, 0, 0, 1);
@define-color color_bg_dark rgba(64, 0, 128, 1);
@define-color color_shadow_active rgba(128, 0, 255, 1);
@define-color color_border rgba(0, 0, 255, 1);
@define-color color_border_active rgba(0, 128, 255, 1);
@define-color color_text rgba(200, 185, 255, 1);
@define-color color_urgent rgba(255, 0, 128, 1);
@define-color color_transparent rgba(0, 0, 0, 0);

/* -- base styles -- */
* {
    font-family: JetBrains Mono Nerd Font;
    font-size: 16px;
    border: none;
    border-radius: 0;
}

box, menubar, button, .background {
    background-color: @color_bg;
    background-image: none;
    box-shadow: none;
}
box {
    background-color: @color_transparent;
}

button, label {
    color: @color_text;
}

button:hover, label:hover {
    box-shadow: inset 0 2px @color_shadow_active;
}

.upower:hover .contents {
    background-color: @color_transparent;
}

scale trough {
    min-width: 1px;
    min-height: 2px;
}

#bar {
    border-bottom: 1px solid @color_border;
}

.popup {
    border: 1px solid @color_border;
    padding: 1em;
}


/* -- clipboard -- */

.clipboard {
    margin-left: 5px;
    font-size: 1.1em;
}

.popup-clipboard .item {
    padding-bottom: 0.3em;
    border-bottom: 1px solid @color_border;
}

/* -- clock -- */

.clock {
    font-weight: bold;
    margin-left: 5px;
}

.popup-clock .calendar-clock {
    color: @color_text;
    font-size: 2.5em;
    padding-bottom: 0.1em;
}

.popup-clock .calendar {
    background-color: @color_bg;
    color: @color_text;
}

.popup-clock .calendar .header {
    padding-top: 1em;
    border-top: 1px solid @color_border;
    font-size: 1.5em;
}

.popup-clock .calendar:selected {
    background-color: @color_border_active;
}


/* -- launcher -- */

.launcher .item {
    margin-right: 4px;
}

.launcher .ifix examtem:not(.focused):hover {
    background-color: @color_bg_dark;
}

.launcher .open {
    border-top: 1px solid @color_border;
}

.launcher .focused {
    border-top: 2px solid @color_border_active;
}

.launcher .urgent {
    border-top-color: @color_urgent;
}

.popup-launcher {
    padding: 0;
}

.popup-launcher .popup-item:not(:first-child) {
    border-top: 1px solid @color_border;
}


/* -- music -- */

.music:hover * {
    background-color: @color_bg_dark;
}

.popup-music .album-art {
    margin-right: 1em;
}

.popup-music .icon-box {
    margin-right: 0.4em;
}

.popup-music .title .icon, .popup-music .title .label {
    font-size: 1.7em;
}

.popup-music .controls *:disabled {
    color: @color_border;
}

.popup-music .volume .slider slider {
    border-radius: 100%;
}

.popup-music .volume .icon {
    margin-left: 4px;
}

.popup-music .progress .slider slider {
    border-radius: 100%;
}

/* notifications */

.notifications .count {
    font-size: 0.6rem;
    background-color: @color_text;
    color: @color_bg;
    border-radius: 100%;
    margin-right: 3px;
    margin-top: 3px;
    padding-left: 4px;
    padding-right: 4px;
    opacity: 0.7;
}

/* -- script -- */

.script {
    padding-left: 10px;
}


/* -- sys_info -- */

.sysinfo {
    margin-left: 10px;
}

.sysinfo .item {
    margin-left: 5px;
}


/* -- tray -- */

.tray {
    margin-left: 10px;
}

/* -- volume -- */

.popup-volume .device-box {
    border-right: 1px solid @color_border;
}

/* -- workspaces -- */

.workspaces .item.focused {
    border-top: 1px solid @color_border;
}

/* -- custom: power menu -- */

.popup-power-menu #header {
    font-size: 1.4em;
    padding-bottom: 0.4em;
    margin-bottom: 0.6em;
    border-bottom: 1px solid @color_border;
}

.popup-power-menu .power-btn {
    border: 1px solid @color_border;
    padding: 0.6em 1em;
}

.popup-power-menu #buttons > *:nth-child(1) .power-btn {
    margin-right: 1em;
}

Additional context
sorry but i want a fully usable scroll so i will report every issue with it that makes it uncomfortable to use

Screen capture
https://github.com/user-attachments/assets/de1e88f7-4945-40f6-8dbb-f1dd231159a5

@ralencode ralencode added the bug Something isn't working label Nov 11, 2024
@ralencode
Copy link
Author

regular mouse works perfectly fine tho

@ToxicMushroom
Copy link

Can repro on sway

@JakeStanger
Copy link
Owner

I'm just responding to the scroll event sent by GTK, which helpfully seems to work completely different on trackpad than mouse. Hopefully I can debounce the event or try and do something clever to improve the situation.

@JakeStanger JakeStanger added this to the 0.17.0 milestone Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants