0

I have this strange issue. Let me explain:

  • If I launch a Leafpad instance with leafpad command line (as an example), it shows like this:
    leafpad without sudo behaviour
  • If on the contrary, I do the command sudo leafpad the window shows with both menu and title decorations (which is the expected behaviour, or what I want it to show):
    leafpad with sudo behaviour

What I ultimately want Ubuntu Unity to do is always show menu title AND menu bar. As I see, strangely enough, it only works when issuing a program with sudo.

Is there any way to make it work for all applications, always? This behaviour is quite strange, but I think it finally solves the problem of Firefox not letting you right click:

  • without sudo, Firefox shows the crappy nautilus-like menu/title:
  • with sudo firefox, you can right click into the bookmarks like I'm doing right now

Can we finally learn how is this working in Unity? I've been using Ubuntu for about 5 years or more. I learned a lot of tricks for this O.S., but still this issue makes my life miserable.

EDIT: I have learned that if i execute firefox from another user (even root), windows decorations won't show and so contextual menu for firefox is back! (right click issue solved). However that brings additional problems with firefox Screenshot of firefox in ubuntu working with context menu again! : context menu in firefox

To replicate this:

xhost +local:
su - anotheruser
firefox

The issue is still not solved because, while i can show menu and title in firefox or any other application, it creates additional permission problems because of executing things with different users.

  • When you run leafpad as you, it (actually Unity) has access the 'application menu' so it appeared in the top panel. When run as a different user (sudo or elevated permissions; do a id with & without sudo) it couldn't access your top panel to add 'app menu' so it was forced to use 'window decorations'. This is a permissions issue, and will not be changed (you shouldn't run gui apps with sudo ideally; and they are more difficult in wayland). note: i'm using https://askubuntu.com/questions/10228/whats-the-right-terminology-for-unitys-ui-elements#19166 for names (i'm not a gui person) – guiverc Mar 07 '18 at 02:07
  • You could try running gksudo leafpad (it made no difference on 16.04) which is the sudo command for gui apps. – guiverc Mar 07 '18 at 02:12
  • Running browsers with elevated privileges isn't advisable. – DK Bose Mar 07 '18 at 06:09
  • so running applications with a different user solve the decorations problem? to clarify, i prefer unity to show both title and menu, which in some forums and even here i remember people said was impossible.

    maybe running GUI apps with a different user (not necessarily root) is a "workaround"

    – cpepito Mar 07 '18 at 11:57

1 Answers1

0

Well, finally i solved it. I noticed that most applications don't have a context menu for their menu bar items (right-clicking into a menu option won't do anything) Firefox, on the contrary, allows you to right click a bookmark and open it in a new tab, for example.

So i created a script just for firefox, which changes your user to another proxy user, and afterwards executes firefox with that user. I needed to add a command line for setting permissions into X for that user.

The script which executes firefox is :

xhost +local:
su - anotheruser
firefox

This way, it will prompt you for a password, afterwards it will execute firefox with that proxy user.

This makes firefox let you right-click your bookmarks thus making it great again!

EDIT: Seems my firefox was somehow broken (not profiles, but firefox) Installing another firefox in another location, even the same version, fixed my lack-of-menu problem)

Icecat works OK also

Other versions of firefox (i.e. older, newer) works OK too. It was that my firefox was somehow broken.