Changeset 41055 in webkit


Ignore:
Timestamp:
Feb 18, 2009 4:17:11 AM (15 years ago)
Author:
kov@webkit.org
Message:

2009-02-18 Xan Lopez <xan@gnome.org>

Reviewed by Mark Rowe.

https://bugs.webkit.org/show_bug.cgi?id=23989

Based on a patch by Bo Yang <techrazy.yang@gmail.com>

Make the cursor cache global, that's all we really need and
otherwise we can miss cursor transitions in some situations (see
the bug for one testcase). Also remove some now useless code.

  • platform/Widget.h:
  • platform/gtk/WidgetGtk.cpp: (WebCore::Widget::Widget): (WebCore::Widget::~Widget): (WebCore::Widget::setCursor):
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r41054 r41055  
     12009-02-18  Xan Lopez  <xan@gnome.org>
     2
     3        Reviewed by Mark Rowe.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=23989
     6
     7        Based on a patch by Bo Yang  <techrazy.yang@gmail.com>
     8
     9        Make the cursor cache global, that's all we really need and
     10        otherwise we can miss cursor transitions in some situations (see
     11        the bug for one testcase). Also remove some now useless code.
     12
     13        * platform/Widget.h:
     14        * platform/gtk/WidgetGtk.cpp:
     15        (WebCore::Widget::Widget):
     16        (WebCore::Widget::~Widget):
     17        (WebCore::Widget::setCursor):
     18
    1192009-02-17  Adam Roben  <aroben@apple.com>
    220
  • trunk/WebCore/platform/Widget.h

    r39201 r41055  
    138138
    139139    void setCursor(const Cursor&);
    140     Cursor cursor();
    141140
    142141    virtual void show();
     
    194193    IntRect m_frame; // Not used when a native widget exists.
    195194
    196 #if PLATFORM(MAC) || PLATFORM(GTK)
     195#if PLATFORM(MAC)
    197196    WidgetPrivate* m_data;
    198197#endif
  • trunk/WebCore/platform/gtk/WidgetGtk.cpp

    r37515 r41055  
    4242namespace WebCore {
    4343
    44 class WidgetPrivate {
    45 public:
    46     GdkCursor* cursor;
    47 };
     44static GdkCursor* lastSetCursor;
    4845
    4946Widget::Widget(PlatformWidget widget)
    50     : m_data(new WidgetPrivate)
    5147{
    5248    init(widget);
    53     m_data->cursor = 0;
    5449}
    5550
     
    5853    ASSERT(!parent());
    5954    releasePlatformWidget();
    60     delete m_data;
    6155}
    6256
     
    6458{
    6559    gtk_widget_grab_focus(platformWidget() ? platformWidget() : GTK_WIDGET(root()->hostWindow()->platformWindow()));
    66 }
    67 
    68 Cursor Widget::cursor()
    69 {
    70     return Cursor(m_data->cursor);
    7160}
    7261
     
    7867void Widget::setCursor(const Cursor& cursor)
    7968{
    80     GdkCursor* pcur = cursor.impl();
     69    GdkCursor* platformCursor = cursor.impl();
    8170
    8271    // http://bugs.webkit.org/show_bug.cgi?id=16388
     
    8675    // expensive operation, so avoid it if possible.
    8776
    88     if (pcur == m_data->cursor)
     77    if (platformCursor == lastSetCursor)
    8978        return;
    9079
    91     gdk_window_set_cursor(gdkDrawable(platformWidget()) ? GDK_WINDOW(gdkDrawable(platformWidget())) : GTK_WIDGET(root()->hostWindow()->platformWindow())->window, pcur);
    92     m_data->cursor = pcur;
     80    gdk_window_set_cursor(gdkDrawable(platformWidget()) ? GDK_WINDOW(gdkDrawable(platformWidget())) : GTK_WIDGET(root()->hostWindow()->platformWindow())->window, platformCursor);
     81    lastSetCursor = platformCursor;
    9382}
    9483
Note: See TracChangeset for help on using the changeset viewer.