Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

registerGlobalHotKey and alert #4992

Closed
xland opened this issue Jun 16, 2016 · 3 comments
Closed

registerGlobalHotKey and alert #4992

xland opened this issue Jun 16, 2016 · 3 comments
Assignees
Labels

Comments

@xland
Copy link
Contributor

xland commented Jun 16, 2016

nw version:0.15.2
os version:windows 10 x64
code:

var option = {
    key: "Ctrl+Shift+N",
    active: function() {
        alert("1")
    },
    failed: function(msg) {
        alert("2")
    }
};
var shortcut = new nw.Shortcut(option);
nw.App.registerGlobalHotKey(shortcut);

description:
When app is minsized and the shortcut is pressed, the alert dialog can not show and the app is disabled.

@ghostoy
Copy link
Member

ghostoy commented Jul 5, 2016

I can confirm this issue. Looks like it only happens on Windows. I will try to fix it.

ghostoy pushed a commit to ghostoy/chromium.src that referenced this issue Jul 7, 2016
Bounds of dialogs are calcuated based on the bounds of parent window.
However on Windows, when window is minized, the bounds returned from
system is empty.
Implementing `WebContentsDelegate::ActivateContents` in `AppWindow` to
activate the native window before showing dialog fixes the issue.

fixed nwjs/nw.js#4992
ghostoy pushed a commit to ghostoy/chromium.src that referenced this issue Jul 7, 2016
Bounds of dialogs are calcuated based on the bounds of parent window.
However on Windows, when window is minized, the bounds returned from
system is empty.
Implementing `WebContentsDelegate::ActivateContents` in `AppWindow` to
activate the native window before showing dialog fixes the issue.

fixed nwjs/nw.js#4992
@ghostoy ghostoy added bug and removed regression labels Sep 13, 2016
@rogerwang
Copy link
Member

This is fixed in git and will be available in the next nightly build.

@xland
Copy link
Contributor Author

xland commented Nov 8, 2016

OK~Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants