File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ bool DispatcherHost::Send(IPC::Message* message) {
102102void DispatcherHost::quit_run_loop () {
103103 if (run_loop_)
104104 run_loop_->Quit ();
105+ run_loop_ = NULL ;
105106}
106107
107108bool DispatcherHost::OnMessageReceived (const IPC::Message& message) {
Original file line number Diff line number Diff line change @@ -78,6 +78,8 @@ class DispatcherHost : public content::WebContentsObserver {
7878
7979 void set_run_loop (base::RunLoop* run_loop) { run_loop_ = run_loop; }
8080 void quit_run_loop ();
81+ base::RunLoop* run_loop () { return run_loop_; }
82+
8183 private:
8284 content::RenderViewHost* render_view_host_;
8385 friend class content ::Shell;
Original file line number Diff line number Diff line change @@ -35,7 +35,13 @@ - (id)initWithMenu:(nwapi::Menu*) menu {
3535}
3636
3737- (void )menuNeedsUpdate : (NSMenu *)menu {
38- if (!nwmenu_->enable_show_event ())
38+ if (!nwmenu_->enable_show_event () || nwmenu_->dispatcher_host ()->run_loop ())
39+ return ;
40+ NSEvent * event = [NSApp currentEvent ];
41+ // NSLog (@"%@\n", event);
42+ // Cocoa will try to populate menu on every keystoke of the key equivlants,
43+ // which is slow. The following bypassed it
44+ if ([event type ] != NSSystemDefined || [event subtype ] == 8 )
3945 return ;
4046 base::ListValue args;
4147 base::RunLoop run_loop;
Original file line number Diff line number Diff line change 3838#else
3939# define NW_VERSION_STRING NW_STRINGIFY(NW_MAJOR_VERSION) "." \
4040 NW_STRINGIFY(NW_MINOR_VERSION) "." \
41- NW_STRINGIFY(NW_PATCH_VERSION) "-pre2 "
41+ NW_STRINGIFY(NW_PATCH_VERSION) "-pre6 "
4242#endif
4343
4444#define NW_VERSION "v" NW_VERSION_STRING
You can’t perform that action at this time.
0 commit comments