Skip to content

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

Merged
ckamm merged 1 commit into
owncloud:masterfrom
ckamm:contextmenu_on_demand
Aug 15, 2016
Merged

ckamm merged 1 commit into
owncloud:masterfrom
ckamm:contextmenu_on_demand

Conversation

@ckamm

@ckamm ckamm commented Jul 21, 2016

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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

Comment thread src/gui/owncloudgui.cpp Outdated

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

guruz commented Jul 29, 2016

Copy link
Copy Markdown
Contributor

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

@RalfJung

Copy link
Copy Markdown

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

danimo commented Aug 9, 2016

Copy link
Copy Markdown
Contributor

What's happening here?

@ckamm

ckamm commented Aug 15, 2016

Copy link
Copy Markdown
Contributor Author

@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
ckamm force-pushed the contextmenu_on_demand branch from 13cf75e to 3e27fd0 Compare August 15, 2016 08:39
@ckamm

ckamm commented Aug 15, 2016

Copy link
Copy Markdown
Contributor Author

@jturcotte Does it look good to you now?

Comment thread src/gui/owncloudgui.cpp Outdated

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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 force-pushed the contextmenu_on_demand branch from 3e27fd0 to b22f9fa Compare August 15, 2016 11:42
@ckamm
ckamm merged commit 88cd542 into owncloud:master Aug 15, 2016
@guruz
guruz deleted the contextmenu_on_demand branch August 16, 2016 17:00
Comment thread src/gui/owncloudgui.cpp

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

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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.

7 participants