-
Notifications
You must be signed in to change notification settings - Fork 273
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
multiple systrays on standalone Mac and Linux caused by window.location.reload() #569
Comments
Added a prototype code for checking if database operations are ongoing. see comments for details.
Exit button has been added and SchizoDuckie wondered if we could add others. I think we could add most of the major links to the tray, Library, Settings & About |
Items for calendar, favorites, settings, and about added. on_click routines for each set up. next step, figure out how to add navigation commands into each item's click routines. At the moment all the menu items just restore window.
please test this, especially on standalone Mac, checking that tray duckies still behave, that the menu works, etc. thanks. |
please test on mac and report if it works thanks.
looks ok now. 👍 |
I wonder if DuckieTV is creating a new tray while it is minimized to systray during the local midnight reload that DuckieTV does to refresh the calendar after the date change. |
That's very possible. There's a hard window.location.reload there. Maybe we
|
@lonelyfairie If you are willing and have the time, I have a test I would like performed on a Mac DuckieTV standalone, to test a theory as to the cause of the systray duck cloning. |
@garfield69 yeap, two duckies appear after the sys tray reload, if you disable and enable it again a third duckie appears... and so on to infinity, well untill the tray fills up lol. |
@lonelyfairie We've made some further changes and cleaned up some logic holes. |
@garfield69 Just tested this version, still seeing multiple duckies when using the Mac Reload Systray Test otherwise it seems to be running correctly, no extra duckies when just minimizing, no issues with the window not showing up or exiting the app by using the context menu Quit. |
@lonelyfairie allright, that is good to know.
so that is what we will be looking into next. |
Schizoduckie previously said:
On the assumption he meant using the nwjs Window.reload() in place of the hard window.location.reload(), I set up a proof of concept test on my ubuntu 15.10 duckietv standalone development system (since the multi-systray issue occurs on both mac and linux). I set up the following code with app.js /**
* at start-up set up a timer to refresh DuckieTV a second after midnight, to force a calendar date refresh
*/
.run(
window.onload = function() {
var today = new Date();
var tommorow = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 1);
var timeToMidnight = (tommorow - today) + 1000; // a second after midnight
// #569 test
if (localStorage.getItem('mac_systray_reload_test')) {
timeToMidnight = 10000; // 10 second reload test for mac systray
};
// end #569 test
var timer = setTimeout(function() {
if ((navigator.userAgent.toLowerCase().indexOf('standalone') !== -1)) {
console.debug('nw.gui.Window.get().reload()');
require('nw.gui').Window.get().reload();
} else {
console.debug('window.location.reload()');
window.location.reload();
};
}, timeToMidnight);
}
) I then enabled my reload test for every 10 seconds, and clicked on the minimize button every time the window got reloaded. As the screencapture shows, my test using nwjs reload in this configuration did not solve the multi-systray issue. @SchizoDuckie did I use the correct function for this test, or did you mean something else? |
Here's an idea, why dont you destroy the tray before reloading |
@Js41637 💡 👍 |
The text was updated successfully, but these errors were encountered: