Ticket #4123: handles2.diff

File handles2.diff, 3.8 KB (added by godiard, 11 years ago)
  • src/af/ev/gtk/ev_UnixMouse.cpp

    diff --git a/src/af/ev/gtk/ev_UnixMouse.cpp b/src/af/ev/gtk/ev_UnixMouse.cpp
    index af3cb2a..2ca54ec 100644
    a b void EV_UnixMouse::mouseClick(AV_View* pView, GdkEventButton* e) 
    164164                invokeMouseMethod(pView,pEM,static_cast<UT_sint32>(pView->getGraphics()->tluD(e->x)),static_cast<UT_sint32>(pView->getGraphics()->tluD(e->y)));
    165165                signal(emc|mop|emb|state, static_cast<UT_sint32>(pView->getGraphics()->tluD(e->x)),static_cast<UT_sint32>(pView->getGraphics()->tluD(e->y)));
    166166
    167                 if (gdk_device_get_source (device) == GDK_SOURCE_TOUCHSCREEN) {
     167                if (gdk_device_get_source (device) == GDK_SOURCE_TOUCHSCREEN || getenv ("ABI_TEST_TOUCH")) {
    168168                        pView->setVisualSelectionEnabled(true);
    169169                } else {
    170170                        pView->setVisualSelectionEnabled(false);
  • src/text/fmt/gtk/gtktexthandle.c

    diff --git a/src/text/fmt/gtk/gtktexthandle.c b/src/text/fmt/gtk/gtktexthandle.c
    index 64a37ed..766eb8b 100644
    a b _fv_text_handle_set_relative_to (FvTextHandle *handle, 
    523523      priv->windows[FV_TEXT_HANDLE_POSITION_SELECTION_START].window =
    524524        _fv_text_handle_create_window (handle, FV_TEXT_HANDLE_POSITION_SELECTION_START);
    525525      priv->windows[FV_TEXT_HANDLE_POSITION_SELECTION_END].window =
    526         _fv_text_handle_create_window (handle, FV_TEXT_HANDLE_POSITION_SELECTION_START);
     526        _fv_text_handle_create_window (handle, FV_TEXT_HANDLE_POSITION_SELECTION_END);
    527527      priv->realized = TRUE;
    528528    }
    529529  else
    _fv_text_handle_set_mode (FvTextHandle *handle, 
    550550  if (priv->mode == mode)
    551551    return;
    552552
     553  priv->mode = mode;
     554
     555  if (mode != FV_TEXT_HANDLE_MODE_NONE)
     556    _fv_text_handle_update_shape (handle,
     557                                  priv->windows[FV_TEXT_HANDLE_POSITION_CURSOR].window,
     558                                  FV_TEXT_HANDLE_POSITION_CURSOR);
    553559  switch (mode)
    554560    {
    555561    case FV_TEXT_HANDLE_MODE_CURSOR:
    _fv_text_handle_set_mode (FvTextHandle *handle, 
    568574      gdk_window_hide (priv->windows[FV_TEXT_HANDLE_POSITION_SELECTION_END].window);
    569575      break;
    570576    }
    571 
    572   priv->mode = mode;
    573577}
    574578
    575579FvTextHandleMode
    _fv_text_handle_set_visible (FvTextHandle *handle, 
    645649  if (!window)
    646650    return;
    647651
     652  if (priv->windows[pos].dragged)
     653    return;
     654
    648655  if (!visible)
    649656    gdk_window_hide (window);
    650657  else
  • src/text/fmt/xp/fv_SelectionHandles.cpp

    diff --git a/src/text/fmt/xp/fv_SelectionHandles.cpp b/src/text/fmt/xp/fv_SelectionHandles.cpp
    index c8d538b..8c6cc4b 100644
    a b void FV_SelectionHandles::updateSelectionEnd(UT_sint32 x, UT_sint32 y) 
    107107        pos = UT_MAX (pos, left + 1);
    108108
    109109        m_pView->selectRange(left, pos);
     110        m_pView->_fixInsertionPointCoords();
     111        m_pView->ensureInsertionPointOnScreen();
    110112}
    111113
    112114void FV_SelectionHandles::updateCursor(UT_sint32 x, UT_sint32 y)
  • src/text/fmt/xp/fv_View.cpp

    diff --git a/src/text/fmt/xp/fv_View.cpp b/src/text/fmt/xp/fv_View.cpp
    index 9e78a85..5948ebe 100644
    a b bool FV_View::rtlPages() const 
    1442614426void
    1442714427FV_View::selectRange( PT_DocPosition start, PT_DocPosition end )
    1442814428{
     14429        PT_DocPosition prev_start, prev_end;
     14430
     14431        prev_start = m_Selection.getSelectionLeftAnchor();
     14432        prev_end = m_Selection.getSelectionRightAnchor();
     14433
     14434        if (prev_start == start && prev_end == end)
     14435                return;
     14436
    1442914437        _clearSelection(false);
    1443014438        _setPoint(start);
    1443114439        m_Selection.setSelectionLeftAnchor(start);
    1443214440        _setSelectionAnchor();
    1443314441        setPoint(end);
    1443414442        m_Selection.setSelectionRightAnchor(end);
    14435         _drawSelection();
     14443
     14444        _drawBetweenPositions(MIN (prev_start, start), MAX (prev_end, end));
    1443614445        _updateSelectionHandles();
    1443714446}