Skip to content

Commit

Permalink
fix(ui/webview): use pointer of HWND in internals (#33)
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Gorez <[email protected]>
  • Loading branch information
tony-go authored Nov 12, 2024
1 parent 3b6e02b commit ee52be1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/ui/webview/win32/webview_win32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ class WebView::Internal {
auto fit_to_window() -> void {
if (this->controller && this->parent_) {
RECT bounds;
GetClientRect(this->parent_, &bounds);
GetClientRect(*this->parent_, &bounds);
this->controller->put_Bounds(bounds);
};
}

auto set_parent(void *parent) -> void {
this->parent_ = static_cast<HWND>(parent);
this->parent_ = static_cast<HWND *>(parent);
}

auto create_webview(std::function<void()> callback) -> void {
Expand All @@ -98,7 +98,7 @@ class WebView::Internal {
[this, callback](HRESULT result,
ICoreWebView2Environment *env) -> HRESULT {
env->CreateCoreWebView2Controller(
this->parent_,
*this->parent_,
Callback<
ICoreWebView2CreateCoreWebView2ControllerCompletedHandler>(
[this, callback](
Expand All @@ -120,7 +120,7 @@ class WebView::Internal {
}

private:
HWND parent_;
HWND *parent_;
};

/*
Expand Down
2 changes: 1 addition & 1 deletion src/ui/window/win32/window_win32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ auto Window::show() -> void {

auto Window::handle() -> void * {
auto internal = static_cast<WindowInternal *>(internal_);
return internal->hwnd;
return &internal->hwnd;
}

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

0 comments on commit ee52be1

Please sign in to comment.