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

RESOLVED FIXED in Thunderbird 36.0

Status

RESOLVED FIXED
5 years ago
4 years ago

People

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

Tracking

24 Branch
Thunderbird 36.0

Thunderbird Tracking Flags

(thunderbird36 fixed)

Details

Attachments

(3 attachments, 2 obsolete attachments)

(Reporter)

Description

5 years ago
Created attachment 798964 [details]
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
(Reporter)

Comment 1

4 years ago
Created attachment 8463972 [details]
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.
(Assignee)

Comment 2

4 years ago
Created attachment 8498429 [details] [diff] [review]
patch

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)
(Assignee)

Updated

4 years ago
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+
(Assignee)

Comment 5

4 years ago
(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
(Assignee)

Comment 6

4 years ago
Created attachment 8499120 [details] [diff] [review]
patch v1.1

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.
(Assignee)

Comment 8

4 years ago
Created attachment 8499128 [details] [diff] [review]
patch v2

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
(Assignee)

Updated

4 years ago
Duplicate of this bug: 1052126
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+
(Assignee)

Comment 12

4 years ago
Thanks.
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/880a3e26ce32
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 36.0

Updated

4 years ago
Duplicate of this bug: 1081765
status-thunderbird36: --- → fixed
(Reporter)

Comment 15

4 years ago
Confirmed. Well done and thanks.
You need to log in before you can comment on or make changes to this bug.