After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 771292 - app window grows with each start due to incorrectly using gtk API (wayland)
app window grows with each start due to incorrectly using gtk API (wayland)
Status: RESOLVED FIXED
Product: baobab
Classification: Core
Component: general
3.21.x
Other Linux
: Normal normal
: ---
Assigned To: Baobab Maintainers
Baobab Maintainers
Depends on:
Blocks: WaylandRelated
 
 
Reported: 2016-09-12 12:11 UTC by Kamil Páral
Modified: 2017-10-26 15:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to only use GTKWindow API (1.09 KB, patch)
2017-04-26 14:49 UTC, Gabriel Rauter
none Details | Review
cleaned up code style (missing space) (2.38 MB, patch)
2017-04-27 10:47 UTC, Gabriel Rauter
none Details | Review
sorry previous one was garbage, still not used to the create patch system (1.09 KB, patch)
2017-04-27 10:51 UTC, Gabriel Rauter
none Details | Review
baobab window: use Window size instead of Widget (1.58 KB, patch)
2017-05-14 17:02 UTC, Gabriel Rauter
none Details | Review

Description Kamil Páral 2016-09-12 12:11:08 UTC
Description of problem:
Since gtk3-3.21.5-1.fc25.x86_64 baobab window grows with each start (on wayland). You can see the same issue with virt-manager here:
https://www.youtube.com/watch?v=NO6Wlaoq0x8
(the same issue applies to baobab)

This has been reported against gtk:
https://bugzilla.gnome.org/show_bug.cgi?id=771112
and determined as an application bug:
https://bugzilla.gnome.org/show_bug.cgi?id=771112#c7

Quoting how to fix this:

~~~
https://wiki.gnome.org/HowDoI/SaveWindowState

Querying the window size and then setting it with GtkWindow API is perfectly fine.

Querying the window size with GtkWidget API and then setting it with GtkWindow API, *or* querying the window size with GtkWindow API and then setting it with GtkWidget API, is *not* okay, and only worked up until now with server-side decorations only on X11.
~~~

Version-Release number of selected component (if applicable):
baobab-3.21.90-1.fc25.x86_64
gtk3-3.21.5-1.fc25.x86_64

How reproducible:
always

Steps to Reproduce:
1. start and close baobab repeatedly, it will grow each time
Comment 1 Gabriel Rauter 2017-04-26 14:49:21 UTC
Created attachment 350491 [details] [review]
Patch to only use GTKWindow API
Comment 2 Gabriel Rauter 2017-04-27 10:47:42 UTC
Created attachment 350540 [details] [review]
cleaned up code style (missing space)
Comment 3 Gabriel Rauter 2017-04-27 10:51:15 UTC
Created attachment 350541 [details] [review]
sorry previous one was garbage, still not used to the create patch system
Comment 4 Carlos Soriano 2017-05-14 16:25:39 UTC
Review of attachment 350541 [details] [review]:

The code looks good!

The commit message could use some love, it's important to explain what was happening, why, and how it's fixed. Follow our guidelines in https://wiki.gnome.org/Newcomers/SubmitPatch for commit messages (not need to use gitg though).
Comment 5 Daniel Boles 2017-05-14 16:27:28 UTC
Review of attachment 350541 [details] [review]:

::: src/baobab-window.vala
@@ +159,3 @@
             configure_event.connect ((event) => {
                 if (!(Gdk.WindowState.MAXIMIZED in get_window ().get_state ())) {
+                    int new_width, new_height;

trivial: Are "width" and "height" already used earlier in this scope? If not, I would just call the variables "width" and "height", personally, but maybe others would disagree... (Carlos said he agrees, though :)
Comment 6 Daniel Boles 2017-05-14 16:34:10 UTC
Review of attachment 350541 [details] [review]:

::: src/baobab-window.vala
@@ +159,3 @@
             configure_event.connect ((event) => {
                 if (!(Gdk.WindowState.MAXIMIZED in get_window ().get_state ())) {
+                    int new_width, new_height;

Variables named "width" and "height" are used earlier in the parent scope, so it could be confusing and possibly dangerous to reuse them (depending on how it was done)... so I withdraw my objection!

Just the commit message to go :)
Comment 7 Gabriel Rauter 2017-05-14 17:02:55 UTC
Created attachment 351838 [details] [review]
baobab window: use Window size instead of Widget

updated commit message
Comment 8 Stefano Facchini 2017-10-26 15:55:02 UTC
A similar fix was committed a few weeks ago.