changed the transparency of the window where drag is from on mac.
This commit is contained in:
parent
b92b7c71fb
commit
dbc7659776
|
@ -762,8 +762,9 @@ CClient::fileChunkReceived(CString data)
|
||||||
void
|
void
|
||||||
CClient::dragInfoReceived(UInt32 fileNum, CString data)
|
CClient::dragInfoReceived(UInt32 fileNum, CString data)
|
||||||
{
|
{
|
||||||
CDragInformation::parseDragInfo(m_dragFileList, fileNum, data);
|
|
||||||
LOG((CLOG_DEBUG "drag information received"));
|
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()));
|
LOG((CLOG_DEBUG "total drag file number: %i", m_dragFileList.size()));
|
||||||
|
|
||||||
for(int i = 0; i < m_dragFileList.size(); ++i) {
|
for(int i = 0; i < m_dragFileList.size(); ++i) {
|
||||||
|
|
|
@ -30,14 +30,16 @@ runCocoaApp()
|
||||||
|
|
||||||
NSApplication* app = [[NSApplication alloc] init];
|
NSApplication* app = [[NSApplication alloc] init];
|
||||||
NSWindow* window = [[NSWindow alloc]
|
NSWindow* window = [[NSWindow alloc]
|
||||||
initWithContentRect: NSMakeRect(-100, -100, 100, 100)
|
initWithContentRect: NSMakeRect(0, 0, 100, 4)
|
||||||
styleMask: NSTitledWindowMask | NSMiniaturizableWindowMask
|
styleMask: NSBorderlessWindowMask
|
||||||
backing: NSBackingStoreBuffered
|
backing: NSBackingStoreBuffered
|
||||||
defer: NO];
|
defer: NO];
|
||||||
[window setTitle: @""];
|
[window setTitle: @""];
|
||||||
|
[window setAlphaValue:0.1];
|
||||||
[window makeKeyAndOrderFront:nil];
|
[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_dragWindow = window;
|
||||||
g_dragView = dragView;
|
g_dragView = dragView;
|
||||||
[window setContentView: dragView];
|
[window setContentView: dragView];
|
||||||
|
@ -53,9 +55,10 @@ fakeDragging(const char* str, int length, int cursorX, int cursorY)
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
NSRect screen = [[NSScreen mainScreen] frame];
|
NSRect screen = [[NSScreen mainScreen] frame];
|
||||||
NSLog ( @"mouseLocation: %d %d", cursorX, cursorY);
|
NSLog ( @"mouseLocation: %d %d", cursorX, cursorY);
|
||||||
NSRect rect = NSMakeRect(cursorX - 50, screen.size.height - cursorY - 50, 100, 100);
|
NSRect rect = NSMakeRect(cursorX - 99, screen.size.height - cursorY - 2, 100, 4);
|
||||||
[g_dragWindow setFrame:rect display:YES];
|
[g_dragWindow setFrame:rect display:NO];
|
||||||
[g_dragWindow makeKeyWindow];
|
|
||||||
|
[g_dragWindow makeKeyAndOrderFront:nil];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ acceptsFirstMouse:(NSEvent *)theEvent
|
||||||
- (void)
|
- (void)
|
||||||
mouseDown:(NSEvent *)theEvent
|
mouseDown:(NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
|
NSLog ( @"cocoa mouse down");
|
||||||
NSPoint dragPosition;
|
NSPoint dragPosition;
|
||||||
NSRect imageLocation;
|
NSRect imageLocation;
|
||||||
dragPosition = [self convertPoint:[theEvent locationInWindow]
|
dragPosition = [self convertPoint:[theEvent locationInWindow]
|
||||||
|
|
|
@ -589,6 +589,7 @@ COSXScreen::fakeMouseButton(ButtonID id, bool press)
|
||||||
m_lastSingleClickYCursor = m_yCursor;
|
m_lastSingleClickYCursor = m_yCursor;
|
||||||
}
|
}
|
||||||
if (!press && (id == kButtonLeft)) {
|
if (!press && (id == kButtonLeft)) {
|
||||||
|
// fake ctrl key up
|
||||||
fakeKeyUp(29);
|
fakeKeyUp(29);
|
||||||
|
|
||||||
if (m_fakeDraggingStarted) {
|
if (m_fakeDraggingStarted) {
|
||||||
|
|
Loading…
Reference in New Issue