Skip to content

Commit d291429

Browse files
committed
Add <memory> header to display and window headers; refactor display manager to use IsPrimary() method
This commit includes the addition of the <memory> header in both display.h and window.h files to support smart pointer usage. Additionally, the display manager's GetPrimary() method has been updated to use the IsPrimary() method for improved clarity and consistency in checking primary displays.
1 parent 9284bb1 commit d291429

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/display.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <string>
33
#include "foundation/native_object_provider.h"
44
#include "geometry.h"
5+
#include <memory>
56

67
namespace nativeapi {
78

src/platform/windows/display_manager_windows.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ std::vector<Display> DisplayManager::GetAll() {
4747
Display DisplayManager::GetPrimary() {
4848
std::vector<Display> displays = GetAll();
4949
for (const auto& display : displays) {
50-
if (display.isPrimary) {
50+
if (display.IsPrimary()) {
5151
return display;
5252
}
5353
}

src/window.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <string>
33
#include "geometry.h"
44
#include "foundation/native_object_provider.h"
5+
#include <memory>
56

67
namespace nativeapi {
78

0 commit comments

Comments
 (0)