mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-19 22:43:32 +00:00
22 lines
588 B
C++
Executable File
22 lines
588 B
C++
Executable File
//#include "main_rpi.h"
|
|
|
|
#include <SDL/SDL_syswm.h>
|
|
|
|
void getWindowPosition(int* x, int* y, int* width, int* height) {
|
|
static SDL_SysWMinfo wmInfo;
|
|
SDL_VERSION(&wmInfo.version);
|
|
SDL_GetWMInfo(&wmInfo);
|
|
|
|
static XWindowAttributes attr;
|
|
Display* display = wmInfo.info.x11.display;
|
|
Window window = wmInfo.info.x11.wmwindow;
|
|
Window wndvoid;
|
|
|
|
wmInfo.info.x11.lock_func();
|
|
int status = XGetWindowAttributes(display, window, &attr);
|
|
*width = attr.width;
|
|
*height = attr.height;
|
|
XTranslateCoordinates(display, window, attr.root, 0, 0, x, y, &wndvoid);
|
|
wmInfo.info.x11.unlock_func();
|
|
}
|