Ticket #4123: patch

File patch, 4.1 KB (added by garnacho, 11 years ago)

Updated patch, fixes handle drawing issues

  • 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..e0524eb 100644
    a b _fv_text_handle_draw (FvTextHandle *handle, 
    9393  priv = handle->priv;
    9494  cairo_save (cr);
    9595
     96  cairo_save (cr);
    9697  cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
    9798  cairo_set_source_rgba (cr, 0, 0, 0, 0);
    9899  cairo_paint (cr);
     100  cairo_restore (cr);
    99101
    100102  gtk_style_context_save (priv->style_context);
    101103  gtk_style_context_add_class (priv->style_context, "cursor-handle");
    _fv_text_handle_set_relative_to (FvTextHandle *handle, 
    523525      priv->windows[FV_TEXT_HANDLE_POSITION_SELECTION_START].window =
    524526        _fv_text_handle_create_window (handle, FV_TEXT_HANDLE_POSITION_SELECTION_START);
    525527      priv->windows[FV_TEXT_HANDLE_POSITION_SELECTION_END].window =
    526         _fv_text_handle_create_window (handle, FV_TEXT_HANDLE_POSITION_SELECTION_START);
     528        _fv_text_handle_create_window (handle, FV_TEXT_HANDLE_POSITION_SELECTION_END);
    527529      priv->realized = TRUE;
    528530    }
    529531  else
    _fv_text_handle_set_mode (FvTextHandle *handle, 
    550552  if (priv->mode == mode)
    551553    return;
    552554
     555  priv->mode = mode;
     556
     557  if (mode != FV_TEXT_HANDLE_MODE_NONE)
     558    _fv_text_handle_update_shape (handle,
     559                                  priv->windows[FV_TEXT_HANDLE_POSITION_CURSOR].window,
     560                                  FV_TEXT_HANDLE_POSITION_CURSOR);
    553561  switch (mode)
    554562    {
    555563    case FV_TEXT_HANDLE_MODE_CURSOR:
    _fv_text_handle_set_mode (FvTextHandle *handle, 
    568576      gdk_window_hide (priv->windows[FV_TEXT_HANDLE_POSITION_SELECTION_END].window);
    569577      break;
    570578    }
    571 
    572   priv->mode = mode;
    573579}
    574580
    575581FvTextHandleMode
    _fv_text_handle_set_visible (FvTextHandle *handle, 
    645651  if (!window)
    646652    return;
    647653
     654  if (priv->windows[pos].dragged)
     655    return;
     656
    648657  if (!visible)
    649658    gdk_window_hide (window);
    650659  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}
    1443814447