Closed Bug 912116 Opened 11 years ago Closed 10 years ago

A 6x6-pixel context menu appears when you right-click in a message folder where there are no messages

Categories

(Thunderbird :: Folder and Message Lists, defect)

24 Branch
defect
Not set
normal

Tracking

(thunderbird36 fixed)

RESOLVED FIXED
Thunderbird 36.0
Tracking Status
thunderbird36 --- fixed

People

(Reporter: thee.chicago.wolf, Assigned: aceman)

References

Details

Attachments

(3 files, 2 obsolete files)

Attached image small-strange-box.jpg
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:23.0) Gecko/20100101 Firefox/23.0 SeaMonkey/2.20 (Beta/Release)
Build ID: 20130803200314

Steps to reproduce:

I have an GMail account set up via IMAP. One of the sub folders of the [Gmail] folder is called Spam. With no messages in the Spam folder, I right-clicked in the area where messages would normally be and a small context menu (I think) showed up that was 6x6 pixels in dimension.


Actual results:

A small 6x6 box/context menu showed up (see image).


Expected results:

I would think nothing should show when you right-click on blank, empty nothingness.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Component: OS Integration → Folder and Message Lists
Attached image Now with drop shadow!
So it's been a while since anything happened with this bug. On TB31 I now see the box has added a drop shadow effect.
Attached patch patch (obsolete) — Splinter Review
This fixes it for me.
The initialization of onEditableArea fixes a "undefined property" warning as the property is queried in the menu even when it is not existing yet.
Assignee: nobody → acelists
Status: NEW → ASSIGNED
Attachment #8498429 - Flags: ui-review?(josiah)
Attachment #8498429 - Flags: review?(mkmelin+mozilla)
Blocks: 826732
Comment on attachment 8498429 [details] [diff] [review]
patch

Review of attachment 8498429 [details] [diff] [review]:
-----------------------------------------------------------------

::: mail/base/content/nsContextMenu.js
@@ +89,5 @@
> +      if (!item.hidden)
> +        someItemsShown = true;
> +    }
> +    if (!someItemsShown)
> +      this.shouldDisplay = false;

You should be able to do this better by some combination of where you are and numSelectedMessages I think?
Attachment #8498429 - Flags: review?(mkmelin+mozilla)
Comment on attachment 8498429 [details] [diff] [review]
patch

I don't really think we need a ui-review for this, obviously a 6 by 6 pixel box is bad. :)

Either way though, ui-r+.
Attachment #8498429 - Flags: ui-review?(josiah) → ui-review+
(In reply to Magnus Melin from comment #3)
> You should be able to do this better by some combination of where you are
> and numSelectedMessages I think?

This menu seems to be shown from many different places and on different objects so I would not like to hunt for which contexts produce an empty menu. The function determining that may be so complex that it will become slower than the universal method I proposed. And it would need constant updating of the code as other contexts are added.
OS: Windows XP → All
Hardware: x86 → All
Attached patch patch v1.1 (obsolete) — Splinter Review
Added an early break so that it is not a big perf hit in the common case.
Attachment #8498429 - Attachment is obsolete: true
Comment on attachment 8499120 [details] [diff] [review]
patch v1.1

Review of attachment 8499120 [details] [diff] [review]:
-----------------------------------------------------------------

::: mail/base/content/nsContextMenu.js
@@ +87,5 @@
> +    let someItemsShown = false;
> +    for (let item of contextPopup.children) {
> +      if (!item.hidden) {
> +        someItemsShown = true;
> +        break;

Actually, you could just 'return' here instead. You set someItemsShown to true, so the following if statement will never get called. That's slightly clearer than break statements.
Attached patch patch v2Splinter Review
Good idea, thanks.
Attachment #8499120 - Attachment is obsolete: true
Attachment #8499128 - Flags: review?(mkmelin+mozilla)
(In reply to :aceman from comment #5)
> This menu seems to be shown from many different places and on different
> objects so I would not like to hunt for which contexts produce an empty
> menu. 

I don't think there are other places suffering from this, only threadpane + empty folder
Comment on attachment 8499128 [details] [diff] [review]
patch v2

Review of attachment 8499128 [details] [diff] [review]:
-----------------------------------------------------------------

r=mkmelin
Attachment #8499128 - Flags: review?(mkmelin+mozilla) → review+
Thanks.
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/880a3e26ce32
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 36.0
Confirmed. Well done and thanks.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: