Changeset 54083 in webkit
- Timestamp:
- Jan 29, 2010 4:00:01 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r54082 r54083 1 2010-01-29 Brian Weinstein <bweinstein@apple.com> 2 3 Reviewed by Adam Roben. 4 5 Drag and Drop: Windows uses "stop" sign as cursor when dragging 6 https://bugs.webkit.org/show_bug.cgi?id=34305 7 <rdar://problem/7589672> 8 9 Add a FIXME for the code that needs to be changed to support full 10 custom cursors. 11 12 * page/EventHandler.cpp: 13 (WebCore::EventHandler::handleDrag): 14 1 15 2010-01-29 Victor Wang <victorw@chromium.org> 2 16 -
trunk/WebCore/page/EventHandler.cpp
r53994 r54083 2293 2293 2294 2294 // We are starting a text/image/url drag, so the cursor should be an arrow 2295 if (FrameView* view = m_frame->view()) 2295 if (FrameView* view = m_frame->view()) { 2296 // FIXME <rdar://7577595>: Custom cursors aren't supported during drag and drop (default to pointer). 2296 2297 view->setCursor(pointerCursor()); 2297 2298 } 2299 2298 2300 if (!dragHysteresisExceeded(event.event().pos())) 2299 2301 return true; -
trunk/WebKit/win/ChangeLog
r54078 r54083 1 2010-01-29 Brian Weinstein <bweinstein@apple.com> 2 3 Reviewed by Adam Roben. 4 5 Drag and Drop: Windows uses "stop" sign as cursor when dragging 6 https://bugs.webkit.org/show_bug.cgi?id=34305 7 <rdar://problem/7589672> 8 9 Add a preference in WebKit (that defaults to false), for whether or not 10 we should show the custom cursors during drag and drop. However, this is 11 currently only used on Windows, and only used to hide the "drop not allowed" 12 icon inside the WebView is the preference is set to true. 13 14 This will be off by default, so no change in behavior. 15 16 * Interfaces/IWebPreferencesPrivate.idl: Added new functions. 17 * Interfaces/WebKit.idl: Touched to force Interfaces build. 18 * WebDropSource.cpp: 19 (WebDropSource::GiveFeedback): Implementation of conditional showing cursor 20 logic. 21 * WebPreferenceKeysPrivate.h: Added new preference key. 22 * WebPreferences.cpp: Added new functions. 23 (WebPreferences::setCustomDragCursorsEnabled): 24 (WebPreferences::customDragCursorsEnabled): 25 * WebPreferences.h: Added new functions. 26 1 27 2010-01-28 Jon Honeycutt <jhoneycutt@apple.com> 2 28 -
trunk/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
r52442 r54083 95 95 HRESULT setAcceleratedCompositingEnabled([in] BOOL); 96 96 HRESULT acceleratedCompositingEnabled([out, retval] BOOL*); 97 98 HRESULT setCustomDragCursorsEnabled([in] BOOL); 99 HRESULT customDragCursorsEnabled([out, retval] BOOL*); 97 100 } -
trunk/WebKit/win/Interfaces/WebKit.idl
r54078 r54083 295 295 } 296 296 } 297 -
trunk/WebKit/win/WebDropSource.cpp
r50786 r54083 30 30 #include "WebView.h" 31 31 32 #include <WebCore/Cursor.h> 32 33 #include <WebCore/DragActions.h> 33 34 #include <WebCore/EventHandler.h> 34 35 #include <WebCore/Frame.h> 36 #include <WebCore/FrameView.h> 35 37 #include <WebCore/Page.h> 36 38 #include <WebCore/PlatformMouseEvent.h> … … 113 115 } 114 116 115 STDMETHODIMP WebDropSource::GiveFeedback(DWORD )117 STDMETHODIMP WebDropSource::GiveFeedback(DWORD dwEffect) 116 118 { 117 return DRAGDROP_S_USEDEFAULTCURSORS; 119 BOOL showCustomCursors; 120 if (FAILED(WebPreferences::sharedStandardPreferences()->customDragCursorsEnabled(&showCustomCursors))) 121 return DRAGDROP_S_USEDEFAULTCURSORS; 122 123 // If we don't want to hide the stop icon, let Windows select the cursor. 124 if (!showCustomCursors) 125 return DRAGDROP_S_USEDEFAULTCURSORS; 126 127 // If we are going to show something other than the not allowed arrow, then let Windows 128 // show the cursor. 129 if (dwEffect != DROPEFFECT_NONE) 130 return DRAGDROP_S_USEDEFAULTCURSORS; 131 132 HWND viewWindow; 133 if (FAILED(m_webView->viewWindow(reinterpret_cast<OLE_HANDLE*>(&viewWindow)))) 134 return DRAGDROP_S_USEDEFAULTCURSORS; 135 136 RECT webViewRect; 137 GetWindowRect(viewWindow, &webViewRect); 138 139 POINT cursorPoint; 140 GetCursorPos(&cursorPoint); 141 142 if (!PtInRect(&webViewRect, cursorPoint)) { 143 // If our cursor is outside the bounds of the webView, we want to let Windows select the cursor. 144 return DRAGDROP_S_USEDEFAULTCURSORS; 145 } 146 147 FrameView* view = m_webView->page()->mainFrame()->view(); 148 if (!view) 149 return DRAGDROP_S_USEDEFAULTCURSORS; 150 151 // When dragging inside a WebView and the drag is not allowed, don't show the not allowed icon, 152 // instead, show the pointer cursor. 153 // FIXME <rdar://7577595>: Custom cursors aren't supported during drag and drop (default to pointer). 154 view->setCursor(pointerCursor()); 155 return S_OK; 118 156 } -
trunk/WebKit/win/WebPreferenceKeysPrivate.h
r52442 r54083 132 132 133 133 #define WebKitAcceleratedCompositingEnabledPreferenceKey "WebKitAcceleratedCompositingEnabled" 134 135 #define WebKitCustomDragCursorsEnabledPreferenceKey "WebKitCustomDragCursorsEnabled" -
trunk/WebKit/win/WebPreferences.cpp
r53773 r54083 1375 1375 } 1376 1376 1377 HRESULT WebPreferences::setCustomDragCursorsEnabled(BOOL enabled) 1378 { 1379 setBoolValue(CFSTR(WebKitCustomDragCursorsEnabledPreferenceKey), enabled); 1380 return S_OK; 1381 } 1382 1383 HRESULT WebPreferences::customDragCursorsEnabled(BOOL* enabled) 1384 { 1385 *enabled = boolValueForKey(CFSTR(WebKitCustomDragCursorsEnabledPreferenceKey)); 1386 return S_OK; 1387 } 1388 1377 1389 void WebPreferences::willAddToWebView() 1378 1390 { -
trunk/WebKit/win/WebPreferences.h
r52442 r54083 388 388 virtual HRESULT STDMETHODCALLTYPE acceleratedCompositingEnabled(BOOL*); 389 389 390 virtual HRESULT STDMETHODCALLTYPE setCustomDragCursorsEnabled(BOOL); 391 virtual HRESULT STDMETHODCALLTYPE customDragCursorsEnabled(BOOL*); 392 390 393 // WebPreferences 391 394
Note: See TracChangeset
for help on using the changeset viewer.