Menu

#737 [HexEditor] Unwanted shift of focus by mouse movement

Undefined
open
nobody
None
Undefined
2018-09-20
2018-09-16
bluehazzard
No

windows 7 64 bit
trunk
wx304
TDM-GCC 5.1

steps to reproduce:
1) Open codeblocks
2) File->Open with hex editor
3) Open file A
4) File->Open wiht hex editor
5) Open file B
6) Activate Tab of file B
7) Move mouse from the tabs to the editor up and down. This will focus the tab of file A. No clicking, just moving the mouse from the editor window to the tab window. I am not quite sure what movements are needed to trigger this.

This only happens with the hex editor tabs, not with normal tabs

Discussion

  • bluehazzard

    bluehazzard - 2018-09-16

    It will always focus the first hex editor tab

     
  • Miguel Gimenez

    Miguel Gimenez - 2018-09-17

    This happens to me for a couple of years now, but also with normal editor tabs: Hovering over the tabs causes a tab to be selected.

    I can't reproduce reliably, and lately it seems to be gone. Maybe the change to wxWidgets 3.1.1 has cured it.

     
  • Teodor Petrov

    Teodor Petrov - 2018-09-17

    I think this is by design...

     
  • bluehazzard

    bluehazzard - 2018-09-17

    I hope not, because it is unusable with this bug. Every time you klick on one file tab, move the mouse to the editor it opens the first tab. You can basically not select the wanted tab. I don't know where to start the search.. i will try wx31 and see if it is fixed...

     
  • Teodor Petrov

    Teodor Petrov - 2018-09-17

    Let me know if you find something.
    There is code specifically to do focus follow mouse on windows in the cbAuiNotebook if I remember correctly.

     
  • bluehazzard

    bluehazzard - 2018-09-19

    I tried now with wx310 and the bug is still present...
    this is a backtrace of the manifestation of this bug:

    #0 ??   wxAuiNotebook::SetSelection (this=0x1d9fbe58, new_page=1) (../../src/aui/auibook.cpp:2250)
    #1 0xd91675c    wxAuiNotebook::OnChildFocusNotebook(this=0x1d9fbe58, evt=...) (../../src/aui/auibook.cpp:3039)
    #2 0xd3c4144    wxAppConsoleBase::HandleEvent (this=0x1d697dc8, handler=0x1d9fbe58, func=(void (wxEvtHandler::*)(wxEvtHandler * const, wxEvent &) (../../src/common/appbase.cpp:657)
    #3 0xd3c41a0    wxAppConsoleBase::CallEventHandler(this=0x1d697dc8, handler=0x1d9fbe58, functor=..., event=...) (../../src/common/appbase.cpp:669)
    #4 0xd4e69c7    wxEvtHandler::ProcessEventIfMatchesId(entry=..., handler=0x1d9fbe58, event=...) (../../src/common/event.cpp:1381)
    #5 0xd4e5519    wxEventHashTable::HandleEvent(this=0x3d94204 <cbAuiNotebook::sm_eventHashTable>, event=..., self=0x1d9fbe58) (../../src/common/event.cpp:989)
    #6 0xd4e6e93    wxEvtHandler::TryHereOnly(this=0x1d9fbe58, event=...) (../../src/common/event.cpp:1578)
    #7 0xdd39f88    wxEvtHandler::TryBeforeAndHere(this=0x1d9fbe58, event=...) (../../include/wx/event.h:3656)
    #8 0xd4e6c0f    wxEvtHandler::ProcessEvent(this=0x1d9fbe58, event=...) (../../src/common/event.cpp:1480)
    #9 0xd4e6d39    wxEvtHandler::DoTryChain(this=0x1d9fc028, event=...) (../../src/common/event.cpp:1543)
    #10 0xd4e6c9a   wxEvtHandler::ProcessEventLocally(this=0x1d9fc028, event=...) (../../src/common/event.cpp:1511)
    #11 0xd4e6c24   wxEvtHandler::ProcessEvent(this=0x1d9fc028, event=...) (../../src/common/event.cpp:1484)
    #12 0xd722c62   wxWindowBase::TryAfter(this=0x26c896e8, event=...) (../../src/common/wincmn.cpp:3457)
    #13 0xd4e6c4f   wxEvtHandler::ProcessEvent(this=0x26c896e8, event=...) (../../src/common/event.cpp:1497)
    #14 0xd722c62   wxWindowBase::TryAfter(this=0x265d24e8, event=...) (../../src/common/wincmn.cpp:3457)
    #15 0xd4e6c4f   wxEvtHandler::ProcessEvent(this=0x265d24e8, event=...) (../../src/common/event.cpp:1497)
    #16 0xd4e6f54   wxEvtHandler::SafelyProcessEvent(this=0x265d24e8, event=...) (../../src/common/event.cpp:1602)
    #17 0xd71c3a0   wxWindowBase::HandleWindowEvent(this=0x265d24e8, event=...) (../../src/common/wincmn.cpp:1534)
    #18 ??  0x0d586854 in wxWindow::HandleSetFocus (this=0x265d24e8, hwnd=0x45096c <EnvironmentSettingsDlg::EnvironmentSettingsDlg(wxWindow*, wxAuiDockArt*)+14520>) (../../src/msw/window.cpp:3962)
    #19 0xd5838db   wxWindow::MSWHandleMessage(this=0x265d24e8, result=0x28eb98, message=7, wParam=4524396, lParam=0) (../../src/msw/window.cpp:2790)
    #20 0xd5853f2   wxWindow::MSWWindowProc(this=0x265d24e8, message=7, wParam=4524396, lParam=0) (../../src/msw/window.cpp:3524)
    #21 0xd5830b3   wxWndProc(HWND__*, unsigned int, unsigned int, long)@16(hWnd=0x1e0d2e, message=7, wParam=4524396, lParam=0) (../../src/msw/window.cpp:2667)
    #22 0x759262fa  gapfnScSendMessage() (C:\Windows\syswow64\user32.dll:??)
    #23 0x1e0d2e    ?? () (??:??)
    #24 0x7 ?? () (??:??)
    #25 ??  0x0045096c in EnvironmentSettingsDlg::EnvironmentSettingsDlg (this=0x28ddec, parent=0xd58300a <wxWndProc(HWND__*, unsigned int, unsigned int, long)@16>, art=0x1e0d2e) ([..]codeblocks_sf\src\src\environmentsettingsdlg.cpp:278)
    #26 0x75926d3a  USER32!GetThreadDesktop() (C:\Windows\syswow64\user32.dll:??)
    #27 0xd58300a   wxWindowCreationHook::~wxWindowCreationHook(this=0x75926d3a <USER32!GetThreadDesktop+215>, __in_chrg=<optimized out>) (../../src/msw/window.cpp:2628)
    #28 0x1e0d2e    ?? () (??:??)
    #29 0x7 ?? () (??:??)
    

    no codeblocks function involved... Does someone know how i get the source of send events?

    The fired event is a WM_SETFOCUS event...

     

    Last edit: bluehazzard 2018-09-19
  • Teodor Petrov

    Teodor Petrov - 2018-09-20

    Inspect the source of our direved auibook class and disable anything related to focusing to see if this goes away.

     
  • bluehazzard

    bluehazzard - 2018-09-20

    Ok, if i deactivate this events wxEVT_ENTER_WINDOW, and wxEVT_LEAVE_WINDOW of cbAuiBook the bug does not happen. But it also deactivates the scrolling of the tabs with the mousewheel.

    The error is in void cbAuiNotebook::StoreFocus() and the used wxWindow::FindFocus() function, what returns a wrong window. As far as i can tell for HexEditor tabs, it always returns the first availible HexEditor tab. I have no idea why... I will try to compare cbEditor and HexEditor classes and look if they do something different...

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.