Skip to content

Commit ee52be1

Browse files
authored
fix(ui/webview): use pointer of HWND in internals (#33)
Signed-off-by: Tony Gorez <[email protected]>
1 parent 3b6e02b commit ee52be1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/ui/webview/win32/webview_win32.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ class WebView::Internal {
8282
auto fit_to_window() -> void {
8383
if (this->controller && this->parent_) {
8484
RECT bounds;
85-
GetClientRect(this->parent_, &bounds);
85+
GetClientRect(*this->parent_, &bounds);
8686
this->controller->put_Bounds(bounds);
8787
};
8888
}
8989

9090
auto set_parent(void *parent) -> void {
91-
this->parent_ = static_cast<HWND>(parent);
91+
this->parent_ = static_cast<HWND *>(parent);
9292
}
9393

9494
auto create_webview(std::function<void()> callback) -> void {
@@ -98,7 +98,7 @@ class WebView::Internal {
9898
[this, callback](HRESULT result,
9999
ICoreWebView2Environment *env) -> HRESULT {
100100
env->CreateCoreWebView2Controller(
101-
this->parent_,
101+
*this->parent_,
102102
Callback<
103103
ICoreWebView2CreateCoreWebView2ControllerCompletedHandler>(
104104
[this, callback](
@@ -120,7 +120,7 @@ class WebView::Internal {
120120
}
121121

122122
private:
123-
HWND parent_;
123+
HWND *parent_;
124124
};
125125

126126
/*

src/ui/window/win32/window_win32.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ auto Window::show() -> void {
9595

9696
auto Window::handle() -> void * {
9797
auto internal = static_cast<WindowInternal *>(internal_);
98-
return internal->hwnd;
98+
return &internal->hwnd;
9999
}
100100

101101
auto Window::on_resize(std::function<void(void)> callback) -> void {

0 commit comments

Comments
 (0)