1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:07:43 +00:00

WindowServer: Store the mouse button state in one variable.

This makes the logic around it a lot less verbose.
This commit is contained in:
Andreas Kling 2019-03-05 14:11:46 +01:00
parent 26a9d662f4
commit f3ff402cf3
4 changed files with 25 additions and 51 deletions

View file

@ -24,11 +24,9 @@ public:
void set_y_offset(int);
Point cursor_location() const { return m_cursor_location; }
bool left_mouse_button_pressed() const { return m_left_mouse_button_pressed; }
bool right_mouse_button_pressed() const { return m_right_mouse_button_pressed; }
bool middle_mouse_button_pressed() const { return m_middle_mouse_button_pressed; }
unsigned mouse_button_state() const { return m_mouse_button_state; }
void on_receive_mouse_data(int dx, int dy, bool left_button, bool right_button, bool middle_button);
void on_receive_mouse_data(int dx, int dy, unsigned buttons);
void on_receive_keyboard_data(KeyEvent);
private:
@ -39,9 +37,7 @@ private:
int m_framebuffer_fd { -1 };
Point m_cursor_location;
bool m_left_mouse_button_pressed { false };
bool m_right_mouse_button_pressed { false };
bool m_middle_mouse_button_pressed { false };
unsigned m_mouse_button_state { 0 };
};
inline RGBA32* WSScreen::scanline(int y)