Menu isn't shown in gedit when run with sudo

Bug #1527590 reported by Marc Deslauriers
118
This bug affects 22 people
Affects Status Importance Assigned to Milestone
gedit (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

There are multiple ways to use gedit where the menu is not being shown, rendering it unusable.

1- use it over ssh
2- do "sudo gedit"

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: gedit 3.18.2-1ubuntu4
ProcVersionSignature: User Name 4.3.0-2.11-generic 4.3.0
Uname: Linux 4.3.0-2-generic x86_64
ApportVersion: 2.19.3-0ubuntu2
Architecture: amd64
CurrentDesktop: Unity
Date: Fri Dec 18 07:16:30 2015
InstallationDate: Installed on 2015-10-23 (55 days ago)
InstallationMedia: Ubuntu 15.10 "Wily Werewolf" - Release amd64 (20151021)
SourcePackage: gedit
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gedit (Ubuntu):
status: New → Confirmed
Changed in gedit (Ubuntu):
importance: Undecided → High
Revision history for this message
Lonnie Lee Best (launchpad-startport) wrote :

Here's a screen-shot of the issue where the typical menu cannot be shown in the title-bar, because gedit is currently utilizing the title bar itself at the application-level (which is overriding the "desktop-environment-level):
http://neartalk.com/ss/Gedit-No-Menu.png

Revision history for this message
Lonnie Lee Best (launchpad-startport) wrote :

Temporarily, I'm using pluma instead of gedit as a work-around for the menu-not-displaying-in-title-bar-issue:
sudo apt-get install pluma

Pluma seems to be some previous fork of gedit, and looks like gedit did about two versions ago. Here's a screen shot of pluma, where you can see the correct behavior regarding the title-bar-menu:
http://neartalk.com/ss/pluma.png

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

FYI Lonnie the issue you are referring to is bug 1518516. It's not the same as this issue.

This bug isn't a dupe of 1518516, it's a slightly different issue.

Revision history for this message
neclepsio (neclepsio) wrote :

Same here. Fresh install, fully updated.

Revision history for this message
neclepsio (neclepsio) wrote :

Setting UBUNTU_MENUPROXY does not help. Also, if I understand correctly, I'm not affected by #3: if menu is set to display in window titlebar, it works for me (if not using sudo).

Revision history for this message
Mateusz Stachowski (stachowski-mateusz) wrote :

The #3 isn't relevant anymore because gedit is patched to disable CSD (Client Side Decorations) on Unity.

However this patch doesn't work for point #2. So when you run gedit as root you get it with CSD and this means no menus. And this affects menus displayed on the panel and in the window titlebar.

This is how gedit looks with CSD normally: http://2.bp.blogspot.com/-tAION31T1J4/VgKtBTmqWOI/AAAAAAAAW5k/qxa5fz7qXdo/s1600/gedit-minimap.png

Mathew Hodson (mhodson)
summary: - gedit unusable when menu can't be displayed
+ Menu isn't shown in gedit when run as root
Changed in gedit (Ubuntu):
importance: High → Medium
description: updated
summary: - Menu isn't shown in gedit when run as root
+ Menu isn't shown in gedit when run with sudo
Revision history for this message
Éric Piel (Delmic) (piel) wrote :

With this command, I'm able to run gedit in sudo and get the menu:
sudo -E gedit

The environment variable that matters is DBUS_SESSION_BUS_ADDRESS.

So you can also get gedit working like this:
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY GTK_MODULES=$GTK_MODULES DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS gedit

That said, dconf still doesn't work. So it's not possible changing the preferences.

Revision history for this message
Michael Fox (news-9) wrote :

Same problem. New install of 16.04.1.
$ gedit --> shows menu
$ sudo gedit --> does NOT show menu
$ gksudo gedit --> does NOT show menu
$ sudo -i ... # gedit --> does NOT show menu
This happens whether the menus are set for the title bar OR for the top of the screen.
Tried reinstalling gedit. No difference.

Revision history for this message
Coeur Noir (coeur-noir) wrote :

Same here with gedit / ubuntu 16.04 unity.

Does same kind of behaviour with Nautilus and Synaptic come from the same "bug" or is it different things ? please see → https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/1606627

Revision history for this message
Norbert (nrbrtx) wrote :

Same here with gedit / ubuntu 16.04 unity.

Revision history for this message
adrenochrome (adrenochrome) wrote :

still no update or explanation about this problem ? still the same behaviour on 17.04

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.