Skip to content

Gtk not working on MacOS Sonoma 14.4 or 14.4.1 #698

@JeffFessler

Description

@JeffFessler

The MWE code below works perfectly fine on MacOS Ventura 13.6.6 but on Sonoma 14.4.1 it produces numerous warnings like this:

(<unknown>:18639): Gtk-WARNING **: 21:31:19.255: drawing failure for widget 'GtkButton': the surface type is not appropriate for the operation

I am using Julia 1.10.2 and Gtk v1.3.0 in both cases. (There could be other environment differences and I cannot pin down exactly when it stopped working.)

Furthermore, the GUI shows just a blank white screen at first, and only after moving the mouse into the GUI and clicking and moving the mouse out again does the "Click Me" text finally appear. This is a disastrous state for trying to use Gtk with Sonoma. I am teaching a class where >60 students are trying to use GUIs like this so I am pleading for help!

This code was working earlier this semester, so it is possible that Sonoma 14.4 (Mar. 7) or 14.4.1 (Mar. 25) caused it to stop working. If anyone could test with Sonoma 14.3 that would be helpful!

The code is based on https://juliagraphics.github.io/Gtk.jl/latest/manual/gettingStarted

using Gtk

win = GtkWindow("My First Gtk.jl Program", 400, 200)

b = GtkButton("Click Me")
push!(win,b)

function on_button_clicked(w)
  println("The button has been clicked")
end
signal_connect(on_button_clicked, b, "clicked")

signal_connect(win, "key-press-event") do widget, event
	println("You pressed key ", event.keyval)
end

showall(win)

Edit: actually I am now getting the same error with MacOS Ventura 13.6.6. Unclear what changed. Earlier in the semester it worked on some version of MacOS...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions