Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly handle offscreen window resize #74

Merged
merged 2 commits into from
Oct 18, 2020
Merged

Conversation

masm11
Copy link
Owner

@masm11 masm11 commented Oct 16, 2020

i'm fixing #71 and #73.

it seems to need more debug.

Yuuki Harano added 2 commits October 17, 2020 03:47
* src/xwidget.c (Fmake_xwidget): Use gtk_container_check_resize instead.
(Fxwidget_resize): Use gtk_container_check_resize instead.

; Gtk+3 document says:
; > Applications should not use any API specific to GtkWindow
; > to operate on this object. It should be treated as a GtkBin
; > that has no parent widget.
* src/xwidget.c (xwidget_osr_draw_cb): Call it to avoid alloc_needes.
@A6GibKm
Copy link

A6GibKm commented Oct 16, 2020

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
Copy link

A6GibKm commented Oct 17, 2020

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! 👍

@A6GibKm
Copy link

A6GibKm commented Oct 17, 2020

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
Copy link
Owner Author

masm11 commented Oct 17, 2020

!?!? What a weird behavior.

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

@A6GibKm
Copy link

A6GibKm commented Oct 17, 2020

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:

  • F33 silverblue
  • Gnome 3.38 in wayland

@masm11
Copy link
Owner Author

masm11 commented Oct 18, 2020

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

@A6GibKm
Copy link

A6GibKm commented Oct 18, 2020

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
Copy link
Owner Author

masm11 commented Oct 18, 2020

Try #75 to work around the resizing issue.

@A6GibKm
Copy link

A6GibKm commented Oct 18, 2020

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

@masm11
Copy link
Owner Author

masm11 commented Oct 18, 2020

Thanks for the testing.

@masm11 masm11 merged commit 0d0ae36 into pgtk Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants