Skip to content

Commit

Permalink
Merge pull request #37492 from akien-mga/warnings-clang-displayserver…
Browse files Browse the repository at this point in the history
…windows

Fix Clang warnings on Windows
  • Loading branch information
akien-mga authored Apr 1, 2020
2 parents 2e84b7b + 516b3bb commit ff14d07
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 10 deletions.
1 change: 0 additions & 1 deletion platform/linuxbsd/display_server_x11.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ class DisplayServerX11 : public DisplayServer {

void _handle_key_event(WindowID p_window, XKeyEvent *p_event, bool p_echo = false);

bool force_quit;
bool minimized;
bool window_has_focus;
bool do_mouse_warp;
Expand Down
13 changes: 11 additions & 2 deletions platform/windows/display_server_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,8 @@ bool DisplayServerWindows::window_is_maximize_allowed(WindowID p_window) const {
_THREAD_SAFE_METHOD_

ERR_FAIL_COND_V(!windows.has(p_window), false);
const WindowData &wd = windows[p_window];

// FIXME: Implement this, or confirm that it should always be true.

return true; //no idea
}
Expand Down Expand Up @@ -1049,14 +1050,17 @@ void DisplayServerWindows::window_set_flag(WindowFlags p_flag, bool p_enabled, W
} break;
case WINDOW_FLAG_TRANSPARENT: {

// FIXME: Implement.
} break;
case WINDOW_FLAG_NO_FOCUS: {

wd.no_focus = p_enabled;
_update_window_style(p_window);
} break;
case WINDOW_FLAG_MAX: break;
}
}

bool DisplayServerWindows::window_get_flag(WindowFlags p_flag, WindowID p_window) const {

_THREAD_SAFE_METHOD_
Expand All @@ -1078,7 +1082,13 @@ bool DisplayServerWindows::window_get_flag(WindowFlags p_flag, WindowID p_window
} break;
case WINDOW_FLAG_TRANSPARENT: {

// FIXME: Implement.
} break;
case WINDOW_FLAG_NO_FOCUS: {

return wd.no_focus;
} break;
case WINDOW_FLAG_MAX: break;
}

return false;
Expand Down Expand Up @@ -1882,7 +1892,6 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA

_send_window_event(windows[window_id], WINDOW_EVENT_CLOSE_REQUEST);

//force_quit=true;
return 0; // Jump Back
}
case WM_MOUSELEAVE: {
Expand Down
1 change: 0 additions & 1 deletion platform/windows/display_server_windows.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ class DisplayServerWindows : public DisplayServer {
bool shift_mem = false;
bool control_mem = false;
bool meta_mem = false;
bool force_quit = false;
uint32_t last_button_state = 0;
bool use_raw_input = false;
bool drop_events = false;
Expand Down
6 changes: 1 addition & 5 deletions servers/display_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
/*************************************************************************/

#include "display_server.h"

#include "core/input/input_filter.h"
#include "scene/resources/texture.h"

Expand Down Expand Up @@ -517,11 +518,6 @@ void DisplayServer::_bind_methods() {
BIND_ENUM_CONSTANT(WINDOW_FLAG_TRANSPARENT);
BIND_ENUM_CONSTANT(WINDOW_FLAG_NO_FOCUS);
BIND_ENUM_CONSTANT(WINDOW_FLAG_MAX);
BIND_ENUM_CONSTANT(WINDOW_FLAG_RESIZE_DISABLED_BIT);
BIND_ENUM_CONSTANT(WINDOW_FLAG_BORDERLESS_BIT);
BIND_ENUM_CONSTANT(WINDOW_FLAG_ALWAYS_ON_TOP_BIT);
BIND_ENUM_CONSTANT(WINDOW_FLAG_TRANSPARENT_BIT);
BIND_ENUM_CONSTANT(WINDOW_FLAG_NO_FOCUS_BIT);

BIND_ENUM_CONSTANT(LATIN_KEYBOARD_QWERTY);
BIND_ENUM_CONSTANT(LATIN_KEYBOARD_QWERTZ);
Expand Down
4 changes: 4 additions & 0 deletions servers/display_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ class DisplayServer : public Object {
WINDOW_FLAG_TRANSPARENT,
WINDOW_FLAG_NO_FOCUS,
WINDOW_FLAG_MAX,
};

// Separate enum otherwise we get warnings in switches not handling all values.
enum WindowFlagsBit {
WINDOW_FLAG_RESIZE_DISABLED_BIT = (1 << WINDOW_FLAG_RESIZE_DISABLED),
WINDOW_FLAG_BORDERLESS_BIT = (1 << WINDOW_FLAG_BORDERLESS),
WINDOW_FLAG_ALWAYS_ON_TOP_BIT = (1 << WINDOW_FLAG_ALWAYS_ON_TOP),
Expand Down
2 changes: 2 additions & 0 deletions thirdparty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,8 @@ Files extracted from upstream source:

`vk_enum_string_helper.h` is taken from the matching `Vulkan-ValidationLayers`
SDK release: https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/master/layers/generated/vk_enum_string_helper.h
Includes custom change to disable MSVC pragma, might be upstreamed via:
https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/1666

`vk_mem_alloc.h` is taken from https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
Version: 2.3.0
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/vulkan/vk_enum_string_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@


#pragma once
#ifdef _WIN32
#ifdef _MSC_VER
#pragma warning( disable : 4065 )
#endif

Expand Down

0 comments on commit ff14d07

Please sign in to comment.