mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-22 02:38:11 +00:00
Create window_focused callback
This commit is contained in:
parent
b5830de236
commit
fc9954d967
@ -70,11 +70,21 @@ void ui_window_cocoa_set_droppable(void *data, bool droppable)
|
||||
}
|
||||
}
|
||||
|
||||
bool ui_window_cocoa_focused(void *data)
|
||||
{
|
||||
ui_window_cocoa_t *cocoa = (ui_window_cocoa_t*)data;
|
||||
CocoaView *cocoa_view = (CocoaView*)cocoa->data;
|
||||
if ([[cocoa_view window] isMainWindow] == YES)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
const ui_window_t ui_window_cocoa = {
|
||||
ui_window_cocoa_destroy,
|
||||
ui_window_cocoa_set_focused,
|
||||
ui_window_cocoa_set_visible,
|
||||
ui_window_cocoa_set_title,
|
||||
ui_window_cocoa_set_droppable,
|
||||
ui_window_cocoa_focused,
|
||||
"cocoa"
|
||||
};
|
||||
|
@ -42,11 +42,17 @@ static void ui_window_null_set_droppable(void *data, bool droppable)
|
||||
{
|
||||
}
|
||||
|
||||
static bool ui_window_null_focused(void *data)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
const ui_window_t ui_window_null = {
|
||||
ui_window_null_destroy,
|
||||
ui_window_null_set_focused,
|
||||
ui_window_null_set_visible,
|
||||
ui_window_null_set_title,
|
||||
ui_window_null_set_droppable,
|
||||
ui_window_null_focused,
|
||||
"null"
|
||||
};
|
||||
|
@ -79,11 +79,18 @@ void ui_window_win32_set_droppable(void *data, bool droppable)
|
||||
DragAcceptFiles(window->hwnd, droppable);
|
||||
}
|
||||
|
||||
bool ui_window_win32_focused(void *data)
|
||||
{
|
||||
ui_window_win32_t *window = (ui_window_win32_t*)data;
|
||||
return (GetForeGroundWindow() == window->hwnd);
|
||||
}
|
||||
|
||||
const ui_window_t ui_window_win32 = {
|
||||
ui_window_win32_destroy,
|
||||
ui_window_win32_set_focused,
|
||||
ui_window_win32_set_visible,
|
||||
ui_window_win32_set_title,
|
||||
ui_window_win32_set_droppable,
|
||||
ui_window_win32_focused,
|
||||
"win32"
|
||||
};
|
||||
|
@ -38,6 +38,7 @@ typedef struct ui_window
|
||||
void (*set_visible)(void *data, bool visible);
|
||||
void (*set_title)(void *data, char *buf);
|
||||
void (*set_droppable)(void *data, bool droppable);
|
||||
bool (*focused)(void *data);
|
||||
const char *ident;
|
||||
} ui_window_t;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user