Skip to content

Port to GTK 3#37

Open
bgermann wants to merge 6 commits into
ferdymercury:mainfrom
bgermann:gtk3
Open

Port to GTK 3#37
bgermann wants to merge 6 commits into
ferdymercury:mainfrom
bgermann:gtk3

Conversation

@bgermann

@bgermann bgermann commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

This is a submission from Debian to port to GTK 3. The original patch used GooCanvas but is now available with its own Canvas abstraction in Debian unstable.

Fixes: #27
Fixes: #24

emollier and others added 5 commits February 2, 2026 01:30
There is no migration code; users will lose all their configuration.

I don't know why GConf was not used on Windows and macOS; I guess
it's because it is a different library.  Someone (upstream) with
access to these systems should verify if GSettings work there (it's
part of GLib so it should in theory) -- if that's the case it would
simplify the code a lot as much of amide_gconf.c will be removed
along with the *_with_default functions.

Addresses: ferdymercury#27
Unfortunately, the move to GTK 3 makes the main (study) window wider
even without an image loaded (#901677).  This is because some of the
widgets are larger, like GtkSpinButton with big "+" and "-" in it.
Additionally, GTK computes the width of the widget based on the
min/max values of the adjustment -- so the "thickness" button gets
wider than usual because the maximum allowed value is G_MAXDOUBLE.

A major hurdle was frequent aborts when using the custom log handler
due to a GLib bug (see src/amide.h).  The only solution I came up
with was to redefine the macros and avoid setting a custom handler.

The GtkCurve and GtkGammaCurve widgets were ported to GTK 3 but
stripped from some functionality that AMIDE doesn't need (functions
like gtk_curve_set_vector are not available, also the additional
buttons of the GtkGammaCurve widget).  As is required by GTK 3,
drawing is done to an off-screen buffer (a cairo surface) which is
then effectively drawn on the widget during the ::draw signal.

The GtkHandleBox widget was not ported so parts of the UI are no
longer detachable.  I didn't consider this functionality important
enough to bother (unlike GtkCurve/GtkGammaCurve).

The AmitkDial widget was modified to behave as with policy
GTK_UPDATE_DISCONTINUOUS, which is the only use within AMIDE.  Since
GTK 3 removed policy support in GtkRange-based widgets, all of the
widgets where GTK_UPDATE_DISCONTINUOUS is set (for a good reason)
were modified to connect to a "button-release-event" handler, as a
workaround.  The "value-changed" callback is invoked from there.

Fixes: ferdymercury#27
@ferdymercury

Copy link
Copy Markdown
Owner

Thanks for this huge effort! I guess we need someone with Windows to test these changes, before proceeding.

@desiderantes

Copy link
Copy Markdown
Collaborator

This is great, and would simplify my port to meson

Toolbar menu items "Thickness", "Field of view" and "Zoom" do nothing
but they are necessary -- if the window is resized so that the right
border is at one of these widgets, no drop-down arrow will be shown
so the user will not have access to the Gate/Time buttons.  Other
items from "Threshold" leftwards are proper GtkToolItems (rather than
widgets packed in a GtkToolItem) so their menus are fully functional
and will appear as normal/toggle/radio menu items.

Fixes ferdymercury#26.
@bgermann bgermann marked this pull request as ready for review February 6, 2026 10:12
@ferdymercury ferdymercury linked an issue Feb 6, 2026 that may be closed by this pull request
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.

Please switch to GTK 3 Window is too wide and not resizable Using GTK+ 2.x and GTK+ 3 in the same process is not supported

4 participants