Skip to content

Port to Gtk4#780

Merged
danirabbit merged 217 commits into
masterfrom
jeremypw/gtk4
Nov 17, 2025
Merged

Port to Gtk4#780
danirabbit merged 217 commits into
masterfrom
jeremypw/gtk4

Conversation

@jeremypw

@jeremypw jeremypw commented Sep 4, 2024

Copy link
Copy Markdown
Collaborator

Fixes #643

TODO

  • Extract what can be done in Gtk3
  • Finish drop onto terminal widget
  • Fix cancelling close tab with foreground process
  • Get tests working (stable, excluding "quit" action test).
  • TerminalWidget: Check match_keycode () works for non-standard keyboard layouts
  • TerminalView: Check drop on add button contains uri-list

Notes:

  • CheckButtons do not seem to work with only an action_target (no action name) in Gtk4 so the theme string is now added as data. Smaller diff than creating an action to change the theme.
  • Theme buttons needed to have different css class names added to them when their provider is added to the display else they overwrite each other. Adding the providers to the buttons own style context did not work.
  • Application tests have been inactivated pending finding out why they do not work under Gtk4. CI now expected to fail for stable and unstable but pass for development target.
  • vte-2.91-gtk4 (?) seems to have a bug in the native handling of copy paste. This did not work as is does under Gtk3 even if the keypress controller was removed. So for now we handle both modes.
  • Since we already have a keycontroller, it is easier to implement keyboard zooming in the handler rather than create zoom actions and Gtk.Shortcuts.
  • Application.add_accels_for_action only works for global action so added shortcuts for terminal actions using a ShortcutController.
  • Ctrl-Scroll Zoom is simplified and is smoother. KeyController is no longer involved. At present any combination of modifiers including <Control> works but that is easily changed if required.
  • Unit tests now all work on the stable build (excluding the "quit" action test)
  • Unit tests other than ApplicationTests also work on unstable and development-target builds

Comment thread src/Widgets/TerminalWidget.vala Outdated
Comment thread src/Widgets/TerminalWidget.vala Outdated
jeremypw and others added 3 commits October 21, 2025 16:01
Correct parameter type

Co-authored-by: Leo <lenemter@gmail.com>
# Conflicts fixed:
#	src/MainWindow.vala
#	src/Widgets/TerminalWidget.vala
@jeremypw jeremypw requested a review from lenemter October 21, 2025 15:56
Comment thread src/Dialogs/ColorPreferencesDialog.vala Outdated
# Conflicts fixed:
#	src/MainWindow.vala
#	src/Widgets/SettingsPopover.vala
#	src/Widgets/TerminalView.vala
@jeremypw jeremypw changed the title Trial Port to Gtk4 Port to Gtk4 Oct 23, 2025
@jeremypw jeremypw requested a review from lenemter October 23, 2025 14:43
@lenemter

Copy link
Copy Markdown
Member

Found an interesting bug:

  1. Open settings popover
  2. Disable automatic system theme and select a theme
  3. Close popover and open it again
  4. Start toggling "Auto-Hide tab Bar"
  5. After a while the popover closes and never opens again. When this happens these warnings are produced:
(io.elementary.terminal:39260): Gtk-CRITICAL **: 18:23:05.082: GtkBox 0x5cb2fe443dd0 reports a minimum width of 32, but minimum width for height of 1048576 is 207. Expect overlapping widgets.

(io.elementary.terminal:39260): Gtk-CRITICAL **: 18:23:05.082: GtkBox 0x5cb2fe443dd0 reports a minimum width of 32, but minimum width for height of 1048576 is 207. Expect overlapping widgets.

(io.elementary.terminal:39260): Gtk-CRITICAL **: 18:23:05.082: GtkBox 0x5cb2fe443dd0 reports a minimum width of 32, but minimum width for height of 1048576 is 207. Expect overlapping widgets.

@jeremypw

Copy link
Copy Markdown
Collaborator Author

@lenemter Couldn't reproduce that bug on Wayland (Secure Session) but it happened on X (Classic Session). It may be an upstream bug. I'll look into it further.

@jeremypw

jeremypw commented Oct 24, 2025

Copy link
Copy Markdown
Collaborator Author

It seems that bug occurs with any of the toggle switches. It may be related to the revealers associated with them - not sure these are really needed?

Oh, these are part of the Granite.SwitchModelButton so the bug may be there. Not sure its worth changing this widget as X is on the way out.

@jeremypw

Copy link
Copy Markdown
Collaborator Author

Hmm, triggering this bug under gdb with G_DEBUG=fatal-criticals causes the whole desktop to lockup so cannot get the backtrace. Looks like an upstream bug.

@danirabbit

Copy link
Copy Markdown
Member

@jeremypw can you resolve conflicts here please?

@danirabbit danirabbit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd like to get this merged so we can get some wider testing and watch for regressions and make sure this doesn't just diverge from master and get lost

# Conflicts:
#	src/Widgets/TerminalWidget.vala
@jeremypw

Copy link
Copy Markdown
Collaborator Author

@danirabbit Conflict fixed. Would you mind if I release v 7.1.3 first as that is almost ready? There is only one PR targeted at it remaining and that could be dropped from the release if necessary.

@danirabbit

Copy link
Copy Markdown
Member

@jeremypw not at all, though it looks like you have some new features so probably merits a 7.2 ;)

@danirabbit

Copy link
Copy Markdown
Member

@jeremypw just wanna double check before hitting the button that you're okay if we merge :)

@jeremypw

Copy link
Copy Markdown
Collaborator Author

@danirabbit Let's do it!

@jeremypw

Copy link
Copy Markdown
Collaborator Author

Should the development branch be renamed main after merging the Gtk4 port?

@danirabbit

Copy link
Copy Markdown
Member

Yup! I realized we don't have a packaging update prepared, so I will do that and then merge and rename the development branch etc

@danirabbit danirabbit mentioned this pull request Nov 17, 2025
@danirabbit danirabbit merged commit 76febb2 into master Nov 17, 2025
4 checks passed
@danirabbit danirabbit deleted the jeremypw/gtk4 branch November 17, 2025 20:08
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.

Port Terminal to GTK4

4 participants