orangy
Sean Proctor
01/05/2023, 8:03 PMjim
02/02/2023, 7:09 PMSiyamed
02/02/2023, 7:18 PMjim
02/02/2023, 7:22 PMSiyamed
02/02/2023, 7:23 PMorangy
Siyamed
02/02/2023, 7:24 PMSiyamed
02/02/2023, 7:25 PMorangy
Siyamed
02/02/2023, 7:36 PMSiyamed
02/02/2023, 7:37 PMorangy
TextController
has this:
val modifiers: Modifier
get() = coreModifiers
.then(semanticsModifier)
.then(selectionModifiers)
and it is then applied to BasicText’s Layout as modifier.then(controller.modifiers)
, which (if I understand it right for Main
pass) means pointerInput
of selectionModifiers
is handled first and consumes point up and down events. Whatever pointer input handling modifier
passed to BasicText has – it doesn’t have a chance to handle things.
So, the workaround could be handling tap gestures on the Initial
pass on the BasicText’s modifiers, but it looks like pretty complex thing to do with all the logic in tap gesture detection, drags and so on. And also not sure it is a “good enough” way to work it around, or even would work. Or maybe selectionModifiers
need to handle pointer events on the Final
pass.
Just thinking out loud looking into debugger :)Sean McQuillan [G]
02/02/2023, 10:34 PMcodingjeremy
02/03/2023, 12:57 AMSelectionManger
consumes the event (the SelectionContainer
) uses PointerInputScope.detectDragGesturesAfterLongPressWithObserver()
(in TextDragObserver.kt
) which uses the PointerInputScope.detectDragGesturesAfterLongPress()
and consumes the event there... which I assume is why the children Composables aren't getting the events?codingjeremy
02/03/2023, 12:59 AMSelectionManager
to consume that before child composable, so I will let Zach comment on what that is.orangy
orangy
orangy
controller.modifiers
. This way input modifiers can get a chance to handle clicks. But it would look terrible in the API 😞Zach Klippenstein (he/him) [MOD]
02/03/2023, 6:20 PMlayout modifiers should go before point input modifiersI don’t think it should matter. I’ll try swapping the order and see if that fixes it
Zach Klippenstein (he/him) [MOD]
02/04/2023, 12:06 AMorangy
orangy
Zach Klippenstein (he/him) [MOD]
02/06/2023, 6:54 PMorangy
Zach Klippenstein (he/him) [MOD]
02/06/2023, 6:56 PMjim
02/06/2023, 7:02 PMZach Klippenstein (he/him) [MOD]
02/06/2023, 7:02 PM./gradlew :compose:desktop:desktop:desktop-samples:run1
Zach Klippenstein (he/him) [MOD]
02/06/2023, 7:03 PMZach Klippenstein (he/him) [MOD]
02/06/2023, 10:35 PMIgor Demin
02/07/2023, 10:02 AMZach Klippenstein (he/him) [MOD]
02/07/2023, 5:24 PMZach Klippenstein (he/him) [MOD]
02/07/2023, 6:56 PMPointerInputPass.Final
pass, not Main
. That way any “normal” pointer events will get to work as normal. I tried this in aosp desktop and it did fix this particular issue. However, it broke double- and triple-clicking, which I did not have time yesterday to dig into. But i think that probably using a later pass to start the selection gestures is the right approach, and less brittle than relying on modifier order.orangy
Frankly, I dont like the idea of desktop vs android. Android works with mouse etc.As @Siyamed noted, mouse is not just desktop, isn’t it? Unfortunately, I’m not much into Android, what are cases when Android mouse support is essential? TV with BT mouse? Windows Subsystem for Android? Also, some desktop devices have touch support, and Compose for Desktop as far as I can see hardcodes “there is no touch, just mouse”. I understand that proper multitouch support in AWT is hard, but still.
Zach Klippenstein (he/him) [MOD]
02/08/2023, 5:17 PMisTouchMode
flag that is currently hard-coded by platform, but @Grant Toepfer is working on fixing thatorangy
Grant Toepfer
04/10/2023, 5:52 PMorangy
orangy
Igor Demin
04/10/2023, 6:41 PMshould I be concerned about merge conflicts with my WIP? Should I be concerned that the bugs would regress when JB does push up their changes?Merge conflicts and regressions in desktop currently fixed by us. If desktop will break, we just fix it in desktopMain in our fork, or make a fix in commonMain in AOSP.