GTK 2 cleanups - #505
Merged
Merged
GTK 2 cleanups#505
Conversation
Reduce GTK2 implementation-detail dependencies in native widget rendering. - Replace direct GTK_WIDGET_SET_FLAGS / UNSET_FLAGS flag twiddling with public GTK2 APIs (gtk_widget_set_can_focus, gtk_widget_set_can_default, gtk_widget_set_sensitive) in GtkSalFrame::Init, NWSetWidgetState, and toolbar/toggle button rendering. GTK 2.18+ is the minimum required version. - Remove redundant sensitivity flag manipulation in toolbar, grip, menubar, and popup menu rendering. - Consolidate repetitive widget style realization and default flag capture into NWInitWidget(). - Use sal_IntPtr for gWidgetDefaultFlags hash_map key for 64-bit portability. - Clean up gWidgetDefaultFlags and gWidgetData in GtkData::deInitNWF(). No functional change intended.
Replace direct access to GTK internal struct members (m_pWindow->window, ->style) with public GTK2 APIs (gtk_widget_get_window, gtk_widget_get_style) through safe accessor methods getGdkWindow() and getXWindow() on GtkSalFrame. - Add getGdkWindow()/getXWindow() accessors on GtkSalFrame with null guards - Update GtkSalGraphics::GetGdkWindow() to use gtk_widget_get_window() - Remove unused GetGtkWidget() (0 callers) - Replace all m_pWindow->window accesses with getGdkWindow()/getXWindow() - Replace GTK_WIDGET(m_pWindow)->window with GetGdkWindow() - Replace m_pWindow->style with gtk_widget_get_style() - Replace m_pSocket->window with gtk_widget_get_window(m_pSocket) - Replace GDK_WINDOW_XWINDOW(GTK_WIDGET(pParent->getWindow())->window) with pParent->getXWindow() - Add DeInit() call before graphics deletion in GraphicsHolder destructor - Sync window/drawable when returning existing cached graphics instance - Detach/resync all allocated graphics (pGraphics != NULL), not just bInUse, in createNewWindow() and moveToScreen() - Reset m_pWindow = NULL in GtkSalGraphics destructor - Guard gdkDrawable and GetGdkWindow() against NULL to prevent painting when widget is unmapped or destroyed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GTK/X11 event and window cleanup
Isolate GTX/X11 functions (will make it easier to run on Wayland)
This is essential for the more fundamental changes coming forward.