[Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu option

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
User avatar
__NM64__
Lunatic
Lunatic
Posts: 310
Joined: 2013-10-17, 05:29
Location: Northeast Ohio

[Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu option

Unread post by __NM64__ » 2022-07-16, 18:41

Operating system:
Tested on Xubuntu 22.04, Linux Mint 20.3 Xfce, Linux Mint 21 Cinnamon BETA, Linux Mint 21 Xfce BETA

Browser version:
Happens regardless of version and even happens in Firefox and LibreWolf (but doesn't occur in Brave which implies to me that it's simply a long-standing issue in Gecko-derived browsers; also the actual folder viewers in the OS (Thunar, Nemo) don't have this issue)

32-bit or 64-bit browser?:
64bit

Problem URL:
Any URL that has an image; long context menus make this more apparent and using a low resolution (e.g. 800x600) makes it really apparent. I found that https://palemoon.org itself is a good test case by simply positioning the vertical "Support us - Donate to Pale Moon" banner image onto the middle of the very right-side of your screen and then right-clicking (you may want to first hold down the right-click in order to first determine which context menu option your cursor is currently hovering over)

I'm pretty sure this happens with the default configuration of Pale Moon even on a live session of the aforementioned Linux distros, though various addons can make the context menu longer which makes this more of an issue even at higher resolutions.


It may be worth noting that this seems to not be an issue on Windows, seemingly due to the fact that the context menu doesn't appear until you let off of right-click even though the context menu itself does not get re-positioned. For similar reasons, running Pale Moon portable through WINE also does not seem to exhibit this issue since Windows applications ran through WINE, much like on native Windows, also seem to not show the context menu until you let go of right-click.

User avatar
andyprough
Lunatic
Lunatic
Posts: 317
Joined: 2020-05-31, 04:33

Re: [Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu op

Unread post by andyprough » 2022-07-16, 21:53

Wow you are right. I had to try over and over, but I finally got it to do that in a window on my smaller laptop display. I've never seen that before.

If I know it's going to happen, I can keep holding down on the right mouse button and then I'm free to scroll up and down the context menu.

I tried changing a few of the context menu and mouse button options in about:config, such as 'ui.click_hold_context_menus', but didn't see any change in that behavior.

There's some similar reports on Firefox from 2018, where setting ui.context_menus.after_mouseup to true fixed it. But I think this may have been after Firefox abandoned XUL, and from what I was reading the ui.context_menus.after_mouseup preference was to expose some context menu behavior to WebExtensions. There is no ui.context_menus.after_mouseup in my about:config, and when I create one and set it to true (or false) I get no change.
Self-compiled Pale Moon on Libre-antiX GNU/Linux respin, 32-bit and 64-bit, and on Hyperbola GNU/Linux 64-bit

User avatar
__NM64__
Lunatic
Lunatic
Posts: 310
Joined: 2013-10-17, 05:29
Location: Northeast Ohio

Re: [Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu op

Unread post by __NM64__ » 2022-07-16, 22:19

andyprough wrote:
2022-07-16, 21:53
I finally got it to do that in a window on my smaller laptop display.
This is where changing your desktop resolution to something low like 800x600 (or heck, 640x480) really helps in making the issue apparent.

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 803
Joined: 2018-10-28, 19:56
Location: Georgia
Contact:

Re: [Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu op

Unread post by athenian200 » 2022-07-17, 00:49

The fact that this doesn't happen on Windows but does happen with Firefox on Linux makes me wonder if this is actually a GTK issue rather than a Pale Moon specific issue.

Can you test whether other applications using GTK have a similar problem with context menus? I'm curious if this problem is inherent to the GUI toolkit we use on Linux, or if something about the way the browser handles that toolkit introduces it. I'm not sure that Chromium-based browsers rely on GTK in the same way at all, so a non-browser based standard GTK application would be best. They might use their own GUI stuff for context menus, etc. I know traditionally they had a lot of their own... well, chrome.
"There are two sentences inscribed upon the Ancient oracle... 'Know thyself' and 'Nothing too much'; and upon these all other precepts depend." -- Plutarch

User avatar
__NM64__
Lunatic
Lunatic
Posts: 310
Joined: 2013-10-17, 05:29
Location: Northeast Ohio

Re: [Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu op

Unread post by __NM64__ » 2022-07-17, 01:02

athenian200 wrote:
2022-07-17, 00:49
Can you test whether other applications using GTK have a similar problem with context menus?
I'd be happy to test it but, the only other program that I know for sure uses GTK, Audacity, doesn't use right-click context menus, so...

I don't suppose you know of any other program that specifically uses GTK?

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 803
Joined: 2018-10-28, 19:56
Location: Georgia
Contact:

Re: [Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu op

Unread post by athenian200 » 2022-07-17, 01:19

I'd be happy to test it but, the only other program that I know for sure uses GTK, Audacity, doesn't use right-click context menus, so...

I don't suppose you know of any other program that specifically uses GTK?
Well, there are several. The first ones that come to mind for me are Pluma and the MATE terminal. But I would think GEdit and GNOME terminal would use GTK as well?
"There are two sentences inscribed upon the Ancient oracle... 'Know thyself' and 'Nothing too much'; and upon these all other precepts depend." -- Plutarch

User avatar
__NM64__
Lunatic
Lunatic
Posts: 310
Joined: 2013-10-17, 05:29
Location: Northeast Ohio

Re: [Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu op

Unread post by __NM64__ » 2022-07-17, 01:33

athenian200 wrote:
2022-07-17, 01:19
The first ones that come to mind for me are Pluma and the MATE terminal. But I would think GEdit and GNOME terminal would use GTK as well?
Well none of those 4 applications cause the issue in question on my current Mint 20.3 Xfce installation - they all properly cause the context menu to appear on the left side of the cursor once you start getting a context menu's width away from the right side of the screen.

Off-topic:
BTW on the subject of obscure oddball mouse cursor Linux bugs, I don't suppose you have any insight on the proper place to report this bug about the mouse cursor being misaligned by 1x1 pixels?

User avatar
andyprough
Lunatic
Lunatic
Posts: 317
Joined: 2020-05-31, 04:33

Re: [Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu op

Unread post by andyprough » 2022-07-17, 03:33

It also happens when I try it on Hyperbola Linux, which uses xenocara instead of xorg, and it happens with both Pale Moon and with Hyperbola's version of basilisk called iceweasel-uxp.

However, I wouldn't get overly concerned about it. It's going to be very rare these days for anyone to browsing with Pale Moon on a Linux distro while using an 800x600 screen resolution, and if it does happen they can just hold the right mouse button down as a work-around.
Self-compiled Pale Moon on Libre-antiX GNU/Linux respin, 32-bit and 64-bit, and on Hyperbola GNU/Linux 64-bit

User avatar
__NM64__
Lunatic
Lunatic
Posts: 310
Joined: 2013-10-17, 05:29
Location: Northeast Ohio

Re: [Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu op

Unread post by __NM64__ » 2022-07-17, 03:42

andyprough wrote:
2022-07-17, 03:33
However, I wouldn't get overly concerned about it. It's going to be very rare these days for anyone to browsing with Pale Moon on a Linux distro while using an 800x600 screen resolution, and if it does happen they can just hold the right mouse button down as a work-around.
The 800x600 was just a way to make it easier to occur; I originally discovered it myself on a 1024px-high screen with normal 100% DPI scaling and the only reason I ran into it is because I have enough addons that add additional context menu entries that caused the menu to be something like 60% of the height of my screen (basically the issue primarily occurs when the menu is greater than 50% of your vertical resolution).

In the example of clicking on an image with a link, I have 11 additional context entries compared to default.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 32595
Joined: 2011-08-28, 17:27
Location: Tranås, SE
Contact:

Re: [Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu op

Unread post by Moonchild » 2022-07-17, 07:09

Ah,I see the combination of circumstances now. Well, basically the menu runs "out of options" in your situation. It tries to not place the menu under the cursor as best it can while pushed up against the border of the screen. it will swap sides vertically as well to avoid the issue, but if your screen doesn't have enough vertical space to accommodate that, the cursor ends up over the menu. It doesn't "swap sides" horizontally because I'm pretty sure that would conflict with RTL considerations in the widget code.

It would potentially be possible to make the mouse behaviour the same as on windows, i.e. display the context menu on the mouse up event, but I'm not sure if that would break workflows for people (I'm gathering it would for people who right-click+drag to use context menus) and that should be avoided where possible.
"The best revenge is to not be like the person who wronged you." -- Marcus Aurelius
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb

User avatar
__NM64__
Lunatic
Lunatic
Posts: 310
Joined: 2013-10-17, 05:29
Location: Northeast Ohio

Re: [Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu op

Unread post by __NM64__ » 2022-07-17, 07:14

Moonchild wrote:
2022-07-17, 07:09
It doesn't "swap sides" horizontally because I'm pretty sure that would conflict with RTL considerations in the widget code.
Forgive my ignorance, but what does the acronym "RTL" stand for in this case?

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 803
Joined: 2018-10-28, 19:56
Location: Georgia
Contact:

Re: [Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu op

Unread post by athenian200 » 2022-07-17, 07:28

__NM64__ wrote:
2022-07-17, 07:14
Forgive my ignorance, but what does the acronym "RTL" stand for in this case?
Right to left. It basically refers to the way languages like Arabic are displayed with everything in the GUI mirrored across the X axis because the language is written from right to left. That is to say, the way RTL languages are handled internally complicates things as far as making things swap over to different sides. That is probably why Mozilla has not fixed it either.
"There are two sentences inscribed upon the Ancient oracle... 'Know thyself' and 'Nothing too much'; and upon these all other precepts depend." -- Plutarch

User avatar
__NM64__
Lunatic
Lunatic
Posts: 310
Joined: 2013-10-17, 05:29
Location: Northeast Ohio

Re: [Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu op

Unread post by __NM64__ » 2022-08-07, 07:50

I just wanted to add that this is particularly noticeable if you use DownThemAll and right-click on an image that contains a link (again, such as the "Support us" banner on the right side of palemoon.org) as DownThemAll itself adds an additional 4 context menu entries (unfortunately for me, I commonly use both the "DownThemAll" and "dTa! OneClick" selections so removing them from the context menu is impractical)

That being said, I was able to use the old extension "Menu Wizard" (which I already had installed for unrelated reasons) to remove some context menu entries that I never use in order to shink it down to 21 entries which seems to be the maximum amount of entries one can have without causing this issue to occur on a 1024p monitor with 100% DPI scaling.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4021
Joined: 2015-12-09, 15:45
Contact:

Re: [Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu op

Unread post by moonbat » 2022-08-07, 23:18

__NM64__ wrote:
2022-08-07, 07:50
if you use DownThemAll
Why not the actual Pale Moon fork GetEmAll, which has a few fixes/enhancements as well?
__NM64__ wrote:
2022-08-07, 07:50
DownThemAll itself adds an additional 4 context menu entries
All of which can be removed if you ever looked at the extension's preferences.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 20.1 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
__NM64__
Lunatic
Lunatic
Posts: 310
Joined: 2013-10-17, 05:29
Location: Northeast Ohio

Re: [Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu op

Unread post by __NM64__ » 2022-08-07, 23:28

moonbat wrote:
2022-08-07, 23:18
Why not the actual Pale Moon fork GetEmAll, which has a few fixes/enhancements as well?
Because I was not aware of it. I've been using DownThemAll in Pale Moon for... gosh, uh, many many years? Might have been since Pale Moon version 23 if not earlier (I just know that I was already using Pale Moon before version 24, but I don't recall for how long).
__NM64__ wrote:
2022-08-07, 07:50
DownThemAll itself adds an additional 4 context menu entries
All of which can be removed if you ever looked at the extension's preferences.
[/quote]
At least for DownThemAll, the issue is that I only use two of the entries but there are only two checkbox options for removing entries with each individual checkbox option removing two of the four and, of course, each of the two removed ends up removing one of the two menu entries that I use, forcing me to have all 4 visible.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4021
Joined: 2015-12-09, 15:45
Contact:

Re: [Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu op

Unread post by moonbat » 2022-08-07, 23:39

__NM64__ wrote:
2022-08-07, 23:28
I've been using DownThemAll in Pale Moon for... gosh, uh, many many years?
So have I..last year when the decision to drop Firefox extension support was made, I forked it as GetEmAll for compatibility's sake. Since then there have been a few fixes/enhancements to it courtesy RealityRipple.
__NM64__ wrote:
2022-08-07, 23:28
At least for DownThemAll, the issue is that I only use two of the entries but there are only two checkbox options for removing entries with each individual checkbox option removing two of the four and, of course, each of the two removed ends up removing one of the two menu entries that I use, forcing me to have all 4 visible.
If you enable 'Use compact menu', it will move its menu items into a submenu, reducing context menu clutter.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 20.1 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
__NM64__
Lunatic
Lunatic
Posts: 310
Joined: 2013-10-17, 05:29
Location: Northeast Ohio

Re: [Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu op

Unread post by __NM64__ » 2022-08-07, 23:57

moonbat wrote:
2022-08-07, 23:39
__NM64__ wrote:
2022-08-07, 23:28
I've been using DownThemAll in Pale Moon for... gosh, uh, many many years?
So have I.
Yeah but have you been using DownThemAll since the mid to late 2000s like I have? :P (I think it was within a year or two after DownThemAll's very first version)
moonbat wrote:
2022-08-07, 23:39
If you enable 'Use compact menu', it will move its menu items into a submenu, reducing context menu clutter.
Thanks for the tip! With that combined with the "Menu Wizard" tweaks I mentioned, I can get the context menu down to 18 entries when clicking on the "Support us" right-side banner which additionally seems to be the maximum amount of context menu entries to avoid having this issue occur on my other monitor that runs a custom vertical resolution of 888p.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4021
Joined: 2015-12-09, 15:45
Contact:

Re: [Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu op

Unread post by moonbat » 2022-08-08, 01:00

__NM64__ wrote:
2022-08-07, 23:57
Yeah but have you been using DownThemAll since the mid to late 2000s like I have?
Right from the day it debuted on Firefox around 2006-07, when I had already been using Firefox for around 5 years.
__NM64__ wrote:
2022-08-07, 23:57
when clicking on the "Support us" right-side banner
I got rid of that in GtA - so it's a clean manager window with just the buttons.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 20.1 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
__NM64__
Lunatic
Lunatic
Posts: 310
Joined: 2013-10-17, 05:29
Location: Northeast Ohio

Re: [Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu op

Unread post by __NM64__ » 2022-08-08, 01:07

Amusingly I just noticed that Get'emAll still gives incomplete downloads a file extension of ".dtapart"
moonbat wrote:
2022-08-08, 01:00
I got rid of that in GtA - so it's a clean manager window with just the buttons.
EDIT: GtA is a long-running M-rated game series; GeA is a Pale Moon extension forked from DownThemAll. :P

Anyway, I was referring to the "Support us" banner on the right-side of the palemoon.org homepage - you know, this: As previously mentioned, right-clicking on an image that doubles as a hyperlink is what seems to result in the longest context menu with the most entries.
Last edited by __NM64__ on 2022-08-08, 01:14, edited 2 times in total.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4021
Joined: 2015-12-09, 15:45
Contact:

Re: [Linux] Context menu doesn't reposition to left of cursor when no room, causing right-click to auto-select a menu op

Unread post by moonbat » 2022-08-08, 01:13

__NM64__ wrote:
2022-08-08, 01:07
Get'emAll still gives incomplete downloads a file extension of ".dtapart"
Yes, it's a rebranded fork, not a full rewrite :)
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 20.1 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

Post Reply