Commit 1486557
committed
Scale down MacOS scrolling from event controllers
MacOS trackpad scroll events appear to be of much greater magnitude
than those on other systems. To make them usable, we need to scale
down the scroll deltas. For traditional GTK 3 code,
dt_gui_get_scroll_unit_deltas() took care of this. Unfortunately, this
code depends on the "scroll-event" signal. To make the code GTK 4
ready, we need to handle the "scroll" signal generated by a
GtkEventControllerScroll.
For discrete scrolls, we can handle this transparently via the
dt_gui_connect_scroll_discrete() setup function. This new function is
similar to dt_gui_connect_scroll(). There is no need to call it with
the GTK_EVENT_CONTROLLER_SCROLL_DISCRETE flag, as it adds this
automatically. If darktable is compiled for MacOS, a proxy function
will scale down the scroll events.
Note that this commit doesn't do anything to help scale down scroll
events from a non-discrete GtkEventControllerScroll.
Also: In bauhaus _widget_scroll, actually warn if called an a
non-scroll event or no event rather than having a useless NOP
conditional. Don't free the event in unlikely case we can't retrieve
it.
Also: Update/remove a couple comments. In GTK4 it seems preferable to
target events directly to widgets (as gtk_propagate_event and
gtk_event_controller_handle_event are gone) so don't apologize in
comments for using gtk_widget_event().
Fixes: #206981 parent fbd6a7a commit 1486557
4 files changed
Lines changed: 109 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3077 | 3077 | | |
3078 | 3078 | | |
3079 | 3079 | | |
| 3080 | + | |
| 3081 | + | |
3080 | 3082 | | |
3081 | | - | |
3082 | | - | |
3083 | | - | |
3084 | | - | |
3085 | | - | |
| 3083 | + | |
| 3084 | + | |
3086 | 3085 | | |
3087 | 3086 | | |
3088 | 3087 | | |
| |||
3118 | 3117 | | |
3119 | 3118 | | |
3120 | 3119 | | |
3121 | | - | |
| 3120 | + | |
3122 | 3121 | | |
3123 | 3122 | | |
3124 | 3123 | | |
| |||
3733 | 3732 | | |
3734 | 3733 | | |
3735 | 3734 | | |
3736 | | - | |
3737 | | - | |
3738 | | - | |
| 3735 | + | |
| 3736 | + | |
3739 | 3737 | | |
3740 | 3738 | | |
3741 | 3739 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4668 | 4668 | | |
4669 | 4669 | | |
4670 | 4670 | | |
| 4671 | + | |
| 4672 | + | |
| 4673 | + | |
| 4674 | + | |
| 4675 | + | |
| 4676 | + | |
| 4677 | + | |
| 4678 | + | |
| 4679 | + | |
| 4680 | + | |
| 4681 | + | |
| 4682 | + | |
| 4683 | + | |
| 4684 | + | |
| 4685 | + | |
| 4686 | + | |
| 4687 | + | |
| 4688 | + | |
| 4689 | + | |
| 4690 | + | |
| 4691 | + | |
| 4692 | + | |
| 4693 | + | |
| 4694 | + | |
| 4695 | + | |
| 4696 | + | |
| 4697 | + | |
| 4698 | + | |
| 4699 | + | |
| 4700 | + | |
| 4701 | + | |
| 4702 | + | |
| 4703 | + | |
| 4704 | + | |
| 4705 | + | |
| 4706 | + | |
| 4707 | + | |
| 4708 | + | |
| 4709 | + | |
| 4710 | + | |
| 4711 | + | |
| 4712 | + | |
| 4713 | + | |
| 4714 | + | |
| 4715 | + | |
| 4716 | + | |
| 4717 | + | |
| 4718 | + | |
| 4719 | + | |
| 4720 | + | |
| 4721 | + | |
| 4722 | + | |
| 4723 | + | |
| 4724 | + | |
| 4725 | + | |
| 4726 | + | |
| 4727 | + | |
| 4728 | + | |
| 4729 | + | |
| 4730 | + | |
| 4731 | + | |
| 4732 | + | |
| 4733 | + | |
| 4734 | + | |
| 4735 | + | |
| 4736 | + | |
| 4737 | + | |
| 4738 | + | |
| 4739 | + | |
| 4740 | + | |
| 4741 | + | |
| 4742 | + | |
| 4743 | + | |
| 4744 | + | |
| 4745 | + | |
| 4746 | + | |
| 4747 | + | |
| 4748 | + | |
| 4749 | + | |
| 4750 | + | |
| 4751 | + | |
| 4752 | + | |
| 4753 | + | |
| 4754 | + | |
| 4755 | + | |
| 4756 | + | |
| 4757 | + | |
4671 | 4758 | | |
4672 | 4759 | | |
4673 | 4760 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | 567 | | |
573 | 568 | | |
574 | 569 | | |
| |||
588 | 583 | | |
589 | 584 | | |
590 | 585 | | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
591 | 599 | | |
592 | 600 | | |
593 | 601 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
489 | | - | |
490 | 489 | | |
491 | 490 | | |
492 | 491 | | |
| |||
863 | 862 | | |
864 | 863 | | |
865 | 864 | | |
866 | | - | |
867 | | - | |
868 | | - | |
| 865 | + | |
| 866 | + | |
869 | 867 | | |
870 | 868 | | |
871 | 869 | | |
| |||
0 commit comments