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 709595 - Background sometimes doesn't resize
Background sometimes doesn't resize
Status: RESOLVED WONTFIX
Product: gnome-nibbles
Classification: Applications
Component: general
git master
Other Linux
: High minor
: ---
Assigned To: gnome-nibbles-maint
gnome-nibbles-maint
3.12.2
: 739972 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-10-07 19:09 UTC by Mario Wenzel
Modified: 2015-09-20 17:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Background not resizing (18.84 KB, image/png)
2013-10-07 19:09 UTC, Mario Wenzel
  Details
debug patch to get more data on background (1.45 KB, patch)
2014-02-03 19:18 UTC, gQuigs
none Details | Review
Screencast of 3.12 (1.34 MB, application/octet-stream)
2014-05-09 02:48 UTC, Michael Catanzaro
  Details
master, default window size (31.52 KB, image/png)
2014-05-09 23:30 UTC, Michael Catanzaro
  Details
Revert "No more resizing (temporaily) per bug 709595" (1.76 KB, patch)
2014-05-11 15:51 UTC, Michael Catanzaro
committed Details | Review
Revert "Force a minumum size (800x600), also helps for background resizing" (1.83 KB, patch)
2014-05-11 15:51 UTC, Michael Catanzaro
committed Details | Review
Set a size request for the clutter widget (1.36 KB, patch)
2014-05-11 16:17 UTC, Michael Catanzaro
committed Details | Review

Description Mario Wenzel 2013-10-07 19:09:20 UTC
Created attachment 256665 [details]
Background not resizing

If you resize the window before the game starts, the background sometimes doesn't resize. I have not been able to reproduce this reliably. Sometimes it happens, sometimes it doesn't.
Comment 1 Mario Wenzel 2013-10-07 19:24:11 UTC
It seems like if you decrease the window size from its original size and close the game and restart it, the background is smaller and it doesn't get larger.
Comment 2 Michael Catanzaro 2014-01-05 21:08:06 UTC
I think this is only a problem before starting a game in 3.10 (i.e. when the worms are not moving around), at least I think so.  In git master it's always a problem.
Comment 3 gQuigs 2014-01-31 05:07:43 UTC
So part of this was fixed.. by the minimum size fix.  You can still reproduce part of this issue by:
Making your window very large.
Closing it.
Reopening and without resizing trying to play a game.  Note how it goes off of the screen.

Do we care about remembering the previous user's window size?   If not, this is a trivial fix.  (Right now, what happens is we remember the previous tilesize but don't actually change anything but the board size on init.)
Comment 4 Michael Catanzaro 2014-01-31 14:08:25 UTC
I can reproduce this simply by the game at the new default window size!

In 3.10 I can reproduce by opening the game (at the old default window size) and then maximizing it.

