mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-10 00:11:43 +08:00
- checked filename's validation before sending drag info
- refactored duplicated write to drop dir code - removed legacy member variables - fixed code style - fixed typo
This commit is contained in:
@@ -1873,7 +1873,12 @@ CMSWindowsScreen::getDraggingFilename()
|
||||
ShowWindow(m_dropWindow, SW_HIDE);
|
||||
|
||||
if (!filename.empty()) {
|
||||
m_draggingFilename = filename;
|
||||
if (CDragInformation::isFileValid(filename)) {
|
||||
m_draggingFilename = filename;
|
||||
}
|
||||
else {
|
||||
LOG((CLOG_DEBUG "drag file name is invalid: %s", filename.c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
if (m_draggingFilename.empty()) {
|
||||
|
||||
@@ -82,7 +82,7 @@ fakeDragging(const char* str, int cursorX, int cursorY)
|
||||
|
||||
[g_dragWindow setFrame:rect display:NO];
|
||||
[g_dragWindow makeKeyAndOrderFront:nil];
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
|
||||
[g_dragView setFileExt:g_ext];
|
||||
|
||||
|
||||
@@ -911,12 +911,6 @@ COSXScreen::leave()
|
||||
CString& fileList = getDraggingFilename();
|
||||
|
||||
if (!m_isPrimary) {
|
||||
// TODO: is this duplicated?
|
||||
// fake esc key down and up
|
||||
fakeKeyDown(kKeyEscape, 8192, 1);
|
||||
fakeKeyUp(1);
|
||||
fakeMouseButton(kButtonLeft, false);
|
||||
|
||||
if (fileList.empty() == false) {
|
||||
CClientApp& app = CClientApp::instance();
|
||||
CClient* client = app.getClientPtr();
|
||||
|
||||
Reference in New Issue
Block a user