mirror of
https://github.com/debauchee/barrier.git
synced 2024-11-27 10:38:48 +03:00
Fix Mac warning ⚠️
This commit is contained in:
parent
eb0e5a9ecd
commit
72c394208f
@ -119,10 +119,11 @@ OSXClipboard::add(EFormat format, const String & data)
|
|||||||
String osXData = converter->fromIClipboard(data);
|
String osXData = converter->fromIClipboard(data);
|
||||||
CFStringRef flavorType = converter->getOSXFormat();
|
CFStringRef flavorType = converter->getOSXFormat();
|
||||||
CFDataRef dataRef = CFDataCreate(kCFAllocatorDefault, (UInt8 *)osXData.data(), osXData.size());
|
CFDataRef dataRef = CFDataCreate(kCFAllocatorDefault, (UInt8 *)osXData.data(), osXData.size());
|
||||||
|
PasteboardItemID itemID = 0;
|
||||||
|
|
||||||
PasteboardPutItemFlavor(
|
PasteboardPutItemFlavor(
|
||||||
m_pboard,
|
m_pboard,
|
||||||
nullptr,
|
itemID,
|
||||||
flavorType,
|
flavorType,
|
||||||
dataRef,
|
dataRef,
|
||||||
kPasteboardFlavorNoFlags);
|
kPasteboardFlavorNoFlags);
|
||||||
|
@ -120,7 +120,6 @@ static const KeyEntry s_controlKeys[] = {
|
|||||||
{ kKeyCapsLock, s_capsLockVK },
|
{ kKeyCapsLock, s_capsLockVK },
|
||||||
|
|
||||||
{ kKeyMissionControl, s_missionControlVK },
|
{ kKeyMissionControl, s_missionControlVK },
|
||||||
{ kKeyLaunchpad, s_launchpadVK }
|
|
||||||
{ kKeyLaunchpad, s_launchpadVK },
|
{ kKeyLaunchpad, s_launchpadVK },
|
||||||
{ kKeyBrightnessUp, s_brightnessUp },
|
{ kKeyBrightnessUp, s_brightnessUp },
|
||||||
{ kKeyBrightnessDown, s_brightnessDown }
|
{ kKeyBrightnessDown, s_brightnessDown }
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
#include <mach-o/dyld.h>
|
#include <mach-o/dyld.h>
|
||||||
#include <AvailabilityMacros.h>
|
#include <AvailabilityMacros.h>
|
||||||
#include <IOKit/hidsystem/event_status_driver.h>
|
#include <IOKit/hidsystem/event_status_driver.h>
|
||||||
|
#include <AppKit/NSEvent.h>
|
||||||
|
|
||||||
// This isn't in any Apple SDK that I know of as of yet.
|
// This isn't in any Apple SDK that I know of as of yet.
|
||||||
enum {
|
enum {
|
||||||
@ -475,7 +476,7 @@ OSXScreen::postMouseEvent(CGPoint& pos) const
|
|||||||
type = thisButtonType[kMouseButtonDragged];
|
type = thisButtonType[kMouseButtonDragged];
|
||||||
}
|
}
|
||||||
|
|
||||||
CGEventRef event = CGEventCreateMouseEvent(NULL, type, pos, button);
|
CGEventRef event = CGEventCreateMouseEvent(NULL, type, pos, static_cast<CGMouseButton>(button));
|
||||||
|
|
||||||
// Dragging events also need the click state
|
// Dragging events also need the click state
|
||||||
CGEventSetIntegerValueField(event, kCGMouseEventClickState, m_clickState);
|
CGEventSetIntegerValueField(event, kCGMouseEventClickState, m_clickState);
|
||||||
@ -561,7 +562,7 @@ OSXScreen::fakeMouseButton(ButtonID id, bool press)
|
|||||||
MouseButtonEventMapType thisButtonMap = MouseButtonEventMap[index];
|
MouseButtonEventMapType thisButtonMap = MouseButtonEventMap[index];
|
||||||
CGEventType type = thisButtonMap[state];
|
CGEventType type = thisButtonMap[state];
|
||||||
|
|
||||||
CGEventRef event = CGEventCreateMouseEvent(NULL, type, pos, index);
|
CGEventRef event = CGEventCreateMouseEvent(NULL, type, pos, static_cast<CGMouseButton>(index));
|
||||||
|
|
||||||
CGEventSetIntegerValueField(event, kCGMouseEventClickState, m_clickState);
|
CGEventSetIntegerValueField(event, kCGMouseEventClickState, m_clickState);
|
||||||
|
|
||||||
@ -754,7 +755,7 @@ OSXScreen::enable()
|
|||||||
// FIXME -- start watching jump zones
|
// FIXME -- start watching jump zones
|
||||||
|
|
||||||
// kCGEventTapOptionDefault = 0x00000000 (Missing in 10.4, so specified literally)
|
// kCGEventTapOptionDefault = 0x00000000 (Missing in 10.4, so specified literally)
|
||||||
m_eventTapPort = CGEventTapCreate(kCGHIDEventTap, kCGHeadInsertEventTap, 0,
|
m_eventTapPort = CGEventTapCreate(kCGHIDEventTap, kCGHeadInsertEventTap, kCGEventTapOptionDefault,
|
||||||
kCGEventMaskForAllEvents,
|
kCGEventMaskForAllEvents,
|
||||||
handleCGInputEvent,
|
handleCGInputEvent,
|
||||||
this);
|
this);
|
||||||
@ -772,7 +773,7 @@ OSXScreen::enable()
|
|||||||
// there may be a better way to do this, but we register an event handler even if we're
|
// there may be a better way to do this, but we register an event handler even if we're
|
||||||
// not on the primary display (acting as a client). This way, if a local event comes in
|
// not on the primary display (acting as a client). This way, if a local event comes in
|
||||||
// (either keyboard or mouse), we can make sure to show the cursor if we've hidden it.
|
// (either keyboard or mouse), we can make sure to show the cursor if we've hidden it.
|
||||||
m_eventTapPort = CGEventTapCreate(kCGHIDEventTap, kCGHeadInsertEventTap, 0,
|
m_eventTapPort = CGEventTapCreate(kCGHIDEventTap, kCGHeadInsertEventTap, kCGEventTapOptionDefault,
|
||||||
kCGEventMaskForAllEvents,
|
kCGEventMaskForAllEvents,
|
||||||
handleCGInputEventSecondary,
|
handleCGInputEventSecondary,
|
||||||
this);
|
this);
|
||||||
@ -1966,7 +1967,8 @@ OSXScreen::handleCGInputEvent(CGEventTapProxy proxy,
|
|||||||
break;
|
break;
|
||||||
case NX_NULLEVENT:
|
case NX_NULLEVENT:
|
||||||
break;
|
break;
|
||||||
case NX_SYSDEFINED:
|
default:
|
||||||
|
if (type == NX_SYSDEFINED) {
|
||||||
if (isMediaKeyEvent (event)) {
|
if (isMediaKeyEvent (event)) {
|
||||||
LOG((CLOG_DEBUG2 "detected media key event"));
|
LOG((CLOG_DEBUG2 "detected media key event"));
|
||||||
screen->onMediaKey (event);
|
screen->onMediaKey (event);
|
||||||
@ -1975,9 +1977,8 @@ OSXScreen::handleCGInputEvent(CGEventTapProxy proxy,
|
|||||||
return event;
|
return event;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NX_NUMPROCS:
|
}
|
||||||
break;
|
|
||||||
default:
|
|
||||||
LOG((CLOG_WARN "unknown quartz event type: 0x%02x", type));
|
LOG((CLOG_WARN "unknown quartz event type: 0x%02x", type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user