So I don't think remembering the window size is really the problem here. I also don't think it makes sense to not remember the window size if the window is resizable. (Generally applications that don't do this are bad -- Glade, for example. For Nibbles, it would not be as big a deal.)

It might make sense for Nibbles to be unresizable with gtk_window_set_resizable(). That's normally a last resort, and I don't think any of our resizing issues are unfixable, but this would eliminate the entire class of issues (e.g. the size of the "old portions" of the worm doesn't update after unmaximizing the window), so it's definitely worth considering and would be better than leaving it broken.  (And hey, you'd get to delete the gridframe after all. :)
Comment 5 gQuigs 2014-02-03 19:18:14 UTC
Created attachment 267995 [details] [review]
debug patch to get more data on background

This is what I've been doing to debug the background size.  Try starting a new game, and then just adjusting the size a tiny bit.  I'd be very curious what the output is on your machine.
Comment 6 Michael Catanzaro 2014-02-05 04:25:56 UTC
(In reply to comment #4)
> I can reproduce this simply by the game at the new default window size!

Clarification: only on Fridays!

On Tuesdays it looks fine by default, but gets messed up when the tile size increases to 9.

[mcatanzaro@victory-road src]$ jhbuild run gnome-nibbles
Gtk-Message: Failed to load module "canberra-gtk-module"
(gnibbles:4791): Gtk-DEBUG: Connecting to session manager
tilesize  8 
BOARDWIDTH 92  
BOARDHEIGHT 66 
** end board new **BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  736 
BOARDHEIGHT 66  event->height  528 
tilesize  8 
BOARDWIDTH 92  event-width  828 
BOARDHEIGHT 66  event->height  594 
tilesize  9 
BOARDWIDTH 92  event-width  828 
BOARDHEIGHT 66  event->height  594 
tilesize  9 
BOARDWIDTH 92  event-width  828 
BOARDHEIGHT 66  event->height  594 
tilesize  9 
BOARDWIDTH 92  event-width  828 
BOARDHEIGHT 66  event->height  594 
tilesize  9 
BOARDWIDTH 92  event-width  828 
BOARDHEIGHT 66  event->height  594 
tilesize  9 
BOARDWIDTH 92  event-width  828 
BOARDHEIGHT 66  event->height  594 
tilesize  9
Comment 7 Michael Catanzaro 2014-05-09 02:48:15 UTC
Created attachment 276208 [details]
Screencast of 3.12

This is pretty bad.  I think we need to disable resizing until we can get this under control.
Comment 8 Mario Wenzel 2014-05-09 06:55:23 UTC
This is news to me. I thought only the tiled background image was broken. Didn't know the barriers would start to mismatch with the game, making it unplayable. I'd think that makes this one critical?!
Comment 9 gQuigs 2014-05-09 13:20:14 UTC
It appears that on 3.8 this bug is still there but hidden by the resize.  Go back and forth between fullscreen and "left side" aligned.  If you do a few times with 6 AI players eventually you'll catch them moving all over the environment. Could be related to 654072.

The above makes reproducing this bug really easy.  I agree it's critical, now that I can reproduce I'm working on it..
Comment 10 gQuigs 2014-05-09 13:52:54 UTC
Committed something to stop resizing to master.  Let me know if this works for you..  Also does it load initially "right" for you with this patch?
https://git.gnome.org/browse/gnome-nibbles/commit/?id=cd19ab057c0310ff3726dfb1cde50de1acef5581
Comment 11 Michael Catanzaro 2014-05-09 23:29:44 UTC
(In reply to comment #10)
> Committed something to stop resizing to master.  Let me know if this works for
> you..  Also does it load initially "right" for you with this patch?
> https://git.gnome.org/browse/gnome-nibbles/commit/?id=cd19ab057c0310ff3726dfb1cde50de1acef5581

Unfortunately master is borked by default (and I'm using the memory gsettings backend, so I get the default each time I start it).

Smaller issue: make sure to use gtk_window_set_resizable() to disable resizing and maximize for real (currently those actions are accessible but do nothing -- e.g. mouse to the edge of the window and you still get the resize icon).
Comment 12 Michael Catanzaro 2014-05-09 23:30:04 UTC
Created attachment 276266 [details]
master, default window size
Comment 13 gQuigs 2014-05-10 04:45:12 UTC
Can you try changing your default screen size until it fits?  I can go up to 790 vertical before it fits wrong..
   GdkGeometry size_hints = {
-    1024, 768, 0, 0, 1024, 768, 0, 0, 0.0, 0.0, GDK_GRAVITY_NORTH_WEST
+    1060, 790, 0, 0, 1060, 790, 0, 0, 0.0, 0.0, GDK_GRAVITY_NORTH_WEST
Comment 14 Michael Catanzaro 2014-05-11 13:52:14 UTC
I'll play around with this later today, with the optimistic goal of getting a fix into 3.12.2.  (Bryan, could you delay releasing that until tomorrow, if possible?)
Comment 15 Michael Catanzaro 2014-05-11 14:52:14 UTC
(In reply to comment #13)
> Can you try changing your default screen size until it fits?  I can go up to
> 790 vertical before it fits wrong..
>    GdkGeometry size_hints = {
> -    1024, 768, 0, 0, 1024, 768, 0, 0, 0.0, 0.0, GDK_GRAVITY_NORTH_WEST
> +    1060, 790, 0, 0, 1060, 790, 0, 0, 0.0, 0.0, GDK_GRAVITY_NORTH_WEST

The first thing I notice is that the third and fourth fields are for the max size, so you're setting a max size of zero (which I guess is ignored?).  The fifth and sixth control the base size, which is used for resizing the window in increments and which is ignored since we don't use the hint GDK_HINT_BASE_SIZE.  (Maybe it wouldn't be a bad idea to force Nibbles to resize in increments, since that's how the Clutter view works.)
Comment 16 Michael Catanzaro 2014-05-11 15:51:33 UTC
Created attachment 276334 [details] [review]
Revert "No more resizing (temporaily) per bug 709595"

This reverts commit cd19ab057c0310ff3726dfb1cde50de1acef5581.
Comment 17 Michael Catanzaro 2014-05-11 15:51:37 UTC
Created attachment 276335 [details] [review]
Revert "Force a minumum size (800x600), also helps for background resizing"

This reverts commit 55e4d7b91c06b1409cd59ac58c264ac96cd9ef77.

Conflicts:
	src/main.c
Comment 18 Michael Catanzaro 2014-05-11 15:56:29 UTC
I reverted the fix for Bug #721599 and all the resizing bugs went away. Yay! This also means that only the 3.12 branch was ever affected.

I'll next attach a different solution for Bug #721599.
Comment 19 Michael Catanzaro 2014-05-11 15:59:16 UTC
Correction: with the above patches, we're back to the bug originally reported by Mario in comment #0: resizing the window before the game starts causes the broken background texture (but no functional problems), and resizing after the game starts is fine.
Comment 20 Michael Catanzaro 2014-05-11 16:17:22 UTC
Created attachment 276336 [details] [review]
Set a size request for the clutter widget

This prevents us from resizing the window to ludicrously small sizes.

Also, no longer set a default window size, since this is no longer
required now that the clutter widget has a size request. GTK+ will pick
a nice window size to fit the tile size.
Comment 21 Michael Catanzaro 2014-05-11 16:20:26 UTC
(In reply to comment #19)
> Correction: with the above patches, we're back to the bug originally reported
> by Mario in comment #0: resizing the window before the game starts causes the
> broken background texture (but no functional problems), and resizing after the
> game starts is fine.

Also, after the game is closed and reopened, it does not properly remember the tile size from the last time it was played.  So this is really two different size-related bugs we're left with (after the patch set above, which fixes all the really serious issues).
Comment 22 gQuigs 2014-05-12 03:07:26 UTC
Review of attachment 276336 [details] [review]:

This works! Sorry about the other patches... :(
Comment 23 Michael Catanzaro 2014-05-12 15:17:53 UTC
OK, I pushed all of the above to master, and the relevant ones to gnome-3-12, so we should be ready for 3.12.2 now.

The remaining issues are mentioned in comment #21
Comment 24 Sahil Sareen 2014-11-15 15:07:36 UTC
*** Bug 739972 has been marked as a duplicate of this bug. ***
Comment 25 Michael Catanzaro 2015-09-20 17:36:31 UTC
Closing all the bugs. A major rewrite of the code is landing for 3.20, and there's no point in worrying about bugs in the old version anymore.