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

Ported to GTK4 #290

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open

Ported to GTK4 #290

wants to merge 52 commits into from

Conversation

trigg
Copy link
Contributor

@trigg trigg commented Feb 16, 2025

Extensive changes to bring the code base up to working on GTK4.

Dependencies:

  • gtkmm 3 > 4 (same for gdk, glib so on)
  • gtk-layer-shell > gtk4-layer-shell
  • libdbusmenu-gtk3 > libdbusmenu-glib

Material changes overview:

  • The menus on system tray icons had to be rewritten from scratch as the supporting library appears to not be available for gtk4
    • Menu & items are regenerated when changed over the dbus wire
    • Icons appear to be getting ignored by Popover Menu. From all my reading this is intentional on GTK4s part
    • Dbus library answers that there are no tickbox or radio button variants despite testing intentionally for them. These menu items function correctly but don't display the radio/checkmark
    • I am convinced there are some memory leaks here and am squashing them as I find them
  • The entirety of the event handling side of GTK has been rewritten and redefined.
    • System tray icons, Window list windows and application menu context buttons are all now MenuButton allowing us to connect menu options to them
    • EventBox no longer exists, so event callbacks are connected in directly to widgets
    • Volume control slider popup stops scroll wheel & swipe events on button, so the popup no longer shows when volume changes
  • Size allocation events, Redraw events, Scale change events have been removed from gtk4 and considered "the wrong way to do things" for most uses
    • Widgets should not base their internal logic on position & size
    • Scale is left to GTK4 to account for in all cases
    • Icon size should be changed with CSS rules only
    • All icon_size options have been fed into CSS Styles that are generated & updated from config
  • Output management and hotplugging is managed differently and worth double and triple checking by people with less boring monitor layouts than mine
  • Font override is removed. The only way I can see to do this now is to set it via CSS. While feeding the data in from the config is possible the way people write this options currently won't work in GTK4
    • Size needs to be in pixels or css sizes like : 17px 1.2em 0.9rem

While I was in the area:

  • Implemented CSS directory loading for dock and background
  • Added some hover, open window & close window animations to default css
  • Added a dock window-close-animation option as it has adverse effects if you enable it but don't update your default css
  • Realised we'd be better served with a Gtk Revealer... but that's a bigger task that I'll do in a separate attempt.
  • Reworked Background, needs sanity check as I'm sure it'll leak memory

I'm sure there's more, and will edit this as and when possible.

I look forward to uncrustify.

trigg and others added 30 commits February 8, 2025 16:02
- - Almost everything is broken.
- - This is expected
- - This is insane.
- - No, how is this even usable
- - Well whatever.
- - Someone please valgrind because I'm sure there's lots of bad ideas here.
- Fixes #8
- Partially fixes #9
- - Menu icons are currently still not shown
- - Menu checkboxes and radios show as generic label only
- Fixes #15
- Fixes #20
- Some changes to SNI dbusmenu
- Getting occassional segfaults in SNI dbusmenu so these need a better read-through before calling it
- - Still inherently broken until dbusmenu-glib reports a type back
- Dock takes entire width but sets itself to click-through on the outside
- Switched panel to using CenterBox which does a better job than my implementation
- Moved CSS dir loading into base app class
- First attempt at output changes
- Output hot plugging sorted.
- - This will need testing by people with more than 1 external monitor to see if there's any unknowns.
- Add an option to animate icons removed from dock
- Added to default dock CSS
- Fixed #4
- Fixed rectangle hints in dock and panel
- Fixed volume scrolling
- Fixed changing fill type in background triggering a new image load
- Remove GTK interactive debugging
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