Bug 33241 - Emacs build does not work correctly on Wayland GNOME.
Summary: Emacs build does not work correctly on Wayland GNOME.
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 9
Hardware: x86_64 Linux
Priority: Normal minor
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 33433
Blocks:
  Show dependency treegraph
 
Reported: 2024-05-26 00:58 CEST by Omar Jair Purata Funes
Modified: 2024-08-06 22:04 CEST (History)
3 users (show)

See Also:
Source RPM: emacs-28.2-10.1.mga9.src.rpm
CVE:
Status comment:


Attachments

Description Omar Jair Purata Funes 2024-05-26 00:58:49 CEST
Description of problem:

Hello Mageia developers. Thanks for taking the time to read this bug. Currently, the shipped GNOME version in Mageia 9 is 44, and it uses wayland by default. This makes the provided Emacs package behave strangely inside a wayland session, mainly due to graphical bugs such as black corners/borders when snapping the GTK window.

I know the v9 errata proposes switching back to Xorg. However, I think that may be overkill for this package.


Version-Release number of selected component (if applicable): 28.2


How reproducible: Probably easy

Steps to Reproduce:
1. Install emacs via dnf
2. Open a new emacs (gtk) window and snap it to either side of the screen.
3. Notice the errors in the borders of the window.

I tested this with both stock adwaita and third party themes, and the issue still persists. I managed to compile emacs for myself using podman and the --with-pgtk configuration flag, which seems to enhance support for wayland. However, I did not know how to “repackage” the Mageia version in a suitable .rpm format.

I also marked this as minor since, “technically” all I had to do was steal the configuration used in mageia emacs and add the --with-pgtk flag to configure.
Comment 1 Lewis Smith 2024-05-26 20:23:36 CEST
Thank you for the report. Agreed, it is not serious.

Assigning this to ns80, the main maintainer of emacs.
If you (Nicolas) can put a version of emacs in Core/Updates_Testing compiled as the user suggests, so that *he* can try it from there, that would be easiest for him.
Otherwise, explain whether & how he can convert his compiled emacs into a package so that he can install it locally to try. I suspect that might be complicated.

Assignee: bugsquad => nicolas.salguero

Comment 2 Omar Jair Purata Funes 2024-05-27 07:46:36 CEST
I'm willing to help with testing if my assistance is needed. The mageia podman image has proven to be very useful for these tasks.

I made some research and tried with both fedpkg-minimal and rpmbuild to no avail. I'll keep you updated if I find anything else in the meantime.

Thanks for taking this into account!
Comment 3 Nicolas Salguero 2024-05-27 10:23:08 CEST
Hi,

For Mageia 9, emacs cannot be built with --with-pgtk flag because:
1) It means emacs could not be used with x11 any more but only with wayland.
2) That flag is in emacs >= 29 and Mageia 9 ships version 28.2.

For Cauldron, I will try to build emacs twice when I have some time.

Best regards,

Nico.
Comment 4 Nicolas Salguero 2024-05-31 15:43:14 CEST
Hi,

For Cauldron, could you test if replacing emacs-29.3-3.mga10 by emacs-pgtk-29.3-3.mga10 solves the issue, please?

Best regards,

Nico.
Comment 5 Omar Jair Purata Funes 2024-06-01 22:46:35 CEST
Sorry for the late response. I had to test the package to give proper answers. Redirecting display output from podman to wayland was a complete odyssey. 

I tried both:

- emacs-pgtk-29.3-3.mga10.x86_64 inside Mageia Cauldron container image
- emacs-pgtk-29.3-3.mga10.x86_64 inside Mageia Cauldron qemu

I tried backporting it using Mageia 9 libraries but I think this is not possibile due to incomatibilities with: libc (version), libjansson-devel (couldn't find that in dnf) and emacs-common.

Thanks a lot for attending this.
Comment 6 Nicolas Salguero 2024-07-08 16:00:00 CEST
Hi,

I built emacs 29.4 for Mageia 9. Can you test it, please?

Best regards,

Nico.
Nicolas Salguero 2024-07-25 09:53:14 CEST

Depends on: (none) => 33433

Comment 7 Len Lawrence 2024-07-25 15:52:57 CEST
mageia9, x64
Had a look at this using qarepo and urpmi.
Did not see any problems before or after update with emacs but was using GNOME Classic with Wayland and workspaces.  Maybe not a fair test.  Not sure what snapping means.  Moved the editor to either side and through the edge and when it is nearly gone a pale blue rectangle appears, turns white, then the text snaps back into view on the resized panel.  That is after the update and it is symmetric for right or left movements.  The window goes back to its normal size when moved towards the centre.  No strange effects at the bottom border but at the top the whole remaining background turns transparent blue and switches to a fullscreen display.  That can be cancelled via the emacs window decorations.

Switched to GNOME Wayland and ran into trouble with gnome-terminal (unusable) and there was some obscure objection to mate-terminal so emacs had to be launched from the Activities menu, which did no harm because the .emacs file had been read and keyboard customisations were available.
The odd behaviour seen in GNOME Classic Wayland was replicated.

It looks like that behaviour is standard across the board because it happens with Mate on Xorg.

Not sure if this helps at all.

CC: (none) => tarazed25

Comment 8 katnatek 2024-07-25 18:10:31 CEST
(In reply to Len Lawrence from comment #7)
> mageia9, x64
> Had a look at this using qarepo and urpmi.
> Did not see any problems before or after update with emacs but was using
> GNOME Classic with Wayland and workspaces.  Maybe not a fair test.  Not sure
> what snapping means.  Moved the editor to either side and through the edge
> and when it is nearly gone a pale blue rectangle appears, turns white, then
> the text snaps back into view on the resized panel.  That is after the
> update and it is symmetric for right or left movements.  The window goes
> back to its normal size when moved towards the centre.  No strange effects
> at the bottom border but at the top the whole remaining background turns
> transparent blue and switches to a fullscreen display.  That can be
> cancelled via the emacs window decorations.
> 
> Switched to GNOME Wayland and ran into trouble with gnome-terminal
> (unusable) and there was some obscure objection to mate-terminal so emacs
> had to be launched from the Activities menu, which did no harm because the
> .emacs file had been read and keyboard customisations were available.
> The odd behaviour seen in GNOME Classic Wayland was replicated.
> 
> It looks like that behaviour is standard across the board because it happens
> with Mate on Xorg.
> 
> Not sure if this helps at all.

The issue with gnome-terminal could be https://wiki.mageia.org/en/Mageia_9_Errata#GNOME_and_Wayland
Comment 9 Omar Jair Purata Funes 2024-07-30 04:28:35 CEST
I could not find the Emacs 29.1 in the Mageia 9 repositories. However.
I wouldn't discard the proposed theory that the problem comes from Emacs. Both bugs present visual glitches.

However on GNOME 40 + Wayland. These visual errors are translated into black borders around the window.

I suspected about a similar known error present in GNOME 44.1
Comment 10 katnatek 2024-07-30 18:54:17 CEST
(In reply to Omar Jair Purata Funes from comment #9)
> I could not find the Emacs 29.1 in the Mageia 9 repositories. However.
> I wouldn't discard the proposed theory that the problem comes from Emacs.
> Both bugs present visual glitches.
> 
> However on GNOME 40 + Wayland. These visual errors are translated into black
> borders around the window.
> 
> I suspected about a similar known error present in GNOME 44.1

You can use https://wiki.mageia.org/en/QA_Repo
And put the list in https://bugs.mageia.org/show_bug.cgi?id=33433#c1
Comment 11 katnatek 2024-07-30 18:57:53 CEST
(In reply to katnatek from comment #10)
> (In reply to Omar Jair Purata Funes from comment #9)
> > I could not find the Emacs 29.1 in the Mageia 9 repositories. However.
> > I wouldn't discard the proposed theory that the problem comes from Emacs.
> > Both bugs present visual glitches.
> > 
> > However on GNOME 40 + Wayland. These visual errors are translated into black
> > borders around the window.
> > 
> > I suspected about a similar known error present in GNOME 44.1
> 
> You can use https://wiki.mageia.org/en/QA_Repo
> And put the list in https://bugs.mageia.org/show_bug.cgi?id=33433#c1

Oh that is for urpmi, for dnf exist something similar?
Comment 12 katnatek 2024-07-30 19:08:43 CEST
BTW soon will be in updates
Comment 13 katnatek 2024-08-02 18:27:27 CEST
Omar if you already get the update, can confirm if fix this issue?
Comment 14 Omar Jair Purata Funes 2024-08-06 19:24:41 CEST
Already got an update over here! I had some trouble accessing my mageia account, I'm terribly sorry to keep you waiting.

Emacs seems to work now properly in GNOME, KDE and XFCE (tested on my main system and on a gnome-boxes vm).

The "black borders" still persist on GNOME 44.1, but this only happens when using a non-adwaita theme. No issues seen on stock adwaita/libadwaita theming.
Comment 15 Morgan Leijström 2024-08-06 21:24:15 CEST
Thank you

Asigning to QA then so it will be picked up by the QA process.

CC: (none) => fri
Assignee: nicolas.salguero => qa-bugs

Comment 16 Nicolas Salguero 2024-08-06 22:04:46 CEST
It is already fixed with bug 33433

Status: NEW => RESOLVED
CC: (none) => nicolas.salguero
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.