[client] spice: set absolute position and focus state on Wayland

This commit is contained in:
Quantum 2021-01-09 23:50:49 -05:00 committed by Geoffrey McRae
parent d68d82e5f7
commit 790c2b39ad

View file

@ -1206,6 +1206,16 @@ int eventFilter(void * userdata, SDL_Event * event)
handleWindowLeave();
break;
case SDL_WINDOWEVENT_FOCUS_GAINED:
if (g_state.wminfo.subsystem != SDL_SYSWM_X11)
g_state.focused = true;
break;
case SDL_WINDOWEVENT_FOCUS_LOST:
if (g_state.wminfo.subsystem != SDL_SYSWM_X11)
g_state.focused = false;
break;
case SDL_WINDOWEVENT_SIZE_CHANGED:
case SDL_WINDOWEVENT_RESIZED:
if (g_state.wminfo.subsystem != SDL_SYSWM_X11)
@ -1423,6 +1433,9 @@ int eventFilter(void * userdata, SDL_Event * event)
if (g_state.wminfo.subsystem == SDL_SYSWM_X11)
break;
g_cursor.pos.x = event->motion.x;
g_cursor.pos.y = event->motion.y;
if (g_cursor.grab)
handleMouseGrabbed(event->motion.xrel, event->motion.yrel);
else