GNOME Bugzilla – Bug 709595
Background sometimes doesn't resize
Last modified: 2015-09-20 17:36:31 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.
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.
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.
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.)
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. :)
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.
(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
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.
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?!
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..
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
(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).
Created attachment 276266 [details] master, default window size
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
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?)
(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.)
Created attachment 276334 [details] [review] Revert "No more resizing (temporaily) per bug 709595" This reverts commit cd19ab057c0310ff3726dfb1cde50de1acef5581.
Created attachment 276335 [details] [review] Revert "Force a minumum size (800x600), also helps for background resizing" This reverts commit 55e4d7b91c06b1409cd59ac58c264ac96cd9ef77. Conflicts: src/main.c
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.
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.
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.
(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).
Review of attachment 276336 [details] [review]: This works! Sorry about the other patches... :(
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
*** Bug 739972 has been marked as a duplicate of this bug. ***
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.