openMSX / wxcatapult

23 stars 4 forks source link

[Bug] When I press "Start" Button, catupult's window enlarging [sf#291] #13

Closed openMSX-import closed 9 years ago

openMSX-import commented 9 years ago

Reported by fhorse on 2008-07-19 14:07 UTC Every time I press "Stop" Button, catupult's window enlarging by one pixel both horizontally and vertically. Sorry for my english.

openMSX-import commented 9 years ago

Commented by fhorse on 2008-07-19 14:35 UTC Logged In: YES user_id=2152678 Originator: YES

Sorry, when I press "Start" button, my mistake

openMSX-import commented 9 years ago

Updated by fhorse on 2008-07-19 14:35 UTC

openMSX-import commented 9 years ago

Commented by manuelbi on 2008-07-20 12:05 UTC Logged In: YES user_id=78178 Originator: NO

Thanks for your bug report.

We are currently working on a completely redesigned Catapult application. Unfortunately we are not very motivated to fix (small) problems on the old Catapult... So, I'm sorry to say that there's little chance that we will pick up this particular bug. If you'd like to try out the new Catapult, visit us on IRC :)

openMSX-import commented 9 years ago

Updated by manuelbi on 2008-07-20 12:05 UTC

openMSX-import commented 9 years ago

Commented by fhorse on 2008-07-22 15:26 UTC Logged In: YES user_id=2152678 Originator: YES

ok, thx for the answer (and of course for openmsx ;)).

openMSX-import commented 9 years ago

Commented by joxy on 2013-07-24 05:04 UTC I can reproduce this issue.

openMSX-import commented 9 years ago

Commented by joxy on 2013-07-24 05:25 UTC Some observations.

When this button reads as Stop and is clicked, the frame's size is not changed.

When this button reads as Start and is clicked, the button immediately gets disabled, and the frame's size is not changed. The frame size gets changes AFTER the moment when the button gets enabled.

openMSX-import commented 9 years ago

Commented by joxy on 2013-07-24 05:41 UTC The only code which seems to be executing at that moment is:

    Enable(true);
    m_safetyTimer.Stop();

so this must be a quirk of wx's wxWindow::Enable(true).

More observations:

When the frame size is changed,

openMSX-import commented 9 years ago

Commented by joxy on 2013-07-24 05:43 UTC It might be a GNOME/MATE quirk though (I use MATE).

openMSX-import commented 9 years ago

Commented by joxy on 2013-07-24 05:54 UTC No. I have found a wonderful code:

void openMSXController::FinishLaunch()
        ...
    wxSize tempsize = m_appWindow->GetSize();
    tempsize.SetHeight(tempsize.GetHeight()+1);
    tempsize.SetWidth(tempsize.GetWidth()+1);
    m_appWindow->SetSize(tempsize);
#ifdef __WXMSW__
    tempsize.SetHeight(tempsize.GetHeight()-1);
    tempsize.SetWidth(tempsize.GetWidth()-1);
    m_appWindow->SetSize(tempsize);
#endif
openMSX-import commented 9 years ago

Commented by joxy on 2013-07-24 06:24 UTC I don't want to support anything under Windows, so the following strange code remains purely for Windows-likers:

#ifdef __WXMSW__
    wxSize tempsize = m_appWindow->GetSize();
    tempsize.SetHeight(tempsize.GetHeight()+1);
    tempsize.SetWidth(tempsize.GetWidth()+1);
    m_appWindow->SetSize(tempsize);
    tempsize.SetHeight(tempsize.GetHeight()-1);
    tempsize.SetWidth(tempsize.GetWidth()-1);
    m_appWindow->SetSize(tempsize);
#endif
openMSX-import commented 9 years ago

Commented by joxy on 2013-07-24 06:28 UTC Here's a very small patch fixing a non-Windows configs. Attached file patch3.txt:

Index: openMSXController.cpp
===================================================================
--- wxcatapult/src/openMSXController.cpp    (revision 13250)
+++ wxcatapult/src/openMSXController.cpp    (working copy)
@@ -816,11 +816,11 @@
 void openMSXController::FinishLaunch()
 {
    m_appWindow->m_sessionPage->AutoPlugCassette();
+#ifdef __WXMSW__
    wxSize tempsize = m_appWindow->GetSize();
    tempsize.SetHeight(tempsize.GetHeight()+1);
    tempsize.SetWidth(tempsize.GetWidth()+1);
    m_appWindow->SetSize(tempsize);
-#ifdef __WXMSW__
    tempsize.SetHeight(tempsize.GetHeight()-1);
    tempsize.SetWidth(tempsize.GetWidth()-1);
    m_appWindow->SetSize(tempsize);
openMSX-import commented 9 years ago

Commented by joxy on 2013-07-26 10:28 UTC After more testing on Linux, I found out that this patch is not enough. The audio controls layout is broken after the moment openmsx has started. I need to prepare a more correct patch.

openMSX-import commented 9 years ago

Updated by joxy on 2013-07-27 05:10 UTC

openMSX-import commented 9 years ago

Commented by joxy on 2013-07-27 05:10 UTC commit e13b5befe8792f620ee8f89ba2a5f9f191385109 .

fixed for non-Windows.

removing bad code and testing is needed for Windows.

openMSX-import commented 9 years ago

Updated by joxy on 2013-07-27 10:00 UTC

openMSX-import commented 9 years ago

Commented by joxy on 2013-07-27 10:00 UTC Fix for Windows needs to be tested.

openMSX-import commented 9 years ago

Commented by joxy on 2013-07-30 06:02 UTC tested under mingw32.

openMSX-import commented 9 years ago

Commented by joxy on 2013-08-01 05:12 UTC vc 32 tested fine.

openMSX-import commented 9 years ago

Updated by joxy on 2013-08-01 05:13 UTC