masm11 / emacs

Mirror of GNU Emacs
http://www.gnu.org/software/emacs/
GNU General Public License v3.0
198 stars 14 forks source link

Correctly handle offscreen window resize #74

Closed masm11 closed 3 years ago

masm11 commented 3 years ago

i'm fixing #71 and #73.

it seems to need more debug.

A6GibKm commented 3 years ago

Just have in mind that #71 might be an emacs issue a not pgtk related. According to https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44034 it might be the case that it only affects newer versions of gtk.

In any case, this issue belongs to gtk's domain and it might be correct to fix it here independently of what happens in master.

A6GibKm commented 3 years ago

I tested #74. The Gtk error is gone and, more importantly, the buffer is correctly being re displayed.

Only #72 can be still be reproduced, but again, it is also a bug upstream.

Thanks! :+1:

A6GibKm commented 3 years ago

Ok I found an issue in this PR (not reproducible on HEAD), but it is best described in a screencast.

Screencast from 10-17-2020 01:24:19 PM.zip

Resizing the window from one of the top corners leads to weird behaviour.

  1. Instead of the window moved down, it is moving up? (compare mouse and window location)
  2. After the windows reaches a certain size it will print an error
    (emacs:27431): Gtk-CRITICAL **: 13:24:57.249: gtk_distribute_natural_allocation: assertion 'extra_space >= 0' failed
masm11 commented 3 years ago

!?!? What a weird behavior.

It does not reproduce on Wayfire or GNOME(Wayland)...

A6GibKm commented 3 years ago

Ok, so I been educating myself a bit. This is somewhat a gtk issue, I can reproduce it on GNOME terminal on wayland, but it is only a bug in gnome-terminal since it does things in a very hacky way (just quoting a developer here), this bug apparently has existed for some time.

Also gtk_offscreen_window is gone in gtk4.

My current setup:

masm11 commented 3 years ago

Reproduced when resizing the second frame with the top-left corner on GNOME(Wayland).

A6GibKm commented 3 years ago

Yeah, the bug produces different behaviour depending on the corner chosen. On the bottom-right corner, since the window is only being resized, it should work as expected.

masm11 commented 3 years ago

Try #75 to work around the resizing issue.

A6GibKm commented 3 years ago

75 did fix the resizing issue. Thanks :tada:. I tested it on top of this PR ant it seems all the issues (71 and 73) are gone.

masm11 commented 3 years ago

Thanks for the testing.