bug#81580: 30.2; frame resizing does not work under KDE Plasma / Wayland

martin rudalics via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
 >> Under the KDE Plasma window manager, it is normal to be able to
 >> resize a window by dragging one of its borders or one of its corners
 >> with the mouse. This has worked for me, for Emacs and most other
 >> programs, for the last 20 years, under X11. Under Wayland, however,
 >> this does not work for Emacs (it still works for most other programs):
 >> The first attempt to resize it changes the size only by a few pixels,
 >> and further attempts don't change it at all any more — or by several
 >> dozens of pixels, which feels like "random" behaviour.
 >>
 >> Find attached a video of the interaction, on an Emacs instance
 >> opened through 'emacs -q'.
 >>
 >> Platform details:
 >> Distro: Kubuntu 26.04
 >> Windowing system: Wayland
 >> KDE Plasma version: 6.6.5
 >>
 >> This workaround from
 >> https://www.reddit.com/r/emacs/comments/1p0h08g/cant_resize_emacs_frame_by_dragging_frame_corners/
 >> works: adding this line to $HOME/.emacs:
 >> (setq frame-resize-pixelwise t)
 >>
 >> But I claim that as a user, I should not need to do this workaround. In
 >> other words, Emacs should allow resizing its frame by default.
 >> Why?
 >> 1) Because that is what a normal user expects when most other programs
 >> allow resizing their windows in this way.
 >> 2) Because the documentation of this variable
 >> https://www.gnu.org/software/emacs/manual/html_node/elisp/Frame-Size.html#index-frame_002dresize_002dpixelwise
 >> suggests that it is only needed for making maximized/full-screen frames
 >> work.

The Elisp manual entry for 'frame-resize-pixelwise' says that

      Dragging the external border with the mouse is
      done character-wise provided the window manager is willing to
      process the corresponding size hints.

Apparently your KDE Plasma is no more willing to do that.

 >> But here, the Maximize button works perfectly fine; it's the
 >> resizing with a mouse that does not work.
 >
 > I think this is a known problem, caused by Wayland and GTK.  Our
 > recommendation is to use the PGTK build on Wayland.
 >
 > Martin, any comments or suggestions?

It's apparently a new problem.  Emacs by default prescribes to resize
frames character-wise.  This has worked for decades on window managers
under X11 while it never worked on Windows.  Latest versions of KDE and
GNOME are exclusively based on Wayland and whether the X11 compatibility
layer can handle character-wise resizing is beyond my knowledge.  Maybe
Johan who is on KDE Plasma can say more.  Pure Wayland cannot resize
character-wise and the PGTK build does not support it either.

Ceterum censeo 'frame-resize-pixelwise' will have to default to t sooner
or later anyway and will be usable only with older window managers and
non-GTK X builds (maybe).

martin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.