Skip to content

Add GNOME 50 support and fix deprecated GTK4 widgets#171

Open
kongvut wants to merge 1 commit into
neuromorph:mainfrom
kongvut:gnome-50-support
Open

Add GNOME 50 support and fix deprecated GTK4 widgets#171
kongvut wants to merge 1 commit into
neuromorph:mainfrom
kongvut:gnome-50-support

Conversation

@kongvut
Copy link
Copy Markdown

@kongvut kongvut commented May 24, 2026

Summary

  • Add GNOME 50 to shell-version in metadata.json
  • Fix DateMenu clearButton index for GNOME 49+ (DND button was removed, index changed from 1 to 0)
  • Add try-catch and null guards for DateMenu widget tree traversal to handle future internal changes
  • Add safety guards for private API access (_bannerBin, _bgManagers, panel boxes, _calendar)
  • Replace all deprecated GTK4 widgets in prefs.js with modern equivalents

Changes

extension.js

  • DateMenu: fixed clearBtn = msgHbox.get_child_at_index(1)get_child_at_index(0) for GNOME 49+
  • Wrapped DateMenu tree traversal in try-catch with ?. null guards
  • Added null checks for Main.messageTray._bannerBin (3 locations)
  • Added ?. guard for Main.layoutManager._bgManagers
  • Added .filter(Boolean) for panel._leftBox/_centerBox/_rightBox
  • Added null guard for Main.panel.statusArea?.dateMenu?._calendar

prefs.js

  • Gtk.MessageDialogAdw.MessageDialog
  • Gtk.FileChooserDialogGtk.FileDialog (async open/save API)
  • Gtk.ColorButtonGtk.ColorDialogButton (signal: color-setnotify::rgba)
  • Gtk.FontButtonGtk.FontDialogButton (signal: font-setnotify::font-desc, added Pango import)
  • Gtk.ComboBoxTextGtk.DropDown + Gtk.StringList with manual index↔id mapping
  • get_style_context().add_class()add_css_class()

metadata.json

  • Added "50" to shell-version array

Test plan

  • Load extension on GNOME 50 — verify no crashes on startup
  • Open DateMenu — verify notifications, calendar grid, clear button styled correctly
  • Open prefs window — verify all combo boxes, color buttons, font button work
  • Test import/export settings via file dialog
  • Test reset settings dialog
  • Verify panel styling applies correctly (bar, menus, dash)
  • Check for no console errors in journalctl /usr/bin/gnome-shell

🤖 Generated with Claude Code

- Add GNOME 50 to shell-version in metadata.json
- Fix DateMenu clearButton index for GNOME 49+ (DND button removed)
- Add try-catch and null guards for DateMenu widget tree traversal
- Add safety guards for private API access (_bannerBin, _bgManagers,
  panel boxes, _calendar)
- Replace deprecated Gtk.MessageDialog with Adw.MessageDialog
- Replace deprecated Gtk.FileChooserDialog with Gtk.FileDialog (async API)
- Replace deprecated Gtk.ColorButton with Gtk.ColorDialogButton
- Replace deprecated Gtk.FontButton with Gtk.FontDialogButton
- Replace deprecated Gtk.ComboBoxText with Gtk.DropDown + StringList
- Replace deprecated get_style_context().add_class() with add_css_class()

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant