Changeset 41055 in webkit
- Timestamp:
- Feb 18, 2009 4:17:11 AM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r41054 r41055 1 2009-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 1 19 2009-02-17 Adam Roben <aroben@apple.com> 2 20 -
trunk/WebCore/platform/Widget.h
r39201 r41055 138 138 139 139 void setCursor(const Cursor&); 140 Cursor cursor();141 140 142 141 virtual void show(); … … 194 193 IntRect m_frame; // Not used when a native widget exists. 195 194 196 #if PLATFORM(MAC) || PLATFORM(GTK)195 #if PLATFORM(MAC) 197 196 WidgetPrivate* m_data; 198 197 #endif -
trunk/WebCore/platform/gtk/WidgetGtk.cpp
r37515 r41055 42 42 namespace WebCore { 43 43 44 class WidgetPrivate { 45 public: 46 GdkCursor* cursor; 47 }; 44 static GdkCursor* lastSetCursor; 48 45 49 46 Widget::Widget(PlatformWidget widget) 50 : m_data(new WidgetPrivate)51 47 { 52 48 init(widget); 53 m_data->cursor = 0;54 49 } 55 50 … … 58 53 ASSERT(!parent()); 59 54 releasePlatformWidget(); 60 delete m_data;61 55 } 62 56 … … 64 58 { 65 59 gtk_widget_grab_focus(platformWidget() ? platformWidget() : GTK_WIDGET(root()->hostWindow()->platformWindow())); 66 }67 68 Cursor Widget::cursor()69 {70 return Cursor(m_data->cursor);71 60 } 72 61 … … 78 67 void Widget::setCursor(const Cursor& cursor) 79 68 { 80 GdkCursor* p cur = cursor.impl();69 GdkCursor* platformCursor = cursor.impl(); 81 70 82 71 // http://bugs.webkit.org/show_bug.cgi?id=16388 … … 86 75 // expensive operation, so avoid it if possible. 87 76 88 if (p cur == m_data->cursor)77 if (platformCursor == lastSetCursor) 89 78 return; 90 79 91 gdk_window_set_cursor(gdkDrawable(platformWidget()) ? GDK_WINDOW(gdkDrawable(platformWidget())) : GTK_WIDGET(root()->hostWindow()->platformWindow())->window, p cur);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; 93 82 } 94 83
Note: See TracChangeset
for help on using the changeset viewer.