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

Tray menu: Update only on demand #4990 #4985 #5072

Merged
merged 1 commit into from Aug 15, 2016

Conversation

ckamm
Copy link
Contributor

@ckamm ckamm commented Jul 21, 2016

The tray menu is now only updated when it becomes visible or while
it is visible.

@ckamm ckamm added this to the 2.3.0 milestone Jul 21, 2016
@mention-bot
Copy link

@ckamm, thanks for your PR! By analyzing the annotation information on this pull request, we identified @dragotin, @danimo and @ogoffart to be potential reviewers

@@ -699,8 +709,6 @@ void ownCloudGui::slotUpdateProgress(const QString &folder, const ProgressInfo&
_recentItemsActions.takeFirst()->deleteLater();
}
_recentItemsActions.append(action);

slotRebuildRecentMenus();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is removed, how is _recentActionsMenu now updated while the menu is shown during sync?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is a mistake, it should be called when the menu is visible!

@guruz
Copy link
Contributor

guruz commented Jul 29, 2016

(Wondering if this would influence #5074 for @RalfJung )

@RalfJung
Copy link

Hm, I could try this... provided compiling and running owncloud from source somewhere in $HOME is not too difficult. ;)

Should I wait until this is merged (since it seems to have other problems still)?

@danimo
Copy link
Contributor

danimo commented Aug 9, 2016

What's happening here?

@ckamm
Copy link
Contributor Author

ckamm commented Aug 15, 2016

@danimo Is your question about the contents of the patch or about "when will this be merged?"

Now that I'm back from vacation, I'll update this patch and then it can be merged.

@ckamm
Copy link
Contributor Author

ckamm commented Aug 15, 2016

@jturcotte Does it look good to you now?

@@ -552,6 +558,11 @@ void ownCloudGui::setupContextMenu()
}
}

void ownCloudGui::setupContextMenuIfVisible()
{
if (!_contextMenu || _contextMenu->isVisible())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it correct to enter the "if visible" code path when !_contextMenu?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I added this with intent and it does work: setupContextMenu() builds the context menu if necessary. But one might just as well argue that setting up the context menu when it's not being shown yet is pointless. And _contextMenu && would be less confusing to read. I'll update accordingly.

The tray menu is now only updated when it becomes visible or while
it is visible.
@ckamm ckamm merged commit 88cd542 into owncloud:master Aug 15, 2016
@guruz guruz deleted the contextmenu_on_demand branch August 16, 2016 17:00
@@ -552,6 +558,11 @@ void ownCloudGui::setupContextMenu()
}
}

void ownCloudGui::setupContextMenuIfVisible()
{
if (_contextMenu && _contextMenu->isVisible())
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For platform tray icons, _contextMenu->isVisible() will always return false.

Though I am not saying that this change is wrong. I am going to cherry-pick it to the Ubuntu packaging anyway, because without it the context menu is updated every 30 seconds, and Qt quickly runs out of items IDs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will always return false.

isn't that a bug?

I remember there was some follow up work by me and@ckamm to set our own visible variable to true and false when showing or hidding menu. But maybe we factored that out again

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mitya57 Note that there was significant follow up work done on context menu issues, at least 98efb07, but possibly more.

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

Successfully merging this pull request may close these issues.

None yet

7 participants