-
Notifications
You must be signed in to change notification settings - Fork 16
/
Swipe.cpp
40 lines (30 loc) · 1.04 KB
/
Swipe.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "Swipe.h"
#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
SDL_SysWMinfo
Swipe::m_syswminfo = {0};
void
Swipe::lock(bool locked)
{
unsigned int customRegion[] = {
0,
0,
locked?854:0,
locked?480:0,
};
Atom customRegionAtom = XInternAtom(m_syswminfo.info.x11.display,
"_MEEGOTOUCH_CUSTOM_REGION", False);
XChangeProperty(m_syswminfo.info.x11.display,
m_syswminfo.info.x11.window, customRegionAtom,
XA_CARDINAL, 32, PropModeReplace,
reinterpret_cast<unsigned char*>(&customRegion[0]), 4);
XChangeProperty(m_syswminfo.info.x11.display,
m_syswminfo.info.x11.fswindow, customRegionAtom,
XA_CARDINAL, 32, PropModeReplace,
reinterpret_cast<unsigned char*>(&customRegion[0]), 4);
XChangeProperty(m_syswminfo.info.x11.display,
m_syswminfo.info.x11.wmwindow, customRegionAtom,
XA_CARDINAL, 32, PropModeReplace,
reinterpret_cast<unsigned char*>(&customRegion[0]), 4);
}