forked from r0x0r/pywebview
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic multi-window support in Cocoa
Prior to this commit, pywebview applications were limited to one webview window. This fix enables webviews to open multiple windows on the Mac platform, using familiar HTML/JavaScript techniques. Requests to open new windows are handled by the WebPolicyDelegate of the WebView. This means no changes to the existing API or thread model and no spawning multiple windows in seperate threads. Utilises the multiwindow capabilities of Cocoa on the main application thread itself. Until now the BrowserView class has been a strict singleton. This is changed by converting the :instance class property to a Python list holding multiple BrowserView instances. [Thanks to jen@haverstack.com for the idea. :)]. Class property active_instances is set to track the number of open windows. All existing API calls are routed to the initial window by calling them on BrowserView.instances[0].
- Loading branch information
Showing
1 changed file
with
55 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters