m42a / mines-perfect

An improved minesweeper clone
GNU General Public License v2.0
3 stars 3 forks source link

Resizing not working (Linux) #1

Closed p3732 closed 11 years ago

p3732 commented 11 years ago

Hey, so yeah problem is the window won't resize. Unfortunaley I can't really tell wether it's because of the program or because of my system setup not correctly being able to handle wxwidget programs. I installed another program (wxbanker) to try and resizing worked fine, so I think the libwx is not correctly implemented. (Also closing with Alt F4 isn't working either, only menu game->exit is working) This is problem happens when you for example pick another board layout or change difficulty to something other than easy. Related issue: when you pick e.g. triangle layout and then go back to square layout, you will still be able to see the triangles in the lower right corner, that will not be overdrawn. That's it. Nice clone btw :)

m42a commented 11 years ago

Well, I fixed the Alt-F4 problem.

Unfortunately, I can't reproduce the resizing problem. Please post the output of the resize-test branch, and tell me what Window Manager/Desktop Environment you're using.

p3732 commented 11 years ago

Whoa, that was fast :) Using GNOME3 shell which should use mutter (metacity). I attached two screenshot of such misscaled boards. Also I have to correct myself. It does infect resizes sometimes, but I can't figure out by what pattern it does so. I clicked the square board type 5 times in a row and then it resized. Really strange. Screenshot 2012-12-23 18:00:11 Screenshot 2012-12-23 18:07:18

@the Alt F4-fix: It indeed closes with ALT F4.However as I have remapped the close action to super+x it doesn't close with that combination. What I meant was to use some standard keybinding way, but I have no idea what part of the system is supposed to deal with that (maybe even X11 itself?).

Oh and I only see the master branch (?)

m42a commented 11 years ago

There should be a branch dropdown menu on the repo's main page, but this should link directly to it: https://github.com/m42a/mines-perfect/tree/resize-test

I'll look into the close keybind some more.

p3732 commented 11 years ago

Okay the resize-test branch isn't working either. What kind of WM are you using? Maybe I could try the same to see what results I get. Also in which class is the window redrawing mechanism? It's not drawFrames() in gui/bitmapctrl.cpp, is it?

p3732 commented 11 years ago

Have a look at this screenshot: Bildschirmfoto vom 2012-12-23 19:15:15 Sometimes the old bitmap is not even cleared. Again this happens very randomly...

The resizing seems to work under certain conditions, could it be because of a memory leak?

While I'm at it: Are there any debugging paramters I overlooked? Glaubst du es stört wenn wir hier auf deutsch schreiben?

m42a commented 11 years ago

The resize-test branch didn't contain a fix, it spews debugging information to the console so I can compare what's happening on my machine with what's happening on yours. This output will likely also show us why sometimes the refresh works for you and sometimes it doesn't. I added a new version with a lot more output, so if you capture that I'll have a much better idea of what's going on.

I'm using xmonad, a tiling WM.

The window redrawing mechanism is done via the Ctrl class; specifically the draw function, which all of the gui classes override. I believe the problem you're having with overlapping boards is that because the window isn't being resized the background isn't being marked as dirty, and so isn't being overwritten. The easy way to fix that is just to mark it every time a new game is started, but that should be happening anyway, since the board is supposed to resize. Fixing the resize issue will fix the overlapping issue.

p3732 commented 11 years ago

Okay, so here is what I have so far: Tried on Fluxbox - works fine. Ability to close through buitl-mechanism is given. Tried on LXDE, XFCE (And GNOME of course) - not working. Notably all these WM are kind of based on gtk.

I don't get any output with the resize-test branch. Do I have to pass certain parameters when compiling?

m42a commented 11 years ago

You should get output with just the default Makefile. The latest commit hash is 31d44323f894d3aa4bbf8b73585dfc01d8804fae; make sure you have that one. The output should just appear in your terminal.

p3732 commented 11 years ago

I don't get any terminal output with neither of the branches... Did make in the folder and then ./mines-perfect . Anything wrong with that?

m42a commented 11 years ago

No, that's exactly what I'm doing. Try doing a make clean before compiling the resize-test branch. It shouldn't matter, but...

p3732 commented 11 years ago

Did make clean aswell, even deleted the .ini file. Maybe I MainWindow simply gets no events?

p3732 commented 11 years ago

git whatchanged outputs this: Author: Marc Aldorasi m101010a@gmail.com Date: Sun Dec 23 10:00:02 2012 -0500

Alt-F4 now closes the program

:100644 100644 ec10050... 1fd8ab3... M wxwin/app.cpp

commit e2e4bbb00d6a3f09d95da23f91cae3384c171611 Author: Marc Aldorasi m101010a@gmail.com Date: Wed Sep 5 01:52:02 2012 -0400

Fixed warnings

[...]

Seems I am still on the old commit, however git pull says it's up to date. I even did git clone, but nothing. I'm now just gonna paste it over manually...

m42a commented 11 years ago

It can't get no events; painting the window is an event. Besides, there's output whenever a new game is started, and that has to run even if wxWidgets' events are being weird or else the program wouldn't be able to do anything.

p3732 commented 11 years ago

Okay so now with the manual paste I have the event messages. I tried to push some logging file, but seems I don't have permissions. So here is the description http://pastebin.com/8weDPJid And here is the actual log: http://pastebin.com/790QaeQE

m42a commented 11 years ago

It looks like your window manager is reverting the window's size for whatever reason. There's a new commit in the resize-test branch (11b4214ede358dcde76e04f61a2f2d2d1028a758) that makes the program a bit more forceful when setting the size; see if that helps.

And for the closing issue, can you upload a log of you trying to close it via super-x and then you closing it normally?

p3732 commented 11 years ago

Yay, resizing is working like a charm. Therefore the actual issue is fixed :smile: As for the close bug a log wouldn't help. I only get wxEVT_ACTIVATE events on key pressing. When I close it with Alt F4 it's like closing via menu. (Same events) Thanks for fixing, now it's usable.

m42a commented 11 years ago

Alright, just make sure it works on the new master branch and I can close this issue.

p3732 commented 11 years ago

Current branch is fine aswell. The close function thing isn't that important. It's rather a feature than really necessary, still it would be nice. Should I open a new issue or just leave it alone? Anyway thanks for fixing :)

m42a commented 11 years ago

Thanks for reporting this.

The thing about the close issue is I can't reproduce it (I even installed LXDE to try) and I'm not sure what might be causing it. In many cases the Alt-F4 workaround will be good enough, and both the exit menu item and X in the corner still work. I agree it would be nice, I'm just not sure how to go about even debugging it. You can open an issue if you want, just don't expect it to get any activity in the near future.