| e1397ed7 | 12-Sep-2026 |
Pedro Giffuni <pfg@apache.org> |
vcl: GTK2 ownership and lifecycle audit.
Re-architected the GTK2 backend event dispatch pipeline in Apache OpenOffice by replacing linear frame searches with a centralized, O(1) X11 window-to-frame
vcl: GTK2 ownership and lifecycle audit.
Re-architected the GTK2 backend event dispatch pipeline in Apache OpenOffice by replacing linear frame searches with a centralized, O(1) X11 window-to-frame lookup map (m_aWindowFrameMap).
Separated low-level X11 event routing into GtkSalFrame::dispatchXEvent() with explicit event consumption semantics while enforcing lifecycle invariants and registration safety. Changes
Implemented findFrameByXWindow(), registerFrameWindow(), and deregisterFrameWindow() using std::map<XLIB_Window, GtkSalFrame*> in GtkSalDisplay (gtkdata.hxx, gtkdata.cxx), rejecting duplicate registrations with diagnostic logging.
Replaced linear m_aFrames scans in GtkSalDisplay::filterGdkEvent and GtkSalDisplay::Dispatch with direct map lookup.
Extracted GtkSalFrame::dispatchXEvent() in gtkframe.hxx and gtkframe.cxx to handle PropertyNotify, foreign-window ConfigureNotify, and _NET_WM_XEMBED client messages with explicit handling indicators, while retaining legacy Dispatch() as a continuation wrapper.
Hardened GtkSalFrame lifecycle state handling (InitCommon, moveToScreen, createNewWindow, and ~GtkSalFrame) to deregister old X11 window IDs prior to widget realization/recreation and cleanly reset intermediate window state.
Verification
Audited all call sites and lifecycle paths (InitCommon, createNewWindow, moveToScreen, frame destruction, and foreign window resizing) to confirm window IDs are registered only after realization and deregistered before widget teardown.
Verified that dispatchXEvent() null guards protect against unrealized widget access and that legacy callers of Dispatch() retain identical continuation semantics.
Produced with JetBrain's CLion with some help from ChatGPT
show more ...
|
| 02b513ef | 25-Jul-2026 |
Peter Kovacs <petko@apache.org> |
sal/vcl: Win64 (x64) runtime source fixes -- thread key + window pointers
Pointer-width fixes on the runtime boot path (all compile unchanged on x86; dmake-backportable):
- sal osl/thread.h: oslThr
sal/vcl: Win64 (x64) runtime source fixes -- thread key + window pointers
Pointer-width fixes on the runtime boot path (all compile unchanged on x86; dmake-backportable):
- sal osl/thread.h: oslThreadKey sal_uInt32 -> sal_uIntPtr. The w32 osl_createThreadKey returns a heap PTLS* stuffed into the key; on LLP64 that 64-bit pointer was truncated, so osl_getThreadKeyData dereferenced garbage (first crash: cppu getIdContainer during InitVCL). Not present in origin/windows-amd64 (their thread.h/.c match trunk) -- authored here. - vcl win/saldata: ImplSet/GetWindowLong -> LONG_PTR + Set/GetWindowLongPtrW, SetWindowPtr/SetSalObjWindowPtr (LONG)->(LONG_PTR) (frame pointer stored in the window's extra bytes was truncated -> sign-extended garbage in UpdateFrameGeometry) (ref 9b64d14c8d); SAL_FRAME/OBJECT_WNDEXTRA sizeof(DWORD) -> sizeof(ULONG_PTR) so the 8-byte pointer fits the reserve (added beyond the reference, which relied on Windows over-allocating); ImplSendMessage BOOL -> LRESULT (WinSalInstance::CreateFrame/CreateObject route the new SalFrame*/SalObject* back as the SAL_MSG_CREATE* message result -- BOOL truncated it, causing an AV in SalFrame::SetCallback; also fixes the latent HDC/HWND truncations at the other call sites).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> (cherry picked from commit cc0a3ed6d1e1f10040e030b974c4b0ab9c6fbf17) (cherry picked from commit 1ac44d4c16cd8c7fb00879e708b1c066c88ccc26)
show more ...
|