[client] x11/sdl: get the border dimensions from the backend

This commit is contained in:
Geoffrey McRae
2021-01-25 22:23:53 +11:00
parent 6b1e310343
commit dbb18a6ecb
6 changed files with 98 additions and 19 deletions

View File

@@ -458,8 +458,8 @@ void app_handleMouseNormal(double ex, double ey)
const int ty = (local.y <= 0.0) ? floor(local.y) : ceil(local.y);
if (core_isValidPointerPos(
g_state.windowPos.x + g_state.border.x + tx,
g_state.windowPos.y + g_state.border.y + ty))
g_state.windowPos.x + g_state.border.left + tx,
g_state.windowPos.y + g_state.border.top + ty))
{
core_setCursorInView(false);
@@ -570,14 +570,9 @@ void app_updateWindowPos(int x, int y)
g_state.windowPos.y = y;
}
void app_handleResizeEvent(int w, int h)
void app_handleResizeEvent(int w, int h, const struct Border border)
{
SDL_GetWindowBordersSize(g_state.window,
&g_state.border.y,
&g_state.border.x,
&g_state.border.h,
&g_state.border.w
);
memcpy(&g_state.border, &border, sizeof(border));
/* don't do anything else if the window dimensions have not changed */
if (g_state.windowW == w && g_state.windowH == h)

View File

@@ -58,7 +58,7 @@ struct AppState
int windowCX, windowCY;
LG_RendererRotate rotate;
bool focused;
SDL_Rect border;
struct Border border;
SDL_Point srcSize;
LG_RendererRect dstRect;
bool posInfoValid;