summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/modules')
-rw-r--r--src/osd/modules/input/input_sdlcommon.cpp36
-rw-r--r--src/osd/modules/input/input_sdlcommon.h2
2 files changed, 13 insertions, 25 deletions
diff --git a/src/osd/modules/input/input_sdlcommon.cpp b/src/osd/modules/input/input_sdlcommon.cpp
index 1f2606fd973..17186c24eb9 100644
--- a/src/osd/modules/input/input_sdlcommon.cpp
+++ b/src/osd/modules/input/input_sdlcommon.cpp
@@ -86,23 +86,9 @@ void sdl_event_manager::process_window_event(running_machine &machine, SDL_Event
switch (sdlevent.window.event)
{
- case SDL_WINDOWEVENT_SHOWN:
- m_has_focus = true;
- break;
-
- case SDL_WINDOWEVENT_CLOSE:
- machine.schedule_exit();
- break;
-
- case SDL_WINDOWEVENT_LEAVE:
- machine.ui_input().push_mouse_leave_event(window->target());
- m_mouse_over_window = 0;
- break;
-
case SDL_WINDOWEVENT_MOVED:
window->notify_changed();
m_focus_window = window;
- m_has_focus = true;
break;
case SDL_WINDOWEVENT_RESIZED:
@@ -116,24 +102,28 @@ void sdl_event_manager::process_window_event(running_machine &machine, SDL_Event
//printf("event data1,data2 %d x %d %ld\n", event.window.data1, event.window.data2, sizeof(SDL_Event));
window->resize(sdlevent.window.data1, sdlevent.window.data2);
}
- m_focus_window = window;
- m_has_focus = true;
break;
case SDL_WINDOWEVENT_ENTER:
m_mouse_over_window = 1;
- [[fallthrough]];
+ break;
+
+ case SDL_WINDOWEVENT_LEAVE:
+ machine.ui_input().push_mouse_leave_event(window->target());
+ m_mouse_over_window = 0;
+ break;
+
case SDL_WINDOWEVENT_FOCUS_GAINED:
- case SDL_WINDOWEVENT_EXPOSED:
- case SDL_WINDOWEVENT_MAXIMIZED:
- case SDL_WINDOWEVENT_RESTORED:
m_focus_window = window;
- m_has_focus = true;
+ machine.ui_input().push_window_focus_event(window->target());
break;
- case SDL_WINDOWEVENT_MINIMIZED:
case SDL_WINDOWEVENT_FOCUS_LOST:
- m_has_focus = false;
+ machine.ui_input().push_window_defocus_event(window->target());
+ break;
+
+ case SDL_WINDOWEVENT_CLOSE:
+ machine.schedule_exit();
break;
}
}
diff --git a/src/osd/modules/input/input_sdlcommon.h b/src/osd/modules/input/input_sdlcommon.h
index ee13ce307dd..030a8ca4bd7 100644
--- a/src/osd/modules/input/input_sdlcommon.h
+++ b/src/osd/modules/input/input_sdlcommon.h
@@ -117,12 +117,10 @@ class sdl_event_manager : public event_manager_t<sdl_event_subscriber>
{
private:
bool m_mouse_over_window;
- bool m_has_focus;
std::shared_ptr<sdl_window_info> m_focus_window;
sdl_event_manager()
: m_mouse_over_window(true),
- m_has_focus(true),
m_focus_window(nullptr)
{
}