mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 19:20:09 +00:00
Return false if the native cursor cannot be change on SkiaWindow::setNativeMouseCursor
This commit is contained in:
parent
0900019b1e
commit
8cba37e36b
@ -47,7 +47,7 @@ public:
|
||||
- (gfx::Size)clientSize;
|
||||
- (gfx::Size)restoredSize;
|
||||
- (void)setMousePosition:(const gfx::Point&)position;
|
||||
- (void)setNativeMouseCursor:(she::NativeCursor)cursor;
|
||||
- (BOOL)setNativeMouseCursor:(she::NativeCursor)cursor;
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
@ -104,7 +104,7 @@ using namespace she;
|
||||
CFRelease(event);
|
||||
}
|
||||
|
||||
- (void)setNativeMouseCursor:(NativeCursor)cursor
|
||||
- (BOOL)setNativeMouseCursor:(NativeCursor)cursor
|
||||
{
|
||||
NSCursor* nsCursor = nil;
|
||||
|
||||
@ -154,6 +154,7 @@ using namespace she;
|
||||
}
|
||||
|
||||
[self.contentView setCursor:nsCursor];
|
||||
return (nsCursor != nil ? YES: NO);
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -122,8 +122,7 @@ NativeCursor SkiaDisplay::nativeMouseCursor()
|
||||
bool SkiaDisplay::setNativeMouseCursor(NativeCursor cursor)
|
||||
{
|
||||
m_nativeCursor = cursor;
|
||||
m_window.setNativeMouseCursor(cursor);
|
||||
return true;
|
||||
return m_window.setNativeMouseCursor(cursor);
|
||||
}
|
||||
|
||||
void SkiaDisplay::setMousePosition(const gfx::Point& position)
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
void captureMouse();
|
||||
void releaseMouse();
|
||||
void setMousePosition(const gfx::Point& position);
|
||||
void setNativeMouseCursor(NativeCursor cursor);
|
||||
bool setNativeMouseCursor(NativeCursor cursor);
|
||||
void updateWindow(const gfx::Rect& bounds);
|
||||
void* handle();
|
||||
|
||||
|
@ -94,8 +94,8 @@ public:
|
||||
[m_window setMousePosition:position];
|
||||
}
|
||||
|
||||
void setNativeMouseCursor(NativeCursor cursor) {
|
||||
[m_window setNativeMouseCursor:cursor];
|
||||
bool setNativeMouseCursor(NativeCursor cursor) {
|
||||
return ([m_window setNativeMouseCursor:cursor] ? true: false);
|
||||
}
|
||||
|
||||
void updateWindow(const gfx::Rect& bounds) {
|
||||
@ -378,10 +378,12 @@ void SkiaWindow::setMousePosition(const gfx::Point& position)
|
||||
m_impl->setMousePosition(position);
|
||||
}
|
||||
|
||||
void SkiaWindow::setNativeMouseCursor(NativeCursor cursor)
|
||||
bool SkiaWindow::setNativeMouseCursor(NativeCursor cursor)
|
||||
{
|
||||
if (m_impl)
|
||||
m_impl->setNativeMouseCursor(cursor);
|
||||
return m_impl->setNativeMouseCursor(cursor);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
void SkiaWindow::updateWindow(const gfx::Rect& bounds)
|
||||
|
@ -100,7 +100,7 @@ namespace she {
|
||||
SetCursorPos(pos.x, pos.y);
|
||||
}
|
||||
|
||||
void setNativeMouseCursor(NativeCursor cursor) {
|
||||
bool setNativeMouseCursor(NativeCursor cursor) {
|
||||
HCURSOR hcursor = NULL;
|
||||
|
||||
switch (cursor) {
|
||||
@ -150,6 +150,7 @@ namespace she {
|
||||
|
||||
SetCursor(hcursor);
|
||||
m_hcursor = hcursor;
|
||||
return (m_hcursor ? true: false);
|
||||
}
|
||||
|
||||
void updateWindow(const gfx::Rect& bounds) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user