Merge pull request #104907 from bruvzg/scr_ids
Cleanup and unify `DisplayServer` screen methods and documentation.
This commit is contained in:
@ -585,7 +585,7 @@ bool DisplayServer::screen_is_kept_on() const {
|
||||
|
||||
int DisplayServer::get_screen_from_rect(const Rect2 &p_rect) const {
|
||||
int nearest_area = 0;
|
||||
int pos_screen = -1;
|
||||
int pos_screen = INVALID_SCREEN;
|
||||
for (int i = 0; i < get_screen_count(); i++) {
|
||||
Rect2i r;
|
||||
r.position = screen_get_position(i);
|
||||
@ -1758,6 +1758,7 @@ void DisplayServer::_bind_methods() {
|
||||
BIND_ENUM_CONSTANT(MOUSE_MODE_CONFINED_HIDDEN);
|
||||
BIND_ENUM_CONSTANT(MOUSE_MODE_MAX);
|
||||
|
||||
BIND_CONSTANT(INVALID_SCREEN);
|
||||
BIND_CONSTANT(SCREEN_WITH_MOUSE_FOCUS);
|
||||
BIND_CONSTANT(SCREEN_WITH_KEYBOARD_FOCUS);
|
||||
BIND_CONSTANT(SCREEN_PRIMARY);
|
||||
|
||||
@ -318,6 +318,7 @@ public:
|
||||
virtual Rect2i get_display_safe_area() const { return screen_get_usable_rect(); }
|
||||
|
||||
enum {
|
||||
INVALID_SCREEN = -1,
|
||||
SCREEN_WITH_MOUSE_FOCUS = -4,
|
||||
SCREEN_WITH_KEYBOARD_FOCUS = -3,
|
||||
SCREEN_PRIMARY = -2,
|
||||
|
||||
@ -110,7 +110,7 @@ public:
|
||||
|
||||
void window_set_mouse_passthrough(const Vector<Vector2> &p_region, WindowID p_window = MAIN_WINDOW_ID) override {}
|
||||
|
||||
int window_get_current_screen(WindowID p_window = MAIN_WINDOW_ID) const override { return -1; }
|
||||
int window_get_current_screen(WindowID p_window = MAIN_WINDOW_ID) const override { return INVALID_SCREEN; }
|
||||
void window_set_current_screen(int p_screen, WindowID p_window = MAIN_WINDOW_ID) override {}
|
||||
|
||||
Point2i window_get_position(WindowID p_window = MAIN_WINDOW_ID) const override { return Point2i(); }
|
||||
|
||||
Reference in New Issue
Block a user