changed the transparency of the window where drag is from on mac.

This commit is contained in:
jerry 2013-09-12 11:43:34 +00:00
parent b92b7c71fb
commit dbc7659776
4 changed files with 13 additions and 7 deletions

View File

@ -762,8 +762,9 @@ CClient::fileChunkReceived(CString data)
void
CClient::dragInfoReceived(UInt32 fileNum, CString data)
{
CDragInformation::parseDragInfo(m_dragFileList, fileNum, data);
LOG((CLOG_DEBUG "drag information received"));
LOG((CLOG_DEBUG "parsing drag info data: %s", data.c_str()));
CDragInformation::parseDragInfo(m_dragFileList, fileNum, data);
LOG((CLOG_DEBUG "total drag file number: %i", m_dragFileList.size()));
for(int i = 0; i < m_dragFileList.size(); ++i) {

View File

@ -30,14 +30,16 @@ runCocoaApp()
NSApplication* app = [[NSApplication alloc] init];
NSWindow* window = [[NSWindow alloc]
initWithContentRect: NSMakeRect(-100, -100, 100, 100)
styleMask: NSTitledWindowMask | NSMiniaturizableWindowMask
initWithContentRect: NSMakeRect(0, 0, 100, 4)
styleMask: NSBorderlessWindowMask
backing: NSBackingStoreBuffered
defer: NO];
[window setTitle: @""];
[window setAlphaValue:0.1];
[window makeKeyAndOrderFront:nil];
COSXDragView* dragView = [[COSXDragView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
COSXDragView* dragView = [[COSXDragView alloc] initWithFrame:NSMakeRect(0, 0, 100, 4)];
g_dragWindow = window;
g_dragView = dragView;
[window setContentView: dragView];
@ -53,9 +55,10 @@ fakeDragging(const char* str, int length, int cursorX, int cursorY)
dispatch_async(dispatch_get_main_queue(), ^{
NSRect screen = [[NSScreen mainScreen] frame];
NSLog ( @"mouseLocation: %d %d", cursorX, cursorY);
NSRect rect = NSMakeRect(cursorX - 50, screen.size.height - cursorY - 50, 100, 100);
[g_dragWindow setFrame:rect display:YES];
[g_dragWindow makeKeyWindow];
NSRect rect = NSMakeRect(cursorX - 99, screen.size.height - cursorY - 2, 100, 4);
[g_dragWindow setFrame:rect display:NO];
[g_dragWindow makeKeyAndOrderFront:nil];
});
}

View File

@ -43,6 +43,7 @@ acceptsFirstMouse:(NSEvent *)theEvent
- (void)
mouseDown:(NSEvent *)theEvent
{
NSLog ( @"cocoa mouse down");
NSPoint dragPosition;
NSRect imageLocation;
dragPosition = [self convertPoint:[theEvent locationInWindow]

View File

@ -589,6 +589,7 @@ COSXScreen::fakeMouseButton(ButtonID id, bool press)
m_lastSingleClickYCursor = m_yCursor;
}
if (!press && (id == kButtonLeft)) {
// fake ctrl key up
fakeKeyUp(29);
if (m_fakeDraggingStarted) {