Skip to content
  • Cosimo Cecchi's avatar
    notebook: return TRUE for drag-motion event when over tabs · 852d4d61
    Cosimo Cecchi authored
    The GtkNotebook drag-motion event handler may install a timeout when
    hovering over a tab, in order to switch to it.
    On the other hand it's desirable for applications to use the empty tab
    area as a drop target, so the drag-motion handler returns FALSE
    (also in case it installs the switch tab timeout), as explained in
    https://bugzilla.gnome.org/show_bug.cgi?id=350665.
    
    Unfortunately, applications can use the tab label widget (or a child
    of it) as a different drop target area, and install their own
    drag-motion handler there.
    In this scenario, the timeout will still be installed by GtkNotebook's
    handler, but since it returns FALSE, it will never get the matching
    drag-leave event, causing it to trigger also when the mouse pointer
    moved elsewhere before it expired.
    
    Fix this by returning TRUE from drag-motion when the event is over a
    tab. Note that this makes automatic tab switching not work anymore when
    drag and drop is handled in the tab label widget; applications are
    expected to also handle tab switching if desired in such a case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684415
    852d4d61