Skip to content

Commit 8cdefcd

Browse files
author
Roman Sirokov
committed
Change how URL is loaded on an initial window display in Windows
1 parent 7c8840b commit 8cdefcd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

webview/win32.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ def _create_atlax_window(self):
159159
atl_width = self.width - self.scrollbar_width
160160
atl_height = self.height - self.scrollbar_height - VERTICAL_SCROLLBAR_OFFSET
161161

162-
self.atlhwnd = win32gui.CreateWindow("AtlAxWin", self.url,
163-
win32con.WS_CHILD | win32con.WS_HSCROLL | win32con.WS_VSCROLL,
164-
0, 0, atl_width, atl_height, self.hwnd, None, hInstance, None)
162+
self.atlhwnd = win32gui.CreateWindow("AtlAxWin", "bogus-url",
163+
win32con.WS_CHILD | win32con.WS_HSCROLL | win32con.WS_VSCROLL,
164+
0, 0, atl_width, atl_height, self.hwnd, None, hInstance, None)
165165

166166
# COM voodoo
167167
pBrowserUnk = POINTER(IUnknown)()
@@ -181,6 +181,9 @@ def show(self):
181181
win32gui.UpdateWindow(self.atlhwnd)
182182
win32gui.SetFocus(self.atlhwnd)
183183

184+
# Load URL here instead in CreateWindow to prevent a dead-lock
185+
self.browser.Navigate2(self.url)
186+
184187
# Start sending and receiving messages
185188
win32gui.PumpMessages()
186189

0 commit comments

Comments
 (0)