14#include "platform/XWindowsConfig.h"
42 void getShape(int32_t &
x, int32_t &
y, int32_t &width, int32_t &height)
const override;
66 void enter()
override;
68 void leave()
override;
92 Cursor createBlankCursor()
const;
99 void processClipboardRequest(Window window, Time time, Atom property)
const;
102 void destroyClipboardRequest(Window window)
const;
106 static int ioErrorHandler(Display *);
117 Display *openDisplay(
const char *displayName);
119 void setShape(int32_t width, int32_t height);
120 Window openWindow()
const;
123 bool grabMouseAndKeyboard();
124 void onKeyPress(XKeyEvent &);
125 void onKeyRelease(XKeyEvent &,
bool isRepeat);
126 bool onHotKey(
const XKeyEvent &,
bool isRepeat);
127 void onMousePress(
const XButtonEvent &);
128 void onMouseRelease(
const XButtonEvent &);
129 void onMouseMove(
const XMotionEvent &);
133 void selectXIRawMotion();
135 void selectEvents(Window)
const;
136 void doSelectEvents(Window)
const;
138 KeyID mapKeyFromX(XKeyEvent *)
const;
139 ButtonID mapButtonFromX(
const XButtonEvent *)
const;
140 unsigned int mapButtonToX(
ButtonID id)
const;
142 void warpCursorNoFlush(int32_t
x, int32_t
y);
144 void refreshKeyboard(XEvent *);
146 static Bool findKeyEvent(Display *, XEvent *xevent, XPointer arg);
152 HotKeyItem(
int,
unsigned int);
154 bool operator<(
const HotKeyItem &)
const;
160 using FilteredKeycodes = std::set<bool>;
161 using HotKeyList = std::vector<std::pair<int, unsigned int>>;
162 using HotKeyMap = std::map<uint32_t, HotKeyList>;
163 using HotKeyIDList = std::vector<uint32_t>;
164 using HotKeyToIDMap = std::map<HotKeyItem, uint32_t>;
169 Display *m_display =
nullptr;
170 Window m_root = None;
171 Window m_window = None;
176 uint32_t m_activeSides = 0;
182 int32_t m_xCenter = 0;
183 int32_t m_yCenter = 0;
186 int32_t m_xCursor = 0;
187 int32_t m_yCursor = 0;
194 HotKeyIDList m_oldHotKeyIDs;
195 HotKeyToIDMap m_hotKeyToIDMap;
198 Window m_lastFocus = None;
199 int m_lastFocusRevert = RevertToNone;
204 KeyCode m_lastKeycode = 0;
205 FilteredKeycodes m_filtered;
209 uint32_t m_sequenceNumber = 0;
213 bool m_screensaverNotify =
false;
217 std::vector<unsigned char> m_buttons;
226 bool m_xtestIsXineramaUnaware =
true;
231 bool m_preserveFocus =
false;
237 bool m_xi2detected =
false;
240 bool m_xrandr =
false;
241 int m_xrandrEventBase;
static const ClipboardID kClipboardEnd
Definition ClipboardTypes.h:30
uint8_t ClipboardID
Clipboard ID.
Definition ClipboardTypes.h:16
Coordinate ScrollDelta
Definition Coordinate.h:21
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:489
void handleSystemEvent(const Event &event) override
Handle system event.
Definition XWindowsScreen.cpp:1084
bool getClipboard(ClipboardID id, IClipboard *) const override
Get clipboard.
Definition XWindowsScreen.cpp:435
void fakeMouseRelativeMove(int32_t dx, int32_t dy) const override
Fake mouse move.
Definition XWindowsScreen.cpp:780
uint32_t registerHotKey(KeyID key, KeyModifierMask mask) override
Register a system hotkey.
Definition XWindowsScreen.cpp:508
void closeScreensaver() override
Close screen saver.
Definition XWindowsScreen.cpp:379
void updateButtons() override
Update mouse buttons.
Definition XWindowsScreen.cpp:1811
void setOptions(const OptionsList &options) override
Notify of options changes.
Definition XWindowsScreen.cpp:401
bool isPrimary() const override
Test if is primary screen.
Definition XWindowsScreen.cpp:419
void fakeInputEnd() override
Done synthesizing input on primary screen.
Definition XWindowsScreen.cpp:728
void screensaver(bool activate) override
Activate/deactivate screen saver.
Definition XWindowsScreen.cpp:386
XWindowsScreen(const char *displayName, bool isPrimary, IEventQueue *events)
Definition XWindowsScreen.cpp:85
void resetOptions() override
Notify of options changes.
Definition XWindowsScreen.cpp:395
void * getEventTarget() const final
Get event target.
Definition XWindowsScreen.cpp:430
~XWindowsScreen() override
Definition XWindowsScreen.cpp:156
std::string getSecureInputApp() const override
Determine the name of the app causing a secure input state.
Definition XWindowsScreen.cpp:424
void enable() override
Enable screen.
Definition XWindowsScreen.cpp:186
int32_t getJumpZoneSize() const override
Get jump zone size.
Definition XWindowsScreen.cpp:733
void getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const override
Get screen shape.
Definition XWindowsScreen.cpp:451
uint32_t activeSides() override
activeSides
Definition XWindowsScreen.cpp:484
void getCursorCenter(int32_t &x, int32_t &y) const override
Get cursor center position.
Definition XWindowsScreen.cpp:755
void checkClipboards() override
Check clipboard owner.
Definition XWindowsScreen.cpp:366
void fakeMouseMove(int32_t x, int32_t y) override
Fake mouse move.
Definition XWindowsScreen.cpp:770
void unregisterHotKey(uint32_t id) override
Unregister a system hotkey.
Definition XWindowsScreen.cpp:694
void leave() override
Leave screen.
Definition XWindowsScreen.cpp:287
bool canLeave() override
Leave screen.
Definition XWindowsScreen.cpp:278
void enter() override
Enter screen.
Definition XWindowsScreen.cpp:224
void setSequenceNumber(uint32_t) override
Set clipboard sequence number.
Definition XWindowsScreen.cpp:414
void disable() override
Disable screen.
Definition XWindowsScreen.cpp:207
void fakeInputBegin() override
Prepare to synthesize input on primary screen.
Definition XWindowsScreen.cpp:723
void fakeMouseButton(ButtonID id, bool press) override
Fake mouse press/release.
Definition XWindowsScreen.cpp:761
void reconfigure(uint32_t activeSides) override
Update configuration.
Definition XWindowsScreen.cpp:477
bool setClipboard(ClipboardID, const IClipboard *) override
Set clipboard.
Definition XWindowsScreen.cpp:342
void fakeMouseWheel(ScrollDelta delta) const override
Synthesize a mouse wheel event of amount This Implmentation for this method should call applyScrollMo...
Definition XWindowsScreen.cpp:787
void getCursorPos(int32_t &x, int32_t &y) const override
Get cursor position.
Definition XWindowsScreen.cpp:459
IKeyState * getKeyState() const override
Get the key state.
Definition XWindowsScreen.cpp:1070
void openScreensaver(bool notify) override
Open screen saver.
Definition XWindowsScreen.cpp:371
bool isAnyMouseButtonDown(uint32_t &buttonID) const override
Test if mouse is pressed.
Definition XWindowsScreen.cpp:738
Key map.
Definition KeyMap.h:24
EventTypes
Definition EventTypes.h:13