emacs launching in GNOME is all messed up

Bug #2011244 reported by Jonathan Kamens
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
GNU Emacs
New
Unknown
emacs (Ubuntu)
Confirmed
Undecided
Unassigned
gnome-shell (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

With the most recent Lunar updates, which I believe include both an Emacs update and a GNOME update, I have encountered multiple annoying / bizarre problems with launching Emacs in GNOME. In particular:

1) Sometimes Emacs launches as a tiny window rather than a window of the correct size.
2) Sometimes it gets into a state where when I click on the icon in the dock instead of bringing the open Emacs window to the front it launches a new Emacs every time I click.
3) Sometimes it fails to show up in the dock at all when I launch it.

ProblemType: Bug
DistroRelease: Ubuntu 23.04
Package: emacs 1:28.2+1-10ubuntu1
ProcVersionSignature: Ubuntu 6.1.0-16.16-generic 6.1.6
Uname: Linux 6.1.0-16-generic x86_64
ApportVersion: 2.26.0-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Fri Mar 10 16:13:14 2023
InstallationDate: Installed on 2019-08-16 (1302 days ago)
InstallationMedia: Ubuntu 19.04 "Disco Dingo" - Release amd64 (20190416)
PackageArchitecture: all
SourcePackage: emacs
UpgradeStatus: Upgraded to lunar on 2022-11-24 (106 days ago)

Revision history for this message
Jonathan Kamens (jik) wrote :
Revision history for this message
Jonathan Kamens (jik) wrote :

A bit more about this...

There are two Emacs launchers available, "Emacs (GUI)" and "Emacs (Client)". If I pin "Emacs (GUI)" to my favorites and then launch it, I end up with two Emacs icons in my dock, one pinned and one unpinned which is "Emacs (Client)". Every time I click on the "Emacs (GUI)" launcher I get a new window. Clicking on "Emacs (Client)" brings all the windows to the front.

I don't want to pin "Emacs (Client)" to my favorites because if I do that and then try to kill and restart the emacsclient server inside Emacs, it kills the Emacs window. I need to be able to kill and restart the emacsclient server inside Emacs because sometimes I access my computer from the desktop and launch emacs there for editing with emacsclient and other times I access my computer remotely and launch emacs there for editing with emacsclient.

Revision history for this message
Jonathan Kamens (jik) wrote :

I marked this as affecting gnome-shell as well as Emacs because the problem of Emacs launching with a tiny window instead of the properly sized window is occurring even when I downgrade to the older Emacs debs, so that's apparently a problem with the new gnome-shell, not with the new Emacs?

Revision history for this message
Jonathan Kamens (jik) wrote :

Note: the "Sometimes Emacs launches as a tiny window" issue happens *even when Emacs is explicitly launched with -g 80x35 on the command line*.

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

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

Changed in emacs (Ubuntu):
status: New → Confirmed
Changed in gnome-shell (Ubuntu):
status: New → Confirmed
Revision history for this message
Walter Garcia-Fontes (walter-garcia) wrote :

I confirm this issue with the final release of 23.04.

Changed in emacs:
status: Unknown → New
Revision history for this message
Gregory Smith (wolfy) wrote :

As a workaround to the pinning issue, commenting out the StartupWMClass line in /usr/share/applications/emacsclient.desktop allows pinning the Emacs (GUI) desktop entry and doesn't add another icon. The two desktop entries share the same StartupWMClass and I don't know how gnome shell would be able to associate the windows to icons correctly in that situation.

Revision history for this message
Alan Modra (amodra) wrote :

I see this on both 23.04 and 23.10, around 10% of the time emacs launches from a shell, and with emacs -Q too.

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

Other bug subscribers

Remote bug watches

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