FFI_SetCursor not triggered during FORM_OnMouseMove on /FT /Btn widgets — intended design or bug?

43 views
Skip to first unread message

Daniel Hu

unread,
May 29, 2025, 4:06:25 AMMay 29
to pdfium

I am integrating form interactions and have registered the FFI_SetCursor callback in FPDF_FORMFILLINFO. However, when I move the mouse and call FORM_OnMouseMove over a widget of type /FT /Btn (e.g., checkbox or button), my registered FFI_SetCursor callback is never triggered.

After debugging the PDFium source, I found that inside the function:

bool CFFL_InteractiveFormFiller::OnMouseMove(
    CPDFSDK_PageView* pPageView,
    ObservedPtr<CPDFSDK_Widget>& pWidget,
    Mask<FWL_EVENTFLAG> nFlags,
    const CFX_PointF& point) {
  CFFL_FormField* pFormField = GetOrCreateFormField(pWidget.Get());
  return pFormField && pFormField->OnMouseMove(pPageView, nFlags, point);
}

the pFormField object is actually of type CFFL_CheckBox, which inherits from CFFL_Button, which in turn inherits from CFFL_FormField. Notably, CFFL_FormField has a declared and defined virtual method OnMouseMove, but CFFL_Button overrides it with this implementation:

bool CFFL_Button::OnMouseMove(CPDFSDK_PageView* pPageView,

                              Mask<FWL_EVENTFLAG> nFlags,

                              const CFX_PointF& point) {

  return true;

}

This empty override effectively blocks the base class logic that would presumably trigger FFI_SetCursor.


Is this behavior an intentional design choice in PDFium? Or is it a bug that FFI_SetCursor is not triggered for button-like widgets on mouse move?


Also, what is the intended usage of FFI_SetCursor? Must the UI layer itself traverse all annotations/widgets and decide which cursor to show based on the widget /FT type?


Thanks in advance for any clarifications!

Lei Zhang

unread,
Jun 4, 2025, 9:19:38 PMJun 4
to Daniel Hu, pdfium
Based on a quick look, the FFI_SetCursor callback only gets triggered
by actual mouse movements. My guess is whoever added
FORM_OnMouseMove() failed to consider the interaction with
FFI_SetCursor. It seems reasonable to trigger FFI_SetCursor from
FORM_OnMouseMove(). So please file a bug for that on
https://crbug.com/pdfium/new, and as always, code contributions are
welcome.
> --
> You received this message because you are subscribed to the Google Groups "pdfium" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pdfium+un...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/pdfium/77e580e3-2e76-4e16-b2dc-92b3255b12ban%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages