33 const char *displayName,
bool isPrimary,
int mouseScrollDelta,
IEventQueue *events,
bool invertScrolling =
false
45 void getShape(int32_t &
x, int32_t &
y, int32_t &width, int32_t &height)
const override;
64 void fakeMouseWheel(int32_t xDelta, int32_t yDelta)
const override;
69 void enter()
override;
71 void leave()
override;
95 Cursor createBlankCursor()
const;
102 void processClipboardRequest(Window window, Time time, Atom property)
const;
105 void destroyClipboardRequest(Window window)
const;
109 static int ioErrorHandler(Display *);
120 Display *openDisplay(
const char *displayName);
122 void setShape(int32_t width, int32_t height);
123 Window openWindow()
const;
126 bool grabMouseAndKeyboard();
127 void onKeyPress(XKeyEvent &);
128 void onKeyRelease(XKeyEvent &,
bool isRepeat);
129 bool onHotKey(
const XKeyEvent &,
bool isRepeat);
130 void onMousePress(
const XButtonEvent &);
131 void onMouseRelease(
const XButtonEvent &);
132 void onMouseMove(
const XMotionEvent &);
136 void selectXIRawMotion();
138 void selectEvents(Window)
const;
139 void doSelectEvents(Window)
const;
141 KeyID mapKeyFromX(XKeyEvent *)
const;
142 ButtonID mapButtonFromX(
const XButtonEvent *)
const;
143 unsigned int mapButtonToX(
ButtonID id)
const;
145 void warpCursorNoFlush(int32_t
x, int32_t
y);
147 void refreshKeyboard(XEvent *);
149 static Bool findKeyEvent(Display *, XEvent *xevent, XPointer arg);
155 HotKeyItem(
int,
unsigned int);
157 bool operator<(
const HotKeyItem &)
const;
163 using FilteredKeycodes = std::set<bool>;
164 using HotKeyList = std::vector<std::pair<int, unsigned int>>;
165 using HotKeyMap = std::map<uint32_t, HotKeyList>;
166 using HotKeyIDList = std::vector<uint32_t>;
167 using HotKeyToIDMap = std::map<HotKeyItem, uint32_t>;
171 int m_mouseScrollDelta;
173 Display *m_display =
nullptr;
174 Window m_root = None;
175 Window m_window = None;
180 uint32_t m_activeSides = 0;
186 int32_t m_xCenter = 0;
187 int32_t m_yCenter = 0;
190 int32_t m_xCursor = 0;
191 int32_t m_yCursor = 0;
198 HotKeyIDList m_oldHotKeyIDs;
199 HotKeyToIDMap m_hotKeyToIDMap;
202 Window m_lastFocus = None;
203 int m_lastFocusRevert = RevertToNone;
208 KeyCode m_lastKeycode = 0;
209 FilteredKeycodes m_filtered;
213 uint32_t m_sequenceNumber = 0;
217 bool m_screensaverNotify =
false;
221 std::vector<unsigned char> m_buttons;
230 bool m_xtestIsXineramaUnaware =
true;
235 bool m_preserveFocus =
false;
241 bool m_xi2detected =
false;
244 bool m_xrandr =
false;
245 int m_xrandrEventBase;
static const ClipboardID kClipboardEnd
Definition ClipboardTypes.h:30
uint8_t ClipboardID
Clipboard ID.
Definition ClipboardTypes.h:16
int key
Definition KeySequence.cpp:15
uint32_t KeyID
Key ID.
Definition KeyTypes.h:21
uint32_t KeyModifierMask
Modifier key mask.
Definition KeyTypes.h:44
uint8_t ButtonID
Mouse button ID.
Definition MouseTypes.h:16
std::vector< uint32_t > OptionsList
Definition OptionTypes.h:26
int y
Definition ServerConfig.cpp:25
int x
Definition ServerConfig.cpp:24
Event.
Definition Event.h:29
Clipboard interface.
Definition IClipboard.h:19
Event queue interface.
Definition IEventQueue.h:29
IKeyState(const IEventQueue *events)
Definition IKeyState.cpp:17
Definition XDGPowerManager.h:13
X11 clipboard implementation.
Definition XWindowsClipboard.h:26
X Windows key state.
Definition XWindowsKeyState.h:33
X11 screen saver implementation.
Definition XWindowsScreenSaver.h:23
void warpCursor(int32_t x, int32_t y) override
Warp cursor.
Definition XWindowsScreen.cpp:496
void handleSystemEvent(const Event &event) override
Handle system event.
Definition XWindowsScreen.cpp:1097
bool getClipboard(ClipboardID id, IClipboard *) const override
Get clipboard.
Definition XWindowsScreen.cpp:442
XWindowsScreen(const char *displayName, bool isPrimary, int mouseScrollDelta, IEventQueue *events, bool invertScrolling=false)
Definition XWindowsScreen.cpp:86
void fakeMouseRelativeMove(int32_t dx, int32_t dy) const override
Fake mouse move.
Definition XWindowsScreen.cpp:787
uint32_t registerHotKey(KeyID key, KeyModifierMask mask) override
Register a system hotkey.
Definition XWindowsScreen.cpp:515
void closeScreensaver() override
Close screen saver.
Definition XWindowsScreen.cpp:386
void updateButtons() override
Update mouse buttons.
Definition XWindowsScreen.cpp:1826
void setOptions(const OptionsList &options) override
Notify of options changes.
Definition XWindowsScreen.cpp:408
bool isPrimary() const override
Test if is primary screen.
Definition XWindowsScreen.cpp:426
void fakeInputEnd() override
Done synthesizing input on primary screen.
Definition XWindowsScreen.cpp:735
void screensaver(bool activate) override
Activate/deactivate screen saver.
Definition XWindowsScreen.cpp:393
void resetOptions() override
Notify of options changes.
Definition XWindowsScreen.cpp:402
void * getEventTarget() const final
Get event target.
Definition XWindowsScreen.cpp:437
~XWindowsScreen() override
Definition XWindowsScreen.cpp:163
std::string getSecureInputApp() const override
Determine the name of the app causing a secure input state.
Definition XWindowsScreen.cpp:431
void enable() override
Enable screen.
Definition XWindowsScreen.cpp:193
int32_t getJumpZoneSize() const override
Get jump zone size.
Definition XWindowsScreen.cpp:740
void getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const override
Get screen shape.
Definition XWindowsScreen.cpp:458
uint32_t activeSides() override
activeSides
Definition XWindowsScreen.cpp:491
void getCursorCenter(int32_t &x, int32_t &y) const override
Get cursor center position.
Definition XWindowsScreen.cpp:762
void checkClipboards() override
Check clipboard owner.
Definition XWindowsScreen.cpp:373
void fakeMouseMove(int32_t x, int32_t y) override
Fake mouse move.
Definition XWindowsScreen.cpp:777
void unregisterHotKey(uint32_t id) override
Unregister a system hotkey.
Definition XWindowsScreen.cpp:701
void leave() override
Leave screen.
Definition XWindowsScreen.cpp:294
bool canLeave() override
Leave screen.
Definition XWindowsScreen.cpp:285
void enter() override
Enter screen.
Definition XWindowsScreen.cpp:231
void setSequenceNumber(uint32_t) override
Set clipboard sequence number.
Definition XWindowsScreen.cpp:421
void disable() override
Disable screen.
Definition XWindowsScreen.cpp:214
void fakeInputBegin() override
Prepare to synthesize input on primary screen.
Definition XWindowsScreen.cpp:730
void fakeMouseButton(ButtonID id, bool press) override
Fake mouse press/release.
Definition XWindowsScreen.cpp:768
void reconfigure(uint32_t activeSides) override
Update configuration.
Definition XWindowsScreen.cpp:484
bool setClipboard(ClipboardID, const IClipboard *) override
Set clipboard.
Definition XWindowsScreen.cpp:349
void getCursorPos(int32_t &x, int32_t &y) const override
Get cursor position.
Definition XWindowsScreen.cpp:466
IKeyState * getKeyState() const override
Get the key state.
Definition XWindowsScreen.cpp:1083
void openScreensaver(bool notify) override
Open screen saver.
Definition XWindowsScreen.cpp:378
void fakeMouseWheel(int32_t xDelta, int32_t yDelta) const override
Fake mouse wheel.
Definition XWindowsScreen.cpp:794
bool isAnyMouseButtonDown(uint32_t &buttonID) const override
Test if mouse is pressed.
Definition XWindowsScreen.cpp:745
Key map.
Definition KeyMap.h:24
EventTypes
Definition EventTypes.h:13