Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with wx.aui.AuiManager (wxWidget 3.1.6 --> 3.1.7) #22533

Closed
komoto48g opened this issue Jun 15, 2022 · 13 comments
Closed

Problem with wx.aui.AuiManager (wxWidget 3.1.6 --> 3.1.7) #22533

komoto48g opened this issue Jun 15, 2022 · 13 comments
Labels
regression Worked previously, doesn't work any longer
Milestone

Comments

@komoto48g
Copy link

The problem is with wx.aui.AuiManager on wxPython, and I reported it on Phoenix issue tracker: wxWidgets/Phoenix#2187.
This occurs in the latest snapshot of wxPython which is built on the new version wxWidget 3.1.7.
It seems to be coming from upstream (wxWidget), but with MSW only, not with other platforms.

Describe the bug
Each time you drag one floating pane window, the other floating panes drift.
In the demo video, every time you drag the pane [p1], the pane [p2] drifts. It will no longer move once you touch the pane [p2].

isuue-aui-manager_clip.mp4
@vadz
Copy link
Contributor

vadz commented Jun 15, 2022

Sorry, I can't reproduce this with the following patch which seems to faithfully reproduce your Python example:

diff --git a/samples/aui/auidemo.cpp b/samples/aui/auidemo.cpp
index 1e415b311b..1816bef0d2 100644
--- a/samples/aui/auidemo.cpp
+++ b/samples/aui/auidemo.cpp
@@ -668,6 +668,7 @@ bool MyApp::OnInit()
     // set frame icon
     SetIcon(wxIcon(sample_xpm));
 
+#if 0
     // set up default notebook style
     m_notebook_style = wxAUI_NB_DEFAULT_STYLE | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER;
     m_notebook_theme = 0;
@@ -1001,6 +1002,13 @@ bool MyApp::OnInit()
 
     m_perspectives.Add(perspective_default);
     m_perspectives.Add(perspective_all);
+#else
+    m_mgr.AddPane(new wxPanel(this), wxAuiPaneInfo().CenterPane());
+    m_mgr.AddPane(new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(100, 100)),
+                  wxAuiPaneInfo().Float().Caption("p1"));
+    m_mgr.AddPane(new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(100, 100)),
+                  wxAuiPaneInfo().Float().Caption("p2"));
+#endif
 
     // "commit" all changes made to wxAuiManager
     m_mgr.Update();

There must be something specific to your setup which triggers this bug, but I have no idea what could it be...

@vadz vadz added the repro needed A way to reproduce the problem is required label Jun 15, 2022
@komoto48g
Copy link
Author

Thank you for taking the time to check this problem. It is mysterious... I'll also ask the Phoenix community.

@komoto48g
Copy link
Author

This can be reproduced on Windows 10 64bit / wxWidgets-3.1.7 build with VS 2019.

Code Example (click to expand)
#include <wx/wx.h>
#include <wx/aui/aui.h>

class MyFrame : public wxFrame
{
public:
    MyFrame(wxWindow* parent) : wxFrame(parent, -1, _("wxAUI Test"),
        wxDefaultPosition, wxSize(400, 300),
        wxDEFAULT_FRAME_STYLE)
    {
        m_mgr.SetManagedWindow(this);

        wxTextCtrl* text0 = new wxTextCtrl(this, -1, _("Main content window"),
            wxDefaultPosition, wxSize(200, 150),
            wxNO_BORDER | wxTE_MULTILINE);

        wxTextCtrl* text1 = new wxTextCtrl(this, -1, _("Pane 1 - sample text"),
            wxDefaultPosition, wxSize(200, 150),
            wxNO_BORDER | wxTE_MULTILINE);

        wxTextCtrl* text2 = new wxTextCtrl(this, -1, _("Pane 2 - sample text"),
            wxDefaultPosition, wxSize(200, 150),
            wxNO_BORDER | wxTE_MULTILINE);

        m_mgr.AddPane(text0, wxAuiPaneInfo().CenterPane());
        m_mgr.AddPane(text1, wxAuiPaneInfo().Float().Caption("p1"));
        m_mgr.AddPane(text2, wxAuiPaneInfo().Float().Caption("p2"));

        m_mgr.Update();
    }

    ~MyFrame()
    {
        m_mgr.UnInit();
    }

private:
    wxAuiManager m_mgr;
};

class MyApp : public wxApp
{
public:
    bool OnInit()
    {
        wxFrame* frame = new MyFrame(NULL);
        SetTopWindow(frame);
        frame->Show();
        return true;
    }
};

DECLARE_APP(MyApp);
IMPLEMENT_APP(MyApp);

@Kvaz1r
Copy link
Contributor

Kvaz1r commented Jul 14, 2022

Code Example (click to expand)

I can reproduce the bug with this code, it was introduced in commit e777a82

@vadz
Copy link
Contributor

vadz commented Jul 14, 2022

Thanks for debugging this!

@valid-ptr Could you please look at this, as this seems to be due to your change?

@vadz vadz added regression Worked previously, doesn't work any longer and removed repro needed A way to reproduce the problem is required labels Jul 14, 2022
@vadz vadz added this to the 3.2.1 milestone Jul 14, 2022
@acotty
Copy link

acotty commented Jul 19, 2022

It is reproduce able in Code::Blocks on Windows built with wxWidgets 3.1.7 or 3.2.0, but not 3.1.6. I have build 3.1.6. with the 3.1.7 src\aui\floatpane.cpp file and it has the issue.

C::B discussion about this can be seen in the following thread:
https://forums.codeblocks.org/index.php/topic,25031.new.html#new

@vadz
Copy link
Contributor

vadz commented Jul 19, 2022

If there are no comments from @valid-ptr we're going to revert e777a82 to fix this.

@valid-ptr
Copy link
Contributor

Hi! Sorry for delay.

I've checked it right now.
I can reproduce this bug on Windows, but I can't reproduce it on GTK3 under Linux.
I can't reproduce it on macos also.

So, it seems to be a bug on windows platform only.

@vadz
Copy link
Contributor

vadz commented Jul 19, 2022

Thanks for looking at this!

The problem is that it's a regression, i.e. it worked correctly before. As I don't know what's going on here and probably won't have time to debug it, reverting the change is the simplest way to fix this bug for me. If you can find another way to fix it while also preserving your original fix, it would be even better, of course, but we need to fix it in some way.

@valid-ptr
Copy link
Contributor

valid-ptr commented Jul 19, 2022

PR #22651 solves this problem.

@vadz
Copy link
Contributor

vadz commented Jul 19, 2022

Thanks for the fix, it looks like this should indeed restore the old behaviour but if people could please confirm that this fixes the problem in their applications, it would be still welcome. TIA!

@acotty
Copy link

acotty commented Jul 19, 2022

PR #22651 fixes the issue I have been seeing with C::B floating panes.

@komoto48g
Copy link
Author

PR #22651 fixes the problem.
I confirmed it on Windows 10 64bit with VS 2019. Thank you very much!

vadz pushed a commit that referenced this issue Jul 25, 2022
Fix position updating broken since the recent changes of e777a82 (Fix
AUI floating position mismatch, 2022-05-25).

See #22533.

Closes #22651.
vadz pushed a commit that referenced this issue Jul 30, 2022
Fix position updating broken since the recent changes of e777a82 (Fix
AUI floating position mismatch, 2022-05-25).

Closes #22533.

(cherry picked from commit 0e57ed1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression Worked previously, doesn't work any longer
Projects
None yet
Development

No branches or pull requests

5 participants