44 void getShape(int32_t &
x, int32_t &
y, int32_t &width, int32_t &height)
const override;
63 void fakeMouseWheel(int32_t xDelta, int32_t yDelta)
const override;
68 void enter()
override;
70 void leave()
override;
94 Cursor createBlankCursor()
const;
101 void processClipboardRequest(Window window, Time time, Atom property)
const;
104 void destroyClipboardRequest(Window window)
const;
108 static int ioErrorHandler(Display *);
119 Display *openDisplay(
const char *displayName);
121 void setShape(int32_t width, int32_t height);
122 Window openWindow()
const;
125 bool grabMouseAndKeyboard();
126 void onKeyPress(XKeyEvent &);
127 void onKeyRelease(XKeyEvent &,
bool isRepeat);
128 bool onHotKey(
const XKeyEvent &,
bool isRepeat);
129 void onMousePress(
const XButtonEvent &);
130 void onMouseRelease(
const XButtonEvent &);
131 void onMouseMove(
const XMotionEvent &);
135 void selectXIRawMotion();
137 void selectEvents(Window)
const;
138 void doSelectEvents(Window)
const;
140 KeyID mapKeyFromX(XKeyEvent *)
const;
141 ButtonID mapButtonFromX(
const XButtonEvent *)
const;
142 unsigned int mapButtonToX(
ButtonID id)
const;
144 void warpCursorNoFlush(int32_t
x, int32_t
y);
146 void refreshKeyboard(XEvent *);
148 static Bool findKeyEvent(Display *, XEvent *xevent, XPointer arg);
154 HotKeyItem(
int,
unsigned int);
156 bool operator<(
const HotKeyItem &)
const;
162 using FilteredKeycodes = std::set<bool>;
163 using HotKeyList = std::vector<std::pair<int, unsigned int>>;
164 using HotKeyMap = std::map<uint32_t, HotKeyList>;
165 using HotKeyIDList = std::vector<uint32_t>;
166 using HotKeyToIDMap = std::map<HotKeyItem, uint32_t>;
170 int m_mouseScrollDelta;
172 Display *m_display =
nullptr;
173 Window m_root = None;
174 Window m_window = None;
179 uint32_t m_activeSides = 0;
185 int32_t m_xCenter = 0;
186 int32_t m_yCenter = 0;
189 int32_t m_xCursor = 0;
190 int32_t m_yCursor = 0;
197 HotKeyIDList m_oldHotKeyIDs;
198 HotKeyToIDMap m_hotKeyToIDMap;
201 Window m_lastFocus = None;
202 int m_lastFocusRevert = RevertToNone;
207 KeyCode m_lastKeycode = 0;
208 FilteredKeycodes m_filtered;
212 uint32_t m_sequenceNumber = 0;
216 bool m_screensaverNotify =
false;
220 std::vector<unsigned char> m_buttons;
229 bool m_xtestIsXineramaUnaware =
true;
234 bool m_preserveFocus =
false;
240 bool m_xi2detected =
false;
243 bool m_xrandr =
false;
244 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:22
uint32_t KeyModifierMask
Modifier key mask.
Definition KeyTypes.h:45
uint8_t ButtonID
Mouse button ID.
Definition MouseTypes.h:16
std::vector< uint32_t > OptionsList
Definition OptionTypes.h:27
int y
Definition ServerConfig.cpp:27
int x
Definition ServerConfig.cpp:26
Event.
Definition Event.h:27
Clipboard interface.
Definition IClipboard.h:20
Event queue interface.
Definition IEventQueue.h:32
IKeyState(const IEventQueue *events)
Definition IKeyState.cpp:18
X11 clipboard implementation.
Definition XWindowsClipboard.h:23
X Windows key state.
Definition XWindowsKeyState.h:32
Definition XWindowsPowerManager.h:13
X11 screen saver implementation.
Definition XWindowsScreenSaver.h:23
void warpCursor(int32_t x, int32_t y) override
Warp cursor.
Definition XWindowsScreen.cpp:490
void handleSystemEvent(const Event &event) override
Handle system event.
Definition XWindowsScreen.cpp:1118
bool getClipboard(ClipboardID id, IClipboard *) const override
Get clipboard.
Definition XWindowsScreen.cpp:438
void fakeMouseRelativeMove(int32_t dx, int32_t dy) const override
Fake mouse move.
Definition XWindowsScreen.cpp:781
uint32_t registerHotKey(KeyID key, KeyModifierMask mask) override
Register a system hotkey.
Definition XWindowsScreen.cpp:509
void closeScreensaver() override
Close screen saver.
Definition XWindowsScreen.cpp:382
void updateButtons() override
Update mouse buttons.
Definition XWindowsScreen.cpp:1850
void setOptions(const OptionsList &options) override
Notify of options changes.
Definition XWindowsScreen.cpp:404
XWindowsScreen(const char *displayName, bool isPrimary, int mouseScrollDelta, IEventQueue *events, deskflow::ClientScrollDirection m_clientScrollDirection=deskflow::ClientScrollDirection::Normal)
Definition XWindowsScreen.cpp:84
bool isPrimary() const override
Test if is primary screen.
Definition XWindowsScreen.cpp:422
void fakeInputEnd() override
Done synthesizing input on primary screen.
Definition XWindowsScreen.cpp:729
void screensaver(bool activate) override
Activate/deactivate screen saver.
Definition XWindowsScreen.cpp:389
void resetOptions() override
Notify of options changes.
Definition XWindowsScreen.cpp:398
void * getEventTarget() const final
Get event target.
Definition XWindowsScreen.cpp:433
~XWindowsScreen() override
Definition XWindowsScreen.cpp:162
std::string getSecureInputApp() const override
Determine the name of the app causing a secure input state.
Definition XWindowsScreen.cpp:427
void enable() override
Enable screen.
Definition XWindowsScreen.cpp:192
int32_t getJumpZoneSize() const override
Get jump zone size.
Definition XWindowsScreen.cpp:734
void getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const override
Get screen shape.
Definition XWindowsScreen.cpp:454
uint32_t activeSides() override
activeSides
Definition XWindowsScreen.cpp:485
void getCursorCenter(int32_t &x, int32_t &y) const override
Get cursor center position.
Definition XWindowsScreen.cpp:756
void checkClipboards() override
Check clipboard owner.
Definition XWindowsScreen.cpp:369
void fakeMouseMove(int32_t x, int32_t y) override
Fake mouse move.
Definition XWindowsScreen.cpp:771
void unregisterHotKey(uint32_t id) override
Unregister a system hotkey.
Definition XWindowsScreen.cpp:695
void leave() override
Leave screen.
Definition XWindowsScreen.cpp:293
bool canLeave() override
Leave screen.
Definition XWindowsScreen.cpp:284
void enter() override
Enter screen.
Definition XWindowsScreen.cpp:230
void setSequenceNumber(uint32_t) override
Set clipboard sequence number.
Definition XWindowsScreen.cpp:417
void disable() override
Disable screen.
Definition XWindowsScreen.cpp:213
void fakeInputBegin() override
Prepare to synthesize input on primary screen.
Definition XWindowsScreen.cpp:724
void fakeMouseButton(ButtonID id, bool press) override
Fake mouse press/release.
Definition XWindowsScreen.cpp:762
void reconfigure(uint32_t activeSides) override
Update configuration.
Definition XWindowsScreen.cpp:480
bool setClipboard(ClipboardID, const IClipboard *) override
Set clipboard.
Definition XWindowsScreen.cpp:345
void getCursorPos(int32_t &x, int32_t &y) const override
Get cursor position.
Definition XWindowsScreen.cpp:462
IKeyState * getKeyState() const override
Get the key state.
Definition XWindowsScreen.cpp:1104
void openScreensaver(bool notify) override
Open screen saver.
Definition XWindowsScreen.cpp:374
void fakeMouseWheel(int32_t xDelta, int32_t yDelta) const override
Fake mouse wheel.
Definition XWindowsScreen.cpp:788
bool isAnyMouseButtonDown(uint32_t &buttonID) const override
Test if mouse is pressed.
Definition XWindowsScreen.cpp:739
Key map.
Definition KeyMap.h:24
ClientScrollDirection
Definition ClientArgs.h:13
@ Normal
Same direction as the server.
Definition ClientArgs.h:14
EventTypes
Definition EventTypes.h:13