pop-os / libcosmic

WIP library for COSMIC applications
https://pop-os.github.io/libcosmic/cosmic/
Mozilla Public License 2.0
405 stars 35 forks source link

HeaderBar widget immediately causes `on_drag` to be triggered on click #154

Closed Drakulix closed 11 months ago

Drakulix commented 11 months ago

This is especially annoying in cosmic-comp, where just clicking the title-bar will engage overview mode (see https://github.com/pop-os/cosmic-comp/issues/164). Due to cosmic-comp using the same widget itself for server-side decorations the same problem will occur with most Xwayland apps, etc.

This is not an issue with client-side decorated + non-libcosmic based applications. GTK and Qt will both wait for any movement of the cursor before triggering the xdg_toplevel::move request.

It seems to me iced::mouse_area should have a separate on-drag message, that is triggered when any cursor movement above a certain delta value is detected after the left button has been pressed.

mmstick commented 11 months ago

I added an on_drag feature for the mouse area widget in our iced fork. The headerbar will switch to it soon.