Skip to content

Commit

Permalink
Merge pull request #55310 from Ev1lbl0w/fix_headless_window_errors
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga authored Nov 25, 2021
2 parents 1b89296 + 11caecb commit ca70756
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions servers/display_server_headless.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ class DisplayServerHeadless : public DisplayServer {

Vector<DisplayServer::WindowID> get_window_list() const override { return Vector<DisplayServer::WindowID>(); }

WindowID get_window_at_screen_position(const Point2i &p_position) const override { return -1; }
WindowID create_sub_window(WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Rect2i &p_rect = Rect2i()) override { return 0; }
void show_window(WindowID p_id) override {}
void delete_sub_window(WindowID p_id) override {}

WindowID get_window_at_screen_position(const Point2i &p_position) const override { return 0; }

void window_attach_instance_id(ObjectID p_instance, WindowID p_window = MAIN_WINDOW_ID) override {}
ObjectID window_get_attached_instance_id(WindowID p_window = MAIN_WINDOW_ID) const override { return ObjectID(); }
Expand Down Expand Up @@ -93,7 +97,7 @@ class DisplayServerHeadless : public DisplayServer {
Size2i window_get_max_size(WindowID p_window = MAIN_WINDOW_ID) const override { return Size2i(); }

void window_set_min_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override {}
Size2i window_get_min_size(WindowID p_window = MAIN_WINDOW_ID) const override { return Size2i(); };
Size2i window_get_min_size(WindowID p_window = MAIN_WINDOW_ID) const override { return Size2i(); }

void window_set_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override {}
Size2i window_get_size(WindowID p_window = MAIN_WINDOW_ID) const override { return Size2i(); }
Expand All @@ -102,10 +106,13 @@ class DisplayServerHeadless : public DisplayServer {
void window_set_mode(WindowMode p_mode, WindowID p_window = MAIN_WINDOW_ID) override {}
WindowMode window_get_mode(WindowID p_window = MAIN_WINDOW_ID) const override { return WINDOW_MODE_MINIMIZED; }

void window_set_vsync_mode(VSyncMode p_vsync_mode, WindowID p_window = MAIN_WINDOW_ID) override {}
VSyncMode window_get_vsync_mode(WindowID p_window) const override { return VSyncMode::VSYNC_ENABLED; }

bool window_is_maximize_allowed(WindowID p_window = MAIN_WINDOW_ID) const override { return false; }

void window_set_flag(WindowFlags p_flag, bool p_enabled, WindowID p_window = MAIN_WINDOW_ID) override {}
virtual bool window_get_flag(WindowFlags p_flag, WindowID p_window = MAIN_WINDOW_ID) const override { return false; }
bool window_get_flag(WindowFlags p_flag, WindowID p_window = MAIN_WINDOW_ID) const override { return false; }

void window_request_attention(WindowID p_window = MAIN_WINDOW_ID) override {}
void window_move_to_foreground(WindowID p_window = MAIN_WINDOW_ID) override {}
Expand All @@ -114,6 +121,9 @@ class DisplayServerHeadless : public DisplayServer {

bool can_any_window_draw() const override { return false; }

void window_set_ime_active(const bool p_active, WindowID p_window = MAIN_WINDOW_ID) override {}
void window_set_ime_position(const Point2i &p_pos, WindowID p_window = MAIN_WINDOW_ID) override {}

void process_events() override {}

void set_icon(const Ref<Image> &p_icon) override {}
Expand Down

0 comments on commit ca70756

Please sign in to comment.