mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 23:07:18 +00:00
[client] spice: fix borderless due to another SDL bug
SDL2 reports the window position as 0x0 when in borderless mode until the window is moved or resized.
This commit is contained in:
parent
f7d7fbdb73
commit
183d06f90c
@ -1071,8 +1071,11 @@ int eventFilter(void * userdata, SDL_Event * event)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_WINDOWEVENT_MOVED:
|
case SDL_WINDOWEVENT_MOVED:
|
||||||
|
if (g_state.wminfo.subsystem != SDL_SYSWM_X11)
|
||||||
|
{
|
||||||
g_state.windowPos.x = event->window.data1;
|
g_state.windowPos.x = event->window.data1;
|
||||||
g_state.windowPos.y = event->window.data2;
|
g_state.windowPos.y = event->window.data2;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// allow a window close event to close the application even if ignoreQuit is set
|
// allow a window close event to close the application even if ignoreQuit is set
|
||||||
@ -1094,8 +1097,19 @@ int eventFilter(void * userdata, SDL_Event * event)
|
|||||||
switch(xe.type)
|
switch(xe.type)
|
||||||
{
|
{
|
||||||
case ConfigureNotify:
|
case ConfigureNotify:
|
||||||
|
{
|
||||||
|
/* the window may have been re-parented so we need to translate to
|
||||||
|
* ensure we get the screen top left position of the window */
|
||||||
|
Window child;
|
||||||
|
XTranslateCoordinates(g_state.wminfo.info.x11.display,
|
||||||
|
g_state.wminfo.info.x11.window,
|
||||||
|
DefaultRootWindow(g_state.wminfo.info.x11.display),
|
||||||
|
0, 0, &g_state.windowPos.x, &g_state.windowPos.y,
|
||||||
|
&child);
|
||||||
|
|
||||||
handleResizeEvent(xe.xconfigure.width, xe.xconfigure.height);
|
handleResizeEvent(xe.xconfigure.width, xe.xconfigure.height);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
handleMouseMoveEvent(xe.xmotion.x, xe.xmotion.y);
|
handleMouseMoveEvent(xe.xmotion.x, xe.xmotion.y);
|
||||||
|
Loading…
Reference in New Issue
Block a user