fixed dragged name out of date.

This commit is contained in:
jerry 2013-09-13 15:44:33 +00:00
parent e9f43fa7c5
commit 6f982a501a
3 changed files with 17 additions and 8 deletions

View File

@ -1275,7 +1275,7 @@ CMSWindowsScreen::onMouseButton(WPARAM wParam, LPARAM lParam)
m_buttons[button] = true;
if (button == kButtonLeft) {
m_draggingFileDir.clear();
LOG((CLOG_DEBUG "dragging file directory is cleared"));
LOG((CLOG_DEBUG2 "dragging file directory is cleared"));
}
}
else {
@ -1345,12 +1345,6 @@ CMSWindowsScreen::onMouseMove(SInt32 mx, SInt32 my)
CMotionInfo::alloc(m_xCursor, m_yCursor));
if (m_buttons[kButtonLeft] == true && m_draggingStarted == false) {
// temporarily log out dragging file directory
char dir[MAX_PATH];
m_hookLibraryLoader.m_getDraggingFileDir(dir);
m_draggingFileDir.append(dir);
LOG((CLOG_DEBUG "dragging file directory: %s", m_draggingFileDir.c_str()));
m_draggingStarted = true;
}
}
@ -1841,3 +1835,17 @@ CMSWindowsScreen::fakeDraggingFiles(CString str)
{
}
CString&
CMSWindowsScreen::getDraggingFileDir()
{
if (m_draggingStarted) {
// temporarily log out dragging file directory
char dir[MAX_PATH];
m_hookLibraryLoader.m_getDraggingFileDir(dir);
m_draggingFileDir.clear();
m_draggingFileDir.append(dir);
}
return m_draggingFileDir;
}

View File

@ -116,6 +116,7 @@ public:
virtual void setSequenceNumber(UInt32);
virtual bool isPrimary() const;
virtual void fakeDraggingFiles(CString str);
virtual CString& getDraggingFileDir();
protected:
// IPlatformScreen overrides

View File

@ -912,7 +912,7 @@ COSXScreen::leave()
if (!m_isPrimary) {
// fake ctrl key up
fakeKeyUp(29);
// fake esc key down and up
// fake esc key down and up
fakeKeyDown(kKeyEscape, 8192, 1);
fakeKeyUp(1);
CFStringRef dragInfo = getDraggedFileURL